From 570aebce2622d51cd1816ae1b9c787f5e8c47c66 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 23 Sep 2019 21:41:13 -0400 Subject: [PATCH] More refactoring of code. --- Source/Framework/Dynamic/Reference.cs | 42 +-- Source/Game/AI/CoreAI/CreatureAI.cs | 6 +- Source/Game/AI/CoreAI/GuardAI.cs | 4 +- Source/Game/AI/CoreAI/PetAI.cs | 8 +- Source/Game/AI/CoreAI/UnitAI.cs | 42 +-- Source/Game/AI/PlayerAI/PlayerAI.cs | 2 +- Source/Game/AI/ScriptedAI/ScriptedAI.cs | 14 +- Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs | 52 ++-- .../Game/AI/ScriptedAI/ScriptedFollowerAI.cs | 52 ++-- Source/Game/AI/SmartScripts/SmartAI.cs | 18 +- Source/Game/AI/SmartScripts/SmartAIManager.cs | 6 +- Source/Game/AI/SmartScripts/SmartScript.cs | 16 +- .../Game/Achievements/AchievementManager.cs | 2 +- Source/Game/Achievements/CriteriaHandler.cs | 2 +- Source/Game/Arenas/Arena.cs | 6 +- Source/Game/BattleFields/Zones/WinterGrasp.cs | 42 +-- Source/Game/BattleGrounds/BattleGround.cs | 44 +-- .../Game/BattleGrounds/BattleGroundManager.cs | 12 +- .../Game/BattleGrounds/BattleGroundQueue.cs | 22 +- Source/Game/Chat/CommandHandler.cs | 74 ++--- Source/Game/Chat/Commands/AccountCommands.cs | 8 +- Source/Game/Chat/Commands/ArenaCommands.cs | 12 +- Source/Game/Chat/Commands/CastCommands.cs | 22 +- .../Game/Chat/Commands/CharacterCommands.cs | 38 +-- Source/Game/Chat/Commands/CheatCommands.cs | 12 +- Source/Game/Chat/Commands/DebugCommands.cs | 48 ++-- Source/Game/Chat/Commands/DeserterCommands.cs | 4 +- Source/Game/Chat/Commands/EventCommands.cs | 12 +- Source/Game/Chat/Commands/GMCommands.cs | 2 +- .../Game/Chat/Commands/GameObjectCommands.cs | 18 +- Source/Game/Chat/Commands/GoCommands.cs | 10 +- Source/Game/Chat/Commands/GroupCommands.cs | 10 +- Source/Game/Chat/Commands/GuildCommands.cs | 22 +- Source/Game/Chat/Commands/HonorCommands.cs | 6 +- Source/Game/Chat/Commands/InstanceCommands.cs | 4 +- Source/Game/Chat/Commands/LFGCommands.cs | 6 +- Source/Game/Chat/Commands/LearnCommands.cs | 14 +- Source/Game/Chat/Commands/ListCommands.cs | 18 +- Source/Game/Chat/Commands/LookupCommands.cs | 14 +- Source/Game/Chat/Commands/MMapsCommands.cs | 4 +- Source/Game/Chat/Commands/MiscCommands.cs | 110 ++++---- Source/Game/Chat/Commands/ModifyCommands.cs | 66 ++--- Source/Game/Chat/Commands/NPCCommands.cs | 70 ++--- Source/Game/Chat/Commands/PetCommands.cs | 8 +- Source/Game/Chat/Commands/QuestCommands.cs | 16 +- Source/Game/Chat/Commands/RbacCommands.cs | 2 +- Source/Game/Chat/Commands/ResetCommands.cs | 14 +- Source/Game/Chat/Commands/SceneCommands.cs | 6 +- Source/Game/Chat/Commands/SendCommands.cs | 28 +- Source/Game/Chat/Commands/SpellCommands.cs | 18 +- Source/Game/Chat/Commands/TeleCommands.cs | 10 +- Source/Game/Chat/Commands/TitleCommands.cs | 14 +- Source/Game/Chat/Commands/WPCommands.cs | 10 +- .../Collision/BoundingIntervalHierarchy.cs | 108 ++++---- .../BoundingIntervalHierarchyWrap.cs | 20 +- Source/Game/Collision/Callbacks.cs | 10 +- Source/Game/Collision/DynamicTree.cs | 66 ++--- .../Game/Collision/Management/VMapManager.cs | 110 ++++---- Source/Game/Collision/Maps/MapTree.cs | 66 ++--- .../Game/Collision/Models/GameObjectModel.cs | 20 +- Source/Game/Collision/Models/IModel.cs | 4 +- Source/Game/Collision/Models/ModelInstance.cs | 8 +- Source/Game/Collision/Models/WorldModel.cs | 26 +- Source/Game/Collision/RegularGrid2D.cs | 48 ++-- Source/Game/Combat/Events.cs | 18 +- Source/Game/Combat/HostileRegManager.cs | 214 +++++++------- Source/Game/Combat/ThreatManager.cs | 206 +++++++------- Source/Game/Conditions/Condition.cs | 4 +- Source/Game/Conditions/ConditionManager.cs | 92 +++--- Source/Game/DataStorage/M2Storage.cs | 10 +- Source/Game/DungeonFinding/LFGManager.cs | 18 +- Source/Game/DungeonFinding/LFGScripts.cs | 22 +- .../Game/Entities/AreaTrigger/AreaTrigger.cs | 14 +- Source/Game/Entities/Creature/Creature.cs | 8 +- Source/Game/Entities/GameObject/GameObject.cs | 22 +- Source/Game/Entities/Item/Item.cs | 10 +- Source/Game/Entities/Object/WorldObject.cs | 8 +- Source/Game/Entities/Player/KillRewarder.cs | 6 +- Source/Game/Entities/Player/Player.Combat.cs | 2 +- Source/Game/Entities/Player/Player.DB.cs | 2 +- Source/Game/Entities/Player/Player.Groups.cs | 44 +-- Source/Game/Entities/Player/Player.Items.cs | 24 +- Source/Game/Entities/Player/Player.Map.cs | 4 +- Source/Game/Entities/Player/Player.PvP.cs | 8 +- Source/Game/Entities/Player/Player.Quest.cs | 12 +- Source/Game/Entities/Player/Player.Spells.cs | 8 +- Source/Game/Entities/Player/Player.cs | 30 +- Source/Game/Entities/Totem.cs | 2 +- Source/Game/Entities/Unit/Unit.Combat.cs | 52 ++-- Source/Game/Entities/Unit/Unit.Fields.cs | 2 +- Source/Game/Entities/Unit/Unit.Movement.cs | 12 +- Source/Game/Entities/Unit/Unit.Pets.cs | 2 +- Source/Game/Entities/Unit/Unit.Spells.cs | 26 +- Source/Game/Entities/Unit/Unit.cs | 28 +- Source/Game/Events/GameEventManager.cs | 36 +-- Source/Game/Groups/Group.cs | 196 ++++++------- Source/Game/Groups/GroupReference.cs | 14 +- Source/Game/Handlers/BattleGroundHandler.cs | 6 +- Source/Game/Handlers/ChatHandler.cs | 6 +- Source/Game/Handlers/GroupHandler.cs | 8 +- Source/Game/Handlers/LFGHandler.cs | 6 +- Source/Game/Handlers/LootHandler.cs | 22 +- Source/Game/Handlers/MiscHandler.cs | 6 +- Source/Game/Handlers/MovementHandler.cs | 4 +- Source/Game/Handlers/NPCHandler.cs | 6 +- Source/Game/Handlers/PetHandler.cs | 8 +- Source/Game/Handlers/QuestHandler.cs | 8 +- Source/Game/Handlers/SpellHandler.cs | 2 +- Source/Game/Handlers/TaxiHandler.cs | 2 +- Source/Game/Handlers/ToyHandler.cs | 2 +- Source/Game/Handlers/TradeHandler.cs | 44 +-- Source/Game/Loot/Loot.cs | 28 +- Source/Game/Loot/LootManager.cs | 6 +- Source/Game/Mails/MailDraft.cs | 12 +- Source/Game/Maps/AreaBoundary.cs | 2 +- Source/Game/Maps/Cell.cs | 42 +-- Source/Game/Maps/Grid.cs | 60 ++-- Source/Game/Maps/GridDefines.cs | 132 ++++----- Source/Game/Maps/GridMap.cs | 68 ++--- Source/Game/Maps/Instances/InstanceScript.cs | 2 +- Source/Game/Maps/Instances/MapInstance.cs | 4 +- Source/Game/Maps/MMapManager.cs | 44 +-- Source/Game/Maps/Map.cs | 262 +++++++++--------- Source/Game/Maps/MapManager.cs | 8 +- Source/Game/Maps/ObjectGridLoader.cs | 2 +- Source/Game/Maps/TransportManager.cs | 10 +- Source/Game/Miscellaneous/Formulas.cs | 6 +- .../Movement/Generators/FleeingGenerator.cs | 2 +- .../Game/Movement/Generators/HomeMovement.cs | 2 +- .../Game/Movement/Generators/IdleMovement.cs | 2 +- .../Movement/Generators/MovementGenerators.cs | 20 +- .../Game/Movement/Generators/PathGenerator.cs | 4 +- .../Game/Movement/Generators/PointMovement.cs | 2 +- .../SplineChainMovementGenerator.cs | 2 +- .../Movement/Generators/TargetMovement.cs | 66 ++--- .../Movement/Generators/WaypointMovement.cs | 6 +- Source/Game/Movement/MotionMaster.cs | 82 +++--- Source/Game/Movement/MoveSpline.cs | 130 ++++----- Source/Game/Movement/MoveSplineFlags.cs | 10 +- Source/Game/Movement/MoveSplineInit.cs | 2 +- Source/Game/Movement/MoveSplineInitArgs.cs | 6 +- Source/Game/Movement/Spline.cs | 46 +-- Source/Game/Network/PacketManager.cs | 12 +- .../Game/Network/Packets/MovementPackets.cs | 42 +-- Source/Game/OutdoorPVP/OutdoorPvP.cs | 46 +-- .../OutdoorPVP/Zones/HellfirePeninsulaPvP.cs | 32 +-- Source/Game/Phasing/PhasingHandler.cs | 4 +- Source/Game/Pools/PoolManager.cs | 30 +- Source/Game/Scripting/SpellScript.cs | 2 +- Source/Game/Server/WorldManager.cs | 46 +-- Source/Game/Server/WorldSession.cs | 6 +- Source/Game/Spells/Auras/Aura.cs | 2 +- Source/Game/Spells/Auras/AuraEffect.cs | 14 +- Source/Game/Spells/Spell.cs | 138 ++++----- Source/Game/Spells/SpellEffects.cs | 26 +- Source/Game/Spells/SpellInfo.cs | 28 +- Source/Game/Spells/SpellManager.cs | 34 +-- .../Karazhan/AttumenMidnight.cs | 4 +- .../EasternKingdoms/Karazhan/OperaEvent.cs | 6 +- .../ScarletEnclave/Chapter1.cs | 4 +- Source/Scripts/Kalimdor/ZoneAshenvale.cs | 14 +- .../AzjolNerub/AzjolNerub/BossNadronox.cs | 4 +- .../TrialOfTheChampion/GrandChampions.cs | 2 +- .../TrialOfTheCrusader/TrialOfTheCrusader.cs | 2 +- .../ForgeOfSouls/InstanceForgeOfSouls.cs | 4 +- .../FrozenHalls/PitOfSaron/BossKrickAndIck.cs | 4 +- .../IcecrownCitadel/GunshipBattle.cs | 8 +- .../IcecrownCitadel/IcecrownCitadel.cs | 2 +- .../IcecrownCitadel/LadyDeathwhisper.cs | 4 +- .../Nexus/EyeOfEternity/EyeOfEternity.cs | 4 +- .../Northrend/Ulduar/FlameLeviathan.cs | 6 +- Source/Scripts/Outlands/HellfirePeninsula.cs | 8 +- Source/Scripts/Outlands/Zangarmarsh.cs | 4 +- Source/Scripts/Pets/Mage.cs | 12 +- Source/Scripts/Spells/Warlock.cs | 2 +- Source/Scripts/World/NpcSpecial.cs | 6 +- 176 files changed, 2261 insertions(+), 2265 deletions(-) diff --git a/Source/Framework/Dynamic/Reference.cs b/Source/Framework/Dynamic/Reference.cs index 603409792..e0f5942f0 100644 --- a/Source/Framework/Dynamic/Reference.cs +++ b/Source/Framework/Dynamic/Reference.cs @@ -25,13 +25,13 @@ namespace Framework.Dynamic FROM _RefFrom; // Tell our refTo (target) object that we have a link - public virtual void targetObjectBuildLink() { } + public virtual void TargetObjectBuildLink() { } // Tell our refTo (taget) object, that the link is cut - public virtual void targetObjectDestroyLink() { } + public virtual void TargetObjectDestroyLink() { } // Tell our refFrom (source) object, that the link is cut (Target destroyed) - public virtual void sourceObjectDestroyLink() { } + public virtual void SourceObjectDestroyLink() { } public Reference() { @@ -39,24 +39,24 @@ namespace Framework.Dynamic } // Create new link - public void link(TO toObj, FROM fromObj) + public void Link(TO toObj, FROM fromObj) { Cypher.Assert(fromObj != null); // fromObj MUST not be NULL - if (isValid()) - unlink(); + if (IsValid()) + Unlink(); if (toObj != null) { _RefTo = toObj; _RefFrom = fromObj; - targetObjectBuildLink(); + TargetObjectBuildLink(); } } // We don't need the reference anymore. Call comes from the refFrom object // Tell our refTo object, that the link is cut - public void unlink() + public void Unlink() { - targetObjectDestroyLink(); + TargetObjectDestroyLink(); Delink(); _RefTo = null; _RefFrom = null; @@ -64,38 +64,38 @@ namespace Framework.Dynamic // Link is invalid due to destruction of referenced target object. Call comes from the refTo object // Tell our refFrom object, that the link is cut - public void invalidate() // the iRefFrom MUST remain!! + public void Invalidate() // the iRefFrom MUST remain!! { - sourceObjectDestroyLink(); + SourceObjectDestroyLink(); Delink(); _RefTo = null; } - public bool isValid() // Only check the iRefTo + public bool IsValid() // Only check the iRefTo { return _RefTo != null; } - public Reference next() { return ((Reference)GetNextElement()); } - public Reference prev() { return ((Reference)GetPrevElement()); } + public Reference Next() { return ((Reference)GetNextElement()); } + public Reference Prev() { return ((Reference)GetPrevElement()); } - public TO getTarget() { return _RefTo; } + public TO GetTarget() { return _RefTo; } public FROM GetSource() { return _RefFrom; } } public class RefManager : LinkedListHead where TO : class where FROM : class { - ~RefManager() { clearReferences(); } + ~RefManager() { ClearReferences(); } - public Reference getFirst() { return (Reference)base.GetFirstElement(); } - public Reference getLast() { return (Reference)base.GetLastElement(); } + public Reference GetFirst() { return (Reference)base.GetFirstElement(); } + public Reference GetLast() { return (Reference)base.GetLastElement(); } - public void clearReferences() + public void ClearReferences() { Reference refe; - while ((refe = getFirst()) != null) - refe.invalidate(); + while ((refe = GetFirst()) != null) + refe.Invalidate(); } } } diff --git a/Source/Game/AI/CoreAI/CreatureAI.cs b/Source/Game/AI/CoreAI/CreatureAI.cs index 2a60d4bb3..cfdb96bde 100644 --- a/Source/Game/AI/CoreAI/CreatureAI.cs +++ b/Source/Game/AI/CoreAI/CreatureAI.cs @@ -73,8 +73,8 @@ namespace Game.AI if (summoner != null) { Unit target = summoner.GetAttackerForHelper(); - if (target == null && summoner.CanHaveThreatList() && !summoner.GetThreatManager().isThreatListEmpty()) - target = summoner.GetThreatManager().getHostilTarget(); + if (target == null && summoner.CanHaveThreatList() && !summoner.GetThreatManager().IsThreatListEmpty()) + target = summoner.GetThreatManager().GetHostilTarget(); if (target != null && (creature.IsFriendlyTo(summoner) || creature.IsHostileTo(target))) creature.GetAI().AttackStart(target); } @@ -238,7 +238,7 @@ namespace Game.AI return me.GetVictim() != null; } - else if (me.GetThreatManager().isThreatListEmpty()) + else if (me.GetThreatManager().IsThreatListEmpty()) { EnterEvadeMode(EvadeReason.NoHostiles); return false; diff --git a/Source/Game/AI/CoreAI/GuardAI.cs b/Source/Game/AI/CoreAI/GuardAI.cs index 857e7b74e..6a130c844 100644 --- a/Source/Game/AI/CoreAI/GuardAI.cs +++ b/Source/Game/AI/CoreAI/GuardAI.cs @@ -37,9 +37,9 @@ namespace Game.AI if (!obj.IsTypeMask(TypeMask.Unit)) return false; - var threatList = me.GetThreatManager().getThreatList(); + var threatList = me.GetThreatManager().GetThreatList(); foreach (var refe in threatList) - if (refe.getUnitGuid() == obj.GetGUID()) + if (refe.GetUnitGuid() == obj.GetGUID()) return true; return false; diff --git a/Source/Game/AI/CoreAI/PetAI.cs b/Source/Game/AI/CoreAI/PetAI.cs index ae7c0bf66..c8daedbdd 100644 --- a/Source/Game/AI/CoreAI/PetAI.cs +++ b/Source/Game/AI/CoreAI/PetAI.cs @@ -56,7 +56,7 @@ namespace Game.AI me.GetMotionMaster().Clear(); me.GetMotionMaster().MoveIdle(); me.CombatStop(); - me.GetHostileRefManager().deleteReferences(); + me.GetHostileRefManager().DeleteReferences(); return; } @@ -230,7 +230,7 @@ namespace Game.AI SpellCastTargets targets = new SpellCastTargets(); targets.SetUnitTarget(target); - spell.prepare(targets); + spell.Prepare(targets); } // deleted cached Spell objects @@ -262,14 +262,14 @@ namespace Game.AI return; //owner is in group; group members filled in already (no raid . subgroupcount = whole count) - if (group && !group.isRaidGroup() && m_AllySet.Count == (group.GetMembersCount() + 2)) + if (group && !group.IsRaidGroup() && m_AllySet.Count == (group.GetMembersCount() + 2)) return; m_AllySet.Clear(); m_AllySet.Add(me.GetGUID()); if (group) //add group { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player target = refe.GetSource(); if (!target || !target.IsInMap(owner) || !group.SameSubGroup(owner.ToPlayer(), target)) diff --git a/Source/Game/AI/CoreAI/UnitAI.cs b/Source/Game/AI/CoreAI/UnitAI.cs index fda7abf7a..1b31b3697 100644 --- a/Source/Game/AI/CoreAI/UnitAI.cs +++ b/Source/Game/AI/CoreAI/UnitAI.cs @@ -113,17 +113,17 @@ namespace Game.AI // Select the targets satifying the predicate. public Unit SelectTarget(SelectAggroTarget targetType, uint position, ISelector selector) { - var threatlist = GetThreatManager().getThreatList(); + var threatlist = GetThreatManager().GetThreatList(); if (position >= threatlist.Count) return null; List targetList = new List(); Unit currentVictim = null; - var currentVictimReference = GetThreatManager().getCurrentVictim(); + var currentVictimReference = GetThreatManager().GetCurrentVictim(); if (currentVictimReference != null) { - currentVictim = currentVictimReference.getTarget(); + currentVictim = currentVictimReference.GetTarget(); // Current victim always goes first if (currentVictim && selector.Check(currentVictim)) @@ -132,10 +132,10 @@ namespace Game.AI foreach (var hostileRef in threatlist) { - if (currentVictim != null && hostileRef.getTarget() != currentVictim && selector.Check(hostileRef.getTarget())) - targetList.Add(hostileRef.getTarget()); - else if (currentVictim == null && selector.Check(hostileRef.getTarget())) - targetList.Add(hostileRef.getTarget()); + if (currentVictim != null && hostileRef.GetTarget() != currentVictim && selector.Check(hostileRef.GetTarget())) + targetList.Add(hostileRef.GetTarget()); + else if (currentVictim == null && selector.Check(hostileRef.GetTarget())) + targetList.Add(hostileRef.GetTarget()); } if (position >= targetList.Count) @@ -178,13 +178,13 @@ namespace Game.AI { var targetList = new List(); - var threatlist = GetThreatManager().getThreatList(); + var threatlist = GetThreatManager().GetThreatList(); if (threatlist.Empty()) return targetList; foreach (var hostileRef in threatlist) - if (selector.Check(hostileRef.getTarget())) - targetList.Add(hostileRef.getTarget()); + if (selector.Check(hostileRef.GetTarget())) + targetList.Add(hostileRef.GetTarget()); if (targetList.Count < maxTargets) return targetList; @@ -368,15 +368,15 @@ namespace Game.AI public virtual void HealDone(Unit to, uint addhealth) { } public virtual void SpellInterrupted(uint spellId, uint unTimeMs) {} - public virtual void sGossipHello(Player player) { } - public virtual void sGossipSelect(Player player, uint menuId, uint gossipListId) { } - public virtual void sGossipSelectCode(Player player, uint menuId, uint gossipListId, string code) { } - public virtual void sQuestAccept(Player player, Quest quest) { } - public virtual void sQuestSelect(Player player, Quest quest) { } - public virtual void sQuestComplete(Player player, Quest quest) { } - public virtual void sQuestReward(Player player, Quest quest, uint opt) { } - public virtual bool sOnDummyEffect(Unit caster, uint spellId, int effIndex) { return false; } - public virtual void sOnGameEvent(bool start, ushort eventId) { } + public virtual void GossipHello(Player player) { } + public virtual void GossipSelect(Player player, uint menuId, uint gossipListId) { } + public virtual void GossipSelectCode(Player player, uint menuId, uint gossipListId, string code) { } + public virtual void QuestAccept(Player player, Quest quest) { } + public virtual void QuestSelect(Player player, Quest quest) { } + public virtual void QuestComplete(Player player, Quest quest) { } + public virtual void QuestReward(Player player, Quest quest, uint opt) { } + public virtual bool OnDummyEffect(Unit caster, uint spellId, int effIndex) { return false; } + public virtual void OnGameEvent(bool start, ushort eventId) { } public static AISpellInfoType[] AISpellInfo; @@ -552,9 +552,9 @@ namespace Game.AI if (_playerOnly && !target.IsTypeId(TypeId.Player)) return false; - HostileReference currentVictim = _source.GetThreatManager().getCurrentVictim(); + HostileReference currentVictim = _source.GetThreatManager().GetCurrentVictim(); if (currentVictim != null) - return target.GetGUID() != currentVictim.getUnitGuid(); + return target.GetGUID() != currentVictim.GetUnitGuid(); return target != _source.GetVictim(); } diff --git a/Source/Game/AI/PlayerAI/PlayerAI.cs b/Source/Game/AI/PlayerAI/PlayerAI.cs index fcdcb96db..e43d542cd 100644 --- a/Source/Game/AI/PlayerAI/PlayerAI.cs +++ b/Source/Game/AI/PlayerAI/PlayerAI.cs @@ -569,7 +569,7 @@ namespace Game.AI { SpellCastTargets targets = new SpellCastTargets(); targets.SetUnitTarget(spell.Item2); - spell.Item1.prepare(targets); + spell.Item1.Prepare(targets); } void DoRangedAttackIfReady() diff --git a/Source/Game/AI/ScriptedAI/ScriptedAI.cs b/Source/Game/AI/ScriptedAI/ScriptedAI.cs index 7019df230..93ede6858 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedAI.cs @@ -184,17 +184,17 @@ namespace Game.AI //Drops all threat to 0%. Does not remove players from the threat list public void DoResetThreat() { - if (!me.CanHaveThreatList() || me.GetThreatManager().isThreatListEmpty()) + if (!me.CanHaveThreatList() || me.GetThreatManager().IsThreatListEmpty()) { Log.outError(LogFilter.Scripts, "DoResetThreat called for creature that either cannot have threat list or has empty threat list (me entry = {0})", me.GetEntry()); return; } - var threatlist = me.GetThreatManager().getThreatList(); + var threatlist = me.GetThreatManager().GetThreatList(); foreach (var refe in threatlist) { - Unit unit = Global.ObjAccessor.GetUnit(me, refe.getUnitGuid()); + Unit unit = Global.ObjAccessor.GetUnit(me, refe.GetUnitGuid()); if (unit != null && DoGetThreat(unit) != 0) DoModifyThreatPercent(unit, -100); } @@ -204,14 +204,14 @@ namespace Game.AI { if (unit == null) return 0.0f; - return me.GetThreatManager().getThreat(unit); + return me.GetThreatManager().GetThreat(unit); } public void DoModifyThreatPercent(Unit unit, int pct) { if (unit == null) return; - me.GetThreatManager().modifyThreatPercent(unit, pct); + me.GetThreatManager().ModifyThreatPercent(unit, pct); } void DoTeleportTo(float x, float y, float z, uint time = 0) @@ -485,10 +485,10 @@ namespace Game.AI float x, y, z; me.GetPosition(out x, out y, out z); - var threatList = me.GetThreatManager().getThreatList(); + var threatList = me.GetThreatManager().GetThreatList(); foreach (var refe in threatList) { - Unit target = refe.getTarget(); + Unit target = refe.GetTarget(); if (target) if (target.IsTypeId(TypeId.Player) && !CheckBoundary(target)) target.NearTeleportTo(x, y, z, 0); diff --git a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs index d78308101..2db9a8ab1 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs @@ -24,14 +24,14 @@ using System.Linq; namespace Game.AI { - public class npc_escortAI : ScriptedAI + public class NpcEscortAI : ScriptedAI { - public npc_escortAI(Creature creature) : base(creature) + public NpcEscortAI(Creature creature) : base(creature) { m_uiPlayerGUID = ObjectGuid.Empty; m_uiWPWaitTimer = 2500; m_uiPlayerCheckTimer = 1000; - m_uiEscortState = eEscortState.None; + m_uiEscortState = EscortState.None; MaxPlayerDistance = 50; m_pQuestForEscort = null; m_bIsActiveAttacker = true; @@ -101,7 +101,7 @@ namespace Game.AI { if (me.HasReactState(ReactStates.Aggressive) && !me.HasUnitState(UnitState.Stunned) && who.IsTargetableForAttack() && who.IsInAccessiblePlaceFor(me)) { - if (HasEscortState(eEscortState.Escorting) && AssistPlayerInCombatAgainst(who)) + if (HasEscortState(EscortState.Escorting) && AssistPlayerInCombatAgainst(who)) return; if (!me.CanFly() && me.GetDistanceZ(who) > SharedConst.CreatureAttackRangeZ) @@ -135,7 +135,7 @@ namespace Game.AI public override void JustDied(Unit killer) { - if (!HasEscortState(eEscortState.Escorting) || m_uiPlayerGUID.IsEmpty() || m_pQuestForEscort == null) + if (!HasEscortState(EscortState.Escorting) || m_uiPlayerGUID.IsEmpty() || m_pQuestForEscort == null) return; Player player = GetPlayerForEscort(); @@ -144,7 +144,7 @@ namespace Game.AI Group group = player.GetGroup(); if (group) { - for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next()) + for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next()) { Player member = groupRef.GetSource(); if (member) @@ -159,7 +159,7 @@ namespace Game.AI public override void JustRespawned() { - m_uiEscortState = eEscortState.None; + m_uiEscortState = EscortState.None; if (!IsCombatMovementAllowed()) SetCombatMovement(true); @@ -185,9 +185,9 @@ namespace Game.AI me.CombatStop(true); me.SetLootRecipient(null); - if (HasEscortState(eEscortState.Escorting)) + if (HasEscortState(EscortState.Escorting)) { - AddEscortState(eEscortState.Returning); + AddEscortState(EscortState.Returning); ReturnToLastPoint(); Log.outDebug(LogFilter.Scripts, "EscortAI has left combat and is now returning to last point"); } @@ -208,7 +208,7 @@ namespace Game.AI Group group = player.GetGroup(); if (group) { - for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next()) + for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next()) { Player member = groupRef.GetSource(); if (member) @@ -226,7 +226,7 @@ namespace Game.AI public override void UpdateAI(uint diff) { //Waypoint Updating - if (HasEscortState(eEscortState.Escorting) && !me.GetVictim() && m_uiWPWaitTimer != 0 && !HasEscortState(eEscortState.Returning)) + if (HasEscortState(EscortState.Escorting) && !me.GetVictim() && m_uiWPWaitTimer != 0 && !HasEscortState(EscortState.Returning)) { if (m_uiWPWaitTimer <= diff) { @@ -270,7 +270,7 @@ namespace Game.AI } - if (!HasEscortState(eEscortState.Paused)) + if (!HasEscortState(EscortState.Paused)) { var currentWp = WaypointList[CurrentWPIndex]; me.GetMotionMaster().MovePoint(currentWp.Id, currentWp.X, currentWp.Y, currentWp.Z); @@ -284,7 +284,7 @@ namespace Game.AI } //Check if player or any member of his group is within range - if (HasEscortState(eEscortState.Escorting) && !m_uiPlayerGUID.IsEmpty() && !me.GetVictim() && !HasEscortState(eEscortState.Returning)) + if (HasEscortState(EscortState.Escorting) && !m_uiPlayerGUID.IsEmpty() && !me.GetVictim() && !HasEscortState(EscortState.Returning)) { if (m_uiPlayerCheckTimer <= diff) { @@ -322,7 +322,7 @@ namespace Game.AI public override void MovementInform(MovementGeneratorType moveType, uint pointId) { - if (moveType != MovementGeneratorType.Point || !HasEscortState(eEscortState.Escorting)) + if (moveType != MovementGeneratorType.Point || !HasEscortState(EscortState.Escorting)) return; //Combat start position reached, continue waypoint movement @@ -331,7 +331,7 @@ namespace Game.AI Log.outDebug(LogFilter.Scripts, "EscortAI has returned to original position before combat"); me.SetWalk(!m_bIsRunning); - RemoveEscortState(eEscortState.Returning); + RemoveEscortState(EscortState.Returning); if (m_uiWPWaitTimer == 0) m_uiWPWaitTimer = 1; @@ -415,7 +415,7 @@ namespace Game.AI return; } - if (HasEscortState(eEscortState.Escorting)) + if (HasEscortState(EscortState.Escorting)) { Log.outError(LogFilter.Scripts, "EscortAI (script: {0}, creature entry: {1}) attempts to Start while already escorting", me.GetScriptName(), me.GetEntry()); return; @@ -474,18 +474,18 @@ namespace Game.AI else me.SetWalk(true); - AddEscortState(eEscortState.Escorting); + AddEscortState(EscortState.Escorting); } public void SetEscortPaused(bool on) { - if (!HasEscortState(eEscortState.Escorting)) + if (!HasEscortState(EscortState.Escorting)) return; if (on) - AddEscortState(eEscortState.Paused); + AddEscortState(EscortState.Paused); else - RemoveEscortState(eEscortState.Paused); + RemoveEscortState(EscortState.Paused); } bool SetNextWaypoint(uint pointId, float x, float y, float z, float orientation) @@ -557,8 +557,8 @@ namespace Game.AI public virtual void WaypointReached(uint pointId) { } public virtual void WaypointStart(uint pointId) { } - public bool HasEscortState(eEscortState escortState) { return m_uiEscortState.HasAnyFlag(escortState); } - public override bool IsEscorted() { return m_uiEscortState.HasAnyFlag(eEscortState.Escorting); } + public bool HasEscortState(EscortState escortState) { return m_uiEscortState.HasAnyFlag(escortState); } + public override bool IsEscorted() { return m_uiEscortState.HasAnyFlag(EscortState.Escorting); } public void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; } public float GetMaxPlayerDistance() { return MaxPlayerDistance; } @@ -571,13 +571,13 @@ namespace Game.AI public Player GetPlayerForEscort() { return Global.ObjAccessor.GetPlayer(me, m_uiPlayerGUID); } - void AddEscortState(eEscortState escortState) { m_uiEscortState |= escortState; } - void RemoveEscortState(eEscortState escortState) { m_uiEscortState &= ~escortState; } + void AddEscortState(EscortState escortState) { m_uiEscortState |= escortState; } + void RemoveEscortState(EscortState escortState) { m_uiEscortState &= ~escortState; } ObjectGuid m_uiPlayerGUID; uint m_uiWPWaitTimer; uint m_uiPlayerCheckTimer; - eEscortState m_uiEscortState; + EscortState m_uiEscortState; float MaxPlayerDistance; Quest m_pQuestForEscort; //generally passed in Start() when regular escort script. @@ -595,7 +595,7 @@ namespace Game.AI bool HasImmuneToNPCFlags; } - public enum eEscortState + public enum EscortState { None = 0x000, //nothing in progress Escorting = 0x001, //escort are in progress diff --git a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs index 862477112..a4151ca70 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs @@ -22,7 +22,7 @@ using System; namespace Game.AI { - enum eFollowState + enum FollowState { None = 0x000, Inprogress = 0x001, //must always have this state for any follow @@ -38,7 +38,7 @@ namespace Game.AI public FollowerAI(Creature creature) : base(creature) { m_uiUpdateFollowTimer = 2500; - m_uiFollowState = eFollowState.None; + m_uiFollowState = FollowState.None; m_pQuestForFollow = null; } @@ -105,7 +105,7 @@ namespace Game.AI { if (me.HasReactState(ReactStates.Aggressive) && !me.HasUnitState(UnitState.Stunned) && who.IsTargetableForAttack() && who.IsInAccessiblePlaceFor(me)) { - if (HasFollowState(eFollowState.Inprogress) && AssistPlayerInCombatAgainst(who)) + if (HasFollowState(FollowState.Inprogress) && AssistPlayerInCombatAgainst(who)) return; if (!me.CanFly() && me.GetDistanceZ(who) > SharedConst.CreatureAttackRangeZ) @@ -139,7 +139,7 @@ namespace Game.AI public override void JustDied(Unit killer) { - if (!HasFollowState(eFollowState.Inprogress) || m_uiLeaderGUID.IsEmpty() || m_pQuestForFollow == null) + if (!HasFollowState(FollowState.Inprogress) || m_uiLeaderGUID.IsEmpty() || m_pQuestForFollow == null) return; // @todo need a better check for quests with time limit. @@ -149,7 +149,7 @@ namespace Game.AI Group group = player.GetGroup(); if (group) { - for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next()) + for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next()) { Player member = groupRef.GetSource(); if (member) @@ -164,7 +164,7 @@ namespace Game.AI public override void JustRespawned() { - m_uiFollowState = eFollowState.None; + m_uiFollowState = FollowState.None; if (!IsCombatMovementAllowed()) SetCombatMovement(true); @@ -182,7 +182,7 @@ namespace Game.AI me.CombatStop(true); me.SetLootRecipient(null); - if (HasFollowState(eFollowState.Inprogress)) + if (HasFollowState(FollowState.Inprogress)) { Log.outDebug(LogFilter.Scripts, "FollowerAI left combat, returning to CombatStartPosition."); @@ -204,11 +204,11 @@ namespace Game.AI public override void UpdateAI(uint uiDiff) { - if (HasFollowState(eFollowState.Inprogress) && !me.GetVictim()) + if (HasFollowState(FollowState.Inprogress) && !me.GetVictim()) { if (m_uiUpdateFollowTimer <= uiDiff) { - if (HasFollowState(eFollowState.Complete) && !HasFollowState(eFollowState.PostEvent)) + if (HasFollowState(FollowState.Complete) && !HasFollowState(FollowState.PostEvent)) { Log.outDebug(LogFilter.Scripts, "FollowerAI is set completed, despawns."); me.DespawnOrUnsummon(); @@ -220,11 +220,11 @@ namespace Game.AI Player player = GetLeaderForFollower(); if (player) { - if (HasFollowState(eFollowState.Returning)) + if (HasFollowState(FollowState.Returning)) { Log.outDebug(LogFilter.Scripts, "FollowerAI is returning to leader."); - RemoveFollowState(eFollowState.Returning); + RemoveFollowState(FollowState.Returning); me.GetMotionMaster().MoveFollow(player, SharedConst.PetFollowDist, SharedConst.PetFollowAngle); return; } @@ -232,7 +232,7 @@ namespace Game.AI Group group = player.GetGroup(); if (group) { - for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next()) + for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next()) { Player member = groupRef.GetSource(); if (member && me.IsWithinDistInMap(member, 100.0f)) @@ -275,15 +275,15 @@ namespace Game.AI public override void MovementInform(MovementGeneratorType motionType, uint pointId) { - if (motionType != MovementGeneratorType.Point || !HasFollowState(eFollowState.Inprogress)) + if (motionType != MovementGeneratorType.Point || !HasFollowState(FollowState.Inprogress)) return; if (pointId == 0xFFFFFF) { if (GetLeaderForFollower()) { - if (!HasFollowState(eFollowState.Paused)) - AddFollowState(eFollowState.Returning); + if (!HasFollowState(FollowState.Paused)) + AddFollowState(FollowState.Returning); } else me.DespawnOrUnsummon(); @@ -298,7 +298,7 @@ namespace Game.AI return; } - if (HasFollowState(eFollowState.Inprogress)) + if (HasFollowState(FollowState.Inprogress)) { Log.outError(LogFilter.Scenario, "FollowerAI attempt to StartFollow while already following."); return; @@ -322,7 +322,7 @@ namespace Game.AI me.SetNpcFlags(NPCFlags.None); me.SetNpcFlags2(NPCFlags2.None); - AddFollowState(eFollowState.Inprogress); + AddFollowState(FollowState.Inprogress); me.GetMotionMaster().MoveFollow(player, SharedConst.PetFollowDist, SharedConst.PetFollowAngle); @@ -341,7 +341,7 @@ namespace Game.AI Group group = player.GetGroup(); if (group) { - for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next()) + for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next()) { Player member = groupRef.GetSource(); if (member && me.IsWithinDistInMap(member, 100.0f) && member.IsAlive()) @@ -371,24 +371,24 @@ namespace Game.AI } if (bWithEndEvent) - AddFollowState(eFollowState.PostEvent); + AddFollowState(FollowState.PostEvent); else { - if (HasFollowState(eFollowState.PostEvent)) - RemoveFollowState(eFollowState.PostEvent); + if (HasFollowState(FollowState.PostEvent)) + RemoveFollowState(FollowState.PostEvent); } - AddFollowState(eFollowState.Complete); + AddFollowState(FollowState.Complete); } - bool HasFollowState(eFollowState uiFollowState) { return (m_uiFollowState & uiFollowState) != 0; } + bool HasFollowState(FollowState uiFollowState) { return (m_uiFollowState & uiFollowState) != 0; } - void AddFollowState(eFollowState uiFollowState) { m_uiFollowState |= uiFollowState; } - void RemoveFollowState(eFollowState uiFollowState) { m_uiFollowState &= ~uiFollowState; } + void AddFollowState(FollowState uiFollowState) { m_uiFollowState |= uiFollowState; } + void RemoveFollowState(FollowState uiFollowState) { m_uiFollowState &= ~uiFollowState; } ObjectGuid m_uiLeaderGUID; uint m_uiUpdateFollowTimer; - eFollowState m_uiFollowState; + FollowState m_uiFollowState; Quest m_pQuestForFollow; //normally we have a quest } diff --git a/Source/Game/AI/SmartScripts/SmartAI.cs b/Source/Game/AI/SmartScripts/SmartAI.cs index abfbc1f3c..a71c3ae5c 100644 --- a/Source/Game/AI/SmartScripts/SmartAI.cs +++ b/Source/Game/AI/SmartScripts/SmartAI.cs @@ -235,7 +235,7 @@ namespace Game.AI Group group = player.GetGroup(); if (group) { - for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next()) + for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next()) { Player groupGuy = groupRef.GetSource(); if (!groupGuy.IsInMap(player)) @@ -399,7 +399,7 @@ namespace Game.AI Group group = player.GetGroup(); if (group) { - for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next()) + for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next()) { Player groupGuy = groupRef.GetSource(); if (groupGuy.IsInMap(player) && me.GetDistance(groupGuy) <= checkDist) @@ -800,29 +800,29 @@ namespace Game.AI mEvadeDisabled = disable; } - public override void sGossipHello(Player player) + public override void GossipHello(Player player) { GetScript().ProcessEventsFor(SmartEvents.GossipHello, player); } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { GetScript().ProcessEventsFor(SmartEvents.GossipSelect, player, menuId, gossipListId); } - public override void sGossipSelectCode(Player player, uint menuId, uint gossipListId, string code) { } + public override void GossipSelectCode(Player player, uint menuId, uint gossipListId, string code) { } - public override void sQuestAccept(Player player, Quest quest) + public override void QuestAccept(Player player, Quest quest) { GetScript().ProcessEventsFor(SmartEvents.AcceptedQuest, player, quest.Id); } - public override void sQuestReward(Player player, Quest quest, uint opt) + public override void QuestReward(Player player, Quest quest, uint opt) { GetScript().ProcessEventsFor(SmartEvents.RewardQuest, player, quest.Id, opt); } - public override bool sOnDummyEffect(Unit caster, uint spellId, int effIndex) + public override bool OnDummyEffect(Unit caster, uint spellId, int effIndex) { GetScript().ProcessEventsFor(SmartEvents.DummyEffect, caster, spellId, (uint)effIndex); return true; @@ -916,7 +916,7 @@ namespace Game.AI GetScript().SetScript9(e, entry); } - public override void sOnGameEvent(bool start, ushort eventId) + public override void OnGameEvent(bool start, ushort eventId) { GetScript().ProcessEventsFor(start ? SmartEvents.GameEventStart : SmartEvents.GameEventEnd, null, eventId); } diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index f2b064c00..d377a7d52 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -660,7 +660,7 @@ namespace Game.AI case SmartEvents.GameEventEnd: { var events = Global.GameEventMgr.GetEventMap(); - if (e.Event.gameEvent.gameEventId >= events.Length || !events[e.Event.gameEvent.gameEventId].isValid()) + if (e.Event.gameEvent.gameEventId >= events.Length || !events[e.Event.gameEvent.gameEventId].IsValid()) return false; break; @@ -1139,7 +1139,7 @@ namespace Game.AI } GameEventData eventData = events[eventId]; - if (!eventData.isValid()) + if (!eventData.IsValid()) { Log.outError(LogFilter.Sql, "SmartAIMgr: Entry {0} SourceType {1} Event {2} Action {3} uses non-existent event, eventId {4}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.Action.gameEventStop.id); return false; @@ -1158,7 +1158,7 @@ namespace Game.AI } GameEventData eventData = events[eventId]; - if (!eventData.isValid()) + if (!eventData.IsValid()) { Log.outError(LogFilter.Sql, "SmartAIMgr: Entry {0} SourceType {1} Event {2} Action {3} uses non-existent event, eventId {4}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.Action.gameEventStart.id); return false; diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index f10903997..47a773002 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -392,13 +392,13 @@ namespace Game.AI if (me == null) break; - var threatList = me.GetThreatManager().getThreatList(); + var threatList = me.GetThreatManager().GetThreatList(); foreach (var refe in threatList) { - Unit target = Global.ObjAccessor.GetUnit(me, refe.getUnitGuid()); + Unit target = Global.ObjAccessor.GetUnit(me, refe.GetUnitGuid()); if (target != null) { - me.GetThreatManager().modifyThreatPercent(target, e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC); + me.GetThreatManager().ModifyThreatPercent(target, e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC); Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_THREAT_ALL_PCT: Creature guidLow {0} modify threat for unit {1}, value {2}", me.GetGUID().ToString(), target.GetGUID().ToString(), e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC); } @@ -418,7 +418,7 @@ namespace Game.AI { if (IsUnit(obj)) { - me.GetThreatManager().modifyThreatPercent(obj.ToUnit(), e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC); + me.GetThreatManager().ModifyThreatPercent(obj.ToUnit(), e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC); Log.outDebug(LogFilter.ScriptsAi, "SmartScript.ProcessAction. SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow {0} modify threat for unit {1}, value {2}", me.GetGUID().ToString(), obj.GetGUID().ToString(), e.Action.threatPCT.threatINC != 0 ? (int)e.Action.threatPCT.threatINC : -(int)e.Action.threatPCT.threatDEC); } @@ -2913,7 +2913,7 @@ namespace Game.AI Group group = player.GetGroup(); if (group) { - for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.next()) + for (GroupReference groupRef = group.GetFirstMember(); groupRef != null; groupRef = groupRef.Next()) { Player member = groupRef.GetSource(); if (member) @@ -3118,10 +3118,10 @@ namespace Game.AI { if (me != null) { - var threatList = me.GetThreatManager().getThreatList(); + var threatList = me.GetThreatManager().GetThreatList(); foreach (var i in threatList) { - Unit temp = Global.ObjAccessor.GetUnit(me, i.getUnitGuid()); + Unit temp = Global.ObjAccessor.GetUnit(me, i.GetUnitGuid()); if (temp != null) if (e.Target.hostilRandom.maxDist == 0 || me.IsWithinCombatRange(temp, (float)e.Target.hostilRandom.maxDist)) l.Add(temp); @@ -3157,7 +3157,7 @@ namespace Game.AI Group lootGroup = me.GetLootRecipientGroup(); if (lootGroup) { - for (GroupReference refe = lootGroup.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = lootGroup.GetFirstMember(); refe != null; refe = refe.Next()) { Player recipient = refe.GetSource(); if (recipient) diff --git a/Source/Game/Achievements/AchievementManager.cs b/Source/Game/Achievements/AchievementManager.cs index 029480a7b..3ffa51af9 100644 --- a/Source/Game/Achievements/AchievementManager.cs +++ b/Source/Game/Achievements/AchievementManager.cs @@ -940,7 +940,7 @@ namespace Game.Achievements Group group = referencePlayer.GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player groupMember = refe.GetSource(); if (groupMember) diff --git a/Source/Game/Achievements/CriteriaHandler.cs b/Source/Game/Achievements/CriteriaHandler.cs index 5fc79dd2c..4643378f8 100644 --- a/Source/Game/Achievements/CriteriaHandler.cs +++ b/Source/Game/Achievements/CriteriaHandler.cs @@ -1292,7 +1292,7 @@ namespace Game.Achievements case CriteriaAdditionalCondition.ArenaType: // 24 { Battleground bg = referencePlayer.GetBattleground(); - if (!bg || !bg.isArena() || bg.GetArenaType() != (ArenaTypes)reqValue) + if (!bg || !bg.IsArena() || bg.GetArenaType() != (ArenaTypes)reqValue) return false; break; } diff --git a/Source/Game/Arenas/Arena.cs b/Source/Game/Arenas/Arena.cs index d6d19362f..769c4a546 100644 --- a/Source/Game/Arenas/Arena.cs +++ b/Source/Game/Arenas/Arena.cs @@ -99,7 +99,7 @@ namespace Game.Arenas { base.BuildPvPLogDataPacket(out pvpLogData); - if (isRated()) + if (IsRated()) { pvpLogData.Ratings.HasValue = true; @@ -114,7 +114,7 @@ namespace Game.Arenas public override void RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket) { - if (isRated() && GetStatus() == BattlegroundStatus.InProgress) + if (IsRated() && GetStatus() == BattlegroundStatus.InProgress) { var bgPlayer = GetPlayers().LookupByKey(guid); if (bgPlayer != null) // check if the player was a participant of the match, or only entered through gm command (appear) @@ -151,7 +151,7 @@ namespace Game.Arenas public override void EndBattleground(Team winner) { // arena rating calculation - if (isRated()) + if (IsRated()) { uint loserTeamRating = 0; uint loserMatchmakerRating = 0; diff --git a/Source/Game/BattleFields/Zones/WinterGrasp.cs b/Source/Game/BattleFields/Zones/WinterGrasp.cs index 2bd51a7c2..b536a1c10 100644 --- a/Source/Game/BattleFields/Zones/WinterGrasp.cs +++ b/Source/Game/BattleFields/Zones/WinterGrasp.cs @@ -61,27 +61,27 @@ namespace Game.BattleFields m_saveTimer = 60000; // Load from db - if ((Global.WorldMgr.getWorldState(WGWorldStates.Active) == 0) && (Global.WorldMgr.getWorldState(WGWorldStates.Defender) == 0) && (Global.WorldMgr.getWorldState(WGConst.ClockWorldState[0]) == 0)) + if ((Global.WorldMgr.GetWorldState(WGWorldStates.Active) == 0) && (Global.WorldMgr.GetWorldState(WGWorldStates.Defender) == 0) && (Global.WorldMgr.GetWorldState(WGConst.ClockWorldState[0]) == 0)) { - Global.WorldMgr.setWorldState(WGWorldStates.Active, 0); - Global.WorldMgr.setWorldState(WGWorldStates.Defender, RandomHelper.URand(0, 1)); - Global.WorldMgr.setWorldState(WGConst.ClockWorldState[0], m_NoWarBattleTime); + Global.WorldMgr.SetWorldState(WGWorldStates.Active, 0); + Global.WorldMgr.SetWorldState(WGWorldStates.Defender, RandomHelper.URand(0, 1)); + Global.WorldMgr.SetWorldState(WGConst.ClockWorldState[0], m_NoWarBattleTime); } - m_isActive = Global.WorldMgr.getWorldState(WGWorldStates.Active) != 0; - m_DefenderTeam = Global.WorldMgr.getWorldState(WGWorldStates.Defender); + m_isActive = Global.WorldMgr.GetWorldState(WGWorldStates.Active) != 0; + m_DefenderTeam = Global.WorldMgr.GetWorldState(WGWorldStates.Defender); - m_Timer = Global.WorldMgr.getWorldState(WGConst.ClockWorldState[0]); + m_Timer = Global.WorldMgr.GetWorldState(WGConst.ClockWorldState[0]); if (m_isActive) { m_isActive = false; m_Timer = m_RestartAfterCrash; } - SetData(WGData.WonA, Global.WorldMgr.getWorldState(WGWorldStates.AttackedA)); - SetData(WGData.DefA, Global.WorldMgr.getWorldState(WGWorldStates.DefendedA)); - SetData(WGData.WonH, Global.WorldMgr.getWorldState(WGWorldStates.AttackedH)); - SetData(WGData.DefH, Global.WorldMgr.getWorldState(WGWorldStates.DefendedH)); + SetData(WGData.WonA, Global.WorldMgr.GetWorldState(WGWorldStates.AttackedA)); + SetData(WGData.DefA, Global.WorldMgr.GetWorldState(WGWorldStates.DefendedA)); + SetData(WGData.WonH, Global.WorldMgr.GetWorldState(WGWorldStates.AttackedH)); + SetData(WGData.DefH, Global.WorldMgr.GetWorldState(WGWorldStates.DefendedH)); foreach (var gy in WGConst.WGGraveYard) { @@ -163,13 +163,13 @@ namespace Game.BattleFields bool m_return = base.Update(diff); if (m_saveTimer <= diff) { - Global.WorldMgr.setWorldState(WGWorldStates.Active, m_isActive); - Global.WorldMgr.setWorldState(WGWorldStates.Defender, m_DefenderTeam); - Global.WorldMgr.setWorldState(WGConst.ClockWorldState[0], m_Timer); - Global.WorldMgr.setWorldState(WGWorldStates.AttackedA, GetData(WGData.WonA)); - Global.WorldMgr.setWorldState(WGWorldStates.DefendedA, GetData(WGData.DefA)); - Global.WorldMgr.setWorldState(WGWorldStates.AttackedH, GetData(WGData.WonH)); - Global.WorldMgr.setWorldState(WGWorldStates.DefendedH, GetData(WGData.DefH)); + Global.WorldMgr.SetWorldState(WGWorldStates.Active, m_isActive); + Global.WorldMgr.SetWorldState(WGWorldStates.Defender, m_DefenderTeam); + Global.WorldMgr.SetWorldState(WGConst.ClockWorldState[0], m_Timer); + Global.WorldMgr.SetWorldState(WGWorldStates.AttackedA, GetData(WGData.WonA)); + Global.WorldMgr.SetWorldState(WGWorldStates.DefendedA, GetData(WGData.DefA)); + Global.WorldMgr.SetWorldState(WGWorldStates.AttackedH, GetData(WGData.WonH)); + Global.WorldMgr.SetWorldState(WGWorldStates.DefendedH, GetData(WGData.DefH)); m_saveTimer = 60 * Time.InMilliseconds; } else @@ -1194,7 +1194,7 @@ namespace Game.BattleFields break; } - _state = (WGGameObjectState)Global.WorldMgr.getWorldState(_worldState); + _state = (WGGameObjectState)Global.WorldMgr.GetWorldState(_worldState); switch (_state) { case WGGameObjectState.NeutralIntact: @@ -1449,7 +1449,7 @@ namespace Game.BattleFields public void Save() { - Global.WorldMgr.setWorldState(_worldState, (ulong)_state); + Global.WorldMgr.SetWorldState(_worldState, (ulong)_state); } public ObjectGuid GetGUID() { return _buildGUID; } @@ -1568,7 +1568,7 @@ namespace Game.BattleFields public void Save() { - Global.WorldMgr.setWorldState(_staticInfo.WorldStateId, (uint)_state); + Global.WorldMgr.SetWorldState(_staticInfo.WorldStateId, (uint)_state); } public uint GetTeamControl() { return _teamControl; } diff --git a/Source/Game/BattleGrounds/BattleGround.cs b/Source/Game/BattleGrounds/BattleGround.cs index 1a191a0c9..5a7b259e0 100644 --- a/Source/Game/BattleGrounds/BattleGround.cs +++ b/Source/Game/BattleGrounds/BattleGround.cs @@ -116,7 +116,7 @@ namespace Game.BattleGrounds _ProcessOfflineQueue(); _ProcessPlayerPositionBroadcast(diff); // after 47 Time.Minutes without one team losing, the arena closes with no winner and no rating change - if (isArena()) + if (IsArena()) { if (GetElapsedTime() >= 47 * Time.Minute * Time.InMilliseconds) { @@ -298,7 +298,7 @@ namespace Game.BattleGrounds EndBattleground(GetPrematureWinner()); m_PrematureCountDown = false; } - else if (!Global.BattlegroundMgr.isTesting()) + else if (!Global.BattlegroundMgr.IsTesting()) { uint newtime = m_PrematureCountDownTimer - diff; // announce every Time.Minute @@ -324,7 +324,7 @@ namespace Game.BattleGrounds // ********************************************************* ModifyStartDelayTime((int)diff); - if (!isArena()) + if (!IsArena()) SetRemainingTime(300000); if (m_ResetStatTimer > 5000) @@ -341,7 +341,7 @@ namespace Game.BattleGrounds // Send packet every 10 seconds until the 2nd field reach 0 if (m_CountdownTimer >= 10000) { - uint countdownMaxForBGType = isArena() ? BattlegroundConst.ArenaCountdownMax : BattlegroundConst.BattlegroundCountdownMax; + uint countdownMaxForBGType = IsArena() ? BattlegroundConst.ArenaCountdownMax : BattlegroundConst.BattlegroundCountdownMax; StartTimer timer = new StartTimer(); timer.Type = TimerType.Pvp; @@ -409,7 +409,7 @@ namespace Game.BattleGrounds SetStartDelayTime(StartDelayTimes[BattlegroundConst.EventIdFourth]); // Remove preparation - if (isArena()) + if (IsArena()) { //todo add arena sound PlaySoundToAll(SOUND_ARENA_START); foreach (var guid in GetPlayers().Keys) @@ -655,7 +655,7 @@ namespace Game.BattleGrounds if (winner == Team.Alliance) { - if (isBattleground()) + if (IsBattleground()) SendBroadcastText(BattlegroundBroadcastTexts.AllianceWins, ChatMsg.BgSystemNeutral); PlaySoundToAll((uint)BattlegroundSounds.AllianceWins); @@ -663,7 +663,7 @@ namespace Game.BattleGrounds } else if (winner == Team.Horde) { - if (isBattleground()) + if (IsBattleground()) SendBroadcastText(BattlegroundBroadcastTexts.HordeWins, ChatMsg.BgSystemNeutral); PlaySoundToAll((uint)BattlegroundSounds.HordeWins); @@ -676,7 +676,7 @@ namespace Game.BattleGrounds PreparedStatement stmt = null; ulong battlegroundId = 1; - if (isBattleground() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable)) + if (IsBattleground() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable)) { stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_PVPSTATS_MAXID); SQLResult result = DB.Characters.Query(stmt); @@ -722,7 +722,7 @@ namespace Game.BattleGrounds { //needed cause else in av some creatures will kill the players at the end player.CombatStop(); - player.GetHostileRefManager().deleteReferences(); + player.GetHostileRefManager().DeleteReferences(); } // remove temporary currency bonus auras before rewarding player @@ -732,7 +732,7 @@ namespace Game.BattleGrounds uint winnerKills = player.GetRandomWinner() ? WorldConfig.GetUIntValue(WorldCfg.BgRewardWinnerHonorLast) : WorldConfig.GetUIntValue(WorldCfg.BgRewardWinnerHonorFirst); uint loserKills = player.GetRandomWinner() ? WorldConfig.GetUIntValue(WorldCfg.BgRewardLoserHonorLast) : WorldConfig.GetUIntValue(WorldCfg.BgRewardLoserHonorFirst); - if (isBattleground() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable)) + if (IsBattleground() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundStoreStatisticsEnable)) { stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_PVPSTATS_PLAYER); var score = PlayerScores.LookupByKey(player.GetGUID()); @@ -810,7 +810,7 @@ namespace Game.BattleGrounds { //variable kills means how many honorable kills you scored (so we need kills * honor_for_one_kill) uint maxLevel = Math.Min(GetMaxLevel(), 80U); - return Formulas.hk_honor_at_level(maxLevel, kills); + return Formulas.HKHonorAtLevel(maxLevel, kills); } void BlockMovement(Player player) @@ -867,7 +867,7 @@ namespace Game.BattleGrounds player.ClearAfkReports(); // if arena, remove the specific arena auras - if (isArena()) + if (IsArena()) { bgTypeId = BattlegroundTypeId.AA; // set the bg type to all arenas (it will be used for queue refreshing) @@ -895,7 +895,7 @@ namespace Game.BattleGrounds } DecreaseInvitedCount(team); //we should update Battleground queue, but only if bg isn't ending - if (isBattleground() && GetStatus() < BattlegroundStatus.WaitLeave) + if (IsBattleground() && GetStatus() < BattlegroundStatus.WaitLeave) { // a player has left the Battleground, so there are free slots . add to queue AddToBGFreeSlotQueue(); @@ -1007,7 +1007,7 @@ namespace Game.BattleGrounds player.RemoveAurasByType(AuraType.Mounted); // add arena specific auras - if (isArena()) + if (IsArena()) { player.RemoveArenaEnchantments(EnchantmentSlot.Temp); @@ -1026,7 +1026,7 @@ namespace Game.BattleGrounds { player.CastSpell(player, BattlegroundConst.SpellPreparation, true); // reduces all mana cost of spells. - uint countdownMaxForBGType = isArena() ? BattlegroundConst.ArenaCountdownMax : BattlegroundConst.BattlegroundCountdownMax; + uint countdownMaxForBGType = IsArena() ? BattlegroundConst.ArenaCountdownMax : BattlegroundConst.BattlegroundCountdownMax; StartTimer timer = new StartTimer(); timer.Type = TimerType.Pvp; timer.TimeRemaining = countdownMaxForBGType - (GetElapsedTime() / 1000); @@ -1120,7 +1120,7 @@ namespace Game.BattleGrounds RemovePlayer(player, guid, GetPlayerTeam(guid)); // 1 player is logging out, if it is the last, then end arena! - if (isArena()) + if (IsArena()) if (GetAlivePlayersCountByTeam(player.GetBGTeam()) <= 1 && GetPlayersCountByTeam(GetOtherTeam(player.GetBGTeam())) != 0) EndBattleground(GetOtherTeam(player.GetBGTeam())); } @@ -1129,7 +1129,7 @@ namespace Game.BattleGrounds // This method should be called only once ... it adds pointer to queue void AddToBGFreeSlotQueue() { - if (!m_InBGFreeSlotQueue && isBattleground()) + if (!m_InBGFreeSlotQueue && IsBattleground()) { Global.BattlegroundMgr.AddToBGFreeSlotQueue(m_TypeID, this); m_InBGFreeSlotQueue = true; @@ -1251,7 +1251,7 @@ namespace Game.BattleGrounds if (bgScore == null) // player not found... return false; - if (type == ScoreType.BonusHonor && doAddHonor && isBattleground()) + if (type == ScoreType.BonusHonor && doAddHonor && IsBattleground()) player.RewardHonor(null, 1, (int)value); else bgScore.UpdateScore(type, value); @@ -1640,7 +1640,7 @@ namespace Game.BattleGrounds } } - if (!isArena()) + if (!IsArena()) { // To be able to remove insignia -- ONLY IN Battlegrounds victim.AddUnitFlag(UnitFlags.Skinnable); @@ -1869,9 +1869,9 @@ namespace Game.BattleGrounds public void SetRandom(bool isRandom) { m_IsRandom = isRandom; } uint GetInvitedCount(Team team) { return (team == Team.Alliance) ? m_InvitedAlliance : m_InvitedHorde; } - public bool isArena() { return m_IsArena; } - public bool isBattleground() { return !m_IsArena; } - public bool isRated() { return m_IsRated; } + public bool IsArena() { return m_IsArena; } + public bool IsBattleground() { return !m_IsArena; } + public bool IsRated() { return m_IsRated; } public Dictionary GetPlayers() { return m_Players; } uint GetPlayersSize() { return (uint)m_Players.Count; } diff --git a/Source/Game/BattleGrounds/BattleGroundManager.cs b/Source/Game/BattleGrounds/BattleGroundManager.cs index ce3d93a95..0f477978b 100644 --- a/Source/Game/BattleGrounds/BattleGroundManager.cs +++ b/Source/Game/BattleGrounds/BattleGroundManager.cs @@ -134,9 +134,9 @@ namespace Game.BattleGrounds header.QueueID = bg.GetQueueId(); header.RangeMin = (byte)bg.GetMinLevel(); header.RangeMax = (byte)bg.GetMaxLevel(); - header.TeamSize = (byte)(bg.isArena() ? arenaType : 0); + header.TeamSize = (byte)(bg.IsArena() ? arenaType : 0); header.InstanceID = bg.GetClientInstanceID(); - header.RegisteredMatch = bg.isRated(); + header.RegisteredMatch = bg.IsRated(); header.TournamentRules = false; } @@ -267,7 +267,7 @@ namespace Game.BattleGrounds // create a copy of the BG template Battleground bg = bg_template.GetCopy(); - bool isRandom = bgTypeId != originalBgTypeId && !bg.isArena(); + bool isRandom = bgTypeId != originalBgTypeId && !bg.IsArena(); bg.SetBracket(bracketEntry); bg.SetInstanceID(Global.MapMgr.GenerateInstanceId()); @@ -282,7 +282,7 @@ namespace Game.BattleGrounds bg.SetQueueId((ulong)bgTypeId | 0x1F10000000000000); // Set up correct min/max player counts for scoreboards - if (bg.isArena()) + if (bg.IsArena()) { uint maxPlayersPerTeam = 0; switch (arenaType) @@ -857,8 +857,8 @@ namespace Game.BattleGrounds public BattlegroundQueue GetBattlegroundQueue(BattlegroundQueueTypeId bgQueueTypeId) { return m_BattlegroundQueues[(int)bgQueueTypeId]; } - public bool isArenaTesting() { return m_ArenaTesting; } - public bool isTesting() { return m_Testing; } + public bool IsArenaTesting() { return m_ArenaTesting; } + public bool IsTesting() { return m_Testing; } public BattlegroundTypeId GetBattleMasterBG(uint entry) { diff --git a/Source/Game/BattleGrounds/BattleGroundQueue.cs b/Source/Game/BattleGrounds/BattleGroundQueue.cs index 9e122249e..1a7a6da5d 100644 --- a/Source/Game/BattleGrounds/BattleGroundQueue.cs +++ b/Source/Game/BattleGrounds/BattleGroundQueue.cs @@ -97,7 +97,7 @@ namespace Game.BattleGrounds //add players from group to ginfo if (grp) { - for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (!member) @@ -385,7 +385,7 @@ namespace Game.BattleGrounds BattlegroundBracketId bracket_id = bg.GetBracketId(); // set ArenaTeamId for rated matches - if (bg.isArena() && bg.isRated()) + if (bg.IsArena() && bg.IsRated()) bg.SetArenaTeamIdForTeam(ginfo.Team, ginfo.ArenaTeamId); ginfo.RemoveInviteTime = GameTime.GetGameTimeMS() + BattlegroundConst.InviteAcceptWaitTime; @@ -644,7 +644,7 @@ namespace Game.BattleGrounds return false; } //allow 1v0 if debug bg - if (Global.BattlegroundMgr.isTesting() && (m_SelectionPools[TeamId.Alliance].GetPlayerCount() != 0 || m_SelectionPools[TeamId.Horde].GetPlayerCount() != 0)) + if (Global.BattlegroundMgr.IsTesting() && (m_SelectionPools[TeamId.Alliance].GetPlayerCount() != 0 || m_SelectionPools[TeamId.Horde].GetPlayerCount() != 0)) return true; //return true if there are enough players in selection pools - enable to work .debug bg command correctly return m_SelectionPools[TeamId.Alliance].GetPlayerCount() >= minPlayers && m_SelectionPools[TeamId.Horde].GetPlayerCount() >= minPlayers; @@ -745,7 +745,7 @@ namespace Game.BattleGrounds foreach (var bg in bgQueues) { // DO NOT allow queue manager to invite new player to rated games - if (!bg.isRated() && bg.GetTypeID() == bgTypeId && bg.GetBracketId() == bracket_id && + if (!bg.IsRated() && bg.GetTypeID() == bgTypeId && bg.GetBracketId() == bracket_id && bg.GetStatus() > BattlegroundStatus.WaitQueue && bg.GetStatus() < BattlegroundStatus.WaitLeave) { // clear selection pools @@ -787,18 +787,18 @@ namespace Game.BattleGrounds uint MinPlayersPerTeam = bg_template.GetMinPlayersPerTeam(); uint MaxPlayersPerTeam = bg_template.GetMaxPlayersPerTeam(); - if (bg_template.isArena()) + if (bg_template.IsArena()) { MaxPlayersPerTeam = arenaType; - MinPlayersPerTeam = (uint)(Global.BattlegroundMgr.isArenaTesting() ? 1 : arenaType); + MinPlayersPerTeam = (uint)(Global.BattlegroundMgr.IsArenaTesting() ? 1 : arenaType); } - else if (Global.BattlegroundMgr.isTesting()) + else if (Global.BattlegroundMgr.IsTesting()) MinPlayersPerTeam = 1; m_SelectionPools[TeamId.Alliance].Init(); m_SelectionPools[TeamId.Horde].Init(); - if (bg_template.isBattleground()) + if (bg_template.IsBattleground()) { if (CheckPremadeMatch(bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam)) { @@ -826,7 +826,7 @@ namespace Game.BattleGrounds { // if there are enough players in pools, start new Battleground or non rated arena if (CheckNormalMatch(bg_template, bracket_id, MinPlayersPerTeam, MaxPlayersPerTeam) - || (bg_template.isArena() && CheckSkirmishForSameFaction(bracket_id, MinPlayersPerTeam))) + || (bg_template.IsArena() && CheckSkirmishForSameFaction(bracket_id, MinPlayersPerTeam))) { // we successfully created a pool Battleground bg2 = Global.BattlegroundMgr.CreateNewBattleground(bgTypeId, bracketEntry, (ArenaTypes)arenaType, false); @@ -846,7 +846,7 @@ namespace Game.BattleGrounds bg2.StartBattleground(); } } - else if (bg_template.isArena()) + else if (bg_template.IsArena()) { // found out the minimum and maximum ratings the newly added team should battle against // arenaRating is the rating of the latest joined team, or 0 @@ -1166,7 +1166,7 @@ namespace Game.BattleGrounds player.RemoveBattlegroundQueueId(m_BgQueueTypeId); bgQueue.RemovePlayer(m_PlayerGuid, true); //update queues if Battleground isn't ended - if (bg && bg.isBattleground() && bg.GetStatus() != BattlegroundStatus.WaitLeave) + if (bg && bg.IsBattleground() && bg.GetStatus() != BattlegroundStatus.WaitLeave) Global.BattlegroundMgr.ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg.GetBracketId()); BattlefieldStatusNone battlefieldStatus; diff --git a/Source/Game/Chat/CommandHandler.cs b/Source/Game/Chat/CommandHandler.cs index 0064127dd..f7c839210 100644 --- a/Source/Game/Chat/CommandHandler.cs +++ b/Source/Game/Chat/CommandHandler.cs @@ -81,7 +81,7 @@ namespace Game.Chat //if (!command.Name.Equals(cmd)) //continue; - if (!hasStringAbbr(command.Name, cmd)) + if (!HasStringAbbr(command.Name, cmd)) continue; bool match = false; @@ -89,7 +89,7 @@ namespace Game.Chat { foreach (var command2 in table) { - if (!hasStringAbbr(command2.Name, cmd)) + if (!HasStringAbbr(command2.Name, cmd)) continue; if (command2.Name.Equals(cmd)) @@ -180,7 +180,7 @@ namespace Game.Chat if (!IsAvailable(command)) continue; - if (!hasStringAbbr(command.Name, cmd)) + if (!HasStringAbbr(command.Name, cmd)) continue; // have subcommand @@ -236,7 +236,7 @@ namespace Game.Chat continue; // for empty subcmd show all available - if (!subcmd.IsEmpty() && !hasStringAbbr(command.Name, subcmd)) + if (!subcmd.IsEmpty() && !HasStringAbbr(command.Name, subcmd)) continue; if (GetSession() != null) @@ -271,17 +271,17 @@ namespace Game.Chat public virtual bool HasPermission(RBACPermissions permission) { return _session.HasPermission(permission); } - public string extractKeyFromLink(StringArguments args, params string[] linkType) + public string ExtractKeyFromLink(StringArguments args, params string[] linkType) { int throwaway; - return extractKeyFromLink(args, linkType, out throwaway); + return ExtractKeyFromLink(args, linkType, out throwaway); } - public string extractKeyFromLink(StringArguments args, string[] linkType, out int found_idx) + public string ExtractKeyFromLink(StringArguments args, string[] linkType, out int found_idx) { string throwaway; - return extractKeyFromLink(args, linkType, out found_idx, out throwaway); + return ExtractKeyFromLink(args, linkType, out found_idx, out throwaway); } - public string extractKeyFromLink(StringArguments args, string[] linkType, out int found_idx, out string something1) + public string ExtractKeyFromLink(StringArguments args, string[] linkType, out int found_idx, out string something1) { found_idx = 0; something1 = null; @@ -327,7 +327,7 @@ namespace Game.Chat return null; } - public void extractOptFirstArg(StringArguments args, out string arg1, out string arg2) + public void ExtractOptFirstArg(StringArguments args, out string arg1, out string arg2) { string p1 = args.NextString(); string p2 = args.NextString(); @@ -342,9 +342,9 @@ namespace Game.Chat arg2 = p2; } - public GameTele extractGameTeleFromLink(StringArguments args) + public GameTele ExtractGameTeleFromLink(StringArguments args) { - string cId = extractKeyFromLink(args, "Htele"); + string cId = ExtractKeyFromLink(args, "Htele"); if (string.IsNullOrEmpty(cId)) return null; @@ -354,7 +354,7 @@ namespace Game.Chat return Global.ObjectMgr.GetGameTele(id); } - public string extractQuotedArg(string str) + public string ExtractQuotedArg(string str) { if (string.IsNullOrEmpty(str)) return null; @@ -364,10 +364,10 @@ namespace Game.Chat return str.Replace("\"", String.Empty); } - string extractPlayerNameFromLink(StringArguments args) + string ExtractPlayerNameFromLink(StringArguments args) { // |color|Hplayer:name|h[name]|h|r - string name = extractKeyFromLink(args, "Hplayer"); + string name = ExtractKeyFromLink(args, "Hplayer"); if (name.IsEmpty()) return ""; @@ -376,19 +376,19 @@ namespace Game.Chat return name; } - public bool extractPlayerTarget(StringArguments args, out Player player) + public bool ExtractPlayerTarget(StringArguments args, out Player player) { ObjectGuid guid; string name; - return extractPlayerTarget(args, out player, out guid, out name); + return ExtractPlayerTarget(args, out player, out guid, out name); } - public bool extractPlayerTarget(StringArguments args, out Player player, out ObjectGuid playerGuid) + public bool ExtractPlayerTarget(StringArguments args, out Player player, out ObjectGuid playerGuid) { string name; - return extractPlayerTarget(args, out player, out playerGuid, out name); + return ExtractPlayerTarget(args, out player, out playerGuid, out name); } - public bool extractPlayerTarget(StringArguments args, out Player player, out ObjectGuid playerGuid, out string playerName) + public bool ExtractPlayerTarget(StringArguments args, out Player player, out ObjectGuid playerGuid, out string playerName) { player = null; playerGuid = ObjectGuid.Empty; @@ -396,7 +396,7 @@ namespace Game.Chat if (!args.Empty()) { - string name = extractPlayerNameFromLink(args); + string name = ExtractPlayerNameFromLink(args); if (string.IsNullOrEmpty(name)) { SendSysMessage(CypherStrings.PlayerNotFound); @@ -412,7 +412,7 @@ namespace Game.Chat } else { - player = getSelectedPlayer(); + player = GetSelectedPlayer(); playerGuid = player != null ? player.GetGUID() : ObjectGuid.Empty; playerName = player != null ? player.GetName() : ""; } @@ -426,7 +426,7 @@ namespace Game.Chat return true; } - public ulong extractLowGuidFromLink(StringArguments args, ref HighGuid guidHigh) + public ulong ExtractLowGuidFromLink(StringArguments args, ref HighGuid guidHigh) { int type; @@ -439,7 +439,7 @@ namespace Game.Chat // |color|Hcreature:creature_guid|h[name]|h|r // |color|Hgameobject:go_guid|h[name]|h|r // |color|Hplayer:name|h[name]|h|r - string idS = extractKeyFromLink(args, guidKeys, out type); + string idS = ExtractKeyFromLink(args, guidKeys, out type); if (string.IsNullOrEmpty(idS)) return 0; @@ -489,7 +489,7 @@ namespace Game.Chat "Htrade", // profession/skill spell "Hglyph", // glyph }; - public uint extractSpellIdFromLink(StringArguments args) + public uint ExtractSpellIdFromLink(StringArguments args) { // number or [name] Shift-click form |color|Henchant:recipe_spell_id|h[prof_name: recipe_name]|h|r // number or [name] Shift-click form |color|Hglyph:glyph_slot_id:glyph_prop_id|h[value]|h|r @@ -498,7 +498,7 @@ namespace Game.Chat // number or [name] Shift-click form |color|Htrade:spell_id, skill_id, max_value, cur_value|h[name]|h|r int type = 0; string param1Str = null; - string idS = extractKeyFromLink(args, spellKeys, out type, out param1Str); + string idS = ExtractKeyFromLink(args, spellKeys, out type, out param1Str); if (string.IsNullOrEmpty(idS)) return 0; @@ -538,7 +538,7 @@ namespace Game.Chat return 0; } - public Player getSelectedPlayer() + public Player GetSelectedPlayer() { if (_session == null) return null; @@ -550,7 +550,7 @@ namespace Game.Chat return Global.ObjAccessor.FindPlayer(selected); } - public Unit getSelectedUnit() + public Unit GetSelectedUnit() { if (_session == null) return null; @@ -573,14 +573,14 @@ namespace Game.Chat return Global.ObjAccessor.GetUnit(_session.GetPlayer(), selected); } - public Creature getSelectedCreature() + public Creature GetSelectedCreature() { if (_session == null) return null; return ObjectAccessor.GetCreatureOrPetOrVehicle(_session.GetPlayer(), _session.GetPlayer().GetTarget()); } - public Player getSelectedPlayerOrSelf() + public Player GetSelectedPlayerOrSelf() { if (_session == null) return null; @@ -639,7 +639,7 @@ namespace Game.Chat return searcher.GetTarget(); } - public string playerLink(string name, bool console = false) + public string PlayerLink(string name, bool console = false) { return console ? name : "|cffffffff|Hplayer:" + name + "|h[" + name + "]|h|r"; } @@ -649,9 +649,9 @@ namespace Game.Chat } public string GetNameLink(Player obj) { - return playerLink(obj.GetName()); + return PlayerLink(obj.GetName()); } - public virtual bool needReportToTarget(Player chr) + public virtual bool NeedReportToTarget(Player chr) { Player pl = _session.GetPlayer(); return pl != chr && pl.IsVisibleGloballyFor(chr); @@ -703,7 +703,7 @@ namespace Game.Chat return false; } - bool hasStringAbbr(string name, string part) + bool HasStringAbbr(string name, string part) { // non "" command if (!name.IsEmpty()) @@ -822,8 +822,8 @@ namespace Game.Chat } else { - if (getSelectedPlayer()) - player = getSelectedPlayer(); + if (GetSelectedPlayer()) + player = GetSelectedPlayer(); else player = _session.GetPlayer(); @@ -866,7 +866,7 @@ namespace Game.Chat return GetCypherString(CypherStrings.ConsoleCommand); } - public override bool needReportToTarget(Player chr) + public override bool NeedReportToTarget(Player chr) { return true; } diff --git a/Source/Game/Chat/Commands/AccountCommands.cs b/Source/Game/Chat/Commands/AccountCommands.cs index 163f25778..e9764e838 100644 --- a/Source/Game/Chat/Commands/AccountCommands.cs +++ b/Source/Game/Chat/Commands/AccountCommands.cs @@ -467,7 +467,7 @@ namespace Game.Chat if (string.IsNullOrEmpty(exp)) { - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) return false; @@ -531,7 +531,7 @@ namespace Game.Chat if (string.IsNullOrEmpty(arg3)) { - if (!handler.getSelectedPlayer()) + if (!handler.GetSelectedPlayer()) return false; isAccountNameGiven = false; } @@ -560,7 +560,7 @@ namespace Game.Chat } // command.getSession() == NULL only for console - targetAccountId = (isAccountNameGiven) ? Global.AccountMgr.GetId(targetAccountName) : handler.getSelectedPlayer().GetSession().GetAccountId(); + targetAccountId = (isAccountNameGiven) ? Global.AccountMgr.GetId(targetAccountName) : handler.GetSelectedPlayer().GetSession().GetAccountId(); if (!int.TryParse(isAccountNameGiven ? arg3 : arg2, out int gmRealmID)) return false; @@ -602,7 +602,7 @@ namespace Game.Chat return false; } - RBACData rbac = isAccountNameGiven ? null : handler.getSelectedPlayer().GetSession().GetRBACData(); + RBACData rbac = isAccountNameGiven ? null : handler.GetSelectedPlayer().GetSession().GetRBACData(); Global.AccountMgr.UpdateAccountAccess(rbac, targetAccountId, (byte)gm, gmRealmID); handler.SendSysMessage(CypherStrings.YouChangeSecurity, targetAccountName, gm); return true; diff --git a/Source/Game/Chat/Commands/ArenaCommands.cs b/Source/Game/Chat/Commands/ArenaCommands.cs index 37b82e5e1..62475f916 100644 --- a/Source/Game/Chat/Commands/ArenaCommands.cs +++ b/Source/Game/Chat/Commands/ArenaCommands.cs @@ -32,10 +32,10 @@ namespace Game.Chat return false; Player target; - if (!handler.extractPlayerTarget(args[0] != '"' ? args : null, out target)) + if (!handler.ExtractPlayerTarget(args[0] != '"' ? args : null, out target)) return false; - string name = handler.extractQuotedArg(args.NextString()); + string name = handler.ExtractQuotedArg(args.NextString()); if (string.IsNullOrEmpty(name)) return false; @@ -119,14 +119,14 @@ namespace Game.Chat if (args.Empty()) return false; - string oldArenaStr = handler.extractQuotedArg(args.NextString()); + string oldArenaStr = handler.ExtractQuotedArg(args.NextString()); if (string.IsNullOrEmpty(oldArenaStr)) { handler.SendSysMessage(CypherStrings.BadValue); return false; } - string newArenaStr = handler.extractQuotedArg(args.NextString()); + string newArenaStr = handler.ExtractQuotedArg(args.NextString()); if (string.IsNullOrEmpty(newArenaStr)) { handler.SendSysMessage(CypherStrings.BadValue); @@ -176,7 +176,7 @@ namespace Game.Chat string idStr; string nameStr; - handler.extractOptFirstArg(args, out idStr, out nameStr); + handler.ExtractOptFirstArg(args, out idStr, out nameStr); if (string.IsNullOrEmpty(idStr)) return false; @@ -185,7 +185,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; - if (!handler.extractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid)) + if (!handler.ExtractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid)) return false; ArenaTeam arena = Global.ArenaTeamMgr.GetArenaTeamById(teamId); diff --git a/Source/Game/Chat/Commands/CastCommands.cs b/Source/Game/Chat/Commands/CastCommands.cs index 286e353ce..8720282fd 100644 --- a/Source/Game/Chat/Commands/CastCommands.cs +++ b/Source/Game/Chat/Commands/CastCommands.cs @@ -32,7 +32,7 @@ namespace Game.Chat if (args.Empty()) return false; - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -40,7 +40,7 @@ namespace Game.Chat } // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0) return false; @@ -61,7 +61,7 @@ namespace Game.Chat [Command("back", RBACPermissions.CommandCastBack)] static bool HandleCastBackCommand(StringArguments args, CommandHandler handler) { - Creature caster = handler.getSelectedCreature(); + Creature caster = handler.GetSelectedCreature(); if (!caster) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -69,7 +69,7 @@ namespace Game.Chat } // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0) return false; @@ -97,7 +97,7 @@ namespace Game.Chat return false; // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0) return false; @@ -129,7 +129,7 @@ namespace Game.Chat if (args.Empty()) return false; - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -137,7 +137,7 @@ namespace Game.Chat } // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0) return false; @@ -152,7 +152,7 @@ namespace Game.Chat [Command("target", RBACPermissions.CommandCastTarget)] static bool HandleCastTargetCommad(StringArguments args, CommandHandler handler) { - Creature caster = handler.getSelectedCreature(); + Creature caster = handler.GetSelectedCreature(); if (!caster) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -166,7 +166,7 @@ namespace Game.Chat } // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0) return false; @@ -190,7 +190,7 @@ namespace Game.Chat [Command("dest", RBACPermissions.CommandCastDest)] static bool HandleCastDestCommand(StringArguments args, CommandHandler handler) { - Unit caster = handler.getSelectedUnit(); + Unit caster = handler.GetSelectedUnit(); if (!caster) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -198,7 +198,7 @@ namespace Game.Chat } // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0) return false; diff --git a/Source/Game/Chat/Commands/CharacterCommands.cs b/Source/Game/Chat/Commands/CharacterCommands.cs index 10de68190..c9da8cd05 100644 --- a/Source/Game/Chat/Commands/CharacterCommands.cs +++ b/Source/Game/Chat/Commands/CharacterCommands.cs @@ -37,7 +37,7 @@ namespace Game.Chat return false; Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; LocaleConstant loc = handler.GetSessionDbcLocale(); @@ -76,7 +76,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; string newNameStr = args.NextString(); @@ -181,7 +181,7 @@ namespace Game.Chat if (handler.HasLowerSecurity(null, targetGuid)) return false; - string oldNameLink = handler.playerLink(targetName); + string oldNameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.RenamePlayerGuid, oldNameLink, targetGuid.ToString()); PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG); @@ -199,7 +199,7 @@ namespace Game.Chat { string nameStr; string levelStr; - handler.extractOptFirstArg(args, out nameStr, out levelStr); + handler.ExtractOptFirstArg(args, out nameStr, out levelStr); if (string.IsNullOrEmpty(levelStr)) return false; @@ -213,7 +213,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out targetName)) return false; int oldlevel = (int)(target ? target.GetLevel() : Global.CharacterCacheStorage.GetCharacterLevelByGuid(targetGuid)); @@ -230,7 +230,7 @@ namespace Game.Chat HandleCharacterLevel(target, targetGuid, oldlevel, newlevel, handler); if (handler.GetSession() == null || handler.GetSession().GetPlayer() != target) // including player == NULL { - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.YouChangeLvl, nameLink, newlevel); } @@ -244,7 +244,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG); @@ -257,7 +257,7 @@ namespace Game.Chat } else { - string oldNameLink = handler.playerLink(targetName); + string oldNameLink = handler.PlayerLink(targetName); stmt.AddValue(1, targetGuid.GetCounter()); handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, oldNameLink, targetGuid.ToString()); } @@ -271,14 +271,14 @@ namespace Game.Chat { string playerNameStr; string accountName; - handler.extractOptFirstArg(args, out playerNameStr, out accountName); + handler.ExtractOptFirstArg(args, out playerNameStr, out accountName); if (accountName.IsEmpty()) return false; ObjectGuid targetGuid; string targetName; Player playerNotUsed; - if (!handler.extractPlayerTarget(new StringArguments(playerNameStr), out playerNotUsed, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(new StringArguments(playerNameStr), out playerNotUsed, out targetGuid, out targetName)) return false; CharacterCacheEntry characterInfo = Global.CharacterCacheStorage.GetCharacterCacheByGuid(targetGuid); @@ -347,7 +347,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG); @@ -360,7 +360,7 @@ namespace Game.Chat } else { - string oldNameLink = handler.playerLink(targetName); + string oldNameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, oldNameLink, targetGuid.ToString()); stmt.AddValue(1, targetGuid.GetCounter()); } @@ -375,7 +375,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG); @@ -389,7 +389,7 @@ namespace Game.Chat } else { - string oldNameLink = handler.playerLink(targetName); + string oldNameLink = handler.PlayerLink(targetName); // @todo add text into database handler.SendSysMessage(CypherStrings.CustomizePlayerGuid, oldNameLink, targetGuid.ToString()); stmt.AddValue(1, targetGuid.GetCounter()); @@ -403,7 +403,7 @@ namespace Game.Chat static bool HandleCharacterReputationCommand(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; LocaleConstant loc = handler.GetSessionDbcLocale(); @@ -735,7 +735,7 @@ namespace Game.Chat { string nameStr; string levelStr; - handler.extractOptFirstArg(args, out nameStr, out levelStr); + handler.ExtractOptFirstArg(args, out nameStr, out levelStr); // exception opt second arg: .character level $name if (!string.IsNullOrEmpty(levelStr) && !levelStr.IsNumber()) @@ -747,7 +747,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out targetName)) return false; int oldlevel = (int)(target ? target.GetLevel() : Global.CharacterCacheStorage.GetCharacterLevelByGuid(targetGuid)); @@ -765,7 +765,7 @@ namespace Game.Chat if (handler.GetSession() == null || handler.GetSession().GetPlayer() != target) // including chr == NULL { - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.YouChangeLvl, nameLink, newlevel); } @@ -780,7 +780,7 @@ namespace Game.Chat player.InitTalentForLevel(); player.SetXP(0); - if (handler.needReportToTarget(player)) + if (handler.NeedReportToTarget(player)) { if (oldLevel == newLevel) player.SendSysMessage(CypherStrings.YoursLevelProgressReset, handler.GetNameLink()); diff --git a/Source/Game/Chat/Commands/CheatCommands.cs b/Source/Game/Chat/Commands/CheatCommands.cs index d4cbcf8a7..cc51f0cc9 100644 --- a/Source/Game/Chat/Commands/CheatCommands.cs +++ b/Source/Game/Chat/Commands/CheatCommands.cs @@ -184,7 +184,7 @@ namespace Game.Chat.Commands { string argstr = args.NextString(); - Player chr = handler.getSelectedPlayer(); + Player chr = handler.GetSelectedPlayer(); if (!chr) chr = handler.GetSession().GetPlayer(); else if (handler.HasLowerSecurity(chr, ObjectGuid.Empty)) // check online security @@ -197,7 +197,7 @@ namespace Game.Chat.Commands { chr.SetTaxiCheater(false); handler.SendSysMessage(CypherStrings.YouRemoveTaxis, handler.GetNameLink(chr)); - if (handler.needReportToTarget(chr)) + if (handler.NeedReportToTarget(chr)) chr.SendSysMessage(CypherStrings.YoursTaxisRemoved, handler.GetNameLink()); return true; @@ -206,7 +206,7 @@ namespace Game.Chat.Commands { chr.SetTaxiCheater(true); handler.SendSysMessage(CypherStrings.YouGiveTaxis, handler.GetNameLink(chr)); - if (handler.needReportToTarget(chr)) + if (handler.NeedReportToTarget(chr)) chr.SendSysMessage(CypherStrings.YoursTaxisAdded, handler.GetNameLink()); return true; } @@ -222,7 +222,7 @@ namespace Game.Chat.Commands return false; int flag = args.NextInt32(); - Player chr = handler.getSelectedPlayer(); + Player chr = handler.GetSelectedPlayer(); if (!chr) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -232,13 +232,13 @@ namespace Game.Chat.Commands if (flag != 0) { handler.SendSysMessage(CypherStrings.YouSetExploreAll, handler.GetNameLink(chr)); - if (handler.needReportToTarget(chr)) + if (handler.NeedReportToTarget(chr)) chr.SendSysMessage(CypherStrings.YoursExploreSetAll, handler.GetNameLink()); } else { handler.SendSysMessage(CypherStrings.YouSetExploreNothing, handler.GetNameLink(chr)); - if (handler.needReportToTarget(chr)) + if (handler.NeedReportToTarget(chr)) chr.SendSysMessage(CypherStrings.YoursExploreSetNothing, handler.GetNameLink()); } diff --git a/Source/Game/Chat/Commands/DebugCommands.cs b/Source/Game/Chat/Commands/DebugCommands.cs index 15d101219..efcd86650 100644 --- a/Source/Game/Chat/Commands/DebugCommands.cs +++ b/Source/Game/Chat/Commands/DebugCommands.cs @@ -40,7 +40,7 @@ namespace Game.Chat return false; uint animId = args.NextUInt32(); - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (unit) unit.HandleEmoteCommand((Emote)animId); return true; @@ -84,7 +84,7 @@ namespace Game.Chat if (!player) return false; - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); if (!target || !target.IsAIEnabled || target.GetAI() == null) return false; @@ -115,7 +115,7 @@ namespace Game.Chat if (conversationEntry == 0) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -128,7 +128,7 @@ namespace Game.Chat [Command("entervehicle", RBACPermissions.CommandDebugEntervehicle)] static bool HandleDebugEnterVehicleCommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target || !target.IsVehicle()) return false; @@ -183,7 +183,7 @@ namespace Game.Chat else return false; - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) player = handler.GetSession().GetPlayer(); @@ -438,10 +438,10 @@ namespace Game.Chat [Command("hostil", RBACPermissions.CommandDebugHostil)] static bool HandleDebugHostileRefListCommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) target = handler.GetSession().GetPlayer(); - HostileReference refe = target.GetHostileRefManager().getFirst(); + HostileReference refe = target.GetHostileRefManager().GetFirst(); uint count = 0; handler.SendSysMessage("Hostil reference list of {0} (guid {1})", target.GetName(), target.GetGUID().ToString()); while (refe != null) @@ -450,9 +450,9 @@ namespace Game.Chat if (unit) { ++count; - handler.SendSysMessage(" {0}. {1} ({2}, SpawnId: {3}) - threat {4}", count, unit.GetName(), unit.GetGUID().ToString(), unit.IsTypeId(TypeId.Unit) ? unit.ToCreature().GetSpawnId() : 0, refe.getThreat()); + handler.SendSysMessage(" {0}. {1} ({2}, SpawnId: {3}) - threat {4}", count, unit.GetName(), unit.GetGUID().ToString(), unit.IsTypeId(TypeId.Unit) ? unit.ToCreature().GetSpawnId() : 0, refe.GetThreat()); } - refe = refe.next(); + refe = refe.Next(); } handler.SendSysMessage("End of hostil reference list."); return true; @@ -480,7 +480,7 @@ namespace Game.Chat [Command("lootrecipient", RBACPermissions.CommandDebugLootrecipient)] static bool HandleDebugGetLootRecipientCommand(StringArguments args, CommandHandler handler) { - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); if (!target) return false; @@ -492,7 +492,7 @@ namespace Game.Chat [Command("los", RBACPermissions.CommandDebugLos)] static bool HandleDebugLoSCommand(StringArguments args, CommandHandler handler) { - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (unit) handler.SendSysMessage("Unit {0} (GuidLow: {1}) is {2}in LoS", unit.GetName(), unit.GetGUID().ToString(), handler.GetSession().GetPlayer().IsWithinLOSInMap(unit) ? "" : "not "); return true; @@ -501,7 +501,7 @@ namespace Game.Chat [Command("moveflags", RBACPermissions.CommandDebugMoveflags)] static bool HandleDebugMoveflagsCommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) target = handler.GetSession().GetPlayer(); @@ -621,7 +621,7 @@ namespace Game.Chat [Command("phase", RBACPermissions.CommandDebugPhase)] static bool HandleDebugPhaseCommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -677,7 +677,7 @@ namespace Game.Chat return false; } - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (!unit) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -700,7 +700,7 @@ namespace Game.Chat [Command("setvid", RBACPermissions.CommandDebugSetvid)] static bool HandleDebugSetVehicleIdCommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target || target.IsVehicle()) return false; @@ -751,20 +751,20 @@ namespace Game.Chat [Command("threat", RBACPermissions.CommandDebugThreat)] static bool HandleDebugThreatListCommand(StringArguments args, CommandHandler handler) { - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); if (!target || target.IsTotem() || target.IsPet()) return false; - var threatList = target.GetThreatManager().getThreatList(); + var threatList = target.GetThreatManager().GetThreatList(); uint count = 0; handler.SendSysMessage("Threat list of {0} (guid {1})", target.GetName(), target.GetGUID().ToString()); foreach (var refe in threatList) { - Unit unit = refe.getTarget(); + Unit unit = refe.GetTarget(); if (!unit) continue; ++count; - handler.SendSysMessage(" {0}. {1} (guid {2}) - threat {3}", count, unit.GetName(), unit.GetGUID().ToString(), refe.getThreat()); + handler.SendSysMessage(" {0}. {1} (guid {2}) - threat {3}", count, unit.GetName(), unit.GetGUID().ToString(), refe.GetThreat()); } handler.SendSysMessage("End of threat list."); return true; @@ -832,7 +832,7 @@ namespace Game.Chat if (worldStateIdStr.IsEmpty()) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (target == null) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -844,11 +844,11 @@ namespace Game.Chat if (value != 0) { - Global.WorldMgr.setWorldState(worldStateId, value); + Global.WorldMgr.SetWorldState(worldStateId, value); target.SendUpdateWorldState(worldStateId, value); } else - handler.SendSysMessage($"Worldstate {worldStateId} actual value : {Global.WorldMgr.getWorldState(worldStateId)}"); + handler.SendSysMessage($"Worldstate {worldStateId} actual value : {Global.WorldMgr.GetWorldState(worldStateId)}"); return true; } @@ -866,7 +866,7 @@ namespace Game.Chat uint expressionId = uint.Parse(expressionIdStr); - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (target == null) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -1126,7 +1126,7 @@ namespace Game.Chat return false; } - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (!unit) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); diff --git a/Source/Game/Chat/Commands/DeserterCommands.cs b/Source/Game/Chat/Commands/DeserterCommands.cs index c744bcf08..a9823771f 100644 --- a/Source/Game/Chat/Commands/DeserterCommands.cs +++ b/Source/Game/Chat/Commands/DeserterCommands.cs @@ -68,7 +68,7 @@ namespace Game.Chat.Commands if (args.Empty()) return false; - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -94,7 +94,7 @@ namespace Game.Chat.Commands static bool HandleDeserterRemove(StringArguments args, CommandHandler handler, bool isInstance) { - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) { handler.SendSysMessage(CypherStrings.NoCharSelected); diff --git a/Source/Game/Chat/Commands/EventCommands.cs b/Source/Game/Chat/Commands/EventCommands.cs index a4a71e932..e17cba0b3 100644 --- a/Source/Game/Chat/Commands/EventCommands.cs +++ b/Source/Game/Chat/Commands/EventCommands.cs @@ -30,7 +30,7 @@ namespace Game.Chat return false; // id or [name] Shift-click form |color|Hgameevent:id|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameevent"); + string id = handler.ExtractKeyFromLink(args, "Hgameevent"); if (string.IsNullOrEmpty(id)) return false; @@ -45,7 +45,7 @@ namespace Game.Chat } GameEventData eventData = events[eventId]; - if (!eventData.isValid()) + if (!eventData.IsValid()) { handler.SendSysMessage(CypherStrings.EventNotExist); return false; @@ -105,7 +105,7 @@ namespace Game.Chat return false; // id or [name] Shift-click form |color|Hgameevent:id|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameevent"); + string id = handler.ExtractKeyFromLink(args, "Hgameevent"); if (string.IsNullOrEmpty(id)) return false; @@ -120,7 +120,7 @@ namespace Game.Chat } GameEventData eventData = events[eventId]; - if (!eventData.isValid()) + if (!eventData.IsValid()) { handler.SendSysMessage(CypherStrings.EventNotExist); return false; @@ -144,7 +144,7 @@ namespace Game.Chat return false; // id or [name] Shift-click form |color|Hgameevent:id|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameevent"); + string id = handler.ExtractKeyFromLink(args, "Hgameevent"); if (string.IsNullOrEmpty(id)) return false; @@ -159,7 +159,7 @@ namespace Game.Chat } GameEventData eventData = events[eventId]; - if (!eventData.isValid()) + if (!eventData.IsValid()) { handler.SendSysMessage(CypherStrings.EventNotExist); return false; diff --git a/Source/Game/Chat/Commands/GMCommands.cs b/Source/Game/Chat/Commands/GMCommands.cs index e63d195e0..2ad2ddb4c 100644 --- a/Source/Game/Chat/Commands/GMCommands.cs +++ b/Source/Game/Chat/Commands/GMCommands.cs @@ -98,7 +98,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (target == null) target = handler.GetPlayer(); diff --git a/Source/Game/Chat/Commands/GameObjectCommands.cs b/Source/Game/Chat/Commands/GameObjectCommands.cs index fdb316118..53c2b4401 100644 --- a/Source/Game/Chat/Commands/GameObjectCommands.cs +++ b/Source/Game/Chat/Commands/GameObjectCommands.cs @@ -37,7 +37,7 @@ namespace Game.Chat if (args.Empty()) return false; - string id = handler.extractKeyFromLink(args, "Hgameobject"); + string id = handler.ExtractKeyFromLink(args, "Hgameobject"); if (string.IsNullOrEmpty(id)) return false; @@ -63,7 +63,7 @@ namespace Game.Chat static bool HandleGameObjectDeleteCommand(StringArguments args, CommandHandler handler) { // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameobject"); + string id = handler.ExtractKeyFromLink(args, "Hgameobject"); if (string.IsNullOrEmpty(id)) return false; @@ -103,7 +103,7 @@ namespace Game.Chat static bool HandleGameObjectMoveCommand(StringArguments args, CommandHandler handler) { // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameobject"); + string id = handler.ExtractKeyFromLink(args, "Hgameobject"); if (string.IsNullOrEmpty(id)) return false; @@ -219,7 +219,7 @@ namespace Game.Chat if (!args.Empty()) { // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r - string idStr = handler.extractKeyFromLink(args, "Hgameobject_entry"); + string idStr = handler.ExtractKeyFromLink(args, "Hgameobject_entry"); if (string.IsNullOrEmpty(idStr)) return false; @@ -328,7 +328,7 @@ namespace Game.Chat static bool HandleGameObjectTurnCommand(StringArguments args, CommandHandler handler) { // number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameobject"); + string id = handler.ExtractKeyFromLink(args, "Hgameobject"); if (string.IsNullOrEmpty(id)) return false; @@ -401,13 +401,13 @@ namespace Game.Chat if (args.Empty()) return false; - string param1 = handler.extractKeyFromLink(args, "Hgameobject_entry"); + string param1 = handler.ExtractKeyFromLink(args, "Hgameobject_entry"); if (param1.IsEmpty()) return false; if (param1.Equals("guid")) { - string cValue = handler.extractKeyFromLink(args, "Hgameobject"); + string cValue = handler.ExtractKeyFromLink(args, "Hgameobject"); if (cValue.IsEmpty()) return false; @@ -462,7 +462,7 @@ namespace Game.Chat return false; // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r - string idStr = handler.extractKeyFromLink(args, "Hgameobject_entry"); + string idStr = handler.ExtractKeyFromLink(args, "Hgameobject_entry"); if (string.IsNullOrEmpty(idStr)) return false; @@ -591,7 +591,7 @@ namespace Game.Chat static bool HandleGameObjectSetStateCommand(StringArguments args, CommandHandler handler) { // number or [name] Shift-click form |color|Hgameobject:go_id|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameobject"); + string id = handler.ExtractKeyFromLink(args, "Hgameobject"); if (string.IsNullOrEmpty(id)) return false; diff --git a/Source/Game/Chat/Commands/GoCommands.cs b/Source/Game/Chat/Commands/GoCommands.cs index 81d3de16c..965c84b31 100644 --- a/Source/Game/Chat/Commands/GoCommands.cs +++ b/Source/Game/Chat/Commands/GoCommands.cs @@ -39,7 +39,7 @@ namespace Game.Chat.Commands Player player = handler.GetSession().GetPlayer(); // "id" or number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r - string param1 = handler.extractKeyFromLink(args, "Hcreature", "Hcreature_entry"); + string param1 = handler.ExtractKeyFromLink(args, "Hcreature", "Hcreature_entry"); if (string.IsNullOrEmpty(param1)) return false; @@ -195,7 +195,7 @@ namespace Game.Chat.Commands Player player = handler.GetSession().GetPlayer(); // number or [name] Shift-click form |color|Hgameobject:go_guid|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameobject"); + string id = handler.ExtractKeyFromLink(args, "Hgameobject"); if (string.IsNullOrEmpty(id)) return false; @@ -249,7 +249,7 @@ namespace Game.Chat.Commands Player player = handler.GetSession().GetPlayer(); - string id = handler.extractKeyFromLink(args, "Hquest"); + string id = handler.ExtractKeyFromLink(args, "Hquest"); if (string.IsNullOrEmpty(id)) return false; @@ -312,7 +312,7 @@ namespace Game.Chat.Commands if (args.Empty()) return false; - string id = handler.extractKeyFromLink(args, "Htaxinode"); + string id = handler.ExtractKeyFromLink(args, "Htaxinode"); if (string.IsNullOrEmpty(id)) return false; @@ -405,7 +405,7 @@ namespace Game.Chat.Commands if (x == 0.0f || y == 0.0f) return false; - string idStr = handler.extractKeyFromLink(args, "Harea"); // string or [name] Shift-click form |color|Harea:area_id|h[name]|h|r + string idStr = handler.ExtractKeyFromLink(args, "Harea"); // string or [name] Shift-click form |color|Harea:area_id|h[name]|h|r if (!uint.TryParse(idStr, out uint areaId)) areaId = player.GetZoneId(); diff --git a/Source/Game/Chat/Commands/GroupCommands.cs b/Source/Game/Chat/Commands/GroupCommands.cs index 575a33c74..b8ab8b1c7 100644 --- a/Source/Game/Chat/Commands/GroupCommands.cs +++ b/Source/Game/Chat/Commands/GroupCommands.cs @@ -36,7 +36,7 @@ namespace Game.Chat static bool HandleGroupSummonCommand(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; // check online security @@ -68,7 +68,7 @@ namespace Game.Chat return false; } - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); @@ -100,7 +100,7 @@ namespace Game.Chat } handler.SendSysMessage(CypherStrings.Summoning, plNameLink, ""); - if (handler.needReportToTarget(player)) + if (handler.NeedReportToTarget(player)) player.SendSysMessage(CypherStrings.SummonedBy, handler.GetNameLink()); // stop flight if need @@ -255,7 +255,7 @@ namespace Game.Chat guidTarget = parseGUID; } // If not, we return false and end right away. - else if (!handler.extractPlayerTarget(args, out playerTarget, out guidTarget, out nameTarget)) + else if (!handler.ExtractPlayerTarget(args, out playerTarget, out guidTarget, out nameTarget)) return false; // Next, we need a group. So we define a group variable. @@ -286,7 +286,7 @@ namespace Game.Chat var members = groupTarget.GetMemberSlots(); // To avoid a cluster fuck, namely trying multiple queries to simply get a group member count... - handler.SendSysMessage(CypherStrings.GroupType, (groupTarget.isRaidGroup() ? "raid" : "party"), members.Count); + handler.SendSysMessage(CypherStrings.GroupType, (groupTarget.IsRaidGroup() ? "raid" : "party"), members.Count); // ... we simply move the group type and member count print after retrieving the slots and simply output it's size. // While rather dirty codestyle-wise, it saves space (if only a little). For each member, we look several informations up. diff --git a/Source/Game/Chat/Commands/GuildCommands.cs b/Source/Game/Chat/Commands/GuildCommands.cs index 8b157ef63..fc2c5fca3 100644 --- a/Source/Game/Chat/Commands/GuildCommands.cs +++ b/Source/Game/Chat/Commands/GuildCommands.cs @@ -32,10 +32,10 @@ namespace Game.Chat return false; Player target; - if (!handler.extractPlayerTarget(args[0] != '"' ? args : null, out target)) + if (!handler.ExtractPlayerTarget(args[0] != '"' ? args : null, out target)) return false; - string guildname = handler.extractQuotedArg(args.NextString()); + string guildname = handler.ExtractQuotedArg(args.NextString()); if (string.IsNullOrEmpty(guildname)) return false; @@ -60,7 +60,7 @@ namespace Game.Chat [Command("delete", RBACPermissions.CommandGuildDelete, true)] static bool HandleGuildDeleteCommand(StringArguments args, CommandHandler handler) { - string guildName = handler.extractQuotedArg(args.NextString()); + string guildName = handler.ExtractQuotedArg(args.NextString()); if (string.IsNullOrEmpty(guildName)) return false; @@ -79,10 +79,10 @@ namespace Game.Chat return false; Player target; - if (!handler.extractPlayerTarget(args[0] != '"' ? args : null, out target)) + if (!handler.ExtractPlayerTarget(args[0] != '"' ? args : null, out target)) return false; - string guildName = handler.extractQuotedArg(args.NextString()); + string guildName = handler.ExtractQuotedArg(args.NextString()); if (string.IsNullOrEmpty(guildName)) return false; @@ -100,7 +100,7 @@ namespace Game.Chat { Player target; ObjectGuid targetGuid = ObjectGuid.Empty; - if (!handler.extractPlayerTarget(args, out target, out targetGuid)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid)) return false; ulong guildId = target != null ? target.GetGuildId() : Global.CharacterCacheStorage.GetCharacterGuildIdByGuid(targetGuid); @@ -120,14 +120,14 @@ namespace Game.Chat { string nameStr; string rankStr; - handler.extractOptFirstArg(args, out nameStr, out rankStr); + handler.ExtractOptFirstArg(args, out nameStr, out rankStr); if (string.IsNullOrEmpty(rankStr)) return false; Player target; ObjectGuid targetGuid; string target_name; - if (!handler.extractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out target_name)) + if (!handler.ExtractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out target_name)) return false; ulong guildId = target ? target.GetGuildId() : Global.CharacterCacheStorage.GetCharacterGuildIdByGuid(targetGuid); @@ -150,14 +150,14 @@ namespace Game.Chat if (args.Empty()) return false; - string oldGuildStr = handler.extractQuotedArg(args.NextString()); + string oldGuildStr = handler.ExtractQuotedArg(args.NextString()); if (string.IsNullOrEmpty(oldGuildStr)) { handler.SendSysMessage(CypherStrings.BadValue); return false; } - string newGuildStr = handler.extractQuotedArg(args.NextString()); + string newGuildStr = handler.ExtractQuotedArg(args.NextString()); if (string.IsNullOrEmpty(newGuildStr)) { handler.SendSysMessage(CypherStrings.InsertGuildName); @@ -191,7 +191,7 @@ namespace Game.Chat static bool HandleGuildInfoCommand(StringArguments args, CommandHandler handler) { Guild guild = null; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!args.Empty() && args[0] != '\0') { diff --git a/Source/Game/Chat/Commands/HonorCommands.cs b/Source/Game/Chat/Commands/HonorCommands.cs index 61d46874c..86d604b74 100644 --- a/Source/Game/Chat/Commands/HonorCommands.cs +++ b/Source/Game/Chat/Commands/HonorCommands.cs @@ -27,7 +27,7 @@ namespace Game.Chat.Commands [Command("update", RBACPermissions.CommandHonorUpdate)] static bool HandleHonorUpdateCommand(StringArguments args, CommandHandler handler) { - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -51,7 +51,7 @@ namespace Game.Chat.Commands if (args.Empty()) return false; - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -70,7 +70,7 @@ namespace Game.Chat.Commands [Command("kill", RBACPermissions.CommandHonorAddKill)] static bool HandleHonorAddKillCommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); diff --git a/Source/Game/Chat/Commands/InstanceCommands.cs b/Source/Game/Chat/Commands/InstanceCommands.cs index ff5418f18..7b841669a 100644 --- a/Source/Game/Chat/Commands/InstanceCommands.cs +++ b/Source/Game/Chat/Commands/InstanceCommands.cs @@ -29,7 +29,7 @@ namespace Game.Chat [Command("listbinds", RBACPermissions.CommandInstanceListbinds)] static bool HandleInstanceListBinds(StringArguments args, CommandHandler handler) { - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) player = handler.GetSession().GetPlayer(); @@ -76,7 +76,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) player = handler.GetSession().GetPlayer(); diff --git a/Source/Game/Chat/Commands/LFGCommands.cs b/Source/Game/Chat/Commands/LFGCommands.cs index 20dd3e79b..be3d67bb9 100644 --- a/Source/Game/Chat/Commands/LFGCommands.cs +++ b/Source/Game/Chat/Commands/LFGCommands.cs @@ -33,7 +33,7 @@ namespace Game.Chat Player target = null; string playerName; ObjectGuid guid; - if (!handler.extractPlayerTarget(args, out target, out guid, out playerName)) + if (!handler.ExtractPlayerTarget(args, out target, out guid, out playerName)) return false; GetPlayerInfo(handler, target); @@ -56,7 +56,7 @@ namespace Game.Chat playerTarget = Global.ObjAccessor.FindPlayer(parseGUID); guidTarget = parseGUID; } - else if (!handler.extractPlayerTarget(args, out playerTarget, out guidTarget, out nameTarget)) + else if (!handler.ExtractPlayerTarget(args, out playerTarget, out guidTarget, out nameTarget)) return false; Group groupTarget = null; @@ -78,7 +78,7 @@ namespace Game.Chat } ObjectGuid guid = groupTarget.GetGUID(); - handler.SendSysMessage(CypherStrings.LfgGroupInfo, groupTarget.isLFGGroup(), Global.LFGMgr.GetState(guid), Global.LFGMgr.GetDungeon(guid)); + handler.SendSysMessage(CypherStrings.LfgGroupInfo, groupTarget.IsLFGGroup(), Global.LFGMgr.GetState(guid), Global.LFGMgr.GetDungeon(guid)); foreach (var slot in groupTarget.GetMemberSlots()) { diff --git a/Source/Game/Chat/Commands/LearnCommands.cs b/Source/Game/Chat/Commands/LearnCommands.cs index 7de0833da..37e3cd460 100644 --- a/Source/Game/Chat/Commands/LearnCommands.cs +++ b/Source/Game/Chat/Commands/LearnCommands.cs @@ -31,7 +31,7 @@ namespace Game.Chat.Commands [Command("", RBACPermissions.CommandLearn)] static bool HandleLearnCommand(StringArguments args, CommandHandler handler) { - Player targetPlayer = handler.getSelectedPlayerOrSelf(); + Player targetPlayer = handler.GetSelectedPlayerOrSelf(); if (!targetPlayer) { @@ -40,7 +40,7 @@ namespace Game.Chat.Commands } // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spell = handler.extractSpellIdFromLink(args); + uint spell = handler.ExtractSpellIdFromLink(args); if (spell == 0 || !Global.SpellMgr.HasSpellInfo(spell)) return false; @@ -108,7 +108,7 @@ namespace Game.Chat.Commands static bool HandleLearnAllDefaultCommand(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; target.LearnDefaultSkills(); @@ -123,7 +123,7 @@ namespace Game.Chat.Commands static bool HandleLearnAllCraftsCommand(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; foreach (var skillInfo in CliDB.SkillLineStorage.Values) @@ -144,7 +144,7 @@ namespace Game.Chat.Commands // Learns all recipes of specified profession and sets skill to max // Example: .learn all_recipes enchanting - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -320,14 +320,14 @@ namespace Game.Chat.Commands return false; // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0) return false; string allStr = args.NextString(); bool allRanks = !string.IsNullOrEmpty(allStr) && allStr == "all"; - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); diff --git a/Source/Game/Chat/Commands/ListCommands.cs b/Source/Game/Chat/Commands/ListCommands.cs index 1120328ef..46deaa0eb 100644 --- a/Source/Game/Chat/Commands/ListCommands.cs +++ b/Source/Game/Chat/Commands/ListCommands.cs @@ -30,7 +30,7 @@ namespace Game.Chat.Commands [Command("auras", RBACPermissions.CommandListAuras)] static bool HandleListAurasCommand(StringArguments args, CommandHandler handler) { - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (!unit) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -81,7 +81,7 @@ namespace Game.Chat.Commands return false; // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hcreature_entry"); + string id = handler.ExtractKeyFromLink(args, "Hcreature_entry"); if (string.IsNullOrEmpty(id)) return false; @@ -148,7 +148,7 @@ namespace Game.Chat.Commands if (args.Empty()) return false; - string id = handler.extractKeyFromLink(args, "Hitem"); + string id = handler.ExtractKeyFromLink(args, "Hitem"); if (string.IsNullOrEmpty(id)) return false; @@ -350,7 +350,7 @@ namespace Game.Chat.Commands target = Global.ObjAccessor.FindPlayer(parseGUID); targetGuid = parseGUID; } - else if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + else if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_MAIL_LIST_COUNT); @@ -360,7 +360,7 @@ namespace Game.Chat.Commands { uint countMail = result.Read(0); - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.ListMailHeader, countMail, nameLink, targetGuid.ToString()); handler.SendSysMessage(CypherStrings.AccountListBar); @@ -385,8 +385,8 @@ namespace Game.Chat.Commands uint gold = (uint)(money / MoneyConstants.Gold); uint silv = (uint)(money % MoneyConstants.Gold) / MoneyConstants.Silver; uint copp = (uint)(money % MoneyConstants.Gold) % MoneyConstants.Silver; - string receiverStr = handler.playerLink(receiver); - string senderStr = handler.playerLink(sender); + string receiverStr = handler.PlayerLink(receiver); + string senderStr = handler.PlayerLink(sender); handler.SendSysMessage(CypherStrings.ListMailInfo1, messageId, subject, gold, silv, copp); handler.SendSysMessage(CypherStrings.ListMailInfo2, senderStr, senderId, receiverStr, receiverId); handler.SendSysMessage(CypherStrings.ListMailInfo3, Time.UnixTimeToDateTime(deliverTime).ToLongDateString(), Time.UnixTimeToDateTime(expireTime).ToLongDateString()); @@ -447,7 +447,7 @@ namespace Game.Chat.Commands return false; // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r - string id = handler.extractKeyFromLink(args, "Hgameobject_entry"); + string id = handler.ExtractKeyFromLink(args, "Hgameobject_entry"); if (string.IsNullOrEmpty(id)) return false; @@ -512,7 +512,7 @@ namespace Game.Chat.Commands [Command("scenes", RBACPermissions.CommandListScenes)] static bool HandleListScenesCommand(StringArguments args, CommandHandler handler) { - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) target = handler.GetSession().GetPlayer(); diff --git a/Source/Game/Chat/Commands/LookupCommands.cs b/Source/Game/Chat/Commands/LookupCommands.cs index 4298b6d93..d960cdebf 100644 --- a/Source/Game/Chat/Commands/LookupCommands.cs +++ b/Source/Game/Chat/Commands/LookupCommands.cs @@ -222,7 +222,7 @@ namespace Game.Chat return false; // Can be NULL at console call - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); string namePart = args.NextString().ToLower(); @@ -490,7 +490,7 @@ namespace Game.Chat return false; // can be NULL at console call - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); string namePart = args.NextString().ToLower(); @@ -620,7 +620,7 @@ namespace Game.Chat return false; // can be NULL in console call - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); string namePart = args.NextString(); @@ -786,7 +786,7 @@ namespace Game.Chat return false; // can be NULL in console call - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); // title name have single string arg for player name string targetName = target ? target.GetName() : "NAME"; @@ -943,7 +943,7 @@ namespace Game.Chat int limit; string limitStr; - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (args.Empty()) { // NULL only if used from console @@ -1058,7 +1058,7 @@ namespace Game.Chat return false; // can be NULL at console call - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); string namePart = args.NextString(); @@ -1157,7 +1157,7 @@ namespace Game.Chat return false; // can be NULL at console call - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); uint id = args.NextUInt32(); diff --git a/Source/Game/Chat/Commands/MMapsCommands.cs b/Source/Game/Chat/Commands/MMapsCommands.cs index 2080a68bd..ab4b25186 100644 --- a/Source/Game/Chat/Commands/MMapsCommands.cs +++ b/Source/Game/Chat/Commands/MMapsCommands.cs @@ -40,7 +40,7 @@ namespace Game.Chat // units Player player = handler.GetPlayer(); - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (player == null || target == null) { handler.SendSysMessage("Invalid target/source selection."); @@ -187,7 +187,7 @@ namespace Game.Chat uint terrainMapId = PhasingHandler.GetTerrainMapId(player.GetPhaseShift(), player.GetMap(), player.GetPositionX(), player.GetPositionY()); handler.SendSysMessage("mmap stats:"); handler.SendSysMessage(" global mmap pathfinding is {0}abled", Global.DisableMgr.IsPathfindingEnabled(player.GetMapId()) ? "En" : "Dis"); - handler.SendSysMessage(" {0} maps loaded with {1} tiles overall", Global.MMapMgr.getLoadedMapsCount(), Global.MMapMgr.getLoadedTilesCount()); + handler.SendSysMessage(" {0} maps loaded with {1} tiles overall", Global.MMapMgr.GetLoadedMapsCount(), Global.MMapMgr.GetLoadedTilesCount()); Detour.dtNavMesh navmesh = Global.MMapMgr.GetNavMesh(terrainMapId); if (navmesh == null) diff --git a/Source/Game/Chat/Commands/MiscCommands.cs b/Source/Game/Chat/Commands/MiscCommands.cs index 220112b72..e57d25903 100644 --- a/Source/Game/Chat/Commands/MiscCommands.cs +++ b/Source/Game/Chat/Commands/MiscCommands.cs @@ -85,7 +85,7 @@ namespace Game.Chat { Player target; ObjectGuid targetGuid; - if (!handler.extractPlayerTarget(args, out target, out targetGuid)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid)) return false; if (target != null) @@ -103,7 +103,7 @@ namespace Game.Chat [CommandNonGroup("die", RBACPermissions.CommandDie)] static bool Die(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target && handler.GetPlayer().GetTarget().IsEmpty()) { @@ -129,7 +129,7 @@ namespace Game.Chat if (!args.Empty()) { HighGuid guidHigh = 0; - ulong guidLow = handler.extractLowGuidFromLink(args, ref guidHigh); + ulong guidLow = handler.ExtractLowGuidFromLink(args, ref guidHigh); if (guidLow == 0) return false; switch (guidHigh) @@ -169,7 +169,7 @@ namespace Game.Chat } else { - obj = handler.getSelectedUnit(); + obj = handler.GetSelectedUnit(); if (!obj) { @@ -201,8 +201,8 @@ namespace Game.Chat GridCoord gridCoord = GridDefines.ComputeGridCoord(obj.GetPositionX(), obj.GetPositionY()); // 63? WHY? - uint gridX = (MapConst.MaxGrids - 1) - gridCoord.x_coord; - uint gridY = (MapConst.MaxGrids - 1) - gridCoord.y_coord; + uint gridX = (MapConst.MaxGrids - 1) - gridCoord.X_coord; + uint gridY = (MapConst.MaxGrids - 1) - gridCoord.Y_coord; bool haveMap = Map.ExistMap(mapId, gridX, gridY); bool haveVMap = Map.ExistVMap(mapId, gridX, gridY); @@ -237,7 +237,7 @@ namespace Game.Chat zoneX, zoneY, groundZ, floorZ, haveMap, haveVMap, haveMMap); LiquidData liquidStatus; - ZLiquidStatus status = map.getLiquidStatus(obj.GetPhaseShift(), obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ(), MapConst.MapAllLiquidTypes, out liquidStatus); + ZLiquidStatus status = map.GetLiquidStatus(obj.GetPhaseShift(), obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ(), MapConst.MapAllLiquidTypes, out liquidStatus); if (liquidStatus != null) handler.SendSysMessage(CypherStrings.LiquidStatus, liquidStatus.level, liquidStatus.depth_level, liquidStatus.entry, liquidStatus.type_flags, status); @@ -281,7 +281,7 @@ namespace Game.Chat } else // item_id or [name] Shift-click form |color|Hitem:item_id:0:0:0|h[name]|h|r { - string idStr = handler.extractKeyFromLink(args, "Hitem"); + string idStr = handler.ExtractKeyFromLink(args, "Hitem"); if (string.IsNullOrEmpty(idStr)) return false; @@ -309,7 +309,7 @@ namespace Game.Chat } Player player = handler.GetSession().GetPlayer(); - Player playerTarget = handler.getSelectedPlayer(); + Player playerTarget = handler.GetSelectedPlayer(); if (!playerTarget) playerTarget = player; @@ -377,7 +377,7 @@ namespace Game.Chat if (args.Empty()) return false; - string idStr = handler.extractKeyFromLink(args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r + string idStr = handler.ExtractKeyFromLink(args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r if (string.IsNullOrEmpty(idStr)) return false; @@ -403,7 +403,7 @@ namespace Game.Chat } Player player = handler.GetSession().GetPlayer(); - Player playerTarget = handler.getSelectedPlayer(); + Player playerTarget = handler.GetSelectedPlayer(); if (!playerTarget) playerTarget = player; @@ -485,7 +485,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; Player _player = handler.GetSession().GetPlayer(); @@ -501,7 +501,7 @@ namespace Game.Chat if (handler.HasLowerSecurity(target, ObjectGuid.Empty)) return false; - string chrNameLink = handler.playerLink(targetName); + string chrNameLink = handler.PlayerLink(targetName); Map map = target.GetMap(); if (map.IsBattlegroundOrArena()) @@ -598,7 +598,7 @@ namespace Game.Chat if (handler.HasLowerSecurity(null, targetGuid)) return false; - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.AppearingAt, nameLink); @@ -632,7 +632,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; Player _player = handler.GetSession().GetPlayer(); @@ -645,7 +645,7 @@ namespace Game.Chat if (target) { - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); // check online security if (handler.HasLowerSecurity(target, ObjectGuid.Empty)) return false; @@ -698,8 +698,8 @@ namespace Game.Chat } handler.SendSysMessage(CypherStrings.Summoning, nameLink, ""); - if (handler.needReportToTarget(target)) - target.SendSysMessage(CypherStrings.SummonedBy, handler.playerLink(_player.GetName())); + if (handler.NeedReportToTarget(target)) + target.SendSysMessage(CypherStrings.SummonedBy, handler.PlayerLink(_player.GetName())); // stop flight if need if (target.IsInFlight()) @@ -724,7 +724,7 @@ namespace Game.Chat if (handler.HasLowerSecurity(null, targetGuid)) return false; - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.Summoning, nameLink, handler.GetCypherString(CypherStrings.Offline)); @@ -814,7 +814,7 @@ namespace Game.Chat if (!args.Empty()) { HighGuid guidHigh = 0; - ulong guidLow = handler.extractLowGuidFromLink(args, ref guidHigh); + ulong guidLow = handler.ExtractLowGuidFromLink(args, ref guidHigh); if (guidLow == 0) return false; switch (guidHigh) @@ -854,7 +854,7 @@ namespace Game.Chat } else { - obj = handler.getSelectedUnit(); + obj = handler.GetSelectedUnit(); if (!obj) { @@ -872,7 +872,7 @@ namespace Game.Chat static bool Recall(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; // check online security @@ -905,7 +905,7 @@ namespace Game.Chat // save GM account without delay and output message if (handler.GetSession().HasPermission(RBACPermissions.CommandsSaveWithoutDelay)) { - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (target) target.SaveToDB(); else @@ -938,7 +938,7 @@ namespace Game.Chat Player target = null; string playerName; ObjectGuid guid; - if (!handler.extractPlayerTarget(args, out target, out guid, out playerName)) + if (!handler.ExtractPlayerTarget(args, out target, out guid, out playerName)) return false; if (handler.GetSession() != null && target == handler.GetSession().GetPlayer()) @@ -992,7 +992,7 @@ namespace Game.Chat Player player = null; ObjectGuid targetGUID; - if (!handler.extractPlayerTarget(args, out player, out targetGUID)) + if (!handler.ExtractPlayerTarget(args, out player, out targetGUID)) return false; if (!player) @@ -1161,7 +1161,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player playerTarget = handler.getSelectedPlayer(); + Player playerTarget = handler.GetSelectedPlayer(); if (!playerTarget) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -1201,7 +1201,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player playerTarget = handler.getSelectedPlayer(); + Player playerTarget = handler.GetSelectedPlayer(); if (!playerTarget) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -1297,7 +1297,7 @@ namespace Game.Chat targetGuid = parseGUID; } // if not, then return false. Which shouldn't happen, now should it ? - else if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + else if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; /* The variables we extract for the command. They are @@ -1473,7 +1473,7 @@ namespace Game.Chat } // Creates a chat link to the character. Returns nameLink - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); // Returns banType, banTime, bannedBy, banreason PreparedStatement stmt2 = DB.Login.GetPreparedStatement(LoginStatements.SEL_PINFO_BANS); @@ -1632,7 +1632,7 @@ namespace Game.Chat Player player = handler.GetSession().GetPlayer(); // accept only explicitly selected target (not implicitly self targeting case) - Creature target = !player.GetTarget().IsEmpty() ? handler.getSelectedCreature() : null; + Creature target = !player.GetTarget().IsEmpty() ? handler.GetSelectedCreature() : null; if (target) { if (target.IsPet()) @@ -1658,7 +1658,7 @@ namespace Game.Chat { string nameStr; string delayStr; - handler.extractOptFirstArg(args, out nameStr, out delayStr); + handler.ExtractOptFirstArg(args, out nameStr, out delayStr); if (string.IsNullOrEmpty(delayStr)) return false; @@ -1670,7 +1670,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(new StringArguments(nameStr), out target, out targetGuid, out targetName)) return false; uint accountId = target ? target.GetSession().GetAccountId() : Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(targetGuid); @@ -1703,7 +1703,7 @@ namespace Game.Chat long muteTime = Time.UnixTime + notSpeakTime * Time.Minute; target.GetSession().m_muteTime = muteTime; stmt.AddValue(0, muteTime); - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); if (WorldConfig.GetBoolValue(WorldCfg.ShowMuteInWorld)) { @@ -1726,7 +1726,7 @@ namespace Game.Chat stmt.AddValue(2, muteBy); stmt.AddValue(3, accountId); DB.Login.Execute(stmt); - string nameLink_ = handler.playerLink(targetName); + string nameLink_ = handler.PlayerLink(targetName); if (WorldConfig.GetBoolValue(WorldCfg.ShowMuteInWorld) && !target) Global.WorldMgr.SendWorldText(CypherStrings.CommandMutemessageWorld, handler.GetSession().GetPlayerName(), nameLink_, notSpeakTime, muteReasonStr); @@ -1742,7 +1742,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; uint accountId = target ? target.GetSession().GetAccountId() : Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(targetGuid); @@ -1780,7 +1780,7 @@ namespace Game.Chat if (target) target.SendSysMessage(CypherStrings.YourChatEnabled); - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.YouEnableChat, nameLink); @@ -1833,7 +1833,7 @@ namespace Game.Chat [CommandNonGroup("movegens", RBACPermissions.CommandMovegens)] static bool MoveGens(StringArguments args, CommandHandler handler) { - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (!unit) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -1877,9 +1877,9 @@ namespace Game.Chat { Unit target = null; if (unit.IsTypeId(TypeId.Player)) - target = ((ChaseMovementGenerator)movementGenerator).target; + target = ((ChaseMovementGenerator)movementGenerator).Target; else - target = ((ChaseMovementGenerator)movementGenerator).target; + target = ((ChaseMovementGenerator)movementGenerator).Target; if (!target) handler.SendSysMessage(CypherStrings.MovegensChaseNull); @@ -1893,9 +1893,9 @@ namespace Game.Chat { Unit target = null; if (unit.IsTypeId(TypeId.Player)) - target = ((FollowMovementGenerator)movementGenerator).target; + target = ((FollowMovementGenerator)movementGenerator).Target; else - target = ((FollowMovementGenerator)movementGenerator).target; + target = ((FollowMovementGenerator)movementGenerator).Target; if (!target) handler.SendSysMessage(CypherStrings.MovegensFollowNull); @@ -1941,7 +1941,7 @@ namespace Game.Chat [CommandNonGroup("cometome", RBACPermissions.CommandCometome)] static bool HandleComeToMeCommand(StringArguments args, CommandHandler handler) { - Creature caster = handler.getSelectedCreature(); + Creature caster = handler.GetSelectedCreature(); if (!caster) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -2000,7 +2000,7 @@ namespace Game.Chat return true; } - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target || handler.GetSession().GetPlayer().GetTarget().IsEmpty()) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -2066,7 +2066,7 @@ namespace Game.Chat // non-melee damage // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellid = handler.extractSpellIdFromLink(args); + uint spellid = handler.ExtractSpellIdFromLink(args); if (spellid == 0) return false; @@ -2099,7 +2099,7 @@ namespace Game.Chat if (!target) { - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; } @@ -2108,7 +2108,7 @@ namespace Game.Chat return false; target.CombatStop(); - target.GetHostileRefManager().deleteReferences(); + target.GetHostileRefManager().DeleteReferences(); return true; } @@ -2116,7 +2116,7 @@ namespace Game.Chat static bool RepairItems(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; // check online security @@ -2127,7 +2127,7 @@ namespace Game.Chat target.DurabilityRepairAll(false, 0, false); handler.SendSysMessage(CypherStrings.YouRepairItems, handler.GetNameLink(target)); - if (handler.needReportToTarget(target)) + if (handler.NeedReportToTarget(target)) target.SendSysMessage(CypherStrings.YourItemsRepaired, handler.GetNameLink()); return true; @@ -2136,7 +2136,7 @@ namespace Game.Chat [CommandNonGroup("freeze", RBACPermissions.CommandFreeze)] static bool HandleFreezeCommand(StringArguments args, CommandHandler handler) { - Player player = handler.getSelectedPlayer(); // Selected player, if any. Might be null. + Player player = handler.GetSelectedPlayer(); // Selected player, if any. Might be null. int freezeDuration = 0; // Freeze Duration (in seconds) bool canApplyFreeze = false; // Determines if every possible argument is set so Freeze can be applied bool getDurationFromConfig = false; // If there's no given duration, we'll retrieve the world cfg value later @@ -2240,7 +2240,7 @@ namespace Game.Chat } else // If no name was entered - use target { - player = handler.getSelectedPlayer(); + player = handler.GetSelectedPlayer(); if (player) name = player.GetName(); } @@ -2344,7 +2344,7 @@ namespace Game.Chat [CommandNonGroup("possess", RBACPermissions.CommandPossess)] static bool Possess(StringArguments args, CommandHandler handler) { - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (!unit) return false; @@ -2355,7 +2355,7 @@ namespace Game.Chat [CommandNonGroup("unpossess", RBACPermissions.CommandUnpossess)] static bool UnPossess(StringArguments args, CommandHandler handler) { - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (!unit) unit = handler.GetSession().GetPlayer(); @@ -2367,7 +2367,7 @@ namespace Game.Chat [CommandNonGroup("bindsight", RBACPermissions.CommandBindsight)] static bool BindSight(StringArguments args, CommandHandler handler) { - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (!unit) return false; @@ -2434,14 +2434,14 @@ namespace Game.Chat if (args.Empty()) return false; - string idStr = handler.extractKeyFromLink(args, "Hachievement"); + string idStr = handler.ExtractKeyFromLink(args, "Hachievement"); if (string.IsNullOrEmpty(idStr)) return false; if (!uint.TryParse(idStr, out uint achievementId) || achievementId == 0) return false; - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); diff --git a/Source/Game/Chat/Commands/ModifyCommands.cs b/Source/Game/Chat/Commands/ModifyCommands.cs index a0f51b631..ce5bb8dd6 100644 --- a/Source/Game/Chat/Commands/ModifyCommands.cs +++ b/Source/Game/Chat/Commands/ModifyCommands.cs @@ -32,7 +32,7 @@ namespace Game.Chat static bool HandleModifyHPCommand(StringArguments args, CommandHandler handler) { int hp, hpmax = 0; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (CheckModifyResources(args, handler, target, out hp, out hpmax)) { NotifyModification(handler, target, CypherStrings.YouChangeHp, CypherStrings.YoursHpChanged, hp, hpmax); @@ -47,7 +47,7 @@ namespace Game.Chat static bool HandleModifyManaCommand(StringArguments args, CommandHandler handler) { int mana, manamax; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (CheckModifyResources(args, handler, target, out mana, out manamax)) { @@ -64,7 +64,7 @@ namespace Game.Chat static bool HandleModifyEnergyCommand(StringArguments args, CommandHandler handler) { int energy, energymax; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); byte energyMultiplier = 10; if (CheckModifyResources(args, handler, target, out energy, out energymax, energyMultiplier)) { @@ -80,7 +80,7 @@ namespace Game.Chat static bool HandleModifyRageCommand(StringArguments args, CommandHandler handler) { int rage, ragemax; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); byte rageMultiplier = 10; if (CheckModifyResources(args, handler, target, out rage, out ragemax, rageMultiplier)) { @@ -96,7 +96,7 @@ namespace Game.Chat static bool HandleModifyRunicPowerCommand(StringArguments args, CommandHandler handler) { int rune, runemax; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); byte runeMultiplier = 10; if (CheckModifyResources(args, handler, target, out rune, out runemax, runeMultiplier)) { @@ -111,9 +111,9 @@ namespace Game.Chat [Command("faction", RBACPermissions.CommandModifyFaction)] static bool HandleModifyFactionCommand(StringArguments args, CommandHandler handler) { - string pfactionid = handler.extractKeyFromLink(args, "Hfaction"); + string pfactionid = handler.ExtractKeyFromLink(args, "Hfaction"); - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); if (!target) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -177,7 +177,7 @@ namespace Game.Chat if (!ushort.TryParse(args.NextString(), out ushort mark)) mark = 65535; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -189,7 +189,7 @@ namespace Game.Chat return false; handler.SendSysMessage(CypherStrings.YouChangeSpellflatid, spellflatid, val, mark, handler.GetNameLink(target)); - if (handler.needReportToTarget(target)) + if (handler.NeedReportToTarget(target)) target.SendSysMessage(CypherStrings.YoursSpellflatidChanged, handler.GetNameLink(), spellflatid, val, mark); SetSpellModifier packet = new SetSpellModifier(ServerOpcodes.SetFlatSpellModifier); @@ -212,7 +212,7 @@ namespace Game.Chat static bool HandleModifyScaleCommand(StringArguments args, CommandHandler handler) { float Scale; - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (CheckModifySpeed(args, handler, target, out Scale, 0.1f, 10.0f, false)) { NotifyModification(handler, target, CypherStrings.YouChangeSize, CypherStrings.YoursSizeChanged, Scale); @@ -241,7 +241,7 @@ namespace Game.Chat return false; } - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -266,7 +266,7 @@ namespace Game.Chat [Command("money", RBACPermissions.CommandModifyMoney)] static bool HandleModifyMoneyCommand(StringArguments args, CommandHandler handler) { - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -288,7 +288,7 @@ namespace Game.Chat if (newmoney <= 0) { handler.SendSysMessage(CypherStrings.YouTakeAllMoney, handler.GetNameLink(target)); - if (handler.needReportToTarget(target)) + if (handler.NeedReportToTarget(target)) target.SendSysMessage(CypherStrings.YoursAllMoneyGone, handler.GetNameLink()); target.SetMoney(0); @@ -300,7 +300,7 @@ namespace Game.Chat newmoney = (long)PlayerConst.MaxMoneyAmount; handler.SendSysMessage(CypherStrings.YouTakeMoney, moneyToAddMsg, handler.GetNameLink(target)); - if (handler.needReportToTarget(target)) + if (handler.NeedReportToTarget(target)) target.SendSysMessage(CypherStrings.YoursMoneyTaken, handler.GetNameLink(), moneyToAddMsg); target.SetMoney((ulong)newmoney); } @@ -308,7 +308,7 @@ namespace Game.Chat else { handler.SendSysMessage(CypherStrings.YouGiveMoney, moneyToAdd, handler.GetNameLink(target)); - if (handler.needReportToTarget(target)) + if (handler.NeedReportToTarget(target)) target.SendSysMessage(CypherStrings.YoursMoneyGiven, handler.GetNameLink(), moneyToAdd); if ((ulong)moneyToAdd >= PlayerConst.MaxMoneyAmount) @@ -329,7 +329,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -359,7 +359,7 @@ namespace Game.Chat if (drunklevel > 100) drunklevel = 100; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (target) target.SetDrunkValue(drunklevel); @@ -372,7 +372,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -383,7 +383,7 @@ namespace Game.Chat if (handler.HasLowerSecurity(target, ObjectGuid.Empty)) return false; - string factionTxt = handler.extractKeyFromLink(args, "Hfaction"); + string factionTxt = handler.ExtractKeyFromLink(args, "Hfaction"); if (string.IsNullOrEmpty(factionTxt)) return false; @@ -465,7 +465,7 @@ namespace Game.Chat return false; } - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (visibleMapId != 0) { @@ -499,7 +499,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -558,7 +558,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -601,7 +601,7 @@ namespace Game.Chat handler.SendSysMessage(CypherStrings.YouChangeGender, handler.GetNameLink(target), gender); - if (handler.needReportToTarget(target)) + if (handler.NeedReportToTarget(target)) target.SendSysMessage(CypherStrings.YourGenderChanged, gender, handler.GetNameLink()); return true; @@ -613,7 +613,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -642,7 +642,7 @@ namespace Game.Chat uint display_id = args.NextUInt32(); - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) target = handler.GetSession().GetPlayer(); @@ -658,7 +658,7 @@ namespace Game.Chat [CommandNonGroup("demorph", RBACPermissions.CommandDemorph)] static bool HandleDeMorphCommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) target = handler.GetSession().GetPlayer(); @@ -685,7 +685,7 @@ namespace Game.Chat return false; } - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -713,7 +713,7 @@ namespace Game.Chat static bool HandleModifyASpeedCommand(StringArguments args, CommandHandler handler) { float allSpeed; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (CheckModifySpeed(args, handler, target, out allSpeed, 0.1f, 50.0f)) { NotifyModification(handler, target, CypherStrings.YouChangeAspeed, CypherStrings.YoursAspeedChanged, allSpeed); @@ -730,7 +730,7 @@ namespace Game.Chat static bool HandleModifySwimCommand(StringArguments args, CommandHandler handler) { float swimSpeed; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (CheckModifySpeed(args, handler, target, out swimSpeed, 0.1f, 50.0f)) { NotifyModification(handler, target, CypherStrings.YouChangeSwimSpeed, CypherStrings.YoursSwimSpeedChanged, swimSpeed); @@ -744,7 +744,7 @@ namespace Game.Chat static bool HandleModifyBWalkCommand(StringArguments args, CommandHandler handler) { float backSpeed; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (CheckModifySpeed(args, handler, target, out backSpeed, 0.1f, 50.0f)) { NotifyModification(handler, target, CypherStrings.YouChangeBackSpeed, CypherStrings.YoursBackSpeedChanged, backSpeed); @@ -758,7 +758,7 @@ namespace Game.Chat static bool HandleModifyFlyCommand(StringArguments args, CommandHandler handler) { float flySpeed; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (CheckModifySpeed(args, handler, target, out flySpeed, 0.1f, 50.0f, false)) { NotifyModification(handler, target, CypherStrings.YouChangeFlySpeed, CypherStrings.YoursFlySpeedChanged, flySpeed); @@ -772,7 +772,7 @@ namespace Game.Chat static bool HandleModifyWalkSpeedCommand(StringArguments args, CommandHandler handler) { float Speed; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (CheckModifySpeed(args, handler, target, out Speed, 0.1f, 50.0f)) { NotifyModification(handler, target, CypherStrings.YouChangeSpeed, CypherStrings.YoursSpeedChanged, Speed); @@ -789,7 +789,7 @@ namespace Game.Chat if (player) { handler.SendSysMessage(resourceMessage, new object[] { handler.GetNameLink(player) }.Combine(args)); - if (handler.needReportToTarget(player)) + if (handler.NeedReportToTarget(player)) player.SendSysMessage(resourceReportMessage, new object[] { handler.GetNameLink() }.Combine(args)); } } diff --git a/Source/Game/Chat/Commands/NPCCommands.cs b/Source/Game/Chat/Commands/NPCCommands.cs index 71cdf1968..f74d04f62 100644 --- a/Source/Game/Chat/Commands/NPCCommands.cs +++ b/Source/Game/Chat/Commands/NPCCommands.cs @@ -35,7 +35,7 @@ namespace Game.Chat [Command("info", RBACPermissions.CommandNpcInfo)] static bool Info(StringArguments args, CommandHandler handler) { - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); if (!target) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -115,11 +115,11 @@ namespace Game.Chat { ulong lowguid = 0; - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { // number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r - string cId = handler.extractKeyFromLink(args, "Hcreature"); + string cId = handler.ExtractKeyFromLink(args, "Hcreature"); if (string.IsNullOrEmpty(cId)) return false; @@ -236,7 +236,7 @@ namespace Game.Chat { uint emote = args.NextUInt32(); - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); if (!target) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -254,7 +254,7 @@ namespace Game.Chat if (args.Empty()) return false; - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { @@ -273,7 +273,7 @@ namespace Game.Chat if (args.Empty()) return false; - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -314,7 +314,7 @@ namespace Game.Chat return false; } - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -341,7 +341,7 @@ namespace Game.Chat if (args.Empty()) return false; - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -359,7 +359,7 @@ namespace Game.Chat [Command("tame", RBACPermissions.CommandNpcTame)] static bool Tame(StringArguments args, CommandHandler handler) { - Creature creatureTarget = handler.getSelectedCreature(); + Creature creatureTarget = handler.GetSelectedCreature(); if (!creatureTarget || creatureTarget.IsPet()) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -422,7 +422,7 @@ namespace Game.Chat [Command("evade", RBACPermissions.CommandNpcEvade)] static bool HandleNpcEvadeCommand(StringArguments args, CommandHandler handler) { - Creature creatureTarget = handler.getSelectedCreature(); + Creature creatureTarget = handler.GetSelectedCreature(); if (!creatureTarget || creatureTarget.IsPet()) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -470,7 +470,7 @@ namespace Game.Chat static bool HandleNpcFollowCommand(StringArguments args, CommandHandler handler) { Player player = handler.GetSession().GetPlayer(); - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { @@ -489,7 +489,7 @@ namespace Game.Chat static bool HandleNpcUnFollowCommand(StringArguments args, CommandHandler handler) { Player player = handler.GetPlayer(); - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { @@ -504,9 +504,9 @@ namespace Game.Chat return false; } - FollowMovementGenerator mgen = (FollowMovementGenerator)creature.GetMotionMaster().top(); + FollowMovementGenerator mgen = (FollowMovementGenerator)creature.GetMotionMaster().Top(); - if (mgen.target != player) + if (mgen.Target != player) { handler.SendSysMessage(CypherStrings.CreatureNotFollowYou, creature.GetName()); return false; @@ -531,7 +531,7 @@ namespace Game.Chat if (!args.Empty()) { // number or [name] Shift-click form |color|Hcreature:creature_guid|h[name]|h|r - string cId = handler.extractKeyFromLink(args, "Hcreature"); + string cId = handler.ExtractKeyFromLink(args, "Hcreature"); if (string.IsNullOrEmpty(cId)) return false; @@ -541,7 +541,7 @@ namespace Game.Chat unit = handler.GetCreatureFromPlayerMapByDbGuid(guidLow); } else - unit = handler.getSelectedCreature(); + unit = handler.GetSelectedCreature(); if (!unit || unit.IsPet() || unit.IsTotem()) { @@ -565,14 +565,14 @@ namespace Game.Chat if (args.Empty()) return false; - Creature vendor = handler.getSelectedCreature(); + Creature vendor = handler.GetSelectedCreature(); if (!vendor || !vendor.IsVendor()) { handler.SendSysMessage(CypherStrings.CommandVendorselection); return false; } - string pitem = handler.extractKeyFromLink(args, "Hitem"); + string pitem = handler.ExtractKeyFromLink(args, "Hitem"); if (string.IsNullOrEmpty(pitem)) { handler.SendSysMessage(CypherStrings.CommandNeeditemsend); @@ -627,7 +627,7 @@ namespace Game.Chat if (newEntryNum == 0) return false; - Unit unit = handler.getSelectedUnit(); + Unit unit = handler.GetSelectedUnit(); if (!unit || !unit.IsTypeId(TypeId.Unit)) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -655,7 +655,7 @@ namespace Game.Chat return false; } - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature || creature.IsPet()) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -678,7 +678,7 @@ namespace Game.Chat ulong npcFlags = args.NextUInt64(); - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -712,7 +712,7 @@ namespace Game.Chat return false; } - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { @@ -753,7 +753,7 @@ namespace Game.Chat if (data_1 == 0 || data_2 == 0) return false; - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -774,7 +774,7 @@ namespace Game.Chat uint displayId = args.NextUInt32(); - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature || creature.IsPet()) { @@ -843,7 +843,7 @@ namespace Game.Chat if (string.IsNullOrEmpty(type)) // case .setmovetype $move_type (with selected creature) { type = guid_str; - creature = handler.getSelectedCreature(); + creature = handler.GetSelectedCreature(); if (!creature || creature.IsPet()) return false; lowguid = creature.GetSpawnId(); @@ -923,7 +923,7 @@ namespace Game.Chat return false; } - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature || creature.IsPet()) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -946,7 +946,7 @@ namespace Game.Chat int phaseGroupId = args.NextInt32(); - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature || creature.IsPet()) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -979,7 +979,7 @@ namespace Game.Chat if (option > 0.0f) mtype = MovementGeneratorType.Random; - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); ulong guidLow = 0; if (creature) @@ -1015,7 +1015,7 @@ namespace Game.Chat uint spawnTime = args.NextUInt32(); - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) return false; @@ -1040,7 +1040,7 @@ namespace Game.Chat ulong linkguid = args.NextUInt64(); - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -1073,7 +1073,7 @@ namespace Game.Chat if (args.Empty()) return false; - string charID = handler.extractKeyFromLink(args, "Hcreature_entry"); + string charID = handler.ExtractKeyFromLink(args, "Hcreature_entry"); if (string.IsNullOrEmpty(charID)) return false; @@ -1130,7 +1130,7 @@ namespace Game.Chat byte type = 1; // FIXME: make type (1 item, 2 currency) an argument - string pitem = handler.extractKeyFromLink(args, "Hitem"); + string pitem = handler.ExtractKeyFromLink(args, "Hitem"); if (string.IsNullOrEmpty(pitem)) { handler.SendSysMessage(CypherStrings.CommandNeeditemsend); @@ -1145,7 +1145,7 @@ namespace Game.Chat uint extendedcost = args.NextUInt32(); string fbonuslist = args.NextString(); - Creature vendor = handler.getSelectedCreature(); + Creature vendor = handler.GetSelectedCreature(); if (!vendor) { handler.SendSysMessage(CypherStrings.SelectCreature); @@ -1223,7 +1223,7 @@ namespace Game.Chat return false; uint leaderGUID = args.NextUInt32(); - Creature creature = handler.getSelectedCreature(); + Creature creature = handler.GetSelectedCreature(); if (!creature || creature.GetSpawnId() == 0) { @@ -1278,7 +1278,7 @@ namespace Game.Chat else if (spawntype_str.Equals("NOLOOT")) loot = false; - string charID = handler.extractKeyFromLink(args, "Hcreature_entry"); + string charID = handler.ExtractKeyFromLink(args, "Hcreature_entry"); if (string.IsNullOrEmpty(charID)) return false; diff --git a/Source/Game/Chat/Commands/PetCommands.cs b/Source/Game/Chat/Commands/PetCommands.cs index 073063402..961d7c2b7 100644 --- a/Source/Game/Chat/Commands/PetCommands.cs +++ b/Source/Game/Chat/Commands/PetCommands.cs @@ -29,7 +29,7 @@ namespace Game.Chat static bool HandlePetCreateCommand(StringArguments args, CommandHandler handler) { Player player = handler.GetSession().GetPlayer(); - Creature creatureTarget = handler.getSelectedCreature(); + Creature creatureTarget = handler.GetSelectedCreature(); if (!creatureTarget || creatureTarget.IsPet() || creatureTarget.IsTypeId(TypeId.Player)) { @@ -106,7 +106,7 @@ namespace Game.Chat return false; } - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0 || !Global.SpellMgr.HasSpellInfo(spellId)) return false; @@ -144,7 +144,7 @@ namespace Game.Chat return false; } - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (pet.HasSpell(spellId)) pet.RemoveSpell(spellId, false); @@ -186,7 +186,7 @@ namespace Game.Chat static Pet GetSelectedPlayerPetOrOwn(CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (target) { if (target.IsTypeId(TypeId.Player)) diff --git a/Source/Game/Chat/Commands/QuestCommands.cs b/Source/Game/Chat/Commands/QuestCommands.cs index 1103dcd04..543aa77e1 100644 --- a/Source/Game/Chat/Commands/QuestCommands.cs +++ b/Source/Game/Chat/Commands/QuestCommands.cs @@ -30,7 +30,7 @@ namespace Game.Chat [Command("add", RBACPermissions.CommandQuestAdd)] static bool Add(StringArguments args, CommandHandler handler) { - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -39,7 +39,7 @@ namespace Game.Chat // .addquest #entry' // number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r - string cId = handler.extractKeyFromLink(args, "Hquest"); + string cId = handler.ExtractKeyFromLink(args, "Hquest"); if (!uint.TryParse(cId, out uint entry)) return false; @@ -70,7 +70,7 @@ namespace Game.Chat [Command("complete", RBACPermissions.CommandQuestComplete)] static bool Complete(StringArguments args, CommandHandler handler) { - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -79,7 +79,7 @@ namespace Game.Chat // .quest complete #entry // number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r - string cId = handler.extractKeyFromLink(args, "Hquest"); + string cId = handler.ExtractKeyFromLink(args, "Hquest"); if (!uint.TryParse(cId, out uint entry)) return false; @@ -162,7 +162,7 @@ namespace Game.Chat [Command("remove", RBACPermissions.CommandQuestRemove)] static bool Remove(StringArguments args, CommandHandler handler) { - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -171,7 +171,7 @@ namespace Game.Chat // .removequest #entry' // number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r - string cId = handler.extractKeyFromLink(args, "Hquest"); + string cId = handler.ExtractKeyFromLink(args, "Hquest"); if (!uint.TryParse(cId, out uint entry)) return false; @@ -216,7 +216,7 @@ namespace Game.Chat [Command("reward", RBACPermissions.CommandQuestReward)] static bool Reward(StringArguments args, CommandHandler handler) { - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -225,7 +225,7 @@ namespace Game.Chat // .quest reward #entry // number or [name] Shift-click form |color|Hquest:quest_id:quest_level:min_level:max_level:scaling_faction|h[name]|h|r - string cId = handler.extractKeyFromLink(args, "Hquest"); + string cId = handler.ExtractKeyFromLink(args, "Hquest"); if (!uint.TryParse(cId, out uint entry)) return false; diff --git a/Source/Game/Chat/Commands/RbacCommands.cs b/Source/Game/Chat/Commands/RbacCommands.cs index b93e0e8eb..0cc9e14a5 100644 --- a/Source/Game/Chat/Commands/RbacCommands.cs +++ b/Source/Game/Chat/Commands/RbacCommands.cs @@ -269,7 +269,7 @@ namespace Game.Chat.Commands if (useSelectedPlayer) { - Player player = handler.getSelectedPlayer(); + Player player = handler.GetSelectedPlayer(); if (!player) return null; diff --git a/Source/Game/Chat/Commands/ResetCommands.cs b/Source/Game/Chat/Commands/ResetCommands.cs index 0efc18e9f..1e05533e8 100644 --- a/Source/Game/Chat/Commands/ResetCommands.cs +++ b/Source/Game/Chat/Commands/ResetCommands.cs @@ -33,7 +33,7 @@ namespace Game.Chat { Player target; ObjectGuid targetGuid; - if (!handler.extractPlayerTarget(args, out target, out targetGuid)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid)) return false; if (target) @@ -48,7 +48,7 @@ namespace Game.Chat static bool HandleResetHonorCommand(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; target.ResetHonorStats(); @@ -92,7 +92,7 @@ namespace Game.Chat static bool HandleResetLevelCommand(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; if (!HandleResetStatsOrLevelHelper(target)) @@ -129,7 +129,7 @@ namespace Game.Chat Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; if (target) @@ -157,7 +157,7 @@ namespace Game.Chat static bool HandleResetStatsCommand(StringArguments args, CommandHandler handler) { Player target; - if (!handler.extractPlayerTarget(args, out target)) + if (!handler.ExtractPlayerTarget(args, out target)) return false; if (!HandleResetStatsOrLevelHelper(target)) @@ -178,7 +178,7 @@ namespace Game.Chat ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) { /* TODO: 6.x remove/update pet talents // Try reset talents as Hunter Pet @@ -227,7 +227,7 @@ namespace Game.Chat stmt.AddValue(1, targetGuid.GetCounter()); DB.Characters.Execute(stmt); - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.ResetTalentsOffline, nameLink); return true; } diff --git a/Source/Game/Chat/Commands/SceneCommands.cs b/Source/Game/Chat/Commands/SceneCommands.cs index 127557de7..d8cf9391a 100644 --- a/Source/Game/Chat/Commands/SceneCommands.cs +++ b/Source/Game/Chat/Commands/SceneCommands.cs @@ -31,7 +31,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -67,7 +67,7 @@ namespace Game.Chat return false; uint sceneId = args.NextUInt32(); - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -91,7 +91,7 @@ namespace Game.Chat if (!uint.TryParse(args.NextString(""), out uint flags)) flags = (uint)SceneFlags.Unk16; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); diff --git a/Source/Game/Chat/Commands/SendCommands.cs b/Source/Game/Chat/Commands/SendCommands.cs index 739516858..4b363ddf2 100644 --- a/Source/Game/Chat/Commands/SendCommands.cs +++ b/Source/Game/Chat/Commands/SendCommands.cs @@ -34,14 +34,14 @@ namespace Game.Chat.Commands Player target; ObjectGuid targetGuid; string targetName; - if (!handler.extractPlayerTarget(args, out target, out targetGuid, out targetName)) + if (!handler.ExtractPlayerTarget(args, out target, out targetGuid, out targetName)) return false; string tail1 = args.NextString(""); if (string.IsNullOrEmpty(tail1)) return false; - string subject = handler.extractQuotedArg(tail1); + string subject = handler.ExtractQuotedArg(tail1); if (string.IsNullOrEmpty(subject)) return false; @@ -49,7 +49,7 @@ namespace Game.Chat.Commands if (string.IsNullOrEmpty(tail2)) return false; - string text = handler.extractQuotedArg(tail2); + string text = handler.ExtractQuotedArg(tail2); if (string.IsNullOrEmpty(text)) return false; @@ -63,7 +63,7 @@ namespace Game.Chat.Commands DB.Characters.CommitTransaction(trans); - string nameLink = handler.playerLink(targetName); + string nameLink = handler.PlayerLink(targetName); handler.SendSysMessage(CypherStrings.MailSent, nameLink); return true; } @@ -75,14 +75,14 @@ namespace Game.Chat.Commands Player receiver; ObjectGuid receiverGuid; string receiverName; - if (!handler.extractPlayerTarget(args, out receiver, out receiverGuid, out receiverName)) + if (!handler.ExtractPlayerTarget(args, out receiver, out receiverGuid, out receiverName)) return false; string tail1 = args.NextString(""); if (string.IsNullOrEmpty(tail1)) return false; - string subject = handler.extractQuotedArg(tail1); + string subject = handler.ExtractQuotedArg(tail1); if (string.IsNullOrEmpty(subject)) return false; @@ -90,7 +90,7 @@ namespace Game.Chat.Commands if (string.IsNullOrEmpty(tail2)) return false; - string text = handler.extractQuotedArg(tail2); + string text = handler.ExtractQuotedArg(tail2); if (string.IsNullOrEmpty(text)) return false; @@ -164,7 +164,7 @@ namespace Game.Chat.Commands draft.SendMailTo(trans, new MailReceiver(receiver, receiverGuid.GetCounter()), sender); DB.Characters.CommitTransaction(trans); - string nameLink = handler.playerLink(receiverName); + string nameLink = handler.PlayerLink(receiverName); handler.SendSysMessage(CypherStrings.MailSent, nameLink); return true; } @@ -177,14 +177,14 @@ namespace Game.Chat.Commands Player receiver; ObjectGuid receiverGuid; string receiverName; - if (!handler.extractPlayerTarget(args, out receiver, out receiverGuid, out receiverName)) + if (!handler.ExtractPlayerTarget(args, out receiver, out receiverGuid, out receiverName)) return false; string tail1 = args.NextString(""); if (string.IsNullOrEmpty(tail1)) return false; - string subject = handler.extractQuotedArg(tail1); + string subject = handler.ExtractQuotedArg(tail1); if (string.IsNullOrEmpty(subject)) return false; @@ -192,7 +192,7 @@ namespace Game.Chat.Commands if (string.IsNullOrEmpty(tail2)) return false; - string text = handler.extractQuotedArg(tail2); + string text = handler.ExtractQuotedArg(tail2); if (string.IsNullOrEmpty(text)) return false; @@ -213,7 +213,7 @@ namespace Game.Chat.Commands DB.Characters.CommitTransaction(trans); - string nameLink = handler.playerLink(receiverName); + string nameLink = handler.PlayerLink(receiverName); handler.SendSysMessage(CypherStrings.MailSent, nameLink); return true; } @@ -223,7 +223,7 @@ namespace Game.Chat.Commands { // - Find the player Player player; - if (!handler.extractPlayerTarget(args, out player)) + if (!handler.ExtractPlayerTarget(args, out player)) return false; string msgStr = args.NextString(""); @@ -231,7 +231,7 @@ namespace Game.Chat.Commands return false; // Check that he is not logging out. - if (player.GetSession().isLogingOut()) + if (player.GetSession().IsLogingOut()) { handler.SendSysMessage(CypherStrings.PlayerNotFound); return false; diff --git a/Source/Game/Chat/Commands/SpellCommands.cs b/Source/Game/Chat/Commands/SpellCommands.cs index 364cb3e35..8f59373d5 100644 --- a/Source/Game/Chat/Commands/SpellCommands.cs +++ b/Source/Game/Chat/Commands/SpellCommands.cs @@ -29,7 +29,7 @@ namespace Game.Chat [CommandNonGroup("cooldown", RBACPermissions.CommandCooldown)] static bool HandleCooldownCommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) { handler.SendSysMessage(CypherStrings.PlayerNotFound); @@ -53,7 +53,7 @@ namespace Game.Chat else { // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellIid = handler.extractSpellIdFromLink(args); + uint spellIid = handler.ExtractSpellIdFromLink(args); if (spellIid == 0) return false; @@ -74,7 +74,7 @@ namespace Game.Chat [CommandNonGroup("aura", RBACPermissions.CommandAura)] static bool Auracommand(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -83,7 +83,7 @@ namespace Game.Chat } // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId); if (spellInfo != null) @@ -98,7 +98,7 @@ namespace Game.Chat [CommandNonGroup("unaura", RBACPermissions.CommandUnaura)] static bool UnAura(StringArguments args, CommandHandler handler) { - Unit target = handler.getSelectedUnit(); + Unit target = handler.GetSelectedUnit(); if (!target) { handler.SendSysMessage(CypherStrings.SelectCharOrCreature); @@ -114,7 +114,7 @@ namespace Game.Chat } // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form - uint spellId = handler.extractSpellIdFromLink(args); + uint spellId = handler.ExtractSpellIdFromLink(args); if (spellId == 0) return false; @@ -126,7 +126,7 @@ namespace Game.Chat [CommandNonGroup("maxskill", RBACPermissions.CommandMaxskill)] static bool HandleMaxSkillCommand(StringArguments args, CommandHandler handler) { - Player player = handler.getSelectedPlayerOrSelf(); + Player player = handler.GetSelectedPlayerOrSelf(); if (!player) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -142,7 +142,7 @@ namespace Game.Chat static bool SetSkill(StringArguments args, CommandHandler handler) { // number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r - string skillStr = handler.extractKeyFromLink(args, "Hskill"); + string skillStr = handler.ExtractKeyFromLink(args, "Hskill"); if (string.IsNullOrEmpty(skillStr)) return false; @@ -156,7 +156,7 @@ namespace Game.Chat if (level == 0) return false; - Player target = handler.getSelectedPlayerOrSelf(); + Player target = handler.GetSelectedPlayerOrSelf(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); diff --git a/Source/Game/Chat/Commands/TeleCommands.cs b/Source/Game/Chat/Commands/TeleCommands.cs index 70e66018f..ca92a73d7 100644 --- a/Source/Game/Chat/Commands/TeleCommands.cs +++ b/Source/Game/Chat/Commands/TeleCommands.cs @@ -35,7 +35,7 @@ namespace Game.Chat Player me = handler.GetPlayer(); - GameTele tele = handler.extractGameTeleFromLink(args); + GameTele tele = handler.ExtractGameTeleFromLink(args); if (tele == null) { @@ -88,7 +88,7 @@ namespace Game.Chat if (args.Empty()) return false; - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -100,7 +100,7 @@ namespace Game.Chat return false; // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r - GameTele tele = handler.extractGameTeleFromLink(args); + GameTele tele = handler.ExtractGameTeleFromLink(args); if (tele == null) { handler.SendSysMessage(CypherStrings.CommandTeleNotfound); @@ -123,7 +123,7 @@ namespace Game.Chat return false; } - for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (!player || !player.GetSession()) @@ -142,7 +142,7 @@ namespace Game.Chat } handler.SendSysMessage(CypherStrings.TeleportingTo, plNameLink, "", tele.name); - if (handler.needReportToTarget(player)) + if (handler.NeedReportToTarget(player)) player.SendSysMessage(CypherStrings.TeleportedToBy, nameLink); // stop flight if need diff --git a/Source/Game/Chat/Commands/TitleCommands.cs b/Source/Game/Chat/Commands/TitleCommands.cs index d8f874540..665095b8f 100644 --- a/Source/Game/Chat/Commands/TitleCommands.cs +++ b/Source/Game/Chat/Commands/TitleCommands.cs @@ -31,7 +31,7 @@ namespace Game.Chat.Commands static bool HandleTitlesCurrentCommand(StringArguments args, CommandHandler handler) { // number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r - string id_p = handler.extractKeyFromLink(args, "Htitle"); + string id_p = handler.ExtractKeyFromLink(args, "Htitle"); if (string.IsNullOrEmpty(id_p)) return false; @@ -41,7 +41,7 @@ namespace Game.Chat.Commands return false; } - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -72,7 +72,7 @@ namespace Game.Chat.Commands static bool HandleTitlesAddCommand(StringArguments args, CommandHandler handler) { // number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r - string id_p = handler.extractKeyFromLink(args, "Htitle"); + string id_p = handler.ExtractKeyFromLink(args, "Htitle"); if (string.IsNullOrEmpty(id_p)) return false; @@ -82,7 +82,7 @@ namespace Game.Chat.Commands return false; } - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -114,7 +114,7 @@ namespace Game.Chat.Commands static bool HandleTitlesRemoveCommand(StringArguments args, CommandHandler handler) { // number or [name] Shift-click form |color|Htitle:title_id|h[name]|h|r - string id_p = handler.extractKeyFromLink(args, "Htitle"); + string id_p = handler.ExtractKeyFromLink(args, "Htitle"); if (string.IsNullOrEmpty(id_p)) return false; @@ -124,7 +124,7 @@ namespace Game.Chat.Commands return false; } - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); @@ -171,7 +171,7 @@ namespace Game.Chat.Commands ulong titles = args.NextUInt64(); - Player target = handler.getSelectedPlayer(); + Player target = handler.GetSelectedPlayer(); if (!target) { handler.SendSysMessage(CypherStrings.NoCharSelected); diff --git a/Source/Game/Chat/Commands/WPCommands.cs b/Source/Game/Chat/Commands/WPCommands.cs index 415772bbc..1f8349fd6 100644 --- a/Source/Game/Chat/Commands/WPCommands.cs +++ b/Source/Game/Chat/Commands/WPCommands.cs @@ -39,7 +39,7 @@ namespace Game.Chat.Commands path_number = args.NextString(); uint point = 0; - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); PreparedStatement stmt; @@ -365,7 +365,7 @@ namespace Game.Chat.Commands string path_number = args.NextString(); uint pathid; - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); // Did player provide a path_id? if (string.IsNullOrEmpty(path_number)) @@ -450,7 +450,7 @@ namespace Game.Chat.Commands // . variable lowguid is filled with the GUID of the NPC uint pathid; uint point; - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); // User did select a visual waypoint? if (!target || target.GetEntry() != 1) @@ -625,7 +625,7 @@ namespace Game.Chat.Commands string guid_str = args.NextString(); uint pathid = 0; - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); // Did player provide a PathID? @@ -973,7 +973,7 @@ namespace Game.Chat.Commands [Command("unload", RBACPermissions.CommandWpUnload)] static bool HandleWpUnLoadCommand(StringArguments args, CommandHandler handler) { - Creature target = handler.getSelectedCreature(); + Creature target = handler.GetSelectedCreature(); if (!target) { handler.SendSysMessage("|cff33ffffYou must select a target.|r"); diff --git a/Source/Game/Collision/BoundingIntervalHierarchy.cs b/Source/Game/Collision/BoundingIntervalHierarchy.cs index 413f10fc1..661d8de26 100644 --- a/Source/Game/Collision/BoundingIntervalHierarchy.cs +++ b/Source/Game/Collision/BoundingIntervalHierarchy.cs @@ -27,10 +27,10 @@ namespace Game.Collision { public BIH() { - init_empty(); + InitEmpty(); } - void init_empty() + void InitEmpty() { tree= new uint[3]; objects = new uint[0]; @@ -38,7 +38,7 @@ namespace Game.Collision tree[0] = (3u << 30); // dummy leaf } - void buildHierarchy(List tempTree, buildData dat, BuildStats stats) + void BuildHierarchy(List tempTree, buildData dat, BuildStats stats) { // create space for the first node tempTree.Add(3u << 30); // dummy leaf @@ -51,16 +51,16 @@ namespace Game.Collision gridBox.hi = bounds.Hi; AABound nodeBox = gridBox; // seed subdivide function - subdivide(0, (int)(dat.numPrims - 1), tempTree, dat, gridBox, nodeBox, 0, 1, stats); + Subdivide(0, (int)(dat.numPrims - 1), tempTree, dat, gridBox, nodeBox, 0, 1, stats); } - void subdivide(int left, int right, List tempTree, buildData dat, AABound gridBox, AABound nodeBox, int nodeIndex, int depth, BuildStats stats) + void Subdivide(int left, int right, List tempTree, buildData dat, AABound gridBox, AABound nodeBox, int nodeIndex, int depth, BuildStats stats) { if ((right - left + 1) <= dat.maxPrims || depth >= 64) { // write leaf node - stats.updateLeaf(depth, right - left + 1); - createNode(tempTree, nodeIndex, left, right); + stats.UpdateLeaf(depth, right - left + 1); + CreateNode(tempTree, nodeIndex, left, right); return; } // calculate extents @@ -122,21 +122,21 @@ namespace Game.Collision // node box is too big compare to space occupied by primitives? if (1.3f * nodeNewW < nodeBoxW) { - stats.updateBVH2(); + stats.UpdateBVH2(); int nextIndex1 = tempTree.Count; // allocate child tempTree.Add(0); tempTree.Add(0); tempTree.Add(0); // write bvh2 clip node - stats.updateInner(); + stats.UpdateInner(); tempTree[nodeIndex + 0] = (uint)((axis << 30) | (1 << 29) | nextIndex1); - tempTree[nodeIndex + 1] = floatToRawIntBits(nodeL); - tempTree[nodeIndex + 2] = floatToRawIntBits(nodeR); + tempTree[nodeIndex + 1] = FloatToRawIntBits(nodeL); + tempTree[nodeIndex + 2] = FloatToRawIntBits(nodeR); // update nodebox and recurse nodeBox.lo[axis] = nodeL; nodeBox.hi[axis] = nodeR; - subdivide(left, rightOrig, tempTree, dat, gridBox, nodeBox, nextIndex1, depth + 1, stats); + Subdivide(left, rightOrig, tempTree, dat, gridBox, nodeBox, nextIndex1, depth + 1, stats); return; } } @@ -147,8 +147,8 @@ namespace Game.Collision if (prevAxis == axis && MathFunctions.fuzzyEq(prevSplit, split)) { // we are stuck here - create a leaf - stats.updateLeaf(depth, right - left + 1); - createNode(tempTree, nodeIndex, left, right); + stats.UpdateLeaf(depth, right - left + 1); + CreateNode(tempTree, nodeIndex, left, right); return; } if (clipL <= split) @@ -169,8 +169,8 @@ namespace Game.Collision if (prevAxis == axis && MathFunctions.fuzzyEq(prevSplit, split)) { // we are stuck here - create a leaf - stats.updateLeaf(depth, right - left + 1); - createNode(tempTree, nodeIndex, left, right); + stats.UpdateLeaf(depth, right - left + 1); + CreateNode(tempTree, nodeIndex, left, right); return; } @@ -201,23 +201,23 @@ namespace Game.Collision { // create a node with a left child // write leaf node - stats.updateInner(); + stats.UpdateInner(); tempTree[nodeIndex + 0] = (uint)((prevAxis << 30) | nextIndex0); - tempTree[nodeIndex + 1] = floatToRawIntBits(prevClip); - tempTree[nodeIndex + 2] = floatToRawIntBits(float.PositiveInfinity); + tempTree[nodeIndex + 1] = FloatToRawIntBits(prevClip); + tempTree[nodeIndex + 2] = FloatToRawIntBits(float.PositiveInfinity); } else { // create a node with a right child // write leaf node - stats.updateInner(); + stats.UpdateInner(); tempTree[nodeIndex + 0] = (uint)((prevAxis << 30) | (nextIndex0 - 3)); - tempTree[nodeIndex + 1] = floatToRawIntBits(float.NegativeInfinity); - tempTree[nodeIndex + 2] = floatToRawIntBits(prevClip); + tempTree[nodeIndex + 1] = FloatToRawIntBits(float.NegativeInfinity); + tempTree[nodeIndex + 2] = FloatToRawIntBits(prevClip); } // count stats for the unused leaf depth++; - stats.updateLeaf(depth, 0); + stats.UpdateLeaf(depth, 0); // now we keep going as we are, with a new nodeIndex: nodeIndex = nextIndex0; } @@ -245,10 +245,10 @@ namespace Game.Collision tempTree.Add(0); } // write leaf node - stats.updateInner(); + stats.UpdateInner(); tempTree[nodeIndex + 0] = (uint)((axis << 30) | nextIndex); - tempTree[nodeIndex + 1] = floatToRawIntBits(clipL); - tempTree[nodeIndex + 2] = floatToRawIntBits(clipR); + tempTree[nodeIndex + 1] = FloatToRawIntBits(clipL); + tempTree[nodeIndex + 2] = FloatToRawIntBits(clipR); // prepare L/R child boxes AABound gridBoxL = gridBox; AABound gridBoxR = gridBox; @@ -259,16 +259,16 @@ namespace Game.Collision nodeBoxR.lo[axis] = clipR; // recurse if (nl > 0) - subdivide(left, right, tempTree, dat, gridBoxL, nodeBoxL, nextIndex, depth + 1, stats); + Subdivide(left, right, tempTree, dat, gridBoxL, nodeBoxL, nextIndex, depth + 1, stats); else - stats.updateLeaf(depth + 1, 0); + stats.UpdateLeaf(depth + 1, 0); if (nr > 0) - subdivide(right + 1, rightOrig, tempTree, dat, gridBoxR, nodeBoxR, nextIndex + 3, depth + 1, stats); + Subdivide(right + 1, rightOrig, tempTree, dat, gridBoxR, nodeBoxR, nextIndex + 3, depth + 1, stats); else - stats.updateLeaf(depth + 1, 0); + stats.UpdateLeaf(depth + 1, 0); } - public bool readFromFile(BinaryReader reader) + public bool ReadFromFile(BinaryReader reader) { var lo = reader.Read(); var hi = reader.Read(); @@ -283,11 +283,11 @@ namespace Game.Collision return true; } - public void build(List primitives, uint leafSize = 3, bool printStats = false) where T : IModel + public void Build(List primitives, uint leafSize = 3, bool printStats = false) where T : IModel { if (primitives.Count == 0) { - init_empty(); + InitEmpty(); return; } @@ -296,16 +296,16 @@ namespace Game.Collision dat.numPrims = (uint)primitives.Count; dat.indices = new uint[dat.numPrims]; dat.primBound = new AxisAlignedBox[dat.numPrims]; - bounds = primitives[0].getBounds(); + bounds = primitives[0].GetBounds(); for (int i = 0; i < dat.numPrims; ++i) { dat.indices[i] = (uint)i; - dat.primBound[i] = primitives[i].getBounds(); + dat.primBound[i] = primitives[i].GetBounds(); bounds.merge(dat.primBound[i]); } List tempTree = new List(); BuildStats stats = new BuildStats(); - buildHierarchy(tempTree, dat, stats); + BuildHierarchy(tempTree, dat, stats); objects = new uint[dat.numPrims]; for (int i = 0; i < dat.numPrims; ++i) @@ -314,9 +314,9 @@ namespace Game.Collision tree = tempTree.ToArray(); } - public uint primCount() { return (uint)objects.Length; } + public uint PrimCount() { return (uint)objects.Length; } - public void intersectRay(Ray r, WorkerCallback intersectCallback, ref float maxDist, bool stopAtFirst = false) + public void IntersectRay(Ray r, WorkerCallback intersectCallback, ref float maxDist, bool stopAtFirst = false) { float intervalMin = -1.0f; float intervalMax = -1.0f; @@ -356,7 +356,7 @@ namespace Game.Collision for (int i = 0; i < 3; ++i) { - offsetFront[i] = floatToRawIntBits(dir[i]) >> 31; + offsetFront[i] = FloatToRawIntBits(dir[i]) >> 31; offsetBack[i] = offsetFront[i] ^ 1; offsetFront3[i] = offsetFront[i] * 3; offsetBack3[i] = offsetBack[i] * 3; @@ -383,8 +383,8 @@ namespace Game.Collision if (axis < 3) { // "normal" interior node - float tf = (intBitsToFloat(tree[(int)(node + offsetFront[axis])]) - org[axis]) * invDir[axis]; - float tb = (intBitsToFloat(tree[(int)(node + offsetBack[axis])]) - org[axis]) * invDir[axis]; + float tf = (IntBitsToFloat(tree[(int)(node + offsetFront[axis])]) - org[axis]) * invDir[axis]; + float tb = (IntBitsToFloat(tree[(int)(node + offsetBack[axis])]) - org[axis]) * invDir[axis]; // ray passes between clip zones if (tf < intervalMin && tb > intervalMax) break; @@ -432,8 +432,8 @@ namespace Game.Collision { if (axis > 2) return; // should not happen - float tf = (intBitsToFloat(tree[(int)(node + offsetFront[axis])]) - org[axis]) * invDir[axis]; - float tb = (intBitsToFloat(tree[(int)(node + offsetBack[axis])]) - org[axis]) * invDir[axis]; + float tf = (IntBitsToFloat(tree[(int)(node + offsetFront[axis])]) - org[axis]) * invDir[axis]; + float tb = (IntBitsToFloat(tree[(int)(node + offsetBack[axis])]) - org[axis]) * invDir[axis]; node = offset; intervalMin = (tf >= intervalMin) ? tf : intervalMin; intervalMax = (tb <= intervalMax) ? tb : intervalMax; @@ -459,7 +459,7 @@ namespace Game.Collision } } - public void intersectPoint(Vector3 p, WorkerCallback intersectCallback) + public void IntersectPoint(Vector3 p, WorkerCallback intersectCallback) { if (!bounds.contains(p)) return; @@ -481,8 +481,8 @@ namespace Game.Collision if (axis < 3) { // "normal" interior node - float tl = intBitsToFloat(tree[node + 1]); - float tr = intBitsToFloat(tree[node + 2]); + float tl = IntBitsToFloat(tree[node + 1]); + float tr = IntBitsToFloat(tree[node + 2]); // point is between clip zones if (tl < p[(int)axis] && tr > p[axis]) break; @@ -522,8 +522,8 @@ namespace Game.Collision { if (axis > 2) return; // should not happen - float tl = intBitsToFloat(tree[node + 1]); - float tr = intBitsToFloat(tree[node + 2]); + float tl = IntBitsToFloat(tree[node + 1]); + float tr = IntBitsToFloat(tree[node + 2]); node = offset; if (tl > p[axis] || tr < p[axis]) break; @@ -540,7 +540,7 @@ namespace Game.Collision } } - void createNode(List tempTree, int nodeIndex, int left, int right) + void CreateNode(List tempTree, int nodeIndex, int left, int right) { // write leaf node tempTree[nodeIndex + 0] = (uint)((3 << 30) | left); @@ -589,9 +589,9 @@ namespace Game.Collision numLeavesN[i] = 0; } - public void updateInner() { numNodes++; } - public void updateBVH2() { numBVH2++; } - public void updateLeaf(int depth, int n) + public void UpdateInner() { numNodes++; } + public void UpdateBVH2() { numBVH2++; } + public void UpdateLeaf(int depth, int n) { numLeaves++; minDepth = Math.Min(depth, minDepth); @@ -619,13 +619,13 @@ namespace Game.Collision public float FloatValue; } - uint floatToRawIntBits(float f) + uint FloatToRawIntBits(float f) { FloatToIntConverter converter = new FloatToIntConverter(); converter.FloatValue = f; return converter.IntValue; } - float intBitsToFloat(uint i) + float IntBitsToFloat(uint i) { FloatToIntConverter converter = new FloatToIntConverter(); converter.IntValue = i; diff --git a/Source/Game/Collision/BoundingIntervalHierarchyWrap.cs b/Source/Game/Collision/BoundingIntervalHierarchyWrap.cs index b444116a2..fb95af4d9 100644 --- a/Source/Game/Collision/BoundingIntervalHierarchyWrap.cs +++ b/Source/Game/Collision/BoundingIntervalHierarchyWrap.cs @@ -22,12 +22,12 @@ namespace Game.Collision { public class BIHWrap where T : IModel { - public void insert(T obj) + public void Insert(T obj) { ++unbalanced_times; m_objects_to_push.Add(obj); } - public void remove(T obj) + public void Remove(T obj) { ++unbalanced_times; uint Idx = 0; @@ -37,7 +37,7 @@ namespace Game.Collision m_objects_to_push.Remove(obj); } - public void balance() + public void Balance() { if (unbalanced_times == 0) return; @@ -47,21 +47,21 @@ namespace Game.Collision m_objects.AddRange(m_obj2Idx.Keys); m_objects.AddRange(m_objects_to_push); - m_tree.build(m_objects); + m_tree.Build(m_objects); } - public void intersectRay(Ray ray, WorkerCallback intersectCallback, ref float maxDist) + public void IntersectRay(Ray ray, WorkerCallback intersectCallback, ref float maxDist) { - balance(); + Balance(); MDLCallback temp_cb = new MDLCallback(intersectCallback, m_objects.ToArray(), (uint)m_objects.Count); - m_tree.intersectRay(ray, temp_cb, ref maxDist, true); + m_tree.IntersectRay(ray, temp_cb, ref maxDist, true); } - public void intersectPoint(Vector3 point, WorkerCallback intersectCallback) + public void IntersectPoint(Vector3 point, WorkerCallback intersectCallback) { - balance(); + Balance(); MDLCallback callback = new MDLCallback(intersectCallback, m_objects.ToArray(), (uint)m_objects.Count); - m_tree.intersectPoint(point, callback); + m_tree.IntersectPoint(point, callback); } BIH m_tree = new BIH(); diff --git a/Source/Game/Collision/Callbacks.cs b/Source/Game/Collision/Callbacks.cs index 994eda92d..9517dfdec 100644 --- a/Source/Game/Collision/Callbacks.cs +++ b/Source/Game/Collision/Callbacks.cs @@ -15,10 +15,10 @@ * along with this program. If not, see . */ +using Framework.Constants; using Framework.GameMath; using System; using System.Collections.Generic; -using Framework.Constants; namespace Game.Collision { @@ -178,12 +178,12 @@ namespace Game.Collision { if (prims[entry] == null) return false; - bool result = prims[entry].intersectRay(ray, ref distance, pStopAtFirstHit, flags); + bool result = prims[entry].IntersectRay(ray, ref distance, pStopAtFirstHit, flags); if (result) hit = true; return result; } - public bool didHit() { return hit; } + public bool DidHit() { return hit; } ModelInstance[] prims; bool hit; @@ -201,7 +201,7 @@ namespace Game.Collision if (prims[entry] == null) return; - prims[entry].intersectPoint(point, aInfo); + prims[entry].IntersectPoint(point, aInfo); } ModelInstance[] prims; @@ -242,7 +242,7 @@ namespace Game.Collision return _didHit; } - public bool didHit() { return _didHit; } + public bool DidHit() { return _didHit; } bool _didHit; PhaseShift _phaseShift; diff --git a/Source/Game/Collision/DynamicTree.cs b/Source/Game/Collision/DynamicTree.cs index 17321ad02..7b66d3255 100644 --- a/Source/Game/Collision/DynamicTree.cs +++ b/Source/Game/Collision/DynamicTree.cs @@ -26,42 +26,42 @@ namespace Game.Collision impl = new DynTreeImpl(); } - public void insert(GameObjectModel mdl) + public void Insert(GameObjectModel mdl) { - impl.insert(mdl); + impl.Insert(mdl); } - public void remove(GameObjectModel mdl) + public void Remove(GameObjectModel mdl) { - impl.remove(mdl); + impl.Remove(mdl); } - public bool contains(GameObjectModel mdl) + public bool Contains(GameObjectModel mdl) { - return impl.contains(mdl); + return impl.Contains(mdl); } - public void balance() + public void Balance() { - impl.balance(); + impl.Balance(); } - public void update(uint diff) + public void Update(uint diff) { - impl.update(diff); + impl.Update(diff); } - public bool getIntersectionTime(Ray ray, Vector3 endPos, PhaseShift phaseShift, float maxDist) + public bool GetIntersectionTime(Ray ray, Vector3 endPos, PhaseShift phaseShift, float maxDist) { float distance = maxDist; DynamicTreeIntersectionCallback callback = new DynamicTreeIntersectionCallback(phaseShift); - impl.intersectRay(ray, callback, ref distance, endPos); - if (callback.didHit()) + impl.IntersectRay(ray, callback, ref distance, endPos); + if (callback.DidHit()) maxDist = distance; - return callback.didHit(); + return callback.DidHit(); } - public bool getObjectHitPos(Vector3 startPos, Vector3 endPos, ref Vector3 resultHitPos, float modifyDist, PhaseShift phaseShift) + public bool GetObjectHitPos(Vector3 startPos, Vector3 endPos, ref Vector3 resultHitPos, float modifyDist, PhaseShift phaseShift) { bool result = false; float maxDist = (endPos - startPos).magnitude(); @@ -76,7 +76,7 @@ namespace Game.Collision Vector3 dir = (endPos - startPos) / maxDist; // direction with length of 1 Ray ray = new Ray(startPos, dir); float dist = maxDist; - if (getIntersectionTime(ray, endPos, phaseShift, dist)) + if (GetIntersectionTime(ray, endPos, phaseShift, dist)) { resultHitPos = startPos + dir * dist; if (modifyDist < 0) @@ -99,7 +99,7 @@ namespace Game.Collision return result; } - public bool isInLineOfSight(Vector3 startPos, Vector3 endPos, PhaseShift phaseShift) + public bool IsInLineOfSight(Vector3 startPos, Vector3 endPos, PhaseShift phaseShift) { float maxDist = (endPos - startPos).magnitude(); @@ -108,25 +108,25 @@ namespace Game.Collision Ray r = new Ray(startPos, (endPos - startPos) / maxDist); DynamicTreeIntersectionCallback callback = new DynamicTreeIntersectionCallback(phaseShift); - impl.intersectRay(r, callback, ref maxDist, endPos); + impl.IntersectRay(r, callback, ref maxDist, endPos); - return !callback.didHit(); + return !callback.DidHit(); } - public float getHeight(float x, float y, float z, float maxSearchDist, PhaseShift phaseShift) + public float GetHeight(float x, float y, float z, float maxSearchDist, PhaseShift phaseShift) { Vector3 v = new Vector3(x, y, z + 0.5f); Ray r = new Ray(v, new Vector3(0, 0, -1)); DynamicTreeIntersectionCallback callback = new DynamicTreeIntersectionCallback(phaseShift); - impl.intersectZAllignedRay(r, callback, ref maxSearchDist); + impl.IntersectZAllignedRay(r, callback, ref maxSearchDist); - if (callback.didHit()) + if (callback.DidHit()) return v.Z - maxSearchDist; else return float.NegativeInfinity; } - public bool getAreaInfo(float x, float y, ref float z, PhaseShift phaseShift, out uint flags, out int adtId, out int rootId, out int groupId) + public bool GetAreaInfo(float x, float y, ref float z, PhaseShift phaseShift, out uint flags, out int adtId, out int rootId, out int groupId) { flags = 0; adtId = 0; @@ -135,7 +135,7 @@ namespace Game.Collision Vector3 v = new Vector3(x, y, z + 0.5f); DynamicTreeAreaInfoCallback intersectionCallBack = new DynamicTreeAreaInfoCallback(phaseShift); - impl.intersectPoint(v, intersectionCallBack); + impl.IntersectPoint(v, intersectionCallBack); if (intersectionCallBack.GetAreaInfo().result) { flags = intersectionCallBack.GetAreaInfo().flags; @@ -159,27 +159,27 @@ namespace Game.Collision unbalanced_times = 0; } - public override void insert(GameObjectModel mdl) + public override void Insert(GameObjectModel mdl) { - base.insert(mdl); + base.Insert(mdl); ++unbalanced_times; } - public override void remove(GameObjectModel mdl) + public override void Remove(GameObjectModel mdl) { - base.remove(mdl); + base.Remove(mdl); ++unbalanced_times; } - public override void balance() + public override void Balance() { - base.balance(); + base.Balance(); unbalanced_times = 0; } - public void update(uint difftime) + public void Update(uint difftime) { - if (empty()) + if (Empty()) return; rebalance_timer.Update((int)difftime); @@ -187,7 +187,7 @@ namespace Game.Collision { rebalance_timer.Reset(200); if (unbalanced_times > 0) - balance(); + Balance(); } } diff --git a/Source/Game/Collision/Management/VMapManager.cs b/Source/Game/Collision/Management/VMapManager.cs index 98cbeaaef..2fb7cc72e 100644 --- a/Source/Game/Collision/Management/VMapManager.cs +++ b/Source/Game/Collision/Management/VMapManager.cs @@ -49,17 +49,17 @@ namespace Game.Collision iParentMapData[pair.Value] = pair.Key; } - public VMAPLoadResult loadMap(uint mapId, uint x, uint y) + public VMAPLoadResult LoadMap(uint mapId, uint x, uint y) { var result = VMAPLoadResult.Ignored; - if (isMapLoadingEnabled()) + if (IsMapLoadingEnabled()) { - if (loadSingleMap(mapId, x, y)) + if (LoadSingleMap(mapId, x, y)) { result = VMAPLoadResult.OK; var childMaps = iChildMapData.LookupByKey(mapId); foreach (uint childMapId in childMaps) - if (!loadSingleMap(childMapId, x, y)) + if (!LoadSingleMap(childMapId, x, y)) result = VMAPLoadResult.Error; } else @@ -69,12 +69,12 @@ namespace Game.Collision return result; } - bool loadSingleMap(uint mapId, uint tileX, uint tileY) + bool LoadSingleMap(uint mapId, uint tileX, uint tileY) { var instanceTree = iInstanceMapTrees.LookupByKey(mapId); if (instanceTree == null) { - string filename = VMapPath + getMapFileName(mapId); + string filename = VMapPath + GetMapFileName(mapId); StaticMapTree newTree = new StaticMapTree(mapId); if (!newTree.InitMap(filename)) return false; @@ -87,79 +87,79 @@ namespace Game.Collision return instanceTree.LoadMapTile(tileX, tileY, this); } - public void unloadMap(uint mapId, uint x, uint y) + public void UnloadMap(uint mapId, uint x, uint y) { var childMaps = iChildMapData.LookupByKey(mapId); foreach (uint childMapId in childMaps) - unloadSingleMap(childMapId, x, y); + UnloadSingleMap(childMapId, x, y); - unloadSingleMap(mapId, x, y); + UnloadSingleMap(mapId, x, y); } - void unloadSingleMap(uint mapId, uint x, uint y) + void UnloadSingleMap(uint mapId, uint x, uint y) { var instanceTree = iInstanceMapTrees.LookupByKey(mapId); if (instanceTree != null) { instanceTree.UnloadMapTile(x, y, this); - if (instanceTree.numLoadedTiles() == 0) + if (instanceTree.NumLoadedTiles() == 0) { iInstanceMapTrees.Remove(mapId); } } } - public void unloadMap(uint mapId) + public void UnloadMap(uint mapId) { var childMaps = iChildMapData.LookupByKey(mapId); foreach (uint childMapId in childMaps) - unloadSingleMap(childMapId); + UnloadSingleMap(childMapId); - unloadSingleMap(mapId); + UnloadSingleMap(mapId); } - void unloadSingleMap(uint mapId) + void UnloadSingleMap(uint mapId) { var instanceTree = iInstanceMapTrees.LookupByKey(mapId); if (instanceTree != null) { instanceTree.UnloadMap(this); - if (instanceTree.numLoadedTiles() == 0) + if (instanceTree.NumLoadedTiles() == 0) { iInstanceMapTrees.Remove(mapId); } } } - public bool isInLineOfSight(uint mapId, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags) + public bool IsInLineOfSight(uint mapId, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags) { - if (!isLineOfSightCalcEnabled() || Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, DisableFlags.VmapLOS)) + if (!IsLineOfSightCalcEnabled() || Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, DisableFlags.VmapLOS)) return true; var instanceTree = iInstanceMapTrees.LookupByKey(mapId); if (instanceTree != null) { - Vector3 pos1 = convertPositionToInternalRep(x1, y1, z1); - Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2); + Vector3 pos1 = ConvertPositionToInternalRep(x1, y1, z1); + Vector3 pos2 = ConvertPositionToInternalRep(x2, y2, z2); if (pos1 != pos2) - return instanceTree.isInLineOfSight(pos1, pos2, ignoreFlags); + return instanceTree.IsInLineOfSight(pos1, pos2, ignoreFlags); } return true; } - public bool getObjectHitPos(uint mapId, float x1, float y1, float z1, float x2, float y2, float z2, out float rx, out float ry, out float rz, float modifyDist) + public bool GetObjectHitPos(uint mapId, float x1, float y1, float z1, float x2, float y2, float z2, out float rx, out float ry, out float rz, float modifyDist) { - if (isLineOfSightCalcEnabled() && !Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, DisableFlags.VmapLOS)) + if (IsLineOfSightCalcEnabled() && !Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, DisableFlags.VmapLOS)) { var instanceTree = iInstanceMapTrees.LookupByKey(mapId); if (instanceTree != null) { Vector3 resultPos; - Vector3 pos1 = convertPositionToInternalRep(x1, y1, z1); - Vector3 pos2 = convertPositionToInternalRep(x2, y2, z2); - bool result = instanceTree.getObjectHitPos(pos1, pos2, out resultPos, modifyDist); - resultPos = convertPositionToInternalRep(resultPos.X, resultPos.Y, resultPos.Z); + Vector3 pos1 = ConvertPositionToInternalRep(x1, y1, z1); + Vector3 pos2 = ConvertPositionToInternalRep(x2, y2, z2); + bool result = instanceTree.GetObjectHitPos(pos1, pos2, out resultPos, modifyDist); + resultPos = ConvertPositionToInternalRep(resultPos.X, resultPos.Y, resultPos.Z); rx = resultPos.X; ry = resultPos.Y; rz = resultPos.Z; @@ -174,15 +174,15 @@ namespace Game.Collision return false; } - public float getHeight(uint mapId, float x, float y, float z, float maxSearchDist) + public float GetHeight(uint mapId, float x, float y, float z, float maxSearchDist) { - if (isHeightCalcEnabled() && !Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, DisableFlags.VmapHeight)) + if (IsHeightCalcEnabled() && !Global.DisableMgr.IsDisabledFor(DisableType.VMAP, mapId, null, DisableFlags.VmapHeight)) { var instanceTree = iInstanceMapTrees.LookupByKey(mapId); if (instanceTree != null) { - Vector3 pos = convertPositionToInternalRep(x, y, z); - float height = instanceTree.getHeight(pos, maxSearchDist); + Vector3 pos = ConvertPositionToInternalRep(x, y, z); + float height = instanceTree.GetHeight(pos, maxSearchDist); if (float.IsInfinity(height)) height = MapConst.VMAPInvalidHeightValue; // No height @@ -193,7 +193,7 @@ namespace Game.Collision return MapConst.VMAPInvalidHeightValue; } - public bool getAreaInfo(uint mapId, float x, float y, ref float z, out uint flags, out int adtId, out int rootId, out int groupId) + public bool GetAreaInfo(uint mapId, float x, float y, ref float z, out uint flags, out int adtId, out int rootId, out int groupId) { flags = 0; adtId = 0; @@ -204,8 +204,8 @@ namespace Game.Collision var instanceTree = iInstanceMapTrees.LookupByKey(mapId); if (instanceTree != null) { - Vector3 pos = convertPositionToInternalRep(x, y, z); - bool result = instanceTree.getAreaInfo(ref pos, out flags, out adtId, out rootId, out groupId); + Vector3 pos = ConvertPositionToInternalRep(x, y, z); + bool result = instanceTree.GetAreaInfo(ref pos, out flags, out adtId, out rootId, out groupId); // z is not touched by convertPositionToInternalRep(), so just copy z = pos.Z; return result; @@ -223,7 +223,7 @@ namespace Game.Collision if (instanceTree != null) { LocationInfo info = new LocationInfo(); - Vector3 pos = convertPositionToInternalRep(x, y, z); + Vector3 pos = ConvertPositionToInternalRep(x, y, z); if (instanceTree.GetLocationInfo(pos, info)) { floor = info.ground_Z; @@ -239,7 +239,7 @@ namespace Game.Collision return false; } - public WorldModel acquireModelInstance(string filename, uint flags = 0) + public WorldModel AcquireModelInstance(string filename, uint flags = 0) { lock (LoadedModelFilesLock) { @@ -248,7 +248,7 @@ namespace Game.Collision if (model == null) { WorldModel worldmodel = new WorldModel(); - if (!worldmodel.readFile(VMapPath + filename)) + if (!worldmodel.ReadFile(VMapPath + filename)) { Log.outError(LogFilter.Server, "VMapManager: could not load '{0}'", filename); return null; @@ -259,16 +259,16 @@ namespace Game.Collision worldmodel.Flags = flags; model = new ManagedModel(); - model.setModel(worldmodel); + model.SetModel(worldmodel); iLoadedModelFiles.Add(filename, model); } - model.incRefCount(); - return model.getModel(); + model.IncRefCount(); + return model.GetModel(); } } - public void releaseModelInstance(string filename) + public void ReleaseModelInstance(string filename) { lock (LoadedModelFilesLock) { @@ -279,7 +279,7 @@ namespace Game.Collision Log.outError(LogFilter.Server, "VMapManager: trying to unload non-loaded file '{0}'", filename); return; } - if (model.decRefCount() == 0) + if (model.DecRefCount() == 0) { Log.outDebug(LogFilter.Maps, "VMapManager: unloading file '{0}'", filename); iLoadedModelFiles.Remove(filename); @@ -287,12 +287,12 @@ namespace Game.Collision } } - public LoadResult existsMap(uint mapId, uint x, uint y) + public LoadResult ExistsMap(uint mapId, uint x, uint y) { return StaticMapTree.CanLoadMap(VMapPath, mapId, x, y, this); } - public int getParentMapId(uint mapId) + public int GetParentMapId(uint mapId) { if (iParentMapData.ContainsKey(mapId)) return (int)iParentMapData[mapId]; @@ -300,7 +300,7 @@ namespace Game.Collision return -1; } - Vector3 convertPositionToInternalRep(float x, float y, float z) + Vector3 ConvertPositionToInternalRep(float x, float y, float z) { Vector3 pos = new Vector3(); float mid = 0.5f * 64.0f * 533.33333333f; @@ -311,17 +311,17 @@ namespace Game.Collision return pos; } - public static string getMapFileName(uint mapId) + public static string GetMapFileName(uint mapId) { return $"{mapId:D4}.vmtree"; } - public void setEnableLineOfSightCalc(bool pVal) { _enableLineOfSightCalc = pVal; } - public void setEnableHeightCalc(bool pVal) { _enableHeightCalc = pVal; } + public void SetEnableLineOfSightCalc(bool pVal) { _enableLineOfSightCalc = pVal; } + public void SetEnableHeightCalc(bool pVal) { _enableHeightCalc = pVal; } - public bool isLineOfSightCalcEnabled() { return _enableLineOfSightCalc; } - public bool isHeightCalcEnabled() { return _enableHeightCalc; } - public bool isMapLoadingEnabled() { return _enableLineOfSightCalc || _enableHeightCalc; } + public bool IsLineOfSightCalcEnabled() { return _enableLineOfSightCalc; } + public bool IsHeightCalcEnabled() { return _enableHeightCalc; } + public bool IsMapLoadingEnabled() { return _enableLineOfSightCalc || _enableHeightCalc; } Dictionary iLoadedModelFiles = new Dictionary(); Dictionary iInstanceMapTrees = new Dictionary(); @@ -341,10 +341,10 @@ namespace Game.Collision iRefCount = 0; } - public void setModel(WorldModel model) { iModel = model; } - public WorldModel getModel() { return iModel; } - public void incRefCount() { ++iRefCount; } - public int decRefCount() { return --iRefCount; } + public void SetModel(WorldModel model) { iModel = model; } + public WorldModel GetModel() { return iModel; } + public void IncRefCount() { ++iRefCount; } + public int DecRefCount() { return --iRefCount; } WorldModel iModel; int iRefCount; diff --git a/Source/Game/Collision/Maps/MapTree.cs b/Source/Game/Collision/Maps/MapTree.cs index 20ddb6c57..9b89eb260 100644 --- a/Source/Game/Collision/Maps/MapTree.cs +++ b/Source/Game/Collision/Maps/MapTree.cs @@ -69,9 +69,9 @@ namespace Game.Collision var magic = reader.ReadStringFromChars(8); var node = reader.ReadStringFromChars(4); - if (magic == MapConst.VMapMagic && node == "NODE" && iTree.readFromFile(reader)) + if (magic == MapConst.VMapMagic && node == "NODE" && iTree.ReadFromFile(reader)) { - iNTreeValues = iTree.primCount(); + iNTreeValues = iTree.PrimCount(); iTreeValues = new ModelInstance[iNTreeValues]; success = true; } @@ -98,9 +98,9 @@ namespace Game.Collision { foreach (var id in iLoadedSpawns) { - iTreeValues[id.Key].setUnloaded(); + iTreeValues[id.Key].SetUnloaded(); for (uint refCount = 0; refCount < id.Key; ++refCount) - vm.releaseModelInstance(iTreeValues[id.Key].name); + vm.ReleaseModelInstance(iTreeValues[id.Key].name); } iLoadedSpawns.Clear(); iLoadedTiles.Clear(); @@ -118,7 +118,7 @@ namespace Game.Collision FileStream stream = OpenMapTileFile(VMapManager.VMapPath, iMapID, tileX, tileY, vm); if (stream == null) { - iLoadedTiles[packTileID(tileX, tileY)] = false; + iLoadedTiles[PackTileID(tileX, tileY)] = false; } else { @@ -133,11 +133,11 @@ namespace Game.Collision { // read model spawns ModelSpawn spawn; - result = ModelSpawn.readFromFile(reader, out spawn); + result = ModelSpawn.ReadFromFile(reader, out spawn); if (result) { // acquire model instance - WorldModel model = vm.acquireModelInstance(spawn.name, spawn.flags); + WorldModel model = vm.AcquireModelInstance(spawn.name, spawn.flags); if (model == null) Log.outError(LogFilter.Server, "StaticMapTree.LoadMapTile() : could not acquire WorldModel [{0}, {1}]", tileX, tileY); @@ -165,14 +165,14 @@ namespace Game.Collision } } } - iLoadedTiles[packTileID(tileX, tileY)] = true; + iLoadedTiles[PackTileID(tileX, tileY)] = true; } return result; } public void UnloadMapTile(uint tileX, uint tileY, VMapManager vm) { - uint tileID = packTileID(tileX, tileY); + uint tileID = PackTileID(tileX, tileY); var tile = iLoadedTiles.LookupByKey(tileID); if (!iLoadedTiles.ContainsKey(tileID)) { @@ -195,11 +195,11 @@ namespace Game.Collision { // read model spawns ModelSpawn spawn; - result = ModelSpawn.readFromFile(reader, out spawn); + result = ModelSpawn.ReadFromFile(reader, out spawn); if (result) { // release model instance - vm.releaseModelInstance(spawn.name); + vm.ReleaseModelInstance(spawn.name); // update tree if (!iSpawnIndices.ContainsKey(spawn.ID)) @@ -211,7 +211,7 @@ namespace Game.Collision Log.outError(LogFilter.Server, "StaticMapTree.UnloadMapTile() : trying to unload non-referenced model '{0}' (ID:{1})", spawn.name, spawn.ID); else if (--iLoadedSpawns[referencedNode] == 0) { - iTreeValues[referencedNode].setUnloaded(); + iTreeValues[referencedNode].SetUnloaded(); iLoadedSpawns.Remove(referencedNode); } } @@ -224,17 +224,17 @@ namespace Game.Collision iLoadedTiles.Remove(tileID); } - static uint packTileID(uint tileX, uint tileY) { return tileX << 16 | tileY; } - static void unpackTileID(uint ID, ref uint tileX, ref uint tileY) { tileX = ID >> 16; tileY = ID & 0xFF; } + static uint PackTileID(uint tileX, uint tileY) { return tileX << 16 | tileY; } + static void UnpackTileID(uint ID, ref uint tileX, ref uint tileY) { tileX = ID >> 16; tileY = ID & 0xFF; } static FileStream OpenMapTileFile(string vmapPath, uint mapID, uint tileX, uint tileY, VMapManager vm) { - string tilefile = vmapPath + getTileFileName(mapID, tileX, tileY); + string tilefile = vmapPath + GetTileFileName(mapID, tileX, tileY); if (!File.Exists(tilefile)) { - int parentMapId = vm.getParentMapId(mapID); + int parentMapId = vm.GetParentMapId(mapID); if (parentMapId != -1) - tilefile = vmapPath + getTileFileName((uint)parentMapId, tileX, tileY); + tilefile = vmapPath + GetTileFileName((uint)parentMapId, tileX, tileY); } if (!File.Exists(tilefile)) @@ -245,7 +245,7 @@ namespace Game.Collision public static LoadResult CanLoadMap(string vmapPath, uint mapID, uint tileX, uint tileY, VMapManager vm) { - string fullname = vmapPath + VMapManager.getMapFileName(mapID); + string fullname = vmapPath + VMapManager.GetMapFileName(mapID); if (!File.Exists(fullname)) return LoadResult.FileNotFound; @@ -268,12 +268,12 @@ namespace Game.Collision return LoadResult.Success; } - public static string getTileFileName(uint mapID, uint tileX, uint tileY) + public static string GetTileFileName(uint mapID, uint tileX, uint tileY) { return $"{mapID:D4}_{tileY:D2}_{tileX:D2}.vmtile"; } - public bool getAreaInfo(ref Vector3 pos, out uint flags, out int adtId, out int rootId, out int groupId) + public bool GetAreaInfo(ref Vector3 pos, out uint flags, out int adtId, out int rootId, out int groupId) { flags = 0; adtId = 0; @@ -281,7 +281,7 @@ namespace Game.Collision groupId = 0; AreaInfoCallback intersectionCallBack = new AreaInfoCallback(iTreeValues); - iTree.intersectPoint(pos, intersectionCallBack); + iTree.IntersectPoint(pos, intersectionCallBack); if (intersectionCallBack.aInfo.result) { flags = intersectionCallBack.aInfo.flags; @@ -297,32 +297,32 @@ namespace Game.Collision public bool GetLocationInfo(Vector3 pos, LocationInfo info) { LocationInfoCallback intersectionCallBack = new LocationInfoCallback(iTreeValues, info); - iTree.intersectPoint(pos, intersectionCallBack); + iTree.IntersectPoint(pos, intersectionCallBack); return intersectionCallBack.result; } - public float getHeight(Vector3 pPos, float maxSearchDist) + public float GetHeight(Vector3 pPos, float maxSearchDist) { float height = float.PositiveInfinity; Vector3 dir = new Vector3(0, 0, -1); Ray ray = new Ray(pPos, dir); // direction with length of 1 float maxDist = maxSearchDist; - if (getIntersectionTime(ray, ref maxDist, false, ModelIgnoreFlags.Nothing)) + if (GetIntersectionTime(ray, ref maxDist, false, ModelIgnoreFlags.Nothing)) height = pPos.Z - maxDist; return height; } - bool getIntersectionTime(Ray pRay, ref float pMaxDist, bool pStopAtFirstHit, ModelIgnoreFlags ignoreFlags) + bool GetIntersectionTime(Ray pRay, ref float pMaxDist, bool pStopAtFirstHit, ModelIgnoreFlags ignoreFlags) { float distance = pMaxDist; MapRayCallback intersectionCallBack = new MapRayCallback(iTreeValues, ignoreFlags); - iTree.intersectRay(pRay, intersectionCallBack, ref distance, pStopAtFirstHit); - if (intersectionCallBack.didHit()) + iTree.IntersectRay(pRay, intersectionCallBack, ref distance, pStopAtFirstHit); + if (intersectionCallBack.DidHit()) pMaxDist = distance; - return intersectionCallBack.didHit(); + return intersectionCallBack.DidHit(); } - public bool getObjectHitPos(Vector3 pPos1, Vector3 pPos2, out Vector3 pResultHitPos, float pModifyDist) + public bool GetObjectHitPos(Vector3 pPos1, Vector3 pPos2, out Vector3 pResultHitPos, float pModifyDist) { bool result = false; float maxDist = (pPos2 - pPos1).magnitude(); @@ -337,7 +337,7 @@ namespace Game.Collision Vector3 dir = (pPos2 - pPos1) / maxDist; // direction with length of 1 Ray ray = new Ray(pPos1, dir); float dist = maxDist; - if (getIntersectionTime(ray, ref dist, false, ModelIgnoreFlags.Nothing)) + if (GetIntersectionTime(ray, ref dist, false, ModelIgnoreFlags.Nothing)) { pResultHitPos = pPos1 + dir * dist; if (pModifyDist < 0) @@ -365,7 +365,7 @@ namespace Game.Collision return result; } - public bool isInLineOfSight(Vector3 pos1, Vector3 pos2, ModelIgnoreFlags ignoreFlags) + public bool IsInLineOfSight(Vector3 pos1, Vector3 pos2, ModelIgnoreFlags ignoreFlags) { float maxDist = (pos2 - pos1).magnitude(); // return false if distance is over max float, in case of cheater teleporting to the end of the universe @@ -380,13 +380,13 @@ namespace Game.Collision return true; // direction with length of 1 Ray ray = new Ray(pos1, (pos2 - pos1) / maxDist); - if (getIntersectionTime(ray, ref maxDist, true, ignoreFlags)) + if (GetIntersectionTime(ray, ref maxDist, true, ignoreFlags)) return false; return true; } - public int numLoadedTiles() { return iLoadedTiles.Count; } + public int NumLoadedTiles() { return iLoadedTiles.Count; } uint iMapID; BIH iTree = new BIH(); diff --git a/Source/Game/Collision/Models/GameObjectModel.cs b/Source/Game/Collision/Models/GameObjectModel.cs index 2bc0139ae..8d5fb9b18 100644 --- a/Source/Game/Collision/Models/GameObjectModel.cs +++ b/Source/Game/Collision/Models/GameObjectModel.cs @@ -41,7 +41,7 @@ namespace Game.Collision public class GameObjectModel : IModel { - bool initialize(GameObjectModelOwnerBase modelOwner) + bool Initialize(GameObjectModelOwnerBase modelOwner) { var modelData = StaticModelList.models.LookupByKey(modelOwner.GetDisplayId()); if (modelData == null) @@ -55,7 +55,7 @@ namespace Game.Collision return false; } - iModel = Global.VMapMgr.acquireModelInstance(modelData.name); + iModel = Global.VMapMgr.AcquireModelInstance(modelData.name); if (iModel == null) return false; @@ -82,7 +82,7 @@ namespace Game.Collision public static GameObjectModel Create(GameObjectModelOwnerBase modelOwner) { GameObjectModel mdl = new GameObjectModel(); - if (!mdl.initialize(modelOwner)) + if (!mdl.Initialize(modelOwner)) return null; return mdl; @@ -90,7 +90,7 @@ namespace Game.Collision public override bool IntersectRay(Ray ray, ref float maxDist, bool stopAtFirstHit, PhaseShift phaseShift, ModelIgnoreFlags ignoreFlags) { - if (!isCollisionEnabled() || !owner.IsSpawned()) + if (!IsCollisionEnabled() || !owner.IsSpawned()) return false; if (!owner.IsInPhase(phaseShift)) @@ -115,7 +115,7 @@ namespace Game.Collision public override void IntersectPoint(Vector3 point, AreaInfo info, PhaseShift phaseShift) { - if (!isCollisionEnabled() || !owner.IsSpawned() || !isMapObject()) + if (!IsCollisionEnabled() || !owner.IsSpawned() || !IsMapObject()) return; if (!owner.IsInPhase(phaseShift)) @@ -172,12 +172,12 @@ namespace Game.Collision return true; } - public override Vector3 getPosition() { return iPos; } - public override AxisAlignedBox getBounds() { return iBound; } + public override Vector3 GetPosition() { return iPos; } + public override AxisAlignedBox GetBounds() { return iBound; } - public void enableCollision(bool enable) { _collisionEnabled = enable; } - bool isCollisionEnabled() { return _collisionEnabled; } - public bool isMapObject() { return isWmo; } + public void EnableCollision(bool enable) { _collisionEnabled = enable; } + bool IsCollisionEnabled() { return _collisionEnabled; } + public bool IsMapObject() { return isWmo; } public static void LoadGameObjectModelList() { diff --git a/Source/Game/Collision/Models/IModel.cs b/Source/Game/Collision/Models/IModel.cs index 9d184e9a8..b5312b00e 100644 --- a/Source/Game/Collision/Models/IModel.cs +++ b/Source/Game/Collision/Models/IModel.cs @@ -22,8 +22,8 @@ namespace Game.Collision { public class IModel { - public virtual Vector3 getPosition() { return default; } - public virtual AxisAlignedBox getBounds() { return default; } + public virtual Vector3 GetPosition() { return default; } + public virtual AxisAlignedBox GetBounds() { return default; } public virtual bool IntersectRay(Ray ray, ref float maxDist, bool stopAtFirstHit, PhaseShift phaseShift, ModelIgnoreFlags ignoreFlags) { return false; } public virtual bool IntersectRay(Ray ray, ref float distance, bool stopAtFirstHit, ModelIgnoreFlags ignoreFlags) { return false; } diff --git a/Source/Game/Collision/Models/ModelInstance.cs b/Source/Game/Collision/Models/ModelInstance.cs index d06c41d7b..a844bb20e 100644 --- a/Source/Game/Collision/Models/ModelInstance.cs +++ b/Source/Game/Collision/Models/ModelInstance.cs @@ -44,7 +44,7 @@ namespace Game.Collision name = spawn.name; } - public static bool readFromFile(BinaryReader reader, out ModelSpawn spawn) + public static bool ReadFromFile(BinaryReader reader, out ModelSpawn spawn) { spawn = new ModelSpawn(); @@ -94,7 +94,7 @@ namespace Game.Collision iInvScale = 1.0f / iScale; } - public bool intersectRay(Ray pRay, ref float pMaxDist, bool pStopAtFirstHit, ModelIgnoreFlags ignoreFlags) + public bool IntersectRay(Ray pRay, ref float pMaxDist, bool pStopAtFirstHit, ModelIgnoreFlags ignoreFlags) { if (iModel == null) return false; @@ -116,7 +116,7 @@ namespace Game.Collision return hit; } - public void intersectPoint(Vector3 p, AreaInfo info) + public void IntersectPoint(Vector3 p, AreaInfo info) { if (iModel == null) return; @@ -192,7 +192,7 @@ namespace Game.Collision return false; } - public void setUnloaded() { iModel = null; } + public void SetUnloaded() { iModel = null; } Matrix3 iInvRot; float iInvScale; diff --git a/Source/Game/Collision/Models/WorldModel.cs b/Source/Game/Collision/Models/WorldModel.cs index 1475a3fa4..106a6bf19 100644 --- a/Source/Game/Collision/Models/WorldModel.cs +++ b/Source/Game/Collision/Models/WorldModel.cs @@ -128,7 +128,7 @@ namespace Game.Collision return true; } - public static WmoLiquid readFromFile(BinaryReader reader) + public static WmoLiquid ReadFromFile(BinaryReader reader) { WmoLiquid liquid = new WmoLiquid(); @@ -193,13 +193,13 @@ namespace Game.Collision iLiquid = null; } - void setLiquidData(WmoLiquid liquid) + void SetLiquidData(WmoLiquid liquid) { iLiquid = liquid; liquid = null; } - public bool readFromFile(BinaryReader reader) + public bool ReadFromFile(BinaryReader reader) { triangles.Clear(); vertices.Clear(); @@ -237,7 +237,7 @@ namespace Game.Collision if (reader.ReadStringFromChars(4) != "MBIH") return false; - meshTree.readFromFile(reader); + meshTree.ReadFromFile(reader); // write liquid data if (reader.ReadStringFromChars(4) != "LIQU") @@ -245,7 +245,7 @@ namespace Game.Collision chunkSize = reader.ReadUInt32(); if (chunkSize > 0) - iLiquid = WmoLiquid.readFromFile(reader); + iLiquid = WmoLiquid.ReadFromFile(reader); return true; } @@ -256,7 +256,7 @@ namespace Game.Collision return false; GModelRayCallback callback = new GModelRayCallback(triangles, vertices); - meshTree.intersectRay(ray, callback, ref distance, stopAtFirstHit); + meshTree.IntersectRay(ray, callback, ref distance, stopAtFirstHit); return callback.hit; } @@ -290,7 +290,7 @@ namespace Game.Collision return 0; } - public override AxisAlignedBox getBounds() { return iBound; } + public override AxisAlignedBox GetBounds() { return iBound; } public uint GetMogpFlags() { return iMogpFlags; } @@ -328,7 +328,7 @@ namespace Game.Collision return groupModels[0].IntersectRay(ray, ref distance, stopAtFirstHit); WModelRayCallBack isc = new WModelRayCallBack(groupModels); - groupTree.intersectRay(ray, isc, ref distance, stopAtFirstHit); + groupTree.IntersectRay(ray, isc, ref distance, stopAtFirstHit); return isc.hit; } @@ -339,7 +339,7 @@ namespace Game.Collision return false; WModelAreaCallback callback = new WModelAreaCallback(groupModels, down); - groupTree.intersectPoint(p, callback); + groupTree.IntersectPoint(p, callback); if (callback.hit != null) { info.rootId = (int)RootWMOID; @@ -359,7 +359,7 @@ namespace Game.Collision return false; WModelAreaCallback callback = new WModelAreaCallback(groupModels, down); - groupTree.intersectPoint(p, callback); + groupTree.IntersectPoint(p, callback); if (callback.hit != null) { info.hitModel = callback.hit; @@ -369,7 +369,7 @@ namespace Game.Collision return false; } - public bool readFile(string filename) + public bool ReadFile(string filename) { if (!File.Exists(filename)) { @@ -397,7 +397,7 @@ namespace Game.Collision for (var i = 0; i < count; ++i) { GroupModel group = new GroupModel(); - group.readFromFile(reader); + group.ReadFromFile(reader); groupModels.Add(group); } @@ -405,7 +405,7 @@ namespace Game.Collision if (reader.ReadStringFromChars(4) != "GBIH") return false; - return groupTree.readFromFile(reader); + return groupTree.ReadFromFile(reader); } } diff --git a/Source/Game/Collision/RegularGrid2D.cs b/Source/Game/Collision/RegularGrid2D.cs index 458ecfb77..ac1fe6bf8 100644 --- a/Source/Game/Collision/RegularGrid2D.cs +++ b/Source/Game/Collision/RegularGrid2D.cs @@ -33,29 +33,29 @@ namespace Game.Collision nodes[x] = new Node[CELL_NUMBER]; } - public virtual void insert(T value) + public virtual void Insert(T value) { - AxisAlignedBox bounds = value.getBounds(); + AxisAlignedBox bounds = value.GetBounds(); Cell low = Cell.ComputeCell(bounds.Lo.X, bounds.Lo.Y); Cell high = Cell.ComputeCell(bounds.Hi.X, bounds.Hi.Y); for (int x = low.x; x <= high.x; ++x) { for (int y = low.y; y <= high.y; ++y) { - Node node = getGrid(x, y); - node.insert(value); + Node node = GetGrid(x, y); + node.Insert(value); memberTable.Add(value, node); } } } - public virtual void remove(T value) + public virtual void Remove(T value) { // Remove the member memberTable.Remove(value); } - public virtual void balance() + public virtual void Balance() { for (int x = 0; x < CELL_NUMBER; ++x) { @@ -63,13 +63,13 @@ namespace Game.Collision { Node n = nodes[x][y]; if (n != null) - n.balance(); + n.Balance(); } } } - public bool contains(T value) { return memberTable.ContainsKey(value); } - public bool empty() { return memberTable.Empty(); } + public bool Contains(T value) { return memberTable.ContainsKey(value); } + public bool Empty() { return memberTable.Empty(); } public struct Cell { @@ -95,10 +95,10 @@ namespace Game.Collision return c; } - public bool isValid() { return x >= 0 && x < CELL_NUMBER && y >= 0 && y < CELL_NUMBER; } + public bool IsValid() { return x >= 0 && x < CELL_NUMBER && y >= 0 && y < CELL_NUMBER; } } - Node getGrid(int x, int y) + Node GetGrid(int x, int y) { Cypher.Assert(x < CELL_NUMBER && y < CELL_NUMBER); if (nodes[x][y] == null) @@ -106,15 +106,15 @@ namespace Game.Collision return nodes[x][y]; } - public void intersectRay(Ray ray, WorkerCallback intersectCallback, ref float max_dist) + public void IntersectRay(Ray ray, WorkerCallback intersectCallback, ref float max_dist) { - intersectRay(ray, intersectCallback, ref max_dist, ray.Origin + ray.Direction * max_dist); + IntersectRay(ray, intersectCallback, ref max_dist, ray.Origin + ray.Direction * max_dist); } - public void intersectRay(Ray ray, WorkerCallback intersectCallback, ref float max_dist, Vector3 end) + public void IntersectRay(Ray ray, WorkerCallback intersectCallback, ref float max_dist, Vector3 end) { Cell cell = Cell.ComputeCell(ray.Origin.X, ray.Origin.Y); - if (!cell.isValid()) + if (!cell.IsValid()) return; Cell last_cell = Cell.ComputeCell(end.X, end.Y); @@ -123,7 +123,7 @@ namespace Game.Collision { Node node = nodes[cell.x][cell.y]; if (node != null) - node.intersectRay(ray, intersectCallback, ref max_dist); + node.IntersectRay(ray, intersectCallback, ref max_dist); return; } @@ -166,7 +166,7 @@ namespace Game.Collision Node node = nodes[cell.x][cell.y]; if (node != null) { - node.intersectRay(ray, intersectCallback, ref max_dist); + node.IntersectRay(ray, intersectCallback, ref max_dist); } if (cell == last_cell) break; @@ -180,30 +180,30 @@ namespace Game.Collision tMaxY += tDeltaY; cell.y += stepY; } - } while (cell.isValid()); + } while (cell.IsValid()); } - public void intersectPoint(Vector3 point, WorkerCallback intersectCallback) + public void IntersectPoint(Vector3 point, WorkerCallback intersectCallback) { Cell cell = Cell.ComputeCell(point.X, point.Y); - if (!cell.isValid()) + if (!cell.IsValid()) return; Node node = nodes[cell.x][cell.y]; if (node != null) - node.intersectPoint(point, intersectCallback); + node.IntersectPoint(point, intersectCallback); } // Optimized verson of intersectRay function for rays with vertical directions - public void intersectZAllignedRay(Ray ray, WorkerCallback intersectCallback, ref float max_dist) + public void IntersectZAllignedRay(Ray ray, WorkerCallback intersectCallback, ref float max_dist) { Cell cell = Cell.ComputeCell(ray.Origin.X, ray.Origin.Y); - if (!cell.isValid()) + if (!cell.IsValid()) return; Node node = nodes[cell.x][cell.y]; if (node != null) - node.intersectRay(ray, intersectCallback, ref max_dist); + node.IntersectRay(ray, intersectCallback, ref max_dist); } MultiMap memberTable = new MultiMap(); diff --git a/Source/Game/Combat/Events.cs b/Source/Game/Combat/Events.cs index 92210d7eb..0e76cb0cf 100644 --- a/Source/Game/Combat/Events.cs +++ b/Source/Game/Combat/Events.cs @@ -25,16 +25,16 @@ namespace Game.Combat { iType = pType; } - public UnitEventTypes getType() + public UnitEventTypes GetEventType() { return iType; } - bool matchesTypeMask(uint pMask) + bool MatchesTypeMask(uint pMask) { return Convert.ToBoolean((uint)iType & pMask); } - void setType(UnitEventTypes pType) + void SetEventType(UnitEventTypes pType) { iType = pType; } @@ -67,32 +67,32 @@ namespace Game.Combat iBValue = pValue; } - public float getFValue() + public float GetFValue() { return iFValue; } - bool getBValue() + bool GetBValue() { return iBValue; } - void setBValue(bool pValue) + void SetBValue(bool pValue) { iBValue = pValue; } - public HostileReference getReference() + public HostileReference GetReference() { return iHostileReference; } - public void setThreatManager(ThreatManager pThreatManager) + public void SetThreatManager(ThreatManager pThreatManager) { iThreatManager = pThreatManager; } - ThreatManager getThreatManager() + ThreatManager GetThreatManager() { return iThreatManager; } diff --git a/Source/Game/Combat/HostileRegManager.cs b/Source/Game/Combat/HostileRegManager.cs index 94f1931e7..aee4ba46e 100644 --- a/Source/Game/Combat/HostileRegManager.cs +++ b/Source/Game/Combat/HostileRegManager.cs @@ -31,130 +31,130 @@ namespace Game.Combat Owner = owner; } - Unit getOwner() { return Owner; } + Unit GetOwner() { return Owner; } // send threat to all my haters for the victim // The victim is then hated by them as well // use for buffs and healing threat functionality - public void threatAssist(Unit victim, float baseThreat, SpellInfo threatSpell = null) + public void ThreatAssist(Unit victim, float baseThreat, SpellInfo threatSpell = null) { - float threat = ThreatManager.calcThreat(victim, Owner, baseThreat, (threatSpell != null ? threatSpell.GetSchoolMask() : SpellSchoolMask.Normal), threatSpell); + float threat = ThreatManager.CalcThreat(victim, Owner, baseThreat, (threatSpell != null ? threatSpell.GetSchoolMask() : SpellSchoolMask.Normal), threatSpell); threat /= GetSize(); - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - if (ThreatManager.isValidProcess(victim, refe.GetSource().GetOwner(), threatSpell)) - refe.GetSource().doAddThreat(victim, threat); + if (ThreatManager.IsValidProcess(victim, refe.GetSource().GetOwner(), threatSpell)) + refe.GetSource().DoAddThreat(victim, threat); - refe = refe.next(); + refe = refe.Next(); } } - public void addTempThreat(float threat, bool apply) + public void AddTempThreat(float threat, bool apply) { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { if (apply) { - if (refe.getTempThreatModifier() == 0.0f) - refe.addTempThreat(threat); + if (refe.GetTempThreatModifier() == 0.0f) + refe.AddTempThreat(threat); } else - refe.resetTempThreat(); + refe.ResetTempThreat(); - refe = refe.next(); + refe = refe.Next(); } } - void addThreatPercent(int percent) + void AddThreatPercent(int percent) { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - refe.addThreatPercent(percent); - refe = refe.next(); + refe.AddThreatPercent(percent); + refe = refe.Next(); } } // The references are not needed anymore // tell the source to remove them from the list and free the mem - public void deleteReferences() + public void DeleteReferences() { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - HostileReference nextRef = refe.next(); - refe.removeReference(); + HostileReference nextRef = refe.Next(); + refe.RemoveReference(); refe = nextRef; } } // Remove specific faction references - public void deleteReferencesForFaction(uint faction) + public void DeleteReferencesForFaction(uint faction) { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - HostileReference nextRef = refe.next(); + HostileReference nextRef = refe.Next(); if (refe.GetSource().GetOwner().GetFactionTemplateEntry().Faction == faction) { - refe.removeReference(); + refe.RemoveReference(); } refe = nextRef; } } // delete all references out of specified range - public void deleteReferencesOutOfRange(float range) + public void DeleteReferencesOutOfRange(float range) { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); range = range * range; while (refe != null) { - HostileReference nextRef = refe.next(); + HostileReference nextRef = refe.Next(); Unit owner = refe.GetSource().GetOwner(); - if (!owner.IsActiveObject() && owner.GetExactDist2dSq(getOwner()) > range) + if (!owner.IsActiveObject() && owner.GetExactDist2dSq(GetOwner()) > range) { - refe.removeReference(); + refe.RemoveReference(); } refe = nextRef; } } - public new HostileReference getFirst() { return ((HostileReference)base.getFirst()); } + public new HostileReference GetFirst() { return (HostileReference)base.GetFirst(); } - public void updateThreatTables() + public void UpdateThreatTables() { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - refe.updateOnlineStatus(); - refe = refe.next(); + refe.UpdateOnlineStatus(); + refe = refe.Next(); } } - public void setOnlineOfflineState(bool isOnline) + public void SetOnlineOfflineState(bool isOnline) { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - refe.setOnlineOfflineState(isOnline); - refe = refe.next(); + refe.SetOnlineOfflineState(isOnline); + refe = refe.Next(); } } // set state for one reference, defined by Unit - public void setOnlineOfflineState(Unit creature, bool isOnline) + public void SetOnlineOfflineState(Unit creature, bool isOnline) { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - HostileReference nextRef = refe.next(); + HostileReference nextRef = refe.Next(); if (refe.GetSource().GetOwner() == creature) { - refe.setOnlineOfflineState(isOnline); + refe.SetOnlineOfflineState(isOnline); break; } refe = nextRef; @@ -162,15 +162,15 @@ namespace Game.Combat } // delete one reference, defined by Unit - public void deleteReference(Unit creature) + public void DeleteReference(Unit creature) { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - HostileReference nextRef = refe.next(); + HostileReference nextRef = refe.Next(); if (refe.GetSource().GetOwner() == creature) { - refe.removeReference(); + refe.RemoveReference(); break; } refe = nextRef; @@ -179,14 +179,14 @@ namespace Game.Combat public void UpdateVisibility() { - HostileReference refe = getFirst(); + HostileReference refe = GetFirst(); while (refe != null) { - HostileReference nextRef = refe.next(); - if (!refe.GetSource().GetOwner().CanSeeOrDetect(getOwner())) + HostileReference nextRef = refe.Next(); + if (!refe.GetSource().GetOwner().CanSeeOrDetect(GetOwner())) { - nextRef = refe.next(); - refe.removeReference(); + nextRef = refe.Next(); + refe.RemoveReference(); } refe = nextRef; } @@ -199,32 +199,32 @@ namespace Game.Combat { iThreat = threat; iTempThreatModifier = 0.0f; - link(refUnit, threatManager); + Link(refUnit, threatManager); iUnitGuid = refUnit.GetGUID(); iOnline = true; iAccessible = true; } - public override void targetObjectBuildLink() + public override void TargetObjectBuildLink() { - getTarget().AddHatedBy(this); + GetTarget().AddHatedBy(this); } - public override void targetObjectDestroyLink() + public override void TargetObjectDestroyLink() { - getTarget().RemoveHatedBy(this); + GetTarget().RemoveHatedBy(this); } - public override void sourceObjectDestroyLink() + public override void SourceObjectDestroyLink() { - setOnlineOfflineState(false); + SetOnlineOfflineState(false); } - void fireStatusChanged(ThreatRefStatusChangeEvent threatRefStatusChangeEvent) + void FireStatusChanged(ThreatRefStatusChangeEvent threatRefStatusChangeEvent) { if (GetSource() != null) - GetSource().processThreatEvent(threatRefStatusChangeEvent); + GetSource().ProcessThreatEvent(threatRefStatusChangeEvent); } - public void addThreat(float modThreat) + public void AddThreat(float modThreat) { if (modThreat == 0.0f) return; @@ -233,131 +233,131 @@ namespace Game.Combat // the threat is changed. Source and target unit have to be available // if the link was cut before relink it again - if (!isOnline()) - updateOnlineStatus(); + if (!IsOnline()) + UpdateOnlineStatus(); ThreatRefStatusChangeEvent Event = new ThreatRefStatusChangeEvent(UnitEventTypes.ThreatRefThreatChange, this, modThreat); - fireStatusChanged(Event); + FireStatusChanged(Event); - if (isValid() && modThreat > 0.0f) + if (IsValid() && modThreat > 0.0f) { - Unit victimOwner = getTarget().GetCharmerOrOwner(); + Unit victimOwner = GetTarget().GetCharmerOrOwner(); if (victimOwner != null && victimOwner.IsAlive()) - GetSource().addThreat(victimOwner, 0.0f); // create a threat to the owner of a pet, if the pet attacks + GetSource().AddThreat(victimOwner, 0.0f); // create a threat to the owner of a pet, if the pet attacks } } - public void addThreatPercent(int percent) + public void AddThreatPercent(int percent) { - addThreat(MathFunctions.CalculatePct(iThreat, percent)); + AddThreat(MathFunctions.CalculatePct(iThreat, percent)); } // check, if source can reach target and set the status - public void updateOnlineStatus() + public void UpdateOnlineStatus() { bool online = false; bool accessible = false; - if (!isValid()) + if (!IsValid()) { - Unit target = Global.ObjAccessor.GetUnit(getSourceUnit(), getUnitGuid()); + Unit target = Global.ObjAccessor.GetUnit(GetSourceUnit(), GetUnitGuid()); if (target != null) - link(target, GetSource()); + Link(target, GetSource()); } // only check for online status if // ref is valid // target is no player or not gamemaster // target is not in flight - if (isValid() - && (getTarget().IsTypeId(TypeId.Player) || !getTarget().ToPlayer().IsGameMaster()) - && !getTarget().HasUnitState(UnitState.InFlight) - && getTarget().IsInMap(getSourceUnit()) - && getTarget().IsInPhase(getSourceUnit()) + if (IsValid() + && (GetTarget().IsTypeId(TypeId.Player) || !GetTarget().ToPlayer().IsGameMaster()) + && !GetTarget().HasUnitState(UnitState.InFlight) + && GetTarget().IsInMap(GetSourceUnit()) + && GetTarget().IsInPhase(GetSourceUnit()) ) { - Creature creature = getSourceUnit().ToCreature(); - online = getTarget().IsInAccessiblePlaceFor(creature); + Creature creature = GetSourceUnit().ToCreature(); + online = GetTarget().IsInAccessiblePlaceFor(creature); if (!online) { - if (creature.IsWithinCombatRange(getTarget(), creature.m_CombatDistance)) + if (creature.IsWithinCombatRange(GetTarget(), creature.m_CombatDistance)) online = true; // not accessible but stays online } else accessible = true; } - setAccessibleState(accessible); - setOnlineOfflineState(online); + SetAccessibleState(accessible); + SetOnlineOfflineState(online); } - public void setOnlineOfflineState(bool isOnline) + public void SetOnlineOfflineState(bool isOnline) { if (iOnline != isOnline) { iOnline = isOnline; if (!iOnline) - setAccessibleState(false); // if not online that not accessable as well + SetAccessibleState(false); // if not online that not accessable as well ThreatRefStatusChangeEvent Event = new ThreatRefStatusChangeEvent(UnitEventTypes.ThreatRefOnlineStatus, this); - fireStatusChanged(Event); + FireStatusChanged(Event); } } - void setAccessibleState(bool isAccessible) + void SetAccessibleState(bool isAccessible) { if (iAccessible != isAccessible) { iAccessible = isAccessible; ThreatRefStatusChangeEvent Event = new ThreatRefStatusChangeEvent(UnitEventTypes.ThreatRefAccessibleStatus, this); - fireStatusChanged(Event); + FireStatusChanged(Event); } } // reference is not needed anymore. realy delete it ! - public void removeReference() + public void RemoveReference() { - invalidate(); + Invalidate(); ThreatRefStatusChangeEvent Event = new ThreatRefStatusChangeEvent(UnitEventTypes.ThreatRefRemoveFromList, this); - fireStatusChanged(Event); + FireStatusChanged(Event); } - Unit getSourceUnit() + Unit GetSourceUnit() { return GetSource().GetOwner(); } - public void setThreat(float threat) + public void SetThreat(float threat) { - addThreat(threat - iThreat); + AddThreat(threat - iThreat); } - public float getThreat() + public float GetThreat() { return iThreat + iTempThreatModifier; } - public bool isOnline() + public bool IsOnline() { return iOnline; } // The Unit might be in water and the creature can not enter the water, but has range attack // in this case online = true, but accessible = false - bool isAccessible() + bool IsAccessible() { return iAccessible; } // used for temporary setting a threat and reducing it later again. // the threat modification is stored - public void setTempThreat(float threat) + public void SetTempThreat(float threat) { - addTempThreat(threat - iTempThreatModifier); + AddTempThreat(threat - iTempThreatModifier); } - public void addTempThreat(float threat) + public void AddTempThreat(float threat) { if (threat == 0.0f) return; @@ -365,25 +365,25 @@ namespace Game.Combat iTempThreatModifier += threat; ThreatRefStatusChangeEvent Event = new ThreatRefStatusChangeEvent(UnitEventTypes.ThreatRefThreatChange, this, threat); - fireStatusChanged(Event); + FireStatusChanged(Event); } - public void resetTempThreat() + public void ResetTempThreat() { - addTempThreat(-iTempThreatModifier); + AddTempThreat(-iTempThreatModifier); } - public float getTempThreatModifier() + public float GetTempThreatModifier() { return iTempThreatModifier; } - public ObjectGuid getUnitGuid() + public ObjectGuid GetUnitGuid() { return iUnitGuid; } - public new HostileReference next() { return (HostileReference)base.next(); } + public new HostileReference Next() { return (HostileReference)base.Next(); } float iThreat; float iTempThreatModifier; // used for SPELL_AURA_MOD_TOTAL_THREAT diff --git a/Source/Game/Combat/ThreatManager.cs b/Source/Game/Combat/ThreatManager.cs index f749ed416..87e17ac5a 100644 --- a/Source/Game/Combat/ThreatManager.cs +++ b/Source/Game/Combat/ThreatManager.cs @@ -36,23 +36,23 @@ namespace Game.Combat const int ThreatUpdateInternal = 1 * Time.InMilliseconds; - public void clearReferences() + public void ClearReferences() { - threatContainer.clearReferences(); - threatOfflineContainer.clearReferences(); + threatContainer.ClearReferences(); + threatOfflineContainer.ClearReferences(); currentVictim = null; updateTimer = ThreatUpdateInternal; } - public void addThreat(Unit victim, float threat, SpellSchoolMask schoolMask = SpellSchoolMask.Normal, SpellInfo threatSpell = null) + public void AddThreat(Unit victim, float threat, SpellSchoolMask schoolMask = SpellSchoolMask.Normal, SpellInfo threatSpell = null) { - if (!isValidProcess(victim, Owner, threatSpell)) + if (!IsValidProcess(victim, Owner, threatSpell)) return; - doAddThreat(victim, calcThreat(victim, Owner, threat, schoolMask, threatSpell)); + DoAddThreat(victim, CalcThreat(victim, Owner, threat, schoolMask, threatSpell)); } - public void doAddThreat(Unit victim, float threat) + public void DoAddThreat(Unit victim, float threat) { uint redirectThreadPct = victim.GetRedirectThreatPercent(); Unit redirectTarget = victim.GetRedirectThreatTarget(); @@ -81,78 +81,78 @@ namespace Game.Combat { float redirectThreat = MathFunctions.CalculatePct(threat, redirectThreadPct); threat -= redirectThreat; - if (isValidProcess(redirectTarget, GetOwner())) - _addThreat(redirectTarget, redirectThreat); + if (IsValidProcess(redirectTarget, GetOwner())) + AddThreat(redirectTarget, redirectThreat); } } - _addThreat(victim, threat); + AddThreat(victim, threat); } - void _addThreat(Unit victim, float threat) + void AddThreat(Unit victim, float threat) { - var reff = threatContainer.addThreat(victim, threat); + var reff = threatContainer.AddThreat(victim, threat); // Ref is not in the online refs, search the offline refs next if (reff == null) - reff = threatOfflineContainer.addThreat(victim, threat); + reff = threatOfflineContainer.AddThreat(victim, threat); if (reff == null) // there was no ref => create a new one { - bool isFirst = threatContainer.empty(); + bool isFirst = threatContainer.Empty(); // threat has to be 0 here var hostileRef = new HostileReference(victim, this, 0); - threatContainer.addReference(hostileRef); - hostileRef.addThreat(threat); // now we add the real threat + threatContainer.AddReference(hostileRef); + hostileRef.AddThreat(threat); // now we add the real threat if (victim.IsTypeId(TypeId.Player) && victim.ToPlayer().IsGameMaster()) - hostileRef.setOnlineOfflineState(false); // GM is always offline + hostileRef.SetOnlineOfflineState(false); // GM is always offline else if (isFirst) - setCurrentVictim(hostileRef); + SetCurrentVictim(hostileRef); } } - public void modifyThreatPercent(Unit victim, int percent) + public void ModifyThreatPercent(Unit victim, int percent) { - threatContainer.modifyThreatPercent(victim, percent); + threatContainer.ModifyThreatPercent(victim, percent); } - public Unit getHostilTarget() + public Unit GetHostilTarget() { - threatContainer.update(); - HostileReference nextVictim = threatContainer.selectNextVictim(GetOwner().ToCreature(), getCurrentVictim()); - setCurrentVictim(nextVictim); - return getCurrentVictim() != null ? getCurrentVictim().getTarget() : null; + threatContainer.Update(); + HostileReference nextVictim = threatContainer.SelectNextVictim(GetOwner().ToCreature(), GetCurrentVictim()); + SetCurrentVictim(nextVictim); + return GetCurrentVictim() != null ? GetCurrentVictim().GetTarget() : null; } - public float getThreat(Unit victim, bool alsoSearchOfflineList = false) + public float GetThreat(Unit victim, bool alsoSearchOfflineList = false) { float threat = 0.0f; - HostileReference refe = threatContainer.getReferenceByTarget(victim); + HostileReference refe = threatContainer.GetReferenceByTarget(victim); if (refe == null && alsoSearchOfflineList) - refe = threatOfflineContainer.getReferenceByTarget(victim); + refe = threatOfflineContainer.GetReferenceByTarget(victim); if (refe != null) - threat = refe.getThreat(); + threat = refe.GetThreat(); return threat; } - void tauntApply(Unit taunter) + void TauntApply(Unit taunter) { - HostileReference refe = threatContainer.getReferenceByTarget(taunter); - if (getCurrentVictim() != null && refe != null && (refe.getThreat() < getCurrentVictim().getThreat())) + HostileReference refe = threatContainer.GetReferenceByTarget(taunter); + if (GetCurrentVictim() != null && refe != null && (refe.GetThreat() < GetCurrentVictim().GetThreat())) { - if (refe.getTempThreatModifier() == 0.0f) // Ok, temp threat is unused - refe.setTempThreat(getCurrentVictim().getThreat()); + if (refe.GetTempThreatModifier() == 0.0f) // Ok, temp threat is unused + refe.SetTempThreat(GetCurrentVictim().GetThreat()); } } - void tauntFadeOut(Unit taunter) + void TauntFadeOut(Unit taunter) { - HostileReference refe = threatContainer.getReferenceByTarget(taunter); + HostileReference refe = threatContainer.GetReferenceByTarget(taunter); if (refe != null) - refe.resetTempThreat(); + refe.ResetTempThreat(); } - public void setCurrentVictim(HostileReference pHostileReference) + public void SetCurrentVictim(HostileReference pHostileReference) { if (pHostileReference != null && pHostileReference != currentVictim) { @@ -161,58 +161,58 @@ namespace Game.Combat currentVictim = pHostileReference; } - public void processThreatEvent(ThreatRefStatusChangeEvent threatRefStatusChangeEvent) + public void ProcessThreatEvent(ThreatRefStatusChangeEvent threatRefStatusChangeEvent) { - threatRefStatusChangeEvent.setThreatManager(this); // now we can set the threat manager + threatRefStatusChangeEvent.SetThreatManager(this); // now we can set the threat manager - HostileReference hostilRef = threatRefStatusChangeEvent.getReference(); + HostileReference hostilRef = threatRefStatusChangeEvent.GetReference(); - switch (threatRefStatusChangeEvent.getType()) + switch (threatRefStatusChangeEvent.GetEventType()) { case UnitEventTypes.ThreatRefThreatChange: - if ((getCurrentVictim() == hostilRef && threatRefStatusChangeEvent.getFValue() < 0.0f) || - (getCurrentVictim() != hostilRef && threatRefStatusChangeEvent.getFValue() > 0.0f)) - setDirty(true); // the order in the threat list might have changed + if ((GetCurrentVictim() == hostilRef && threatRefStatusChangeEvent.GetFValue() < 0.0f) || + (GetCurrentVictim() != hostilRef && threatRefStatusChangeEvent.GetFValue() > 0.0f)) + SetDirty(true); // the order in the threat list might have changed break; case UnitEventTypes.ThreatRefOnlineStatus: - if (!hostilRef.isOnline()) + if (!hostilRef.IsOnline()) { - if (hostilRef == getCurrentVictim()) + if (hostilRef == GetCurrentVictim()) { - setCurrentVictim(null); - setDirty(true); + SetCurrentVictim(null); + SetDirty(true); } Owner.SendRemoveFromThreatList(hostilRef); - threatContainer.remove(hostilRef); - threatOfflineContainer.addReference(hostilRef); + threatContainer.Remove(hostilRef); + threatOfflineContainer.AddReference(hostilRef); } else { - if (getCurrentVictim() != null && hostilRef.getThreat() > (1.1f * getCurrentVictim().getThreat())) - setDirty(true); - threatContainer.addReference(hostilRef); - threatOfflineContainer.remove(hostilRef); + if (GetCurrentVictim() != null && hostilRef.GetThreat() > (1.1f * GetCurrentVictim().GetThreat())) + SetDirty(true); + threatContainer.AddReference(hostilRef); + threatOfflineContainer.Remove(hostilRef); } break; case UnitEventTypes.ThreatRefRemoveFromList: - if (hostilRef == getCurrentVictim()) + if (hostilRef == GetCurrentVictim()) { - setCurrentVictim(null); - setDirty(true); + SetCurrentVictim(null); + SetDirty(true); } Owner.SendRemoveFromThreatList(hostilRef); - if (hostilRef.isOnline()) - threatContainer.remove(hostilRef); + if (hostilRef.IsOnline()) + threatContainer.Remove(hostilRef); else - threatOfflineContainer.remove(hostilRef); + threatOfflineContainer.Remove(hostilRef); break; } } - public bool isNeedUpdateToClient(uint time) + public bool IsNeedUpdateToClient(uint time) { - if (isThreatListEmpty()) + if (IsThreatListEmpty()) return false; if (time >= updateTimer) @@ -225,27 +225,27 @@ namespace Game.Combat } // Reset all aggro without modifying the threatlist. - void resetAllAggro() + void ResetAllAggro() { var threatList = threatContainer.threatList; if (threatList.Empty()) return; foreach (var refe in threatList) - refe.setThreat(0); + refe.SetThreat(0); - setDirty(true); + SetDirty(true); } - public bool isThreatListEmpty() + public bool IsThreatListEmpty() { - return threatContainer.empty(); + return threatContainer.Empty(); } - public bool areThreatListsEmpty() + public bool IsThreatListsEmpty() { - return threatContainer.empty() && threatOfflineContainer.empty(); + return threatContainer.Empty() && threatOfflineContainer.Empty(); } - public HostileReference getCurrentVictim() + public HostileReference GetCurrentVictim() { return currentVictim; } @@ -255,17 +255,17 @@ namespace Game.Combat return Owner; } - void setDirty(bool isDirty) + void SetDirty(bool isDirty) { - threatContainer.setDirty(isDirty); + threatContainer.SetDirty(isDirty); } - public List getThreatList() { return threatContainer.getThreatList(); } - public List getOfflineThreatList() { return threatOfflineContainer.getThreatList(); } - public ThreatContainer getOnlineContainer() { return threatContainer; } + public List GetThreatList() { return threatContainer.GetThreatList(); } + public List GetOfflineThreatList() { return threatOfflineContainer.GetThreatList(); } + public ThreatContainer GetOnlineContainer() { return threatContainer; } // The hatingUnit is not used yet - public static float calcThreat(Unit hatedUnit, Unit hatingUnit, float threat, SpellSchoolMask schoolMask = SpellSchoolMask.Normal, SpellInfo threatSpell = null) + public static float CalcThreat(Unit hatedUnit, Unit hatingUnit, float threat, SpellSchoolMask schoolMask = SpellSchoolMask.Normal, SpellInfo threatSpell = null) { if (threatSpell != null) { @@ -287,7 +287,7 @@ namespace Game.Combat return hatedUnit.ApplyTotalThreatModifier(threat, schoolMask); } - public static bool isValidProcess(Unit hatedUnit, Unit hatingUnit, SpellInfo threatSpell = null) + public static bool IsValidProcess(Unit hatedUnit, Unit hatingUnit, SpellInfo threatSpell = null) { //function deals with adding threat and adding players and pets into ThreatList //mobs, NPCs, guards have ThreatList and HateOfflineList @@ -337,17 +337,17 @@ namespace Game.Combat iDirty = false; } - public void clearReferences() + public void ClearReferences() { foreach (var reff in threatList) { - reff.unlink(); + reff.Unlink(); } threatList.Clear(); } - public HostileReference getReferenceByTarget(Unit victim) + public HostileReference GetReferenceByTarget(Unit victim) { if (victim == null) return null; @@ -355,37 +355,37 @@ namespace Game.Combat ObjectGuid guid = victim.GetGUID(); foreach (var reff in threatList) { - if (reff != null && reff.getUnitGuid() == guid) + if (reff != null && reff.GetUnitGuid() == guid) return reff; } return null; } - public HostileReference addThreat(Unit victim, float threat) + public HostileReference AddThreat(Unit victim, float threat) { - var reff = getReferenceByTarget(victim); + var reff = GetReferenceByTarget(victim); if (reff != null) - reff.addThreat(threat); + reff.AddThreat(threat); return reff; } - public void modifyThreatPercent(Unit victim, int percent) + public void ModifyThreatPercent(Unit victim, int percent) { - HostileReference refe = getReferenceByTarget(victim); + HostileReference refe = GetReferenceByTarget(victim); if (refe != null) - refe.addThreatPercent(percent); + refe.AddThreatPercent(percent); } - public void update() + public void Update() { if (iDirty && threatList.Count > 1) - threatList = threatList.OrderByDescending(p => p.getThreat()).ToList(); + threatList = threatList.OrderByDescending(p => p.GetThreat()).ToList(); iDirty = false; } - public HostileReference selectNextVictim(Creature attacker, HostileReference currentVictim) + public HostileReference SelectNextVictim(Creature attacker, HostileReference currentVictim) { HostileReference currentRef = null; bool found = false; @@ -398,7 +398,7 @@ namespace Game.Combat currentRef = threatList[i]; - Unit target = currentRef.getTarget(); + Unit target = currentRef.GetTarget(); Cypher.Assert(target); // if the ref has status online the target must be there ! // some units are prefered in comparison to others @@ -425,17 +425,17 @@ namespace Game.Combat if (currentVictim != null) // select 1.3/1.1 better target in comparison current target { // list sorted and and we check current target, then this is best case - if (currentVictim == currentRef || currentRef.getThreat() <= 1.1f * currentVictim.getThreat()) + if (currentVictim == currentRef || currentRef.GetThreat() <= 1.1f * currentVictim.GetThreat()) { - if (currentVictim != currentRef && attacker.CanCreatureAttack(currentVictim.getTarget())) + if (currentVictim != currentRef && attacker.CanCreatureAttack(currentVictim.GetTarget())) currentRef = currentVictim; // for second case, if currentvictim is attackable found = true; break; } - if (currentRef.getThreat() > 1.3f * currentVictim.getThreat() || - (currentRef.getThreat() > 1.1f * currentVictim.getThreat() && + if (currentRef.GetThreat() > 1.3f * currentVictim.GetThreat() || + (currentRef.GetThreat() > 1.1f * currentVictim.GetThreat() && attacker.IsWithinMeleeRange(target))) { //implement 110% threat rule for targets in melee range found = true; //and 130% rule for targets in ranged distances @@ -455,35 +455,35 @@ namespace Game.Combat return currentRef; } - public void setDirty(bool isDirty) + public void SetDirty(bool isDirty) { iDirty = isDirty; } - bool isDirty() + bool IsDirty() { return iDirty; } - public bool empty() + public bool Empty() { return threatList.Empty(); } - public HostileReference getMostHated() + public HostileReference GetMostHated() { return threatList.Count == 0 ? null : threatList[0]; } - public void remove(HostileReference hostileRef) + public void Remove(HostileReference hostileRef) { threatList.Remove(hostileRef); } - public void addReference(HostileReference hostileRef) + public void AddReference(HostileReference hostileRef) { threatList.Add(hostileRef); } - public List getThreatList() { return threatList; } + public List GetThreatList() { return threatList; } public List threatList { get; set; } bool iDirty; diff --git a/Source/Game/Conditions/Condition.cs b/Source/Game/Conditions/Condition.cs index 15a349d55..c02fd2c91 100644 --- a/Source/Game/Conditions/Condition.cs +++ b/Source/Game/Conditions/Condition.cs @@ -267,7 +267,7 @@ namespace Game.Conditions condMeets = MathFunctions.CompareValues((ComparisionType)ConditionValue2, unit.GetHealthPct(), ConditionValue1); break; case ConditionTypes.WorldState: - condMeets = (ConditionValue2 == Global.WorldMgr.getWorldState((WorldStates)ConditionValue1)); + condMeets = (ConditionValue2 == Global.WorldMgr.GetWorldState((WorldStates)ConditionValue1)); break; case ConditionTypes.PhaseId: condMeets = obj.GetPhaseShift().HasPhase(ConditionValue1); @@ -493,7 +493,7 @@ namespace Game.Conditions return mask; } - public bool isLoaded() + public bool IsLoaded() { return ConditionType > ConditionTypes.None || ReferenceId != 0; } diff --git a/Source/Game/Conditions/ConditionManager.cs b/Source/Game/Conditions/ConditionManager.cs index b56833021..66d51bf1d 100644 --- a/Source/Game/Conditions/ConditionManager.cs +++ b/Source/Game/Conditions/ConditionManager.cs @@ -42,7 +42,7 @@ namespace Game foreach (var i in conditions) { // no point of having not loaded conditions in list - Cypher.Assert(i.isLoaded(), "ConditionMgr.GetSearcherTypeMaskForConditionList - not yet loaded condition found in list"); + Cypher.Assert(i.IsLoaded(), "ConditionMgr.GetSearcherTypeMaskForConditionList - not yet loaded condition found in list"); // group not filled yet, fill with widest mask possible if (!elseGroupSearcherTypeMasks.ContainsKey(i.ElseGroup)) elseGroupSearcherTypeMasks[i.ElseGroup] = GridMapTypeMask.All; @@ -79,7 +79,7 @@ namespace Game foreach (var condition in conditions) { Log.outDebug(LogFilter.Condition, "ConditionMgr.IsPlayerMeetToConditionList condType: {0} val1: {1}", condition.ConditionType, condition.ConditionValue1); - if (condition.isLoaded()) + if (condition.IsLoaded()) { //! Find ElseGroup in ElseGroupStore //! If not found, add an entry in the store and set to true (placeholder) @@ -371,7 +371,7 @@ namespace Game if (cond.SourceEntry != 0 && iSourceTypeOrReferenceId < 0) Log.outError(LogFilter.Sql, "Condition {0} {1} has useless data in SourceEntry ({2})!", rowType, iSourceTypeOrReferenceId, cond.SourceEntry); } - else if (!isConditionTypeValid(cond))//doesn't have reference, validate ConditionType + else if (!IsConditionTypeValid(cond))//doesn't have reference, validate ConditionType continue; if (iSourceTypeOrReferenceId < 0)//it is a reference template @@ -382,7 +382,7 @@ namespace Game }//end of reference templates //if not a reference and SourceType is invalid, skip - if (iConditionTypeOrReference >= 0 && !isSourceTypeValid(cond)) + if (iConditionTypeOrReference >= 0 && !IsSourceTypeValid(cond)) continue; //Grouping is only allowed for some types (loot templates, gossip menus, gossip items) @@ -416,46 +416,46 @@ namespace Game switch (cond.SourceType) { case ConditionSourceType.CreatureLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Creature.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Creature.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.DisenchantLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Disenchant.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Disenchant.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.FishingLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Fishing.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Fishing.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.GameobjectLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Gameobject.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Gameobject.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.ItemLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Items.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Items.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.MailLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Mail.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Mail.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.MillingLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Milling.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Milling.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.PickpocketingLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Pickpocketing.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Pickpocketing.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.ProspectingLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Prospecting.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Prospecting.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.ReferenceLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Reference.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Reference.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.SkinningLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Skinning.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Skinning.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.SpellLootTemplate: - valid = addToLootTemplate(cond, LootStorage.Spell.GetLootForConditionFill(cond.SourceGroup)); + valid = AddToLootTemplate(cond, LootStorage.Spell.GetLootForConditionFill(cond.SourceGroup)); break; case ConditionSourceType.GossipMenu: - valid = addToGossipMenus(cond); + valid = AddToGossipMenus(cond); break; case ConditionSourceType.GossipMenuOption: - valid = addToGossipMenuItems(cond); + valid = AddToGossipMenuItems(cond); break; case ConditionSourceType.SpellClickEvent: { @@ -468,7 +468,7 @@ namespace Game continue; // do not add to m_AllocatedMemory to avoid double deleting } case ConditionSourceType.SpellImplicitTarget: - valid = addToSpellImplicitTargetConditions(cond); + valid = AddToSpellImplicitTargetConditions(cond); break; case ConditionSourceType.VehicleSpell: { @@ -503,7 +503,7 @@ namespace Game continue; } case ConditionSourceType.Phase: - valid = addToPhases(cond); + valid = AddToPhases(cond); break; default: break; @@ -526,7 +526,7 @@ namespace Game Log.outInfo(LogFilter.ServerLoading, "Loaded {0} conditions in {1} ms", count, Time.GetMSTimeDiffToNow(oldMSTime)); } - bool addToLootTemplate(Condition cond, LootTemplate loot) + bool AddToLootTemplate(Condition cond, LootTemplate loot) { if (loot == null) { @@ -534,14 +534,14 @@ namespace Game return false; } - if (loot.addConditionItem(cond)) + if (loot.AddConditionItem(cond)) return true; Log.outError(LogFilter.Sql, "{0} Item {1} not found in LootTemplate {2}.", cond.ToString(), cond.SourceEntry, cond.SourceGroup); return false; } - bool addToGossipMenus(Condition cond) + bool AddToGossipMenus(Condition cond) { var pMenuBounds = Global.ObjectMgr.GetGossipMenusMapBounds(cond.SourceGroup); @@ -558,7 +558,7 @@ namespace Game return false; } - bool addToGossipMenuItems(Condition cond) + bool AddToGossipMenuItems(Condition cond) { var pMenuItemBounds = Global.ObjectMgr.GetGossipMenuItemsMapBounds(cond.SourceGroup); foreach (var menuItems in pMenuItemBounds) @@ -574,7 +574,7 @@ namespace Game return false; } - bool addToSpellImplicitTargetConditions(Condition cond) + bool AddToSpellImplicitTargetConditions(Condition cond) { uint conditionEffMask = cond.SourceGroup; SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo((uint)cond.SourceEntry); @@ -674,7 +674,7 @@ namespace Game return true; } - bool addToPhases(Condition cond) + bool AddToPhases(Condition cond) { if (cond.SourceEntry == 0) { @@ -719,7 +719,7 @@ namespace Game return false; } - bool isSourceTypeValid(Condition cond) + bool IsSourceTypeValid(Condition cond) { switch (cond.SourceType) { @@ -733,7 +733,7 @@ namespace Game LootTemplate loot = LootStorage.Creature.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -750,7 +750,7 @@ namespace Game LootTemplate loot = LootStorage.Disenchant.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -767,7 +767,7 @@ namespace Game LootTemplate loot = LootStorage.Fishing.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -784,7 +784,7 @@ namespace Game LootTemplate loot = LootStorage.Gameobject.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -801,7 +801,7 @@ namespace Game LootTemplate loot = LootStorage.Items.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -818,7 +818,7 @@ namespace Game LootTemplate loot = LootStorage.Mail.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -835,7 +835,7 @@ namespace Game LootTemplate loot = LootStorage.Milling.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -852,7 +852,7 @@ namespace Game LootTemplate loot = LootStorage.Pickpocketing.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -869,7 +869,7 @@ namespace Game LootTemplate loot = LootStorage.Prospecting.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -886,7 +886,7 @@ namespace Game LootTemplate loot = LootStorage.Reference.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -903,7 +903,7 @@ namespace Game LootTemplate loot = LootStorage.Skinning.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -920,7 +920,7 @@ namespace Game LootTemplate loot = LootStorage.Spell.GetLootForConditionFill(cond.SourceGroup); ItemTemplate pItemProto = Global.ObjectMgr.GetItemTemplate((uint)cond.SourceEntry); - if (pItemProto == null && !loot.isReference((uint)cond.SourceEntry)) + if (pItemProto == null && !loot.IsReference((uint)cond.SourceEntry)) { Log.outError(LogFilter.Sql, "{0} SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond.ToString()); return false; @@ -1087,7 +1087,7 @@ namespace Game return true; } - bool isConditionTypeValid(Condition cond) + bool IsConditionTypeValid(Condition cond) { switch (cond.ConditionType) { @@ -1212,7 +1212,7 @@ namespace Game case ConditionTypes.ActiveEvent: { var events = Global.GameEventMgr.GetEventMap(); - if (cond.ConditionValue1 >= events.Length || !events[cond.ConditionValue1].isValid()) + if (cond.ConditionValue1 >= events.Length || !events[cond.ConditionValue1].IsValid()) { Log.outError(LogFilter.Sql, "{0} has non existing event id ({1}), skipped.", cond.ToString(true), cond.ConditionValue1); return false; @@ -1467,7 +1467,7 @@ namespace Game } case ConditionTypes.WorldState: { - if (Global.WorldMgr.getWorldState((WorldStates)cond.ConditionValue1) == 0) + if (Global.WorldMgr.GetWorldState((WorldStates)cond.ConditionValue1) == 0) { Log.outError(LogFilter.Sql, "{0} has non existing world state in value1 ({1}), skipped.", cond.ToString(true), cond.ConditionValue1); return false; @@ -1820,15 +1820,15 @@ namespace Game return false; break; case 3: - if (!group || group.isRaidGroup()) + if (!group || group.IsRaidGroup()) return false; break; case 4: - if (!group || !group.isRaidGroup()) + if (!group || !group.IsRaidGroup()) return false; break; case 5: - if (group && group.isRaidGroup()) + if (group && group.IsRaidGroup()) return false; break; default: @@ -2100,7 +2100,7 @@ namespace Game case WorldStateExpressionValueType.WorldState: { uint worldStateId = buffer.ReadUInt32(); - value = (int)Global.WorldMgr.getWorldState(worldStateId); + value = (int)Global.WorldMgr.GetWorldState(worldStateId); break; } case WorldStateExpressionValueType.Function: diff --git a/Source/Game/DataStorage/M2Storage.cs b/Source/Game/DataStorage/M2Storage.cs index 94442799b..755bb5b16 100644 --- a/Source/Game/DataStorage/M2Storage.cs +++ b/Source/Game/DataStorage/M2Storage.cs @@ -25,7 +25,7 @@ namespace Game.DataStorage public class M2Storage { // Convert the geomoetry from a spline value, to an actual WoW XYZ - static Vector3 translateLocation(Vector4 dbcLocation, Vector3 basePosition, Vector3 splineVector) + static Vector3 TranslateLocation(Vector4 dbcLocation, Vector3 basePosition, Vector3 splineVector) { Vector3 work = new Vector3(); float x = basePosition.X + splineVector.X; @@ -44,7 +44,7 @@ namespace Game.DataStorage } // Number of cameras not used. Multiple cameras never used in 7.1.5 - static void readCamera(M2Camera cam, BinaryReader reader, CinematicCameraRecord dbcentry) + static void ReadCamera(M2Camera cam, BinaryReader reader, CinematicCameraRecord dbcentry) { List cameras = new List(); List targetcam = new List(); @@ -73,7 +73,7 @@ namespace Game.DataStorage for (uint i = 0; i < targTsArray.number; ++i) { // Translate co-ordinates - Vector3 newPos = translateLocation(dbcData, cam.target_position_base, targPositions[i].p0); + Vector3 newPos = TranslateLocation(dbcData, cam.target_position_base, targPositions[i].p0); // Add to vector FlyByCamera thisCam = new FlyByCamera(); @@ -105,7 +105,7 @@ namespace Game.DataStorage for (uint i = 0; i < posTsArray.number; ++i) { // Translate co-ordinates - Vector3 newPos = translateLocation(dbcData, cam.position_base, positions[i].p0); + Vector3 newPos = TranslateLocation(dbcData, cam.position_base, positions[i].p0); // Add to vector FlyByCamera thisCam = new FlyByCamera(); @@ -189,7 +189,7 @@ namespace Game.DataStorage M2Camera cam = m2file.Read(); m2file.BaseStream.Position = 8; - readCamera(cam, new BinaryReader(new MemoryStream(m2file.ReadBytes((int)m2file.BaseStream.Length - 8))), cameraEntry); + ReadCamera(cam, new BinaryReader(new MemoryStream(m2file.ReadBytes((int)m2file.BaseStream.Length - 8))), cameraEntry); } } catch (EndOfStreamException) diff --git a/Source/Game/DungeonFinding/LFGManager.cs b/Source/Game/DungeonFinding/LFGManager.cs index 9b010177f..455d20b35 100644 --- a/Source/Game/DungeonFinding/LFGManager.cs +++ b/Source/Game/DungeonFinding/LFGManager.cs @@ -252,7 +252,7 @@ namespace Game.DungeonFinding public void Update(uint diff) { - if (!isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) + if (!IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) return; long currTime = Time.UnixTime; @@ -363,7 +363,7 @@ namespace Game.DungeonFinding LfgJoinResultData joinData = new LfgJoinResultData(); List players = new List(); uint rDungeonId = 0; - bool isContinue = grp && grp.isLFGGroup() && GetState(gguid) != LfgState.FinishedDungeon; + bool isContinue = grp && grp.IsLFGGroup() && GetState(gguid) != LfgState.FinishedDungeon; // Do not allow to change dungeon in the middle of a current dungeon if (isContinue) @@ -400,7 +400,7 @@ namespace Game.DungeonFinding else { byte memberCount = 0; - for (GroupReference refe = grp.GetFirstMember(); refe != null && joinData.result == LfgJoinResult.Ok; refe = refe.next()) + for (GroupReference refe = grp.GetFirstMember(); refe != null && joinData.result == LfgJoinResult.Ok; refe = refe.Next()) { Player plrg = refe.GetSource(); if (plrg) @@ -524,7 +524,7 @@ namespace Game.DungeonFinding SetState(gguid, LfgState.Rolecheck); // Send update to player LfgUpdateData updateData = new LfgUpdateData(LfgUpdateType.JoinQueue, dungeons); - for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.Next()) { Player plrg = refe.GetSource(); if (plrg) @@ -1201,7 +1201,7 @@ namespace Game.DungeonFinding LFGDungeonData dungeon = null; Group group = player.GetGroup(); - if (group && group.isLFGGroup()) + if (group && group.IsLFGGroup()) dungeon = GetLFGDungeon(GetDungeon(group.GetGUID())); if (dungeon == null) @@ -1244,7 +1244,7 @@ namespace Game.DungeonFinding if (!fromOpcode) { // Select a player inside to be teleported to - for (GroupReference refe = group.GetFirstMember(); refe != null && mapid == 0; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null && mapid == 0; refe = refe.Next()) { Player plrg = refe.GetSource(); if (plrg && plrg != player && plrg.GetMapId() == dungeon.map) @@ -1855,7 +1855,7 @@ namespace Game.DungeonFinding QueuesStore.Clear(); } - public bool isOptionEnabled(LfgOptions option) + public bool IsOptionEnabled(LfgOptions option) { return m_options.HasAnyFlag(option); } @@ -1924,7 +1924,7 @@ namespace Game.DungeonFinding AddPlayerToGroup(gguid, guid); } - public bool selectedRandomLfgDungeon(ObjectGuid guid) + public bool SelectedRandomLfgDungeon(ObjectGuid guid) { if (GetState(guid) != LfgState.None) { @@ -1940,7 +1940,7 @@ namespace Game.DungeonFinding return false; } - public bool inLfgDungeonMap(ObjectGuid guid, uint map, Difficulty difficulty) + public bool InLfgDungeonMap(ObjectGuid guid, uint map, Difficulty difficulty) { if (!guid.IsParty()) guid = GetGroup(guid); diff --git a/Source/Game/DungeonFinding/LFGScripts.cs b/Source/Game/DungeonFinding/LFGScripts.cs index 9afdc42cb..450db4bc3 100644 --- a/Source/Game/DungeonFinding/LFGScripts.cs +++ b/Source/Game/DungeonFinding/LFGScripts.cs @@ -30,7 +30,7 @@ namespace Game.DungeonFinding // Player Hooks public override void OnLogout(Player player) { - if (!Global.LFGMgr.isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) + if (!Global.LFGMgr.IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) return; if (!player.GetGroup()) @@ -41,7 +41,7 @@ namespace Game.DungeonFinding public override void OnLogin(Player player) { - if (!Global.LFGMgr.isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) + if (!Global.LFGMgr.IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) return; // Temporal: Trying to determine when group data and LFG data gets desynched @@ -67,7 +67,7 @@ namespace Game.DungeonFinding { Map map = player.GetMap(); - if (Global.LFGMgr.inLfgDungeonMap(player.GetGUID(), map.GetId(), map.GetDifficultyID())) + if (Global.LFGMgr.InLfgDungeonMap(player.GetGUID(), map.GetId(), map.GetDifficultyID())) { Group group = player.GetGroup(); // This function is also called when players log in @@ -84,14 +84,14 @@ namespace Game.DungeonFinding return; } - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (member) player.GetSession().SendNameQuery(member.GetGUID()); } - if (Global.LFGMgr.selectedRandomLfgDungeon(player.GetGUID())) + if (Global.LFGMgr.SelectedRandomLfgDungeon(player.GetGUID())) player.CastSpell(player, SharedConst.LFGSpellLuckOfTheDraw, true); } else @@ -117,7 +117,7 @@ namespace Game.DungeonFinding // Group Hooks public override void OnAddMember(Group group, ObjectGuid guid) { - if (!Global.LFGMgr.isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) + if (!Global.LFGMgr.IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) return; ObjectGuid gguid = group.GetGUID(); @@ -147,13 +147,13 @@ namespace Game.DungeonFinding public override void OnRemoveMember(Group group, ObjectGuid guid, RemoveMethod method, ObjectGuid kicker, string reason) { - if (!Global.LFGMgr.isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) + if (!Global.LFGMgr.IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) return; ObjectGuid gguid = group.GetGUID(); Log.outDebug(LogFilter.Lfg, "LFGScripts.OnRemoveMember [{0}]: remove [{1}] Method: {2} Kicker: {3} Reason: {4}", gguid, guid, method, kicker, reason); - bool isLFG = group.isLFGGroup(); + bool isLFG = group.IsLFGGroup(); if (isLFG && method == RemoveMethod.Kick) // Player have been kicked { @@ -204,7 +204,7 @@ namespace Game.DungeonFinding public override void OnDisband(Group group) { - if (!Global.LFGMgr.isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) + if (!Global.LFGMgr.IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) return; ObjectGuid gguid = group.GetGUID(); @@ -215,7 +215,7 @@ namespace Game.DungeonFinding public override void OnChangeLeader(Group group, ObjectGuid newLeaderGuid, ObjectGuid oldLeaderGuid) { - if (!Global.LFGMgr.isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) + if (!Global.LFGMgr.IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) return; ObjectGuid gguid = group.GetGUID(); @@ -226,7 +226,7 @@ namespace Game.DungeonFinding public override void OnInviteMember(Group group, ObjectGuid guid) { - if (!Global.LFGMgr.isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) + if (!Global.LFGMgr.IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser)) return; ObjectGuid gguid = group.GetGUID(); diff --git a/Source/Game/Entities/AreaTrigger/AreaTrigger.cs b/Source/Game/Entities/AreaTrigger/AreaTrigger.cs index be130c6b6..51508eb09 100644 --- a/Source/Game/Entities/AreaTrigger/AreaTrigger.cs +++ b/Source/Game/Entities/AreaTrigger/AreaTrigger.cs @@ -632,8 +632,8 @@ namespace Game.Entities _movementTime = 0; - _spline.Init_Spline(splinePoints.ToArray(), splinePoints.Count, Spline.EvaluationMode.Linear); - _spline.initLengths(); + _spline.InitSpline(splinePoints.ToArray(), splinePoints.Count, Spline.EvaluationMode.Linear); + _spline.InitLengths(); // should be sent in object create packets only SetUpdateFieldValue(m_values.ModifyValue(m_areaTriggerData).ModifyValue(m_areaTriggerData.TimeToTarget), timeToTarget); @@ -771,9 +771,9 @@ namespace Game.Entities if (_movementTime >= GetTimeToTarget()) { _reachedDestination = true; - _lastSplineIndex = _spline.last(); + _lastSplineIndex = _spline.Last(); - Vector3 lastSplinePosition = _spline.getPoint(_lastSplineIndex); + Vector3 lastSplinePosition = _spline.GetPoint(_lastSplineIndex); GetMap().AreaTriggerRelocation(this, lastSplinePosition.X, lastSplinePosition.Y, lastSplinePosition.Z, GetOrientation()); DebugVisualizePosition(); @@ -802,7 +802,7 @@ namespace Game.Entities int lastPositionIndex = 0; float percentFromLastPoint = 0; - _spline.computeIndex(currentTimePercent, ref lastPositionIndex, ref percentFromLastPoint); + _spline.ComputeIndex(currentTimePercent, ref lastPositionIndex, ref percentFromLastPoint); Vector3 currentPosition; _spline.Evaluate_Percent(lastPositionIndex, percentFromLastPoint, out currentPosition); @@ -810,7 +810,7 @@ namespace Game.Entities float orientation = GetOrientation(); if (GetTemplate().HasFlag(AreaTriggerFlags.HasFaceMovementDir)) { - Vector3 nextPoint = _spline.getPoint(lastPositionIndex + 1); + Vector3 nextPoint = _spline.GetPoint(lastPositionIndex + 1); orientation = GetAngle(nextPoint.X, nextPoint.Y); } @@ -911,7 +911,7 @@ namespace Game.Entities public Vector3 GetRollPitchYaw() { return _rollPitchYaw; } public Vector3 GetTargetRollPitchYaw() { return _targetRollPitchYaw; } - public bool HasSplines() { return !_spline.empty(); } + public bool HasSplines() { return !_spline.Empty(); } public Spline GetSpline() { return _spline; } public uint GetElapsedTimeForMovement() { return GetTimeSinceCreated(); } // @todo: research the right value, in sniffs both timers are nearly identical diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index aea54bee6..023a7f649 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -127,7 +127,7 @@ namespace Game.Entities SetDeathState(DeathState.Dead); RemoveAllAuras(); DestroyForNearbyPlayers(); // old UpdateObjectVisibility() - loot.clear(); + loot.Clear(); uint respawnDelay = m_respawnDelay; if (IsAIEnabled) GetAI().CorpseRemoved(respawnDelay); @@ -1625,7 +1625,7 @@ namespace Game.Entities Log.outDebug(LogFilter.Unit, "Respawning creature {0} ({1})", GetName(), GetGUID().ToString()); m_respawnTime = 0; ResetPickPocketRefillTimer(); - loot.clear(); + loot.Clear(); if (m_originalEntry != GetEntry()) UpdateEntry(m_originalEntry); @@ -3110,9 +3110,9 @@ namespace Game.Entities if (CanHaveThreatList()) { - if (target == null && !GetThreatManager().isThreatListEmpty()) + if (target == null && !GetThreatManager().IsThreatListEmpty()) // No taunt aura or taunt aura caster is dead standard target selection - target = GetThreatManager().getHostilTarget(); + target = GetThreatManager().GetHostilTarget(); } else if (!HasReactState(ReactStates.Passive)) { diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index e68b7d177..fe996cbc7 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -267,7 +267,7 @@ namespace Game.Entities SetDisplayId(goInfo.displayId); m_model = CreateModel(); - if (m_model != null && m_model.isMapObject()) + if (m_model != null && m_model.IsMapObject()) AddFlag(GameObjectFlags.MapObject); // GAMEOBJECT_BYTES_1, index at 0, 1, 2 and 3 @@ -759,7 +759,7 @@ namespace Game.Entities return; } - loot.clear(); + loot.Clear(); //! If this is summoned by a spell with ie. SPELL_EFFECT_SUMMON_OBJECT_WILD, with or without owner, we check respawn criteria based on spell //! The GetOwnerGUID() check is mostly for compatibility with hacky scripts - 99% of the time summoning should be done trough spells. @@ -849,7 +849,7 @@ namespace Game.Entities public void GetFishLoot(Loot fishloot, Player loot_owner) { - fishloot.clear(); + fishloot.Clear(); uint zone, subzone; uint defaultzone = 1; @@ -857,19 +857,19 @@ namespace Game.Entities // if subzone loot exist use it fishloot.FillLoot(subzone, LootStorage.Fishing, loot_owner, true, true); - if (fishloot.empty()) + if (fishloot.Empty()) { //subzone no result,use zone loot fishloot.FillLoot(zone, LootStorage.Fishing, loot_owner, true); //use zone 1 as default, somewhere fishing got nothing,becase subzone and zone not set, like Off the coast of Storm Peaks. - if (fishloot.empty()) + if (fishloot.Empty()) fishloot.FillLoot(defaultzone, LootStorage.Fishing, loot_owner, true, true); } } public void GetFishLootJunk(Loot fishloot, Player loot_owner) { - fishloot.clear(); + fishloot.Clear(); uint zone, subzone; uint defaultzone = 1; @@ -877,11 +877,11 @@ namespace Game.Entities // if subzone loot exist use it fishloot.FillLoot(subzone, LootStorage.Fishing, loot_owner, true, true, LootModes.JunkFish); - if (fishloot.empty()) //use this becase if zone or subzone has normal mask drop, then fishloot.FillLoot return true. + if (fishloot.Empty()) //use this becase if zone or subzone has normal mask drop, then fishloot.FillLoot return true. { //use zone loot fishloot.FillLoot(zone, LootStorage.Fishing, loot_owner, true, true, LootModes.JunkFish); - if (fishloot.empty()) + if (fishloot.Empty()) //use zone 1 as default fishloot.FillLoot(defaultzone, LootStorage.Fishing, loot_owner, true, true, LootModes.JunkFish); } @@ -1479,7 +1479,7 @@ namespace Game.Entities Group group = player.GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (member) @@ -2376,7 +2376,7 @@ namespace Game.Entities if (m_model == null) return; - m_model.enableCollision(enable); + m_model.EnableCollision(enable); } void UpdateModel() @@ -2392,7 +2392,7 @@ namespace Game.Entities if (m_model != null) GetMap().InsertGameObjectModel(m_model); - if (m_model != null && m_model.isMapObject()) + if (m_model != null && m_model.IsMapObject()) AddFlag(GameObjectFlags.MapObject); else RemoveFlag(GameObjectFlags.MapObject); diff --git a/Source/Game/Entities/Item/Item.cs b/Source/Game/Entities/Item/Item.cs index 2bb46193e..557818a97 100644 --- a/Source/Game/Entities/Item/Item.cs +++ b/Source/Game/Entities/Item/Item.cs @@ -355,7 +355,7 @@ namespace Game.Entities } // Delete the items if this is a container - if (!loot.isLooted()) + if (!loot.IsLooted()) ItemContainerDeleteLootMoneyAndLootItemsFromDB(); Dispose(); @@ -642,7 +642,7 @@ namespace Game.Entities DeleteFromDB(trans, GetGUID().GetCounter()); // Delete the items if this is a container - if (!loot.isLooted()) + if (!loot.IsLooted()) ItemContainerDeleteLootMoneyAndLootItemsFromDB(); } @@ -1707,7 +1707,7 @@ namespace Game.Entities public void ItemContainerSaveLootToDB() { // Saves the money and item loot associated with an openable item to the DB - if (loot.isLooted()) // no money and no loot + if (loot.IsLooted()) // no money and no loot return; SQLTransaction trans = new SQLTransaction(); @@ -1728,7 +1728,7 @@ namespace Game.Entities } // Save items - if (!loot.isLooted()) + if (!loot.IsLooted()) { PreparedStatement stmt_items = DB.Characters.GetPreparedStatement(CharStatements.DEL_ITEMCONTAINER_ITEMS); stmt_items.AddValue(0, loot.containerID.GetCounter()); @@ -1849,7 +1849,7 @@ namespace Game.Entities } // Mark the item if it has loot so it won't be generated again on open - m_lootGenerated = !loot.isLooted(); + m_lootGenerated = !loot.IsLooted(); return m_lootGenerated; } diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 4122b7810..a87e33cc8 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -1909,7 +1909,7 @@ namespace Game.Entities else GetHitSpherePointFor(new Position(ox, oy, oz), out x, out y, out z); - return GetMap().isInLineOfSight(GetPhaseShift(), x, y, z + 2.0f, ox, oy, oz + 2.0f, ignoreFlags); + return GetMap().IsInLineOfSight(GetPhaseShift(), x, y, z + 2.0f, ox, oy, oz + 2.0f, ignoreFlags); } return true; @@ -2248,7 +2248,7 @@ namespace Game.Entities return z; } LiquidData liquid_status; - ZLiquidStatus res = obj.GetMap().getLiquidStatus(obj.GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out liquid_status); + ZLiquidStatus res = obj.GetMap().GetLiquidStatus(obj.GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out liquid_status); if (res != 0 && liquid_status.level > helper) // water must be above ground { if (liquid_status.level > z) // z is underwater @@ -2274,7 +2274,7 @@ namespace Game.Entities } float destz = NormalizeZforCollision(this, destx, desty, pos.GetPositionZ()); - bool col = Global.VMapMgr.getObjectHitPos(PhasingHandler.GetTerrainMapId(GetPhaseShift(), GetMap(), pos.posX, pos.posY), pos.posX, pos.posY, pos.posZ + 0.5f, destx, desty, destz + 0.5f, out destx, out desty, out destz, -0.5f); + bool col = Global.VMapMgr.GetObjectHitPos(PhasingHandler.GetTerrainMapId(GetPhaseShift(), GetMap(), pos.posX, pos.posY), pos.posX, pos.posY, pos.posZ + 0.5f, destx, desty, destz + 0.5f, out destx, out desty, out destz, -0.5f); // collision occured if (col) @@ -2286,7 +2286,7 @@ namespace Game.Entities } // check dynamic collision - col = GetMap().getObjectHitPos(GetPhaseShift(), pos.posX, pos.posY, pos.posZ + 0.5f, destx, desty, destz + 0.5f, out destx, out desty, out destz, -0.5f); + col = GetMap().GetObjectHitPos(GetPhaseShift(), pos.posX, pos.posY, pos.posZ + 0.5f, destx, desty, destz + 0.5f, out destx, out desty, out destz, -0.5f); // Collided with a gameobject if (col) diff --git a/Source/Game/Entities/Player/KillRewarder.cs b/Source/Game/Entities/Player/KillRewarder.cs index c157510fe..eba0e9db2 100644 --- a/Source/Game/Entities/Player/KillRewarder.cs +++ b/Source/Game/Entities/Player/KillRewarder.cs @@ -112,7 +112,7 @@ namespace Game.Entities if (_group) { // 2. In case when player is in group, initialize variables necessary for group calculations: - for (GroupReference refe = _group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = _group.GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (member) @@ -258,11 +258,11 @@ namespace Game.Entities if (!_isBattleground) { // 3.1.2. Alter group rate if group is in raid (not for Battlegrounds). - bool isRaid = !_isPvP && CliDB.MapStorage.LookupByKey(_killer.GetMapId()).IsRaid() && _group.isRaidGroup(); + bool isRaid = !_isPvP && CliDB.MapStorage.LookupByKey(_killer.GetMapId()).IsRaid() && _group.IsRaidGroup(); _groupRate = Formulas.XPInGroupRate(_count, isRaid); } // 3.1.3. Reward each group member (even dead or corpse) within reward distance. - for (GroupReference refe = _group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = _group.GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (member) diff --git a/Source/Game/Entities/Player/Player.Combat.cs b/Source/Game/Entities/Player/Player.Combat.cs index 5258241ca..315f7797b 100644 --- a/Source/Game/Entities/Player/Player.Combat.cs +++ b/Source/Game/Entities/Player/Player.Combat.cs @@ -58,7 +58,7 @@ namespace Game.Entities Group group = GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (!player) diff --git a/Source/Game/Entities/Player/Player.DB.cs b/Source/Game/Entities/Player/Player.DB.cs index 061bebd10..f3af5292a 100644 --- a/Source/Game/Entities/Player/Player.DB.cs +++ b/Source/Game/Entities/Player/Player.DB.cs @@ -3431,7 +3431,7 @@ namespace Game.Entities // check if stats should only be saved on logout // save stats can be out of transaction - if (GetSession().isLogingOut() || !WorldConfig.GetBoolValue(WorldCfg.StatsSaveOnlyOnLogout)) + if (GetSession().IsLogingOut() || !WorldConfig.GetBoolValue(WorldCfg.StatsSaveOnlyOnLogout)) _SaveStats(trans); DB.Characters.CommitTransaction(trans); diff --git a/Source/Game/Entities/Player/Player.Groups.cs b/Source/Game/Entities/Player/Player.Groups.cs index 499436d9c..e7f098e6c 100644 --- a/Source/Game/Entities/Player/Player.Groups.cs +++ b/Source/Game/Entities/Player/Player.Groups.cs @@ -32,7 +32,7 @@ namespace Game.Entities List nearMembers = new List(); - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player Target = refe.GetSource(); @@ -55,7 +55,7 @@ namespace Game.Entities if (!grp) return PartyResult.NotInGroup; - if (grp.isLFGGroup()) + if (grp.IsLFGGroup()) { ObjectGuid gguid = grp.GetGUID(); if (Global.LFGMgr.GetKicksLeft(gguid) == 0) @@ -71,11 +71,11 @@ namespace Game.Entities if (state == LfgState.FinishedDungeon) return PartyResult.PartyLfgBootDungeonComplete; - if (grp.isRollLootActive()) + if (grp.IsRollLootActive()) return PartyResult.PartyLfgBootLootRolls; // @todo Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer. - for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.Next()) if (refe.GetSource() && refe.GetSource().IsInMap(this) && refe.GetSource().IsInCombat()) return PartyResult.PartyLfgBootInCombat; @@ -106,10 +106,10 @@ namespace Game.Entities bool InRandomLfgDungeon() { - if (Global.LFGMgr.selectedRandomLfgDungeon(GetGUID())) + if (Global.LFGMgr.SelectedRandomLfgDungeon(GetGUID())) { Map map = GetMap(); - return Global.LFGMgr.inLfgDungeonMap(GetGUID(), map.GetId(), map.GetDifficultyID()); + return Global.LFGMgr.InLfgDungeonMap(GetGUID(), map.GetId(), map.GetDifficultyID()); } return false; @@ -120,20 +120,20 @@ namespace Game.Entities //we must move references from m_group to m_originalGroup SetOriginalGroup(GetGroup(), GetSubGroup()); - m_group.unlink(); - m_group.link(group, this); - m_group.setSubGroup(subgroup); + m_group.Unlink(); + m_group.Link(group, this); + m_group.SetSubGroup(subgroup); } public void RemoveFromBattlegroundOrBattlefieldRaid() { //remove existing reference - m_group.unlink(); + m_group.Unlink(); Group group = GetOriginalGroup(); if (group) { - m_group.link(group, this); - m_group.setSubGroup(GetOriginalSubGroup()); + m_group.Link(group, this); + m_group.SetSubGroup(GetOriginalSubGroup()); } SetOriginalGroup(null); } @@ -141,22 +141,22 @@ namespace Game.Entities public void SetOriginalGroup(Group group, byte subgroup = 0) { if (!group) - m_originalGroup.unlink(); + m_originalGroup.Unlink(); else { - m_originalGroup.link(group, this); - m_originalGroup.setSubGroup(subgroup); + m_originalGroup.Link(group, this); + m_originalGroup.SetSubGroup(subgroup); } } public void SetGroup(Group group, byte subgroup = 0) { if (!group) - m_group.unlink(); + m_group.Unlink(); else { - m_group.link(group, this); - m_group.setSubGroup(subgroup); + m_group.Link(group, this); + m_group.SetSubGroup(subgroup); } UpdateObjectVisibility(false); @@ -206,16 +206,16 @@ namespace Game.Entities public Group GetGroupInvite() { return m_groupInvite; } public void SetGroupInvite(Group group) { m_groupInvite = group; } - public Group GetGroup() { return m_group.getTarget(); } + public Group GetGroup() { return m_group.GetTarget(); } public GroupReference GetGroupRef() { return m_group; } - public byte GetSubGroup() { return m_group.getSubGroup(); } + public byte GetSubGroup() { return m_group.GetSubGroup(); } public GroupUpdateFlags GetGroupUpdateFlag() { return m_groupUpdateMask; } public void SetGroupUpdateFlag(GroupUpdateFlags flag) { m_groupUpdateMask |= flag; } public void RemoveGroupUpdateFlag(GroupUpdateFlags flag) { m_groupUpdateMask &= ~flag; } - public Group GetOriginalGroup() { return m_originalGroup.getTarget(); } + public Group GetOriginalGroup() { return m_originalGroup.GetTarget(); } public GroupReference GetOriginalGroupRef() { return m_originalGroup; } - public byte GetOriginalSubGroup() { return m_originalGroup.getSubGroup(); } + public byte GetOriginalSubGroup() { return m_originalGroup.GetSubGroup(); } public void SetPassOnGroupLoot(bool bPassOnGroupLoot) { m_bPassOnGroupLoot = bPassOnGroupLoot; } public bool GetPassOnGroupLoot() { return m_bPassOnGroupLoot; } diff --git a/Source/Game/Entities/Player/Player.Items.cs b/Source/Game/Entities/Player/Player.Items.cs index b4fa96fd6..22f82e3d9 100644 --- a/Source/Game/Entities/Player/Player.Items.cs +++ b/Source/Game/Entities/Player/Player.Items.cs @@ -3309,12 +3309,12 @@ namespace Game.Entities public InventoryResult CanRollForItemInLFG(ItemTemplate proto, WorldObject lootedObject) { - if (!GetGroup() || !GetGroup().isLFGGroup()) + if (!GetGroup() || !GetGroup().IsLFGGroup()) return InventoryResult.Ok; // not in LFG group // check if looted object is inside the lfg dungeon Map map = lootedObject.GetMap(); - if (!Global.LFGMgr.inLfgDungeonMap(GetGroup().GetGUID(), map.GetId(), map.GetDifficultyID())) + if (!Global.LFGMgr.InLfgDungeonMap(GetGroup().GetGUID(), map.GetId(), map.GetDifficultyID())) return InventoryResult.Ok; if (proto == null) @@ -5138,7 +5138,7 @@ namespace Game.Entities return InventoryResult.NotInCombat; Battleground bg = GetBattleground(); if (bg) - if (bg.isArena() && bg.GetStatus() == BattlegroundStatus.InProgress) + if (bg.IsArena() && bg.GetStatus() == BattlegroundStatus.InProgress) return InventoryResult.NotDuringArenaMatch; } @@ -5371,7 +5371,7 @@ namespace Game.Entities return InventoryResult.NotInCombat; Battleground bg = GetBattleground(); if (bg) - if (bg.isArena() && bg.GetStatus() == BattlegroundStatus.InProgress) + if (bg.IsArena() && bg.GetStatus() == BattlegroundStatus.InProgress) return InventoryResult.NotDuringArenaMatch; } @@ -6235,7 +6235,7 @@ namespace Game.Entities // loot was generated and respawntime has passed since then, allow to recreate loot // to avoid bugs, this rule covers spawned gameobjects only - if (go.IsSpawnedByDefault() && go.GetLootState() == LootState.Activated && !go.loot.isLooted() && go.GetLootGenerationTime() + go.GetRespawnDelay() < Time.UnixTime) + if (go.IsSpawnedByDefault() && go.GetLootState() == LootState.Activated && !go.loot.IsLooted() && go.GetLootGenerationTime() + go.GetRespawnDelay() < Time.UnixTime) go.SetLootState(LootState.Ready); if (go.GetLootState() == LootState.Ready) @@ -6253,7 +6253,7 @@ namespace Game.Entities if (lootid != 0) { - loot.clear(); + loot.Clear(); Group group = GetGroup(); bool groupRules = (group && go.GetGoInfo().type == GameObjectTypes.Chest && go.GetGoInfo().Chest.usegrouplootrules != 0); @@ -6274,7 +6274,7 @@ namespace Game.Entities { GameObjectTemplateAddon addon = go.GetTemplateAddon(); if (addon != null) - loot.generateMoneyLoot(addon.mingold, addon.maxgold); + loot.GenerateMoneyLoot(addon.mingold, addon.maxgold); } if (loot_type == LootType.Fishing) @@ -6346,7 +6346,7 @@ namespace Game.Entities if (!item.m_lootGenerated && !item.ItemContainerLoadLootFromDB()) { item.m_lootGenerated = true; - loot.clear(); + loot.Clear(); switch (loot_type) { @@ -6360,7 +6360,7 @@ namespace Game.Entities loot.FillLoot(item.GetEntry(), LootStorage.Milling, this, true); break; default: - loot.generateMoneyLoot(item.GetTemplate().MinMoneyLoot, item.GetTemplate().MaxMoneyLoot); + loot.GenerateMoneyLoot(item.GetTemplate().MinMoneyLoot, item.GetTemplate().MaxMoneyLoot); loot.FillLoot(item.GetEntry(), LootStorage.Items, this, true, loot.gold != 0); // Force save the loot and money items that were just rolled @@ -6387,7 +6387,7 @@ namespace Game.Entities if (loot.loot_type == LootType.None) { uint pLevel = bones.loot.gold; - bones.loot.clear(); + bones.loot.Clear(); // For AV Achievement Battleground bg = GetBattleground(); @@ -6435,7 +6435,7 @@ namespace Game.Entities if (creature.CanGeneratePickPocketLoot()) { creature.StartPickPocketRefillTimer(); - loot.clear(); + loot.Clear(); uint lootid = creature.GetCreatureTemplate().PickPocketId; if (lootid != 0) @@ -6500,7 +6500,7 @@ namespace Game.Entities } else if (loot_type == LootType.Skinning) { - loot.clear(); + loot.Clear(); loot.FillLoot(creature.GetCreatureTemplate().SkinLootId, LootStorage.Skinning, this, true); permission = PermissionTypes.Owner; diff --git a/Source/Game/Entities/Player/Player.Map.cs b/Source/Game/Entities/Player/Player.Map.cs index af52bc57d..534ca9299 100644 --- a/Source/Game/Entities/Player/Player.Map.cs +++ b/Source/Game/Entities/Player/Player.Map.cs @@ -537,7 +537,7 @@ namespace Game.Entities // raid instances require the player to be in a raid group to be valid if (map.IsRaid() && !WorldConfig.GetBoolValue(WorldCfg.InstanceIgnoreRaid) && (map.GetEntry().Expansion() >= (Expansion)WorldConfig.GetIntValue(WorldCfg.Expansion))) - if (!GetGroup() || !GetGroup().isRaidGroup()) + if (!GetGroup() || !GetGroup().IsRaidGroup()) return false; Group group = GetGroup(); @@ -715,7 +715,7 @@ namespace Game.Entities public override void UpdateUnderwaterState(Map m, float x, float y, float z) { LiquidData liquid_status; - ZLiquidStatus res = m.getLiquidStatus(GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out liquid_status); + ZLiquidStatus res = m.GetLiquidStatus(GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out liquid_status); if (res == 0) { m_MirrorTimerFlags &= ~(PlayerUnderwaterState.InWater | PlayerUnderwaterState.InLava | PlayerUnderwaterState.InSlime | PlayerUnderwaterState.InDarkWater); diff --git a/Source/Game/Entities/Player/Player.PvP.cs b/Source/Game/Entities/Player/Player.PvP.cs index 1e6ec19e4..a6625d9f2 100644 --- a/Source/Game/Entities/Player/Player.PvP.cs +++ b/Source/Game/Entities/Player/Player.PvP.cs @@ -85,7 +85,7 @@ namespace Game.Entities UpdateHonorFields(); // do not reward honor in arenas, but return true to enable onkill spellproc - if (InBattleground() && GetBattleground() && GetBattleground().isArena()) + if (InBattleground() && GetBattleground() && GetBattleground().IsArena()) return true; // Promote to float for calculations @@ -132,7 +132,7 @@ namespace Game.Entities else victim_guid.Clear(); // Don't show HK: message, only log. - honor_f = (float)Math.Ceiling(Formulas.hk_honor_at_level_f(k_level) * (v_level - k_grey) / (k_level - k_grey)); + honor_f = (float)Math.Ceiling(Formulas.HKHonorAtLevelF(k_level) * (v_level - k_grey) / (k_level - k_grey)); // count the number of playerkills in one day ApplyModUpdateFieldValue(m_values.ModifyValue(m_activePlayerData).ModifyValue(m_activePlayerData.TodayHonorableKills), (ushort)1, true); @@ -729,7 +729,7 @@ namespace Game.Entities bg.RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true); // call after remove to be sure that player resurrected for correct cast - if (bg.isBattleground() && !IsGameMaster() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundCastDeserter)) + if (bg.IsBattleground() && !IsGameMaster() && WorldConfig.GetBoolValue(WorldCfg.BattlegroundCastDeserter)) { if (bg.GetStatus() == BattlegroundStatus.InProgress || bg.GetStatus() == BattlegroundStatus.WaitJoin) { @@ -752,7 +752,7 @@ namespace Game.Entities if (HasAura(26013)) return false; - if (bg.isArena() && !GetSession().HasPermission(RBACPermissions.JoinArenas)) + if (bg.IsArena() && !GetSession().HasPermission(RBACPermissions.JoinArenas)) return false; if (bg.IsRandom() && !GetSession().HasPermission(RBACPermissions.JoinRandomBg)) diff --git a/Source/Game/Entities/Player/Player.Quest.cs b/Source/Game/Entities/Player/Player.Quest.cs index f1a74b104..82f911181 100644 --- a/Source/Game/Entities/Player/Player.Quest.cs +++ b/Source/Game/Entities/Player/Player.Quest.cs @@ -580,7 +580,7 @@ namespace Game.Entities { case TypeId.Unit: Global.ScriptMgr.OnQuestAccept(this, (questGiver.ToCreature()), quest); - questGiver.ToCreature().GetAI().sQuestAccept(this, quest); + questGiver.ToCreature().GetAI().QuestAccept(this, quest); break; case TypeId.Item: case TypeId.Container: @@ -2077,7 +2077,7 @@ namespace Game.Entities var group = GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); @@ -2216,7 +2216,7 @@ namespace Game.Entities // just if !ingroup || !noraidgroup || raidgroup QuestStatusData q_status = m_QuestStatus[questid]; - if (q_status.Status == QuestStatus.Incomplete && (GetGroup() == null || !GetGroup().isRaidGroup() || qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))) + if (q_status.Status == QuestStatus.Incomplete && (GetGroup() == null || !GetGroup().IsRaidGroup() || qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))) { if (qInfo.HasSpecialFlag(QuestSpecialFlags.Kill))// && !qInfo.HasSpecialFlag(QuestSpecialFlags.Cast)) { @@ -2263,7 +2263,7 @@ namespace Game.Entities // just if !ingroup || !noraidgroup || raidgroup QuestStatusData q_status = m_QuestStatus[questid]; - if (q_status.Status == QuestStatus.Incomplete && (GetGroup() == null || !GetGroup().isRaidGroup() || qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))) + if (q_status.Status == QuestStatus.Incomplete && (GetGroup() == null || !GetGroup().IsRaidGroup() || qInfo.IsAllowedInRaid(GetMap().GetDifficultyID()))) { foreach (QuestObjective obj in qInfo.Objectives) { @@ -2550,7 +2550,7 @@ namespace Game.Entities continue; // hide quest if player is in raid-group and quest is no raid quest - if (GetGroup() != null && GetGroup().isRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID())) + if (GetGroup() != null && GetGroup().IsRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID())) if (!InBattleground()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later continue; @@ -2943,7 +2943,7 @@ namespace Game.Entities if (qInfo == null) continue; - if (GetGroup() != null && GetGroup().isRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID())) + if (GetGroup() != null && GetGroup().IsRaidGroup() && !qInfo.IsAllowedInRaid(GetMap().GetDifficultyID())) continue; foreach (QuestObjective obj in qInfo.Objectives) diff --git a/Source/Game/Entities/Player/Player.Spells.cs b/Source/Game/Entities/Player/Player.Spells.cs index 4657e512c..57c167012 100644 --- a/Source/Game/Entities/Player/Player.Spells.cs +++ b/Source/Game/Entities/Player/Player.Spells.cs @@ -1529,7 +1529,7 @@ namespace Game.Entities spell.m_fromClient = true; spell.m_CastItem = item; spell.SetSpellValue(SpellValueMod.BasePoint0, (int)learning_spell_id); - spell.prepare(targets); + spell.Prepare(targets); return; } } @@ -1565,7 +1565,7 @@ namespace Game.Entities spell.m_CastItem = item; spell.m_misc.Data0 = misc[0]; spell.m_misc.Data1 = misc[1]; - spell.prepare(targets); + spell.Prepare(targets); return; } @@ -1599,7 +1599,7 @@ namespace Game.Entities spell.m_CastItem = item; spell.m_misc.Data0 = misc[0]; spell.m_misc.Data1 = misc[1]; - spell.prepare(targets); + spell.Prepare(targets); return; } } @@ -1697,7 +1697,7 @@ namespace Game.Entities { Spell spell = GetCurrentSpell(i); if (spell != null) - if (spell.getState() != SpellState.Delayed && !HasItemFitToSpellRequirements(spell.m_spellInfo, pItem)) + if (spell.GetState() != SpellState.Delayed && !HasItemFitToSpellRequirements(spell.m_spellInfo, pItem)) InterruptSpell(i); } } diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index 0e27614a9..b95da70af 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -731,7 +731,7 @@ namespace Game.Entities { m_hostileReferenceCheckTimer = 15 * Time.InMilliseconds; if (!GetMap().IsDungeon()) - GetHostileRefManager().deleteReferencesOutOfRange(GetVisibilityRange()); + GetHostileRefManager().DeleteReferencesOutOfRange(GetVisibilityRange()); } else m_hostileReferenceCheckTimer -= diff; @@ -1958,7 +1958,7 @@ namespace Game.Entities // remove auras that need water/land RemoveAurasWithInterruptFlags((apply ? SpellAuraInterruptFlags.NotAbovewater : SpellAuraInterruptFlags.NotUnderwater)); - GetHostileRefManager().updateThreatTables(); + GetHostileRefManager().UpdateThreatTables(); } public void ValidateMovementInfo(MovementInfo mi) { @@ -2200,13 +2200,13 @@ namespace Game.Entities if (pet != null) { pet.SetFaction(35); - pet.GetHostileRefManager().setOnlineOfflineState(false); + pet.GetHostileRefManager().SetOnlineOfflineState(false); } RemovePvpFlag(UnitPVPStateFlags.FFAPvp); ResetContestedPvP(); - GetHostileRefManager().setOnlineOfflineState(false); + GetHostileRefManager().SetOnlineOfflineState(false); CombatStopWithPets(); PhasingHandler.SetAlwaysVisible(GetPhaseShift(), true); @@ -2225,7 +2225,7 @@ namespace Game.Entities if (pet != null) { pet.SetFaction(GetFaction()); - pet.GetHostileRefManager().setOnlineOfflineState(true); + pet.GetHostileRefManager().SetOnlineOfflineState(true); } // restore FFA PvP Server state @@ -2235,7 +2235,7 @@ namespace Game.Entities // restore FFA PvP area state, remove not allowed for GM mounts UpdateArea(m_areaUpdateId); - GetHostileRefManager().setOnlineOfflineState(true); + GetHostileRefManager().SetOnlineOfflineState(true); m_serverSideVisibilityDetect.SetValue(ServerSideVisibilityType.GM, AccountTypes.Player); } @@ -3652,9 +3652,9 @@ namespace Game.Entities return false; Loot loot = creature.loot; - if (loot.isLooted()) // nothing to loot or everything looted. + if (loot.IsLooted()) // nothing to loot or everything looted. return false; - if (!loot.hasItemForAll() && !loot.hasItemFor(this)) // no loot in creature for this player + if (!loot.HasItemForAll() && !loot.HasItemFor(this)) // no loot in creature for this player return false; if (loot.loot_type == LootType.Skinning) @@ -3680,10 +3680,10 @@ namespace Game.Entities if (loot.roundRobinPlayer.IsEmpty() || loot.roundRobinPlayer == GetGUID()) return true; - if (loot.hasOverThresholdItem()) + if (loot.HasOverThresholdItem()) return true; - return loot.hasItemFor(this); + return loot.HasItemFor(this); } return false; @@ -4241,7 +4241,7 @@ namespace Game.Entities SetHealth(1); SetWaterWalking(true); - if (!GetSession().isLogingOut() && !HasUnitState(UnitState.Stunned)) + if (!GetSession().IsLogingOut() && !HasUnitState(UnitState.Stunned)) SetRooted(false); // BG - remove insignia related @@ -4966,7 +4966,7 @@ namespace Game.Entities public bool InArena() { Battleground bg = GetBattleground(); - if (!bg || !bg.isArena()) + if (!bg || !bg.IsArena()) return false; return true; @@ -6732,7 +6732,7 @@ namespace Game.Entities } // not let cheating with start flight in time of logout process || while in combat || has type state: stunned || has type state: root - if (GetSession().isLogingOut() || IsInCombat() || HasUnitState(UnitState.Stunned) || HasUnitState(UnitState.Root)) + if (GetSession().IsLogingOut() || IsInCombat() || HasUnitState(UnitState.Stunned) || HasUnitState(UnitState.Root)) { GetSession().SendActivateTaxiReply(ActivateTaxiReply.PlayerBusy); return false; @@ -6924,7 +6924,7 @@ namespace Game.Entities m_taxi.ClearTaxiDestinations(); // not destinations, clear source node Dismount(); RemoveUnitFlag(UnitFlags.RemoveClientControl | UnitFlags.TaxiFlight); - GetHostileRefManager().setOnlineOfflineState(true); + GetHostileRefManager().SetOnlineOfflineState(true); } public void ContinueTaxiFlight() @@ -6987,7 +6987,7 @@ namespace Game.Entities Group group = GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (!player) diff --git a/Source/Game/Entities/Totem.cs b/Source/Game/Entities/Totem.cs index 57e980cbf..b9b9c485c 100644 --- a/Source/Game/Entities/Totem.cs +++ b/Source/Game/Entities/Totem.cs @@ -131,7 +131,7 @@ namespace Game.Entities Group group = owner.GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player target = refe.GetSource(); if (target && target.IsInMap(owner) && group.SameSubGroup(owner, target)) diff --git a/Source/Game/Entities/Unit/Unit.Combat.cs b/Source/Game/Entities/Unit/Unit.Combat.cs index e9eb2f961..0ed4b6668 100644 --- a/Source/Game/Entities/Unit/Unit.Combat.cs +++ b/Source/Game/Entities/Unit/Unit.Combat.cs @@ -43,10 +43,10 @@ namespace Game.Entities // Search in threat list ObjectGuid guid = who.GetGUID(); - foreach (var refe in GetThreatManager().getThreatList()) + foreach (var refe in GetThreatManager().GetThreatList()) { // Return true if the unit matches - if (refe != null && refe.getUnitGuid() == guid) + if (refe != null && refe.GetUnitGuid() == guid) return true; } @@ -60,18 +60,18 @@ namespace Game.Entities public void SendChangeCurrentVictim(HostileReference pHostileReference) { - if (!GetThreatManager().isThreatListEmpty()) + if (!GetThreatManager().IsThreatListEmpty()) { HighestThreatUpdate packet = new HighestThreatUpdate(); packet.UnitGUID = GetGUID(); - packet.HighestThreatGUID = pHostileReference.getUnitGuid(); + packet.HighestThreatGUID = pHostileReference.GetUnitGuid(); - var refeList = GetThreatManager().getThreatList(); + var refeList = GetThreatManager().GetThreatList(); foreach (var refe in refeList) { ThreatInfo info = new ThreatInfo(); - info.UnitGUID = refe.getUnitGuid(); - info.Threat = (long)refe.getThreat() * 100; + info.UnitGUID = refe.GetUnitGuid(); + info.Threat = (long)refe.GetThreat() * 100; packet.ThreatList.Add(info); } SendMessageToSet(packet, false); @@ -108,7 +108,7 @@ namespace Game.Entities ++i; } - GetHostileRefManager().deleteReferencesForFaction(factionId); + GetHostileRefManager().DeleteReferencesForFaction(factionId); foreach (var control in m_Controlled) control.StopAttackFaction(factionId); @@ -136,22 +136,22 @@ namespace Game.Entities { ThreatRemove packet = new ThreatRemove(); packet.UnitGUID = GetGUID(); - packet.AboutGUID = pHostileReference.getUnitGuid(); + packet.AboutGUID = pHostileReference.GetUnitGuid(); SendMessageToSet(packet, false); } void SendThreatListUpdate() { - if (!GetThreatManager().isThreatListEmpty()) + if (!GetThreatManager().IsThreatListEmpty()) { ThreatUpdate packet = new ThreatUpdate(); packet.UnitGUID = GetGUID(); - var tlist = GetThreatManager().getThreatList(); + var tlist = GetThreatManager().GetThreatList(); foreach (var refe in tlist) { ThreatInfo info = new ThreatInfo(); - info.UnitGUID = refe.getUnitGuid(); - info.Threat = (long)refe.getThreat() * 100; + info.UnitGUID = refe.GetUnitGuid(); + info.Threat = (long)refe.GetThreat() * 100; packet.ThreatList.Add(info); } SendMessageToSet(packet, false); @@ -160,9 +160,9 @@ namespace Game.Entities public void DeleteThreatList() { - if (CanHaveThreatList(true) && !threatManager.isThreatListEmpty()) + if (CanHaveThreatList(true) && !threatManager.IsThreatListEmpty()) SendClearThreatList(); - threatManager.clearReferences(); + threatManager.ClearReferences(); } public void TauntApply(Unit taunter) @@ -208,7 +208,7 @@ namespace Game.Entities if (!target || target != taunter) return; - if (threatManager.isThreatListEmpty()) + if (threatManager.IsThreatListEmpty()) { if (creature.IsAIEnabled) creature.GetAI().EnterEvadeMode(EvadeReason.NoHostiles); @@ -326,7 +326,7 @@ namespace Game.Entities { // Only mobs can manage threat lists if (CanHaveThreatList() && !HasUnitState(UnitState.Evade)) - threatManager.addThreat(victim, fThreat, schoolMask, threatSpell); + threatManager.AddThreat(victim, fThreat, schoolMask, threatSpell); } public float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SpellSchoolMask.Normal) { @@ -601,7 +601,7 @@ namespace Game.Entities // melee attack spell casted at main hand attack only - no normal melee dmg dealt if (attType == WeaponAttackType.BaseAttack && GetCurrentSpell(CurrentSpellTypes.Melee) != null && !extra) - m_currentSpells[CurrentSpellTypes.Melee].cast(); + m_currentSpells[CurrentSpellTypes.Melee].Cast(); else { // attack can be redirected to another target @@ -975,7 +975,7 @@ namespace Game.Entities Spell spell = victim.GetCurrentSpell(CurrentSpellTypes.Generic); if (spell) { - if (spell.getState() == SpellState.Preparing) + if (spell.GetState() == SpellState.Preparing) { SpellInterruptFlags interruptFlags = spell.m_spellInfo.InterruptFlags; if (interruptFlags.HasAnyFlag(SpellInterruptFlags.AbortOnDmg)) @@ -1143,7 +1143,7 @@ namespace Game.Entities { Spell spell = victim.GetCurrentSpell(CurrentSpellTypes.Generic); if (spell != null) - if (spell.getState() == SpellState.Preparing) + if (spell.GetState() == SpellState.Preparing) { var interruptFlags = spell.m_spellInfo.InterruptFlags; if (interruptFlags.HasAnyFlag(SpellInterruptFlags.AbortOnDmg)) @@ -1154,7 +1154,7 @@ namespace Game.Entities } Spell spell1 = victim.GetCurrentSpell(CurrentSpellTypes.Channeled); if (spell1 != null) - if (spell1.getState() == SpellState.Casting && spell1.m_spellInfo.HasChannelInterruptFlag(SpellChannelInterruptFlags.Delay) && damagetype != DamageEffectType.DOT) + if (spell1.GetState() == SpellState.Casting && spell1.m_spellInfo.HasChannelInterruptFlag(SpellChannelInterruptFlags.Delay) && damagetype != DamageEffectType.DOT) spell1.DelayedChannel(); } } @@ -1474,13 +1474,13 @@ namespace Game.Entities { Loot loot = creature.loot; - loot.clear(); + loot.Clear(); uint lootid = creature.GetCreatureTemplate().LootId; if (lootid != 0) loot.FillLoot(lootid, LootStorage.Creature, looter, false, false, creature.GetLootMode()); if (creature.GetLootMode() > 0) - loot.generateMoneyLoot(creature.GetCreatureTemplate().MinGold, creature.GetCreatureTemplate().MaxGold); + loot.GenerateMoneyLoot(creature.GetCreatureTemplate().MinGold, creature.GetCreatureTemplate().MaxGold); if (group) { @@ -1490,7 +1490,7 @@ namespace Game.Entities group.SendLooter(creature, null); // Update round robin looter only if the creature had loot - if (!loot.empty()) + if (!loot.Empty()) group.UpdateLooterGuid(creature); } } @@ -1572,7 +1572,7 @@ namespace Game.Entities creature.DeleteThreatList(); // must be after setDeathState which resets dynamic flags - if (!creature.loot.isLooted()) + if (!creature.loot.IsLooted()) creature.AddDynamicFlag(UnitDynFlags.Lootable); else creature.AllLootRemovedFromCorpse(); @@ -1798,7 +1798,7 @@ namespace Game.Entities List nearMembers = new List(); // reserve place for players and pets because resizing vector every unit push is unefficient (vector is reallocated then) - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player target = refe.GetSource(); if (target) diff --git a/Source/Game/Entities/Unit/Unit.Fields.cs b/Source/Game/Entities/Unit/Unit.Fields.cs index 6f1476ad2..e2b14fd09 100644 --- a/Source/Game/Entities/Unit/Unit.Fields.cs +++ b/Source/Game/Entities/Unit/Unit.Fields.cs @@ -40,7 +40,7 @@ namespace Game.Entities //Movement protected float[] m_speed_rate = new float[(int)UnitMoveType.Max]; - RefManager m_FollowingRefManager; + RefManager m_FollowingRefManager; public MoveSpline MoveSpline { get; set; } MotionMaster i_motionMaster; public uint m_movementCounter; //< Incrementing counter used in movement packets diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index a3f695fc1..15f82ffe0 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -46,7 +46,7 @@ namespace Game.Entities public bool IsFlying() { return m_movementInfo.HasMovementFlag(MovementFlag.Flying | MovementFlag.DisableGravity); } public bool IsFalling() { - return m_movementInfo.HasMovementFlag(MovementFlag.Falling | MovementFlag.FallingFar) || MoveSpline.isFalling(); + return m_movementInfo.HasMovementFlag(MovementFlag.Falling | MovementFlag.FallingFar) || MoveSpline.IsFalling(); } public virtual bool CanSwim() { @@ -68,7 +68,7 @@ namespace Game.Entities return GetMap().IsUnderWater(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ()); } - void PropagateSpeedChange() { GetMotionMaster().propagateSpeedChange(); } + void PropagateSpeedChange() { GetMotionMaster().PropagateSpeedChange(); } public float GetSpeed(UnitMoveType mtype) { @@ -679,7 +679,7 @@ namespace Game.Entities } LiquidData liquid; - ZLiquidStatus liquidStatus = GetMap().getLiquidStatus(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ(), MapConst.MapAllLiquidTypes, out liquid); + ZLiquidStatus liquidStatus = GetMap().GetLiquidStatus(GetPhaseShift(), GetPositionX(), GetPositionY(), GetPositionZ(), MapConst.MapAllLiquidTypes, out liquid); isSubmerged = liquidStatus.HasAnyFlag(ZLiquidStatus.UnderWater) || HasUnitMovementFlag(MovementFlag.Swimming); isInWater = liquidStatus.HasAnyFlag(ZLiquidStatus.InWater | ZLiquidStatus.UnderWater); @@ -759,7 +759,7 @@ namespace Game.Entities return; LiquidData liquid_status; - ZLiquidStatus res = m.getLiquidStatus(GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out liquid_status); + ZLiquidStatus res = m.GetLiquidStatus(GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out liquid_status); if (res == 0) { if (_lastLiquid != null && _lastLiquid.SpellID != 0) @@ -1295,7 +1295,7 @@ namespace Game.Entities { Battleground bg = ToPlayer().GetBattleground(); // don't unsummon pet in arena but SetFlag UNIT_FLAG_STUNNED to disable pet's interface - if (bg && bg.isArena()) + if (bg && bg.IsArena()) pet.AddUnitFlag(UnitFlags.Stunned); else player.UnsummonPetTemporaryIfAny(); @@ -1636,7 +1636,7 @@ namespace Game.Entities if (MoveSpline.Finalized()) return; - MoveSpline.updateState((int)diff); + MoveSpline.UpdateState((int)diff); bool arrived = MoveSpline.Finalized(); if (arrived) diff --git a/Source/Game/Entities/Unit/Unit.Pets.cs b/Source/Game/Entities/Unit/Unit.Pets.cs index 9eecd65a5..dadb578b0 100644 --- a/Source/Game/Entities/Unit/Unit.Pets.cs +++ b/Source/Game/Entities/Unit/Unit.Pets.cs @@ -477,7 +477,7 @@ namespace Game.Entities CastStop(); CombatStop(); // @todo CombatStop(true) may cause crash (interrupt spells) - GetHostileRefManager().deleteReferences(); + GetHostileRefManager().DeleteReferences(); DeleteThreatList(); if (_oldFactionId != 0) diff --git a/Source/Game/Entities/Unit/Unit.Spells.cs b/Source/Game/Entities/Unit/Unit.Spells.cs index b44133761..22047bff0 100644 --- a/Source/Game/Entities/Unit/Unit.Spells.cs +++ b/Source/Game/Entities/Unit/Unit.Spells.cs @@ -1034,7 +1034,7 @@ namespace Game.Entities spell.SetSpellValue(pair.Key, pair.Value); spell.m_CastItem = castItem; - spell.prepare(targets, triggeredByAura); + spell.Prepare(targets, triggeredByAura); } public void CastSpell(Unit victim, uint spellId, bool triggered, Item castItem = null, AuraEffect triggeredByAura = null, ObjectGuid originalCaster = default) { @@ -1134,7 +1134,7 @@ namespace Game.Entities if (spellType == CurrentSpellTypes.Channeled) spell.SendChannelUpdate(0); - spell.finish(ok); + spell.Finish(ok); } uint GetCastingTimeForBonus(SpellInfo spellProto, DamageEffectType damagetype, uint CastingTime) @@ -1385,7 +1385,7 @@ namespace Game.Entities // channeled spells during channel stage (after the initial cast timer) allow movement with a specific spell attribute Spell spell = m_currentSpells.LookupByKey(CurrentSpellTypes.Channeled); if (spell) - if (spell.getState() != SpellState.Finished && spell.IsChannelActive()) + if (spell.GetState() != SpellState.Finished && spell.IsChannelActive()) if (spell.GetSpellInfo().IsMoveAllowedChannel()) return false; @@ -1501,7 +1501,7 @@ namespace Game.Entities int overEnergize = damage - gain; SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId); - victim.GetHostileRefManager().threatAssist(this, damage * 0.5f, spellInfo); + victim.GetHostileRefManager().ThreatAssist(this, damage * 0.5f, spellInfo); SendEnergizeSpellLog(victim, spellId, damage, overEnergize, powerType); } @@ -2100,8 +2100,8 @@ namespace Game.Entities // generic spells are cast when they are not finished and not delayed var currentSpell = GetCurrentSpell(CurrentSpellTypes.Generic); if (currentSpell && - (currentSpell.getState() != SpellState.Finished) && - (withDelayed || currentSpell.getState() != SpellState.Delayed)) + (currentSpell.GetState() != SpellState.Finished) && + (withDelayed || currentSpell.GetState() != SpellState.Delayed)) { if (!skipInstant || currentSpell.GetCastTime() != 0) { @@ -2112,7 +2112,7 @@ namespace Game.Entities currentSpell = GetCurrentSpell(CurrentSpellTypes.Channeled); // channeled spells may be delayed, but they are still considered cast if (!skipChanneled && currentSpell && - (currentSpell.getState() != SpellState.Finished)) + (currentSpell.GetState() != SpellState.Finished)) { if (!isAutoshoot || !currentSpell.m_spellInfo.HasAttribute(SpellAttr2.NotResetAutoActions)) return true; @@ -2833,8 +2833,8 @@ namespace Game.Entities Log.outDebug(LogFilter.Unit, "Interrupt spell for unit {0}", GetEntry()); Spell spell = m_currentSpells.LookupByKey(spellType); if (spell != null - && (withDelayed || spell.getState() != SpellState.Delayed) - && (withInstant || spell.GetCastTime() > 0 || spell.getState() == SpellState.Casting)) + && (withDelayed || spell.GetState() != SpellState.Delayed) + && (withInstant || spell.GetCastTime() > 0 || spell.GetState() == SpellState.Casting)) { // for example, do not let self-stun aura interrupt itself if (!spell.IsInterruptable()) @@ -2845,8 +2845,8 @@ namespace Game.Entities if (IsTypeId(TypeId.Player)) ToPlayer().SendAutoRepeatCancel(this); - if (spell.getState() != SpellState.Finished) - spell.cancel(); + if (spell.GetState() != SpellState.Finished) + spell.Cancel(); if (IsCreature() && IsAIEnabled) ToCreature().GetAI().OnSpellCastInterrupt(spell.GetSpellInfo()); @@ -2867,7 +2867,7 @@ namespace Game.Entities Spell spell = GetCurrentSpell(CurrentSpellTypes.Channeled); if (spell != null) { - if (spell.getState() == SpellState.Casting) + if (spell.GetState() == SpellState.Casting) { for (var i = 0; i < m_interruptMask.Length; ++i) m_interruptMask[i] |= spell.m_spellInfo.ChannelInterruptFlags[i]; @@ -3243,7 +3243,7 @@ namespace Game.Entities Spell spell = GetCurrentSpell(CurrentSpellTypes.Channeled); if (spell != null) { - if (spell.getState() == SpellState.Casting + if (spell.GetState() == SpellState.Casting && Convert.ToBoolean(spell.GetSpellInfo().ChannelInterruptFlags[index] & flag) && spell.GetSpellInfo().Id != except && !(Convert.ToBoolean(flag & (uint)SpellAuraInterruptFlags.Move) && HasAuraTypeWithAffectMask(AuraType.CastWhileWalking, spell.GetSpellInfo()))) diff --git a/Source/Game/Entities/Unit/Unit.cs b/Source/Game/Entities/Unit/Unit.cs index 801db9911..6b26465c6 100644 --- a/Source/Game/Entities/Unit/Unit.cs +++ b/Source/Game/Entities/Unit/Unit.cs @@ -44,7 +44,7 @@ namespace Game.Entities UnitTypeMask = UnitTypeMask.None; hostileRefManager = new HostileRefManager(this); _spellHistory = new SpellHistory(this); - m_FollowingRefManager = new RefManager(); + m_FollowingRefManager = new RefManager(); ObjectTypeId = TypeId.Unit; ObjectTypeMask |= TypeMask.Unit; @@ -142,7 +142,7 @@ namespace Game.Entities // Having this would prevent spells from being proced, so let's crash Cypher.Assert(m_procDeep == 0); - if (CanHaveThreatList() && GetThreatManager().isNeedUpdateToClient(diff)) + if (CanHaveThreatList() && GetThreatManager().IsNeedUpdateToClient(diff)) SendThreatListUpdate(); // update combat timer only for players and pets (only pets with PetAI) @@ -191,7 +191,7 @@ namespace Game.Entities for (CurrentSpellTypes i = 0; i < CurrentSpellTypes.Max; ++i) { - if (GetCurrentSpell(i) != null && m_currentSpells[i].getState() == SpellState.Finished) + if (GetCurrentSpell(i) != null && m_currentSpells[i].GetState() == SpellState.Finished) { m_currentSpells[i].SetReferencedFromCurrent(false); m_currentSpells[i] = null; @@ -484,7 +484,7 @@ namespace Game.Entities m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map.RemoveAllObjectsInRemoveList CombatStop(); DeleteThreatList(); - GetHostileRefManager().deleteReferences(); + GetHostileRefManager().DeleteReferences(); GetMotionMaster().Clear(false); // remove different non-standard movement generators. } public override void CleanupsBeforeDelete(bool finalCleanup = true) @@ -1118,7 +1118,7 @@ namespace Game.Entities if (IsTypeId(TypeId.Unit) || !ToPlayer().GetSession().PlayerLogout()) { HostileRefManager refManager = GetHostileRefManager(); - HostileReference refe = refManager.getFirst(); + HostileReference refe = refManager.GetFirst(); while (refe != null) { @@ -1127,17 +1127,17 @@ namespace Game.Entities { Creature creature = unit.ToCreature(); if (creature != null) - refManager.setOnlineOfflineState(creature, creature.IsInPhase(this)); + refManager.SetOnlineOfflineState(creature, creature.IsInPhase(this)); } - refe = refe.next(); + refe = refe.Next(); } // modify threat lists for new phasemask if (!IsTypeId(TypeId.Player)) { - List threatList = GetThreatManager().getThreatList(); - List offlineThreatList = GetThreatManager().getOfflineThreatList(); + List threatList = GetThreatManager().GetThreatList(); + List offlineThreatList = GetThreatManager().GetOfflineThreatList(); // merge expects sorted lists threatList.Sort(); @@ -1146,9 +1146,9 @@ namespace Game.Entities foreach (var host in threatList) { - Unit unit = host.getTarget(); + Unit unit = host.GetTarget(); if (unit != null) - unit.GetHostileRefManager().setOnlineOfflineState(ToCreature(), unit.IsInPhase(this)); + unit.GetHostileRefManager().SetOnlineOfflineState(ToCreature(), unit.IsInPhase(this)); } } } @@ -1603,7 +1603,7 @@ namespace Game.Entities { CombatStop(); DeleteThreatList(); - GetHostileRefManager().deleteReferences(); + GetHostileRefManager().DeleteReferences(); if (IsNonMeleeSpellCast(false)) InterruptNonMeleeSpells(false); @@ -1860,7 +1860,7 @@ namespace Game.Entities // we want to shoot Spell spell = new Spell(this, autoRepeatSpellInfo, TriggerCastFlags.FullMask); - spell.prepare(m_currentSpells[CurrentSpellTypes.AutoRepeat].m_targets); + spell.Prepare(m_currentSpells[CurrentSpellTypes.AutoRepeat].m_targets); // all went good, reset attack ResetAttackTimer(WeaponAttackType.RangedAttack); @@ -2753,7 +2753,7 @@ namespace Game.Entities Battleground bg = target.GetBattleground(); if (bg != null) { - if (bg.isArena()) + if (bg.IsArena()) { DestroyArenaUnit destroyArenaUnit = new DestroyArenaUnit(); destroyArenaUnit.Guid = GetGUID(); diff --git a/Source/Game/Events/GameEventManager.cs b/Source/Game/Events/GameEventManager.cs index 8d0f23ea4..28f72a5ee 100644 --- a/Source/Game/Events/GameEventManager.cs +++ b/Source/Game/Events/GameEventManager.cs @@ -113,7 +113,7 @@ namespace Game if (event_id < 1 || event_id >= mGameEvent.Length) return; - if (!mGameEvent[event_id].isValid()) + if (!mGameEvent[event_id].IsValid()) return; if (m_ActiveEvents.Contains(event_id)) @@ -137,7 +137,7 @@ namespace Game } // When event is started, set its worldstate to current time - Global.WorldMgr.setWorldState(event_id, Time.UnixTime); + Global.WorldMgr.SetWorldState(event_id, Time.UnixTime); return false; } else @@ -174,7 +174,7 @@ namespace Game UnApplyEvent(event_id); // When event is stopped, clean up its worldstate - Global.WorldMgr.setWorldState(event_id, 0); + Global.WorldMgr.SetWorldState(event_id, 0); if (overwrite && !serverwide_evt) { @@ -1000,7 +1000,7 @@ namespace Game else { // If event is inactive, periodically clean up its worldstate - Global.WorldMgr.setWorldState(id, 0); + Global.WorldMgr.SetWorldState(id, 0); Log.outDebug(LogFilter.Misc, "GameEvent {0} is not active", id); if (IsActiveEvent(id)) deactivate.Add(id); @@ -1089,7 +1089,7 @@ namespace Game UpdateBattlegroundSettings(); // If event's worldstate is 0, it means the event hasn't been started yet. In that case, reset seasonal quests. // When event ends (if it expires or if it's stopped via commands) worldstate will be set to 0 again, ready for another seasonal quest reset. - if (Global.WorldMgr.getWorldState(event_id) == 0) + if (Global.WorldMgr.GetWorldState(event_id) == 0) Global.WorldMgr.ResetEventSeasonalQuests(event_id); } @@ -1098,12 +1098,12 @@ namespace Game MultiMap creaturesByMap = new MultiMap(); // go through the creatures whose npcflags are changed in the event - foreach (var pair in mGameEventNPCFlags[event_id]) + foreach (var (guid, npcflag) in mGameEventNPCFlags[event_id]) { // get the creature data from the low guid to get the entry, to be able to find out the whole guid - CreatureData data = Global.ObjectMgr.GetCreatureData(pair.guid); + CreatureData data = Global.ObjectMgr.GetCreatureData(guid); if (data != null) - creaturesByMap.Add(data.mapid, pair.guid); + creaturesByMap.Add(data.mapid, guid); } foreach (var key in creaturesByMap.Keys) @@ -1234,7 +1234,7 @@ namespace Game foreach (var guid in mGameEventCreatureGuids[internal_event_id]) { // check if it's needed by another event, if so, don't remove - if (event_id > 0 && hasCreatureActiveEventExcept(guid, (ushort)event_id)) + if (event_id > 0 && HasCreatureActiveEventExcept(guid, (ushort)event_id)) continue; // Remove the creature from grid @@ -1262,7 +1262,7 @@ namespace Game foreach (var guid in mGameEventGameobjectGuids[internal_event_id]) { // check if it's needed by another event, if so, don't remove - if (event_id > 0 && hasGameObjectActiveEventExcept(guid, (ushort)event_id)) + if (event_id > 0 && HasGameObjectActiveEventExcept(guid, (ushort)event_id)) continue; // Remove the gameobject from grid GameObjectData data = Global.ObjectMgr.GetGOData(guid); @@ -1347,7 +1347,7 @@ namespace Game } } - bool hasCreatureQuestActiveEventExcept(uint questId, ushort eventId) + bool HasCreatureQuestActiveEventExcept(uint questId, ushort eventId) { foreach (var activeEventId in m_ActiveEvents) { @@ -1359,7 +1359,7 @@ namespace Game return false; } - bool hasGameObjectQuestActiveEventExcept(uint questId, ushort eventId) + bool HasGameObjectQuestActiveEventExcept(uint questId, ushort eventId) { foreach (var activeEventId in m_ActiveEvents) { @@ -1370,7 +1370,7 @@ namespace Game } return false; } - bool hasCreatureActiveEventExcept(ulong creatureId, ushort eventId) + bool HasCreatureActiveEventExcept(ulong creatureId, ushort eventId) { foreach (var activeEventId in m_ActiveEvents) { @@ -1384,7 +1384,7 @@ namespace Game } return false; } - bool hasGameObjectActiveEventExcept(ulong goId, ushort eventId) + bool HasGameObjectActiveEventExcept(ulong goId, ushort eventId) { foreach (var activeEventId in m_ActiveEvents) { @@ -1408,7 +1408,7 @@ namespace Game CreatureQuestMap.Add(pair.Item1, pair.Item2); else { - if (!hasCreatureQuestActiveEventExcept(pair.Item2, eventId)) + if (!HasCreatureQuestActiveEventExcept(pair.Item2, eventId)) { // Remove the pair(id, quest) from the multimap CreatureQuestMap.Remove(pair.Item1, pair.Item2); @@ -1422,7 +1422,7 @@ namespace Game GameObjectQuestMap.Add(pair.Item1, pair.Item2); else { - if (!hasGameObjectQuestActiveEventExcept(pair.Item2, eventId)) + if (!HasGameObjectQuestActiveEventExcept(pair.Item2, eventId)) { // Remove the pair(id, quest) from the multimap GameObjectQuestMap.Remove(pair.Item1, pair.Item2); @@ -1643,7 +1643,7 @@ namespace Game public string description; public byte announce; // if 0 dont announce, if 1 announce, if 2 take config value - public bool isValid() { return length > 0 || state > GameEventState.Normal; } + public bool IsValid() { return length > 0 || state > GameEventState.Normal; } } public class ModelEquip @@ -1666,7 +1666,7 @@ namespace Game { foreach (var creature in objs) if (creature.IsInWorld && creature.IsAIEnabled) - creature.GetAI().sOnGameEvent(_activate, _eventId); + creature.GetAI().OnGameEvent(_activate, _eventId); } public override void Visit(IList objs) { diff --git a/Source/Game/Groups/Group.cs b/Source/Game/Groups/Group.cs index 21b2f24f0..b0b46ef27 100644 --- a/Source/Game/Groups/Group.cs +++ b/Source/Game/Groups/Group.cs @@ -53,7 +53,7 @@ namespace Game.Groups m_leaderName = leader.GetName(); leader.AddPlayerFlag(PlayerFlags.GroupLeader); - if (isBGGroup() || isBFGroup()) + if (IsBGGroup() || IsBFGroup()) { m_groupFlags = GroupFlags.MaskBgRaid; m_groupCategory = GroupCategory.Instance; @@ -62,7 +62,7 @@ namespace Game.Groups if (m_groupFlags.HasAnyFlag(GroupFlags.Raid)) _initRaidSubGroupsCounter(); - if (!isLFGGroup()) + if (!IsLFGGroup()) m_lootMethod = LootMethod.GroupLoot; m_lootThreshold = ItemQuality.Uncommon; @@ -72,7 +72,7 @@ namespace Game.Groups m_raidDifficulty = Difficulty.NormalRaid; m_legacyRaidDifficulty = Difficulty.Raid10N; - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { m_dungeonDifficulty = leader.GetDungeonDifficultyID(); m_raidDifficulty = leader.GetRaidDifficultyID(); @@ -180,7 +180,7 @@ namespace Game.Groups m_groupFlags = (m_groupFlags | GroupFlags.Lfg | GroupFlags.LfgRestricted); m_groupCategory = GroupCategory.Instance; m_lootMethod = LootMethod.GroupLoot; - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE); @@ -199,7 +199,7 @@ namespace Game.Groups _initRaidSubGroupsCounter(); - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE); @@ -229,7 +229,7 @@ namespace Game.Groups m_subGroupsCounts = null; - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE); @@ -255,7 +255,7 @@ namespace Game.Groups if (player == null || player.GetGroupInvite()) return false; Group group = player.GetGroup(); - if (group && (group.isBGGroup() || group.isBFGroup())) + if (group && (group.IsBGGroup() || group.IsBFGroup())) group = player.GetOriginalGroup(); if (group) return false; @@ -354,7 +354,7 @@ namespace Game.Groups player.SetGroupInvite(null); if (player.GetGroup() != null) { - if (isBGGroup() || isBFGroup()) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid() + if (IsBGGroup() || IsBFGroup()) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid() player.SetBattlegroundOrBattlefieldRaid(this, subGroup); else //if player is in bg raid and we are adding him to normal group, then call SetOriginalGroup() player.SetOriginalGroup(this, subGroup); @@ -368,14 +368,14 @@ namespace Game.Groups // if the same group invites the player back, cancel the homebind timer player.m_InstanceValid = player.CheckInstanceValidity(false); - if (!isRaidGroup()) // reset targetIcons for non-raid-groups + if (!IsRaidGroup()) // reset targetIcons for non-raid-groups { for (byte i = 0; i < MapConst.TargetIconsCount; ++i) m_targetIcons[i].Clear(); } // insert into the table if we're not a Battlegroundgroup - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.INS_GROUP_MEMBER); @@ -392,7 +392,7 @@ namespace Game.Groups SendUpdate(); Global.ScriptMgr.OnGroupAddMember(this, player.GetGUID()); - if (!IsLeader(player.GetGUID()) && !isBGGroup() && !isBFGroup()) + if (!IsLeader(player.GetGUID()) && !IsBGGroup() && !IsBFGroup()) { // reset the new member's instances, unless he is currently in one of them // including raid/heroic instances that they are not permanently bound to! @@ -424,7 +424,7 @@ namespace Game.Groups UpdatePlayerOutOfRange(player); // quest related GO state dependent from raid membership - if (isRaidGroup()) + if (IsRaidGroup()) player.UpdateForQuestWorldObjects(); { @@ -433,7 +433,7 @@ namespace Game.Groups UpdateObject groupDataPacket; // Broadcast group members' fields to player - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { if (refe.GetSource() == player) continue; @@ -480,7 +480,7 @@ namespace Game.Groups Player player = Global.ObjAccessor.FindConnectedPlayer(guid); if (player) { - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player groupMember = refe.GetSource(); if (groupMember) @@ -495,16 +495,16 @@ namespace Game.Groups } // LFG group vote kick handled in scripts - if (isLFGGroup() && method == RemoveMethod.Kick) + if (IsLFGGroup() && method == RemoveMethod.Kick) return m_memberSlots.Count != 0; // remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG/BF allow 1 member group) - if (GetMembersCount() > ((isBGGroup() || isLFGGroup() || isBFGroup()) ? 1 : 2)) + if (GetMembersCount() > ((IsBGGroup() || IsLFGGroup() || IsBFGroup()) ? 1 : 2)) { if (player) { // Battlegroundgroup handling - if (isBGGroup() || isBFGroup()) + if (IsBGGroup() || IsBFGroup()) player.RemoveFromBattlegroundOrBattlefieldRaid(); else // Regular group @@ -528,7 +528,7 @@ namespace Game.Groups } // Remove player from group in DB - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GROUP_MEMBER); stmt.AddValue(0, guid.GetCounter()); @@ -586,7 +586,7 @@ namespace Game.Groups SendUpdate(); - if (isLFGGroup() && GetMembersCount() == 1) + if (IsLFGGroup() && GetMembersCount() == 1) { Player leader = Global.ObjAccessor.FindPlayer(GetLeaderGUID()); uint mapId = Global.LFGMgr.GetDungeonMapId(GetGUID()); @@ -597,7 +597,7 @@ namespace Game.Groups } } - if (m_memberMgr.GetSize() < ((isLFGGroup() || isBGGroup()) ? 1 : 2)) + if (m_memberMgr.GetSize() < ((IsLFGGroup() || IsBGGroup()) ? 1 : 2)) Disband(); else if (player) { @@ -629,7 +629,7 @@ namespace Game.Groups Global.ScriptMgr.OnGroupChangeLeader(this, newLeaderGuid, m_leaderGuid); - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt; SQLTransaction trans = new SQLTransaction(); @@ -737,7 +737,7 @@ namespace Game.Groups //we cannot call _removeMember because it would invalidate member iterator //if we are removing player from Battlegroundraid - if (isBGGroup() || isBFGroup()) + if (IsBGGroup() || IsBFGroup()) player.RemoveFromBattlegroundOrBattlefieldRaid(); else { @@ -751,7 +751,7 @@ namespace Game.Groups player.SetPartyType(m_groupCategory, GroupType.None); // quest related GO state dependent from raid membership - if (isRaidGroup()) + if (IsRaidGroup()) player.UpdateForQuestWorldObjects(); if (!hideDestroy) @@ -766,7 +766,7 @@ namespace Game.Groups RemoveAllInvites(); - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { SQLTransaction trans = new SQLTransaction(); @@ -797,7 +797,7 @@ namespace Game.Groups void SendLootStartRollToPlayer(uint countDown, uint mapId, Player p, bool canNeed, Roll r) { StartLootRoll startLootRoll = new StartLootRoll(); - startLootRoll.LootObj = r.getTarget().GetGUID(); + startLootRoll.LootObj = r.GetTarget().GetGUID(); startLootRoll.MapID = (int)mapId; startLootRoll.RollTime = countDown; startLootRoll.ValidRolls = r.rollTypeMask; @@ -817,7 +817,7 @@ namespace Game.Groups void SendLootRoll(ObjectGuid playerGuid, int rollNumber, RollType rollType, Roll roll) { LootRollBroadcast lootRoll = new LootRollBroadcast(); - lootRoll.LootObj = roll.getTarget().GetGUID(); + lootRoll.LootObj = roll.GetTarget().GetGUID(); lootRoll.Player = playerGuid; lootRoll.Roll = rollNumber; lootRoll.RollType = rollType; @@ -837,7 +837,7 @@ namespace Game.Groups void SendLootRollWon(ObjectGuid winnerGuid, int rollNumber, RollType rollType, Roll roll) { LootRollWon lootRollWon = new LootRollWon(); - lootRollWon.LootObj = roll.getTarget().GetGUID(); + lootRollWon.LootObj = roll.GetTarget().GetGUID(); lootRollWon.Winner = winnerGuid; lootRollWon.Roll = rollNumber; lootRollWon.RollType = rollType; @@ -858,7 +858,7 @@ namespace Game.Groups void SendLootAllPassed(Roll roll) { LootAllPassed lootAllPassed = new LootAllPassed(); - lootAllPassed.LootObj = roll.getTarget().GetGUID(); + lootAllPassed.LootObj = roll.GetTarget().GetGUID(); roll.FillPacket(lootAllPassed.Item); foreach (var pair in roll.playerVote) @@ -875,7 +875,7 @@ namespace Game.Groups void SendLootRollsComplete(Roll roll) { LootRollsComplete lootRollsComplete = new LootRollsComplete(); - lootRollsComplete.LootObj = roll.getTarget().GetGUID(); + lootRollsComplete.LootObj = roll.GetTarget().GetGUID(); lootRollsComplete.LootListID = (byte)(roll.itemSlot + 1); foreach (var pair in roll.playerVote) @@ -898,7 +898,7 @@ namespace Game.Groups lootList.Owner = creature.GetGUID(); lootList.LootObj = creature.loot.GetGUID(); - if (GetLootMethod() == LootMethod.MasterLoot && creature.loot.hasOverThresholdItem()) + if (GetLootMethod() == LootMethod.MasterLoot && creature.loot.HasOverThresholdItem()) lootList.Master.Set(GetMasterLooterGuid()); if (groupLooter) @@ -925,7 +925,7 @@ namespace Game.Groups { Roll r = new Roll(lootItem); - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player playerToRoll = refe.GetSource(); if (!playerToRoll || playerToRoll.GetSession() == null) @@ -948,7 +948,7 @@ namespace Game.Groups if (r.totalPlayersRolling > 0) { - r.setLoot(loot); + r.SetLoot(loot); r.itemSlot = itemSlot; if (item.GetFlags2().HasAnyFlag(ItemFlags2.CanOnlyRollGreed)) @@ -996,7 +996,7 @@ namespace Game.Groups ItemTemplate item = Global.ObjectMgr.GetItemTemplate(i.itemid); Roll r = new Roll(i); - for (var refe = GetFirstMember(); refe != null; refe = refe.next()) + for (var refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player playerToRoll = refe.GetSource(); if (!playerToRoll || playerToRoll.GetSession() == null) @@ -1012,7 +1012,7 @@ namespace Game.Groups if (r.totalPlayersRolling > 0) { - r.setLoot(loot); + r.SetLoot(loot); r.itemSlot = itemSlot; loot.quest_items[itemSlot - loot.items.Count].is_blocked = true; @@ -1053,7 +1053,7 @@ namespace Game.Groups MasterLootCandidateList data = new MasterLootCandidateList(); data.LootObj = loot.GetGUID(); - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player looter = refe.GetSource(); if (!looter.IsInWorld) @@ -1063,7 +1063,7 @@ namespace Game.Groups data.Players.Add(looter.GetGUID()); } - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player looter = refe.GetSource(); if (looter.IsAtGroupRewardDistance(pLootedObject)) @@ -1081,8 +1081,8 @@ namespace Game.Groups if (!roll.playerVote.ContainsKey(playerGuid)) return; - if (roll.getLoot() != null) - if (roll.getLoot().items.Empty()) + if (roll.GetLoot() != null) + if (roll.GetLoot().items.Empty()) return; RollType rollType = RollType.MaxTypes; @@ -1120,7 +1120,7 @@ namespace Game.Groups { foreach (var roll in RollId.ToList()) { - if (roll.getLoot() == pLoot) + if (roll.GetLoot() == pLoot) { CountTheRoll(roll, allowedMap); //i don't have to edit player votes, who didn't vote ... he will pass } @@ -1129,7 +1129,7 @@ namespace Game.Groups void CountTheRoll(Roll roll, Map allowedMap) { - if (!roll.isValid()) // is loot already deleted ? + if (!roll.IsValid()) // is loot already deleted ? { RollId.Remove(roll); return; @@ -1175,13 +1175,13 @@ namespace Game.Groups player.UpdateCriteria(CriteriaTypes.RollNeedOnLoot, roll.itemid, maxresul); List dest = new List(); - LootItem item = (roll.itemSlot >= roll.getLoot().items.Count ? roll.getLoot().quest_items[roll.itemSlot - roll.getLoot().items.Count] : roll.getLoot().items[roll.itemSlot]); + LootItem item = (roll.itemSlot >= roll.GetLoot().items.Count ? roll.GetLoot().quest_items[roll.itemSlot - roll.GetLoot().items.Count] : roll.GetLoot().items[roll.itemSlot]); InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, roll.itemid, item.count); if (msg == InventoryResult.Ok) { item.is_looted = true; - roll.getLoot().NotifyItemRemoved(roll.itemSlot); - roll.getLoot().unlootedCount--; + roll.GetLoot().NotifyItemRemoved(roll.itemSlot); + roll.GetLoot().unlootedCount--; player.StoreNewItem(dest, roll.itemid, true, item.randomBonusListId, item.GetAllowedLooters(), item.context, item.BonusListIDs); } else @@ -1237,7 +1237,7 @@ namespace Game.Groups { player.UpdateCriteria(CriteriaTypes.RollGreedOnLoot, roll.itemid, maxresul); - LootItem item = roll.itemSlot >= roll.getLoot().items.Count ? roll.getLoot().quest_items[roll.itemSlot - roll.getLoot().items.Count] : roll.getLoot().items[roll.itemSlot]; + LootItem item = roll.itemSlot >= roll.GetLoot().items.Count ? roll.GetLoot().quest_items[roll.itemSlot - roll.GetLoot().items.Count] : roll.GetLoot().items[roll.itemSlot]; if (rollVote == RollType.Greed) { @@ -1246,8 +1246,8 @@ namespace Game.Groups if (msg == InventoryResult.Ok) { item.is_looted = true; - roll.getLoot().NotifyItemRemoved(roll.itemSlot); - roll.getLoot().unlootedCount--; + roll.GetLoot().NotifyItemRemoved(roll.itemSlot); + roll.GetLoot().unlootedCount--; player.StoreNewItem(dest, roll.itemid, true, item.randomBonusListId, item.GetAllowedLooters(), item.context, item.BonusListIDs); } else @@ -1260,8 +1260,8 @@ namespace Game.Groups else if (rollVote == RollType.Disenchant) { item.is_looted = true; - roll.getLoot().NotifyItemRemoved(roll.itemSlot); - roll.getLoot().unlootedCount--; + roll.GetLoot().NotifyItemRemoved(roll.itemSlot); + roll.GetLoot().unlootedCount--; player.UpdateCriteria(CriteriaTypes.CastSpell, 13262); // Disenchant ItemDisenchantLootRecord disenchant = roll.GetItemDisenchantLoot(player); @@ -1296,7 +1296,7 @@ namespace Game.Groups SendLootAllPassed(roll); // remove is_blocked so that the item is lootable by all players - LootItem item = roll.itemSlot >= roll.getLoot().items.Count ? roll.getLoot().quest_items[roll.itemSlot - roll.getLoot().items.Count] : roll.getLoot().items[roll.itemSlot]; + LootItem item = roll.itemSlot >= roll.GetLoot().items.Count ? roll.GetLoot().quest_items[roll.itemSlot - roll.GetLoot().items.Count] : roll.GetLoot().items[roll.itemSlot]; item.is_blocked = false; } @@ -1390,7 +1390,7 @@ namespace Game.Groups playerInfos.Status = GroupMemberOnlineStatus.Offline; if (memberPlayer && memberPlayer.GetSession() && !memberPlayer.GetSession().PlayerLogout()) - playerInfos.Status = GroupMemberOnlineStatus.Online | (isBGGroup() || isBFGroup() ? GroupMemberOnlineStatus.PVP : 0); + playerInfos.Status = GroupMemberOnlineStatus.Online | (IsBGGroup() || IsBFGroup() ? GroupMemberOnlineStatus.PVP : 0); playerInfos.Subgroup = member.group; // groupid playerInfos.Flags = (byte)member.flags; // See enum GroupMemberFlags @@ -1417,7 +1417,7 @@ namespace Game.Groups } // LfgInfos - if (isLFGGroup()) + if (IsLFGGroup()) { partyUpdate.LfgInfos.HasValue = true; @@ -1470,7 +1470,7 @@ namespace Game.Groups PartyMemberState packet = new PartyMemberState(); packet.Initialize(player); - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (member && member != player && (!member.IsInMap(player) || !member.IsWithinDist(player, member.GetSightRange(), false))) @@ -1480,13 +1480,13 @@ namespace Game.Groups public void BroadcastAddonMessagePacket(ServerPacket packet, string prefix, bool ignorePlayersInBGRaid, int group = -1, ObjectGuid ignore = default) { - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (player == null || (!ignore.IsEmpty() && player.GetGUID() == ignore) || (ignorePlayersInBGRaid && player.GetGroup() != this)) continue; - if ((group == -1 || refe.getSubGroup() == group)) + if ((group == -1 || refe.GetSubGroup() == group)) if (player.GetSession().IsAddonRegistered(prefix)) player.SendPacket(packet); } @@ -1494,13 +1494,13 @@ namespace Game.Groups public void BroadcastPacket(ServerPacket packet, bool ignorePlayersInBGRaid, int group = -1, ObjectGuid ignore = default) { - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (!player || (!ignore.IsEmpty() && player.GetGUID() == ignore) || (ignorePlayersInBGRaid && player.GetGroup() != this)) continue; - if (player.GetSession() != null && (group == -1 || refe.getSubGroup() == group)) + if (player.GetSession() != null && (group == -1 || refe.GetSubGroup() == group)) player.SendPacket(packet); } } @@ -1515,7 +1515,7 @@ namespace Game.Groups SubGroupCounterIncrease(group); - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP); @@ -1542,7 +1542,7 @@ namespace Game.Groups public void ChangeMembersGroup(ObjectGuid guid, byte group) { // Only raid groups have sub groups - if (!isRaidGroup()) + if (!IsRaidGroup()) return; // Check if player is really in the raid @@ -1565,7 +1565,7 @@ namespace Game.Groups SubGroupCounterDecrease(prevSubGroup); // Preserve new sub group in database for non-raid groups - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP); @@ -1580,11 +1580,11 @@ namespace Game.Groups if (player) { if (player.GetGroup() == this) - player.GetGroupRef().setSubGroup(group); + player.GetGroupRef().SetSubGroup(group); else { // If player is in BG raid, it is possible that he is also in normal raid - and that normal raid is stored in m_originalGroup reference - player.GetOriginalGroupRef().setSubGroup(group); + player.GetOriginalGroupRef().SetSubGroup(group); } } @@ -1594,7 +1594,7 @@ namespace Game.Groups public void SwapMembersGroups(ObjectGuid firstGuid, ObjectGuid secondGuid) { - if (!isRaidGroup()) + if (!IsRaidGroup()) return; MemberSlot[] slots = new MemberSlot[2]; @@ -1614,7 +1614,7 @@ namespace Game.Groups for (byte i = 0; i < 2; i++) { // Preserve new sub group in database for non-raid groups - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_MEMBER_SUBGROUP); stmt.AddValue(0, slots[i].group); @@ -1627,9 +1627,9 @@ namespace Game.Groups if (player) { if (player.GetGroup() == this) - player.GetGroupRef().setSubGroup(slots[i].group); + player.GetGroupRef().SetSubGroup(slots[i].group); else - player.GetOriginalGroupRef().setSubGroup(slots[i].group); + player.GetOriginalGroupRef().SetSubGroup(slots[i].group); } } DB.Characters.CommitTransaction(trans); @@ -1713,7 +1713,7 @@ namespace Game.Groups { errorGuid = new ObjectGuid(); // check if this group is LFG group - if (isLFGGroup()) + if (IsLFGGroup()) return GroupJoinBattlegroundResult.LfgCantUseBattleground; BattlemasterListRecord bgEntry = CliDB.BattlemasterListStorage.LookupByKey(bgOrTemplate.GetTypeID()); @@ -1743,7 +1743,7 @@ namespace Game.Groups // check every member of the group to be able to join memberscount = 0; - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next(), ++memberscount) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next(), ++memberscount) { Player member = refe.GetSource(); // offline member? don't let join @@ -1786,7 +1786,7 @@ namespace Game.Groups } // only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas... - if (bgOrTemplate.isArena() && memberscount != MinPlayerCount) + if (bgOrTemplate.IsArena() && memberscount != MinPlayerCount) return GroupJoinBattlegroundResult.ArenaTeamPartySize; return GroupJoinBattlegroundResult.None; @@ -1795,7 +1795,7 @@ namespace Game.Groups public void SetDungeonDifficultyID(Difficulty difficulty) { m_dungeonDifficulty = difficulty; - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_DIFFICULTY); @@ -1805,7 +1805,7 @@ namespace Game.Groups DB.Characters.Execute(stmt); } - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (player.GetSession() == null) @@ -1819,7 +1819,7 @@ namespace Game.Groups public void SetRaidDifficultyID(Difficulty difficulty) { m_raidDifficulty = difficulty; - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_RAID_DIFFICULTY); @@ -1829,7 +1829,7 @@ namespace Game.Groups DB.Characters.Execute(stmt); } - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (player.GetSession() == null) @@ -1843,7 +1843,7 @@ namespace Game.Groups public void SetLegacyRaidDifficultyID(Difficulty difficulty) { m_legacyRaidDifficulty = difficulty; - if (!isBGGroup() && !isBFGroup()) + if (!IsBGGroup() && !IsBFGroup()) { PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_GROUP_LEGACY_RAID_DIFFICULTY); @@ -1853,7 +1853,7 @@ namespace Game.Groups DB.Characters.Execute(stmt); } - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (player.GetSession() == null) @@ -1886,7 +1886,7 @@ namespace Game.Groups public void ResetInstances(InstanceResetMethod method, bool isRaid, bool isLegacy, Player SendMsgTo) { - if (isBGGroup() || isBFGroup()) + if (IsBGGroup() || IsBFGroup()) return; // method can be INSTANCE_RESET_ALL, INSTANCE_RESET_CHANGE_DIFFICULTY, INSTANCE_RESET_GROUP_DISBAND @@ -1939,7 +1939,7 @@ namespace Game.Groups Group group = SendMsgTo.GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (player) @@ -2014,7 +2014,7 @@ namespace Game.Groups public InstanceBind BindToInstance(InstanceSave save, bool permanent, bool load = false) { - if (save == null || isBGGroup() || isBFGroup()) + if (save == null || IsBGGroup() || IsBFGroup()) return null; if (!m_boundInstances.ContainsKey(save.GetDifficultyID())) @@ -2306,24 +2306,24 @@ namespace Game.Groups public bool IsFull() { - return isRaidGroup() ? (m_memberSlots.Count >= MapConst.MaxRaidSize) : (m_memberSlots.Count >= MapConst.MaxGroupSize); + return IsRaidGroup() ? (m_memberSlots.Count >= MapConst.MaxRaidSize) : (m_memberSlots.Count >= MapConst.MaxGroupSize); } - public bool isLFGGroup() + public bool IsLFGGroup() { return m_groupFlags.HasAnyFlag(GroupFlags.Lfg); } - public bool isRaidGroup() + public bool IsRaidGroup() { return m_groupFlags.HasAnyFlag(GroupFlags.Raid); } - public bool isBGGroup() + public bool IsBGGroup() { return m_bgGroup != null; } - public bool isBFGroup() + public bool IsBFGroup() { return m_bfGroup != null; } @@ -2333,7 +2333,7 @@ namespace Game.Groups return GetMembersCount() > 0; } - public bool isRollLootActive() { return !RollId.Empty(); } + public bool IsRollLootActive() { return !RollId.Empty(); } public ObjectGuid GetLeaderGUID() { @@ -2446,7 +2446,7 @@ namespace Game.Groups public void SetGroupMemberFlag(ObjectGuid guid, bool apply, GroupMemberFlags flag) { // Assistants, main assistants and main tanks are only available in raid groups - if (!isRaidGroup()) + if (!IsRaidGroup()) return; // Check if player is really in the raid @@ -2487,7 +2487,7 @@ namespace Game.Groups Roll GetRoll(ObjectGuid lootObjectGuid, byte lootListId) { foreach (var roll in RollId) - if (roll.getTarget() != null && roll.getTarget().GetGUID() == lootObjectGuid && roll.itemSlot == lootListId && roll.isValid()) + if (roll.GetTarget() != null && roll.GetTarget().GetGUID() == lootObjectGuid && roll.itemSlot == lootListId && roll.IsValid()) return roll; return null; } @@ -2499,13 +2499,13 @@ namespace Game.Groups void DelinkMember(ObjectGuid guid) { - GroupReference refe = m_memberMgr.getFirst(); + GroupReference refe = m_memberMgr.GetFirst(); while (refe != null) { - GroupReference nextRef = refe.next(); + GroupReference nextRef = refe.Next(); if (refe.GetSource().GetGUID() == guid) { - refe.unlink(); + refe.Unlink(); break; } refe = nextRef; @@ -2579,7 +2579,7 @@ namespace Game.Groups public uint GetDbStoreId() { return m_dbStoreId; } public List GetMemberSlots() { return m_memberSlots; } - public GroupReference GetFirstMember() { return (GroupReference)m_memberMgr.getFirst(); } + public GroupReference GetFirstMember() { return (GroupReference)m_memberMgr.GetFirst(); } public uint GetMembersCount() { return (uint)m_memberSlots.Count; } public GroupFlags GetGroupFlags() { return m_groupFlags; } @@ -2587,7 +2587,7 @@ namespace Game.Groups public void BroadcastWorker(Action worker) { - for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = GetFirstMember(); refe != null; refe = refe.Next()) worker(refe.GetSource()); } @@ -2639,20 +2639,20 @@ namespace Game.Groups rollTypeMask = RollMask.AllNoDisenchant; } - public void setLoot(Loot pLoot) + public void SetLoot(Loot pLoot) { - link(pLoot, this); + Link(pLoot, this); } - public Loot getLoot() + public Loot GetLoot() { - return getTarget(); + return GetTarget(); } - public override void targetObjectBuildLink() + public override void TargetObjectBuildLink() { // called from link() - getTarget().addLootValidatorRef(this); + GetTarget().AddLootValidatorRef(this); } public void FillPacket(LootItemData lootItem) @@ -2661,7 +2661,7 @@ namespace Game.Groups lootItem.Quantity = itemCount; lootItem.LootListID = (byte)(itemSlot + 1); - LootItem lootItemInSlot = getTarget().GetItemInSlot(itemSlot); + LootItem lootItemInSlot = GetTarget().GetItemInSlot(itemSlot); if (lootItemInSlot != null) { lootItem.CanTradeToTapList = lootItemInSlot.allowedGUIDs.Count > 1; @@ -2671,7 +2671,7 @@ namespace Game.Groups public ItemDisenchantLootRecord GetItemDisenchantLoot(Player player) { - LootItem lootItemInSlot = getTarget().GetItemInSlot(itemSlot); + LootItem lootItemInSlot = GetTarget().GetItemInSlot(itemSlot); if (lootItemInSlot != null) { ItemInstance itemInstance = new ItemInstance(lootItemInSlot); diff --git a/Source/Game/Groups/GroupReference.cs b/Source/Game/Groups/GroupReference.cs index 3caaaef19..696465171 100644 --- a/Source/Game/Groups/GroupReference.cs +++ b/Source/Game/Groups/GroupReference.cs @@ -27,24 +27,24 @@ namespace Game.Groups iSubGroup = 0; } - ~GroupReference() { unlink(); } + ~GroupReference() { Unlink(); } - public override void targetObjectBuildLink() + public override void TargetObjectBuildLink() { - getTarget().LinkMember(this); + GetTarget().LinkMember(this); } - public new GroupReference next() { return (GroupReference)base.next(); } + public new GroupReference Next() { return (GroupReference)base.Next(); } - public byte getSubGroup() { return iSubGroup; } + public byte GetSubGroup() { return iSubGroup; } - public void setSubGroup(byte pSubGroup) { iSubGroup = pSubGroup; } + public void SetSubGroup(byte pSubGroup) { iSubGroup = pSubGroup; } byte iSubGroup; } public class GroupRefManager : RefManager { - public new GroupReference getFirst() { return (GroupReference)base.getFirst(); } + public new GroupReference GetFirst() { return (GroupReference)base.GetFirst(); } } } diff --git a/Source/Game/Handlers/BattleGroundHandler.cs b/Source/Game/Handlers/BattleGroundHandler.cs index 558484e8a..e5f0b3cb3 100644 --- a/Source/Game/Handlers/BattleGroundHandler.cs +++ b/Source/Game/Handlers/BattleGroundHandler.cs @@ -184,7 +184,7 @@ namespace Game avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry.GetBracketId()); } - for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (!member) @@ -221,7 +221,7 @@ namespace Game return; // Prevent players from sending BuildPvpLogDataPacket in an arena except for when sent in Battleground.EndBattleground. - if (bg.isArena()) + if (bg.IsArena()) return; PVPLogData pvpLogData; @@ -544,7 +544,7 @@ namespace Game avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry.GetBracketId()); } - for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = grp.GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (!member) diff --git a/Source/Game/Handlers/ChatHandler.cs b/Source/Game/Handlers/ChatHandler.cs index 164d7ec31..e46dbb1df 100644 --- a/Source/Game/Handlers/ChatHandler.cs +++ b/Source/Game/Handlers/ChatHandler.cs @@ -273,7 +273,7 @@ namespace Game if (!group) { group = GetPlayer().GetGroup(); - if (!group || group.isBGGroup()) + if (!group || group.IsBGGroup()) return; } @@ -314,7 +314,7 @@ namespace Game case ChatMsg.Raid: { Group group = GetPlayer().GetGroup(); - if (!group || !group.isRaidGroup() || group.isBGGroup()) + if (!group || !group.IsRaidGroup() || group.IsBGGroup()) return; if (group.IsLeader(GetPlayer().GetGUID())) @@ -330,7 +330,7 @@ namespace Game case ChatMsg.RaidWarning: { Group group = GetPlayer().GetGroup(); - if (!group || !(group.isRaidGroup() || WorldConfig.GetBoolValue(WorldCfg.ChatPartyRaidWarnings)) || !(group.IsLeader(GetPlayer().GetGUID()) || group.IsAssistant(GetPlayer().GetGUID())) || group.isBGGroup()) + if (!group || !(group.IsRaidGroup() || WorldConfig.GetBoolValue(WorldCfg.ChatPartyRaidWarnings)) || !(group.IsLeader(GetPlayer().GetGUID()) || group.IsAssistant(GetPlayer().GetGUID())) || group.IsBGGroup()) return; Global.ScriptMgr.OnPlayerChat(GetPlayer(), type, lang, msg, group); diff --git a/Source/Game/Handlers/GroupHandler.cs b/Source/Game/Handlers/GroupHandler.cs index d2999c2c8..02f9cb640 100644 --- a/Source/Game/Handlers/GroupHandler.cs +++ b/Source/Game/Handlers/GroupHandler.cs @@ -95,11 +95,11 @@ namespace Game } Group group = GetPlayer().GetGroup(); - if (group && group.isBGGroup()) + if (group && group.IsBGGroup()) group = GetPlayer().GetOriginalGroup(); Group group2 = player.GetGroup(); - if (group2 && group2.isBGGroup()) + if (group2 && group2.IsBGGroup()) group2 = player.GetOriginalGroup(); PartyInvite partyInvite; @@ -421,7 +421,7 @@ namespace Game group.SendTargetIconList(this, packet.PartyIndex); else // target icon update { - if (group.isRaidGroup() && !group.IsLeader(GetPlayer().GetGUID()) && !group.IsAssistant(GetPlayer().GetGUID())) + if (group.IsRaidGroup() && !group.IsLeader(GetPlayer().GetGUID()) && !group.IsAssistant(GetPlayer().GetGUID())) return; if (packet.Target.IsPlayer()) @@ -645,7 +645,7 @@ namespace Game if (!group) return; - if (group.isRaidGroup() && !group.IsLeader(GetPlayer().GetGUID()) && !group.IsAssistant(GetPlayer().GetGUID())) + if (group.IsRaidGroup() && !group.IsLeader(GetPlayer().GetGUID()) && !group.IsAssistant(GetPlayer().GetGUID())) return; group.DeleteRaidMarker(packet.MarkerId); diff --git a/Source/Game/Handlers/LFGHandler.cs b/Source/Game/Handlers/LFGHandler.cs index b30a6ba3d..ef304662d 100644 --- a/Source/Game/Handlers/LFGHandler.cs +++ b/Source/Game/Handlers/LFGHandler.cs @@ -32,9 +32,9 @@ namespace Game [WorldPacketHandler(ClientOpcodes.DfJoin)] void HandleLfgJoin(DFJoin dfJoin) { - if (!Global.LFGMgr.isOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser) || + if (!Global.LFGMgr.IsOptionEnabled(LfgOptions.EnableDungeonFinder | LfgOptions.EnableRaidBrowser) || (GetPlayer().GetGroup() && GetPlayer().GetGroup().GetLeaderGUID() != GetPlayer().GetGUID() && - (GetPlayer().GetGroup().GetMembersCount() == MapConst.MaxGroupSize || !GetPlayer().GetGroup().isLFGGroup()))) + (GetPlayer().GetGroup().GetMembersCount() == MapConst.MaxGroupSize || !GetPlayer().GetGroup().IsLFGGroup()))) return; if (dfJoin.Slots.Empty()) @@ -218,7 +218,7 @@ namespace Game LfgPartyInfo lfgPartyInfo = new LfgPartyInfo(); // Get the Locked dungeons of the other party members - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player plrg = refe.GetSource(); if (!plrg) diff --git a/Source/Game/Handlers/LootHandler.cs b/Source/Game/Handlers/LootHandler.cs index 277c2d823..31f3d528d 100644 --- a/Source/Game/Handlers/LootHandler.cs +++ b/Source/Game/Handlers/LootHandler.cs @@ -95,7 +95,7 @@ namespace Game player.StoreLootItem((byte)(req.LootListID - 1), loot, aeResult); // If player is removing the last LootItem, delete the empty container. - if (loot.isLooted() && lguid.IsItem()) + if (loot.IsLooted() && lguid.IsItem()) player.GetSession().DoLootRelease(lguid); } @@ -185,7 +185,7 @@ namespace Game Group group = player.GetGroup(); List playersNear = new List(); - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player member = refe.GetSource(); if (!member) @@ -232,7 +232,7 @@ namespace Game loot.DeleteLootMoneyFromContainerItemDB(); // Delete container if empty - if (loot.isLooted() && guid.IsItem()) + if (loot.IsLooted() && guid.IsItem()) player.GetSession().DoLootRelease(guid); } } @@ -337,7 +337,7 @@ namespace Game // locked doors are opened with spelleffect openlock, prevent remove its as looted go.UseDoorOrButton(); } - else if (loot.isLooted() || go.GetGoType() == GameObjectTypes.FishingNode) + else if (loot.IsLooted() || go.GetGoType() == GameObjectTypes.FishingNode) { if (go.GetGoType() == GameObjectTypes.FishingHole) { // The fishing hole used once more @@ -350,7 +350,7 @@ namespace Game else go.SetLootState(LootState.JustDeactivated); - loot.clear(); + loot.Clear(); } else { @@ -370,9 +370,9 @@ namespace Game loot = corpse.loot; - if (loot.isLooted()) + if (loot.IsLooted()) { - loot.clear(); + loot.Clear(); corpse.RemoveCorpseDynamicFlag(CorpseDynFlags.Lootable); } } @@ -388,7 +388,7 @@ namespace Game if (proto.GetFlags().HasAnyFlag(ItemFlags.IsProspectable | ItemFlags.IsMillable)) { pItem.m_lootGenerated = false; - pItem.loot.clear(); + pItem.loot.Clear(); uint count = pItem.GetCount(); @@ -400,7 +400,7 @@ namespace Game } else { - if (pItem.loot.isLooted() || !proto.GetFlags().HasAnyFlag(ItemFlags.HasLoot)) // Only delete item if no loot or money (unlooted loot is saved to db) + if (pItem.loot.IsLooted() || !proto.GetFlags().HasAnyFlag(ItemFlags.HasLoot)) // Only delete item if no loot or money (unlooted loot is saved to db) player.DestroyItem(pItem.GetBagSlot(), pItem.GetSlot(), true); } return; // item can be looted only single player @@ -414,7 +414,7 @@ namespace Game return; loot = creature.loot; - if (loot.isLooted()) + if (loot.IsLooted()) { creature.RemoveDynamicFlag(UnitDynFlags.Lootable); @@ -422,7 +422,7 @@ namespace Game if (!creature.IsAlive()) creature.AllLootRemovedFromCorpse(); - loot.clear(); + loot.Clear(); } else { diff --git a/Source/Game/Handlers/MiscHandler.cs b/Source/Game/Handlers/MiscHandler.cs index b7e8a11b9..64efcd1c1 100644 --- a/Source/Game/Handlers/MiscHandler.cs +++ b/Source/Game/Handlers/MiscHandler.cs @@ -328,7 +328,7 @@ namespace Game Group group = player.GetGroup(); if (group) - if (group.isLFGGroup() && player.GetMap().IsDungeon()) + if (group.IsLFGGroup() && player.GetMap().IsDungeon()) teleported = player.TeleportToBGEntryPoint(); } @@ -582,7 +582,7 @@ namespace Game { if (group.IsLeader(GetPlayer().GetGUID())) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player groupGuy = refe.GetSource(); if (!groupGuy) @@ -662,7 +662,7 @@ namespace Game { if (group.IsLeader(GetPlayer().GetGUID())) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player groupGuy = refe.GetSource(); if (!groupGuy) diff --git a/Source/Game/Handlers/MovementHandler.cs b/Source/Game/Handlers/MovementHandler.cs index 0c518d48c..530b48108 100644 --- a/Source/Game/Handlers/MovementHandler.cs +++ b/Source/Game/Handlers/MovementHandler.cs @@ -340,7 +340,7 @@ namespace Game if (!seamlessTeleport) { // short preparations to continue flight - FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().top(); + FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().Top(); flight.Initialize(GetPlayer()); } return; @@ -733,7 +733,7 @@ namespace Game if (GetPlayer().GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Flight) { // short preparations to continue flight - FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().top(); + FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().Top(); flight.SetCurrentNodeAfterTeleport(); TaxiPathNodeRecord node = flight.GetPath()[(int)flight.GetCurrentNode()]; diff --git a/Source/Game/Handlers/NPCHandler.cs b/Source/Game/Handlers/NPCHandler.cs index 56d9bf43a..85f3eee70 100644 --- a/Source/Game/Handlers/NPCHandler.cs +++ b/Source/Game/Handlers/NPCHandler.cs @@ -164,7 +164,7 @@ namespace Game GetPlayer().PrepareGossipMenu(unit, unit.GetCreatureTemplate().GossipMenuId, true); GetPlayer().SendPreparedGossip(unit); } - unit.GetAI().sGossipHello(GetPlayer()); + unit.GetAI().GossipHello(GetPlayer()); } [WorldPacketHandler(ClientOpcodes.GossipSelectOption)] @@ -222,7 +222,7 @@ namespace Game { if (unit) { - unit.GetAI().sGossipSelectCode(GetPlayer(), packet.GossipID, packet.GossipIndex, packet.PromotionCode); + unit.GetAI().GossipSelectCode(GetPlayer(), packet.GossipID, packet.GossipIndex, packet.PromotionCode); if (!Global.ScriptMgr.OnGossipSelectCode(GetPlayer(), unit, GetPlayer().PlayerTalkClass.GetGossipOptionSender(packet.GossipIndex), GetPlayer().PlayerTalkClass.GetGossipOptionAction(packet.GossipIndex), packet.PromotionCode)) GetPlayer().OnGossipSelect(unit, packet.GossipIndex, packet.GossipID); } @@ -236,7 +236,7 @@ namespace Game { if (unit != null) { - unit.GetAI().sGossipSelect(GetPlayer(), packet.GossipID, packet.GossipIndex); + unit.GetAI().GossipSelect(GetPlayer(), packet.GossipID, packet.GossipIndex); if (!Global.ScriptMgr.OnGossipSelect(GetPlayer(), unit, GetPlayer().PlayerTalkClass.GetGossipOptionSender(packet.GossipIndex), GetPlayer().PlayerTalkClass.GetGossipOptionAction(packet.GossipIndex))) GetPlayer().OnGossipSelect(unit, packet.GossipIndex, packet.GossipID); } diff --git a/Source/Game/Handlers/PetHandler.cs b/Source/Game/Handlers/PetHandler.cs index 269c41565..23bd85bc4 100644 --- a/Source/Game/Handlers/PetHandler.cs +++ b/Source/Game/Handlers/PetHandler.cs @@ -369,7 +369,7 @@ namespace Game } } - spell.prepare(spell.m_targets); + spell.Prepare(spell.m_targets); } else { @@ -381,7 +381,7 @@ namespace Game if (!pet.GetSpellHistory().HasCooldown(spellid)) pet.GetSpellHistory().ResetCooldown(spellid, true); - spell.finish(false); + spell.Finish(false); spell.Dispose(); // reset specific flags in case of spell fail. AI will reset other flags @@ -692,7 +692,7 @@ namespace Game spellPrepare.ServerCastID = spell.m_castId; SendPacket(spellPrepare); - spell.prepare(targets); + spell.Prepare(targets); } else { @@ -701,7 +701,7 @@ namespace Game if (!caster.GetSpellHistory().HasCooldown(spellInfo.Id)) caster.GetSpellHistory().ResetCooldown(spellInfo.Id, true); - spell.finish(false); + spell.Finish(false); spell.Dispose(); } } diff --git a/Source/Game/Handlers/QuestHandler.cs b/Source/Game/Handlers/QuestHandler.cs index d0f557b57..e8dc7f742 100644 --- a/Source/Game/Handlers/QuestHandler.cs +++ b/Source/Game/Handlers/QuestHandler.cs @@ -80,7 +80,7 @@ namespace Game GetPlayer().PrepareGossipMenu(creature, creature.GetCreatureTemplate().GossipMenuId, true); GetPlayer().SendPreparedGossip(creature); - creature.GetAI().sGossipHello(GetPlayer()); + creature.GetAI().GossipHello(GetPlayer()); } [WorldPacketHandler(ClientOpcodes.QuestGiverAcceptQuest)] @@ -164,7 +164,7 @@ namespace Game var group = _player.GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); @@ -351,7 +351,7 @@ namespace Game } if (creatureQGiver) - creatureQGiver.GetAI().sQuestReward(GetPlayer(), quest, packet.ItemChoiceID); + creatureQGiver.GetAI().QuestReward(GetPlayer(), quest, packet.ItemChoiceID); } break; } @@ -563,7 +563,7 @@ namespace Game Group group = sender.GetGroup(); if (!group) return; - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player receiver = refe.GetSource(); diff --git a/Source/Game/Handlers/SpellHandler.cs b/Source/Game/Handlers/SpellHandler.cs index 0e83edfdf..ba3413a2d 100644 --- a/Source/Game/Handlers/SpellHandler.cs +++ b/Source/Game/Handlers/SpellHandler.cs @@ -337,7 +337,7 @@ namespace Game spell.m_fromClient = true; spell.m_misc.Data0 = cast.Cast.Misc[0]; spell.m_misc.Data1 = cast.Cast.Misc[1]; - spell.prepare(targets); + spell.Prepare(targets); } [WorldPacketHandler(ClientOpcodes.CancelCast, Processing = PacketProcessing.ThreadSafe)] diff --git a/Source/Game/Handlers/TaxiHandler.cs b/Source/Game/Handlers/TaxiHandler.cs index 0bd1ad551..0ce95db92 100644 --- a/Source/Game/Handlers/TaxiHandler.cs +++ b/Source/Game/Handlers/TaxiHandler.cs @@ -238,7 +238,7 @@ namespace Game { if (GetPlayer().m_taxi.RequestEarlyLanding()) { - FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().top(); + FlightPathMovementGenerator flight = (FlightPathMovementGenerator)GetPlayer().GetMotionMaster().Top(); flight.LoadPath(GetPlayer(), flight.GetPath()[(int)flight.GetCurrentNode()].NodeIndex); flight.Reset(GetPlayer()); } diff --git a/Source/Game/Handlers/ToyHandler.cs b/Source/Game/Handlers/ToyHandler.cs index d9f0657ff..c453f28f6 100644 --- a/Source/Game/Handlers/ToyHandler.cs +++ b/Source/Game/Handlers/ToyHandler.cs @@ -91,7 +91,7 @@ namespace Game spell.m_misc.Data0 = packet.Cast.Misc[0]; spell.m_misc.Data1 = packet.Cast.Misc[1]; spell.m_castFlagsEx |= SpellCastFlagsEx.UseToySpell; - spell.prepare(targets); + spell.Prepare(targets); } [WorldPacketHandler(ClientOpcodes.ToyClearFanfare)] diff --git a/Source/Game/Handlers/TradeHandler.cs b/Source/Game/Handlers/TradeHandler.cs index 6f3f401dc..3ddfdbe60 100644 --- a/Source/Game/Handlers/TradeHandler.cs +++ b/Source/Game/Handlers/TradeHandler.cs @@ -94,7 +94,7 @@ namespace Game SendPacket(tradeUpdated); } - void moveItems(Item[] myItems, Item[] hisItems) + void MoveItems(Item[] myItems, Item[] hisItems) { Player trader = GetPlayer().GetTrader(); if (!trader) @@ -176,7 +176,7 @@ namespace Game } } - static void setAcceptTradeMode(TradeData myTrade, TradeData hisTrade, Item[] myItems, Item[] hisItems) + static void SetAcceptTradeMode(TradeData myTrade, TradeData hisTrade, Item[] myItems, Item[] hisItems) { myTrade.SetInAcceptProcess(true); hisTrade.SetInAcceptProcess(true); @@ -202,13 +202,13 @@ namespace Game } } - static void clearAcceptTradeMode(TradeData myTrade, TradeData hisTrade) + static void ClearAcceptTradeMode(TradeData myTrade, TradeData hisTrade) { myTrade.SetInAcceptProcess(false); hisTrade.SetInAcceptProcess(false); } - static void clearAcceptTradeMode(Item[] myItems, Item[] hisItems) + static void ClearAcceptTradeMode(Item[] myItems, Item[] hisItems) { // clear 'in-trade' flag for (byte i = 0; i < (int)TradeSlots.Count; ++i) @@ -329,7 +329,7 @@ namespace Game if (his_trade.IsAccepted()) { - setAcceptTradeMode(my_trade, his_trade, myItems, hisItems); + SetAcceptTradeMode(my_trade, his_trade, myItems, hisItems); Spell my_spell = null; SpellCastTargets my_targets = new SpellCastTargets(); @@ -347,8 +347,8 @@ namespace Game if (spellEntry == null || !his_trade.GetItem(TradeSlots.NonTraded) || (my_trade.HasSpellCastItem() && !castItem)) { - clearAcceptTradeMode(my_trade, his_trade); - clearAcceptTradeMode(myItems, hisItems); + ClearAcceptTradeMode(my_trade, his_trade); + ClearAcceptTradeMode(myItems, hisItems); my_trade.SetSpell(0); return; @@ -364,8 +364,8 @@ namespace Game { my_spell.SendCastResult(res); - clearAcceptTradeMode(my_trade, his_trade); - clearAcceptTradeMode(myItems, hisItems); + ClearAcceptTradeMode(my_trade, his_trade); + ClearAcceptTradeMode(myItems, hisItems); my_spell.Dispose(); my_trade.SetSpell(0); @@ -384,8 +384,8 @@ namespace Game { his_trade.SetSpell(0); - clearAcceptTradeMode(my_trade, his_trade); - clearAcceptTradeMode(myItems, hisItems); + ClearAcceptTradeMode(my_trade, his_trade); + ClearAcceptTradeMode(myItems, hisItems); return; } @@ -399,8 +399,8 @@ namespace Game { his_spell.SendCastResult(res); - clearAcceptTradeMode(my_trade, his_trade); - clearAcceptTradeMode(myItems, hisItems); + ClearAcceptTradeMode(my_trade, his_trade); + ClearAcceptTradeMode(myItems, hisItems); my_spell.Dispose(); his_spell.Dispose(); @@ -420,12 +420,12 @@ namespace Game hisCanCompleteInfo.BagResult = trader.CanStoreItems(myItems, (int)TradeSlots.TradedCount, ref hisCanCompleteInfo.ItemID); myCanCompleteInfo.BagResult = GetPlayer().CanStoreItems(hisItems, (int)TradeSlots.TradedCount, ref myCanCompleteInfo.ItemID); - clearAcceptTradeMode(myItems, hisItems); + ClearAcceptTradeMode(myItems, hisItems); // in case of missing space report error if (myCanCompleteInfo.BagResult != InventoryResult.Ok) { - clearAcceptTradeMode(my_trade, his_trade); + ClearAcceptTradeMode(my_trade, his_trade); myCanCompleteInfo.Status = TradeStatus.Failed; trader.GetSession().SendTradeStatus(myCanCompleteInfo); @@ -437,7 +437,7 @@ namespace Game } else if (hisCanCompleteInfo.BagResult != InventoryResult.Ok) { - clearAcceptTradeMode(my_trade, his_trade); + ClearAcceptTradeMode(my_trade, his_trade); hisCanCompleteInfo.Status = TradeStatus.Failed; SendTradeStatus(hisCanCompleteInfo); @@ -464,7 +464,7 @@ namespace Game } // execute trade: 2. store - moveItems(myItems, hisItems); + MoveItems(myItems, hisItems); // logging money if (HasPermission(RBACPermissions.LogGmTrade)) @@ -490,13 +490,13 @@ namespace Game trader.ModifyMoney((long)my_trade.GetMoney()); if (my_spell) - my_spell.prepare(my_targets); + my_spell.Prepare(my_targets); if (his_spell) - his_spell.prepare(his_targets); + his_spell.Prepare(his_targets); // cleanup - clearAcceptTradeMode(my_trade, his_trade); + ClearAcceptTradeMode(my_trade, his_trade); GetPlayer().SetTradeData(null); trader.SetTradeData(null); @@ -578,7 +578,7 @@ namespace Game return; } - if (isLogingOut()) + if (IsLogingOut()) { info.Status = TradeStatus.LoggingOut; SendTradeStatus(info); @@ -635,7 +635,7 @@ namespace Game return; } - if (pOther.GetSession().isLogingOut()) + if (pOther.GetSession().IsLogingOut()) { info.Status = TradeStatus.TargetLoggingOut; SendTradeStatus(info); diff --git a/Source/Game/Loot/Loot.cs b/Source/Game/Loot/Loot.cs index b4a370a0e..7eceaf608 100644 --- a/Source/Game/Loot/Loot.cs +++ b/Source/Game/Loot/Loot.cs @@ -125,12 +125,12 @@ namespace Game.Loots public class LootValidatorRef : Reference { - public override void targetObjectDestroyLink() + public override void TargetObjectDestroyLink() { } - public override void sourceObjectDestroyLink() + public override void SourceObjectDestroyLink() { } @@ -138,8 +138,8 @@ namespace Game.Loots public class LootValidatorRefManager : RefManager { - public new LootValidatorRef getFirst() { return (LootValidatorRef)base.getFirst(); } - public new LootValidatorRef getLast() { return (LootValidatorRef)base.getLast(); } + public new LootValidatorRef GetFirst() { return (LootValidatorRef)base.GetFirst(); } + public new LootValidatorRef GetLast() { return (LootValidatorRef)base.GetLast(); } } public class Loot @@ -224,7 +224,7 @@ namespace Game.Loots { roundRobinPlayer = lootOwner.GetGUID(); - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player player = refe.GetSource(); if (player) // should actually be looted object instead of lootOwner but looter has to be really close so doesnt really matter @@ -429,7 +429,7 @@ namespace Game.Loots } } - public void generateMoneyLoot(uint minAmount, uint maxAmount) + public void GenerateMoneyLoot(uint minAmount, uint maxAmount) { if (maxAmount > 0) { @@ -550,7 +550,7 @@ namespace Game.Loots } // return true if there is any item that is lootable for any player (not quest item, FFA or conditional) - public bool hasItemForAll() + public bool HasItemForAll() { // Gold is always lootable if (gold != 0) @@ -564,7 +564,7 @@ namespace Game.Loots } // return true if there is any FFA, quest or conditional item for the player. - public bool hasItemFor(Player player) + public bool HasItemFor(Player player) { var lootPlayerQuestItems = GetPlayerQuestItems(); var q_list = lootPlayerQuestItems.LookupByKey(player.GetGUID()); @@ -606,7 +606,7 @@ namespace Game.Loots } // return true if there is any item over the group threshold (i.e. not underthreshold). - public bool hasOverThresholdItem() + public bool HasOverThresholdItem() { for (byte i = 0; i < items.Count; ++i) { @@ -812,12 +812,12 @@ namespace Game.Loots } } - public void addLootValidatorRef(LootValidatorRef pLootValidatorRef) + public void AddLootValidatorRef(LootValidatorRef pLootValidatorRef) { i_LootValidatorRefManager.InsertFirst(pLootValidatorRef); } - public void clear() + public void Clear() { PlayerQuestItems.Clear(); @@ -831,12 +831,12 @@ namespace Game.Loots gold = 0; unlootedCount = 0; roundRobinPlayer = ObjectGuid.Empty; - i_LootValidatorRefManager.clearReferences(); + i_LootValidatorRefManager.ClearReferences(); _itemContext = 0; } - public bool empty() { return items.Empty() && gold == 0; } - public bool isLooted() { return gold == 0 && unlootedCount == 0; } + public bool Empty() { return items.Empty() && gold == 0; } + public bool IsLooted() { return gold == 0 && unlootedCount == 0; } public void AddLooter(ObjectGuid guid) { PlayersLooting.Add(guid); } public void RemoveLooter(ObjectGuid guid) { PlayersLooting.Remove(guid); } diff --git a/Source/Game/Loot/LootManager.cs b/Source/Game/Loot/LootManager.cs index 5ddcb0eda..0a73984c1 100644 --- a/Source/Game/Loot/LootManager.cs +++ b/Source/Game/Loot/LootManager.cs @@ -862,9 +862,9 @@ namespace Game.Loots foreach (var group in Groups.Values) group.CheckLootRefs(store, ref_set); } - public bool addConditionItem(Condition cond) + public bool AddConditionItem(Condition cond) { - if (cond == null || !cond.isLoaded())//should never happen, checked at loading + if (cond == null || !cond.IsLoaded())//should never happen, checked at loading { Log.outError(LogFilter.Loot, "LootTemplate.addConditionItem: condition is null"); return false; @@ -918,7 +918,7 @@ namespace Game.Loots } return false; } - public bool isReference(uint id) + public bool IsReference(uint id) { foreach (var storeItem in Entries) if (storeItem.itemid == id && storeItem.reference > 0) diff --git a/Source/Game/Mails/MailDraft.cs b/Source/Game/Mails/MailDraft.cs index 640177ee9..6af0780dd 100644 --- a/Source/Game/Mails/MailDraft.cs +++ b/Source/Game/Mails/MailDraft.cs @@ -49,7 +49,7 @@ namespace Game.Mails return this; } - void prepareItems(Player receiver, SQLTransaction trans) + void PrepareItems(Player receiver, SQLTransaction trans) { if (m_mailTemplateId == 0 || !m_mailTemplateItemsNeed) return; @@ -77,7 +77,7 @@ namespace Game.Mails } } - void deleteIncludedItems(SQLTransaction trans, bool inDB = false) + void DeleteIncludedItems(SQLTransaction trans, bool inDB = false) { foreach (var item in m_items.Values) { @@ -103,7 +103,7 @@ namespace Game.Mails if (receiver == null && rc_account == 0) // sender not exist { - deleteIncludedItems(trans, true); + DeleteIncludedItems(trans, true); return; } @@ -144,7 +144,7 @@ namespace Game.Mails Player pSender = Global.ObjAccessor.FindPlayer(ObjectGuid.Create(HighGuid.Player, sender.GetSenderId())); if (pReceiver != null) - prepareItems(pReceiver, trans); // generate mail template items + PrepareItems(pReceiver, trans); // generate mail template items uint mailId = Global.ObjectMgr.GenerateMailID(); @@ -229,10 +229,10 @@ namespace Game.Mails } } else if (!m_items.Empty()) - deleteIncludedItems(null); + DeleteIncludedItems(null); } else if (!m_items.Empty()) - deleteIncludedItems(null); + DeleteIncludedItems(null); } uint GetMailTemplateId() { return m_mailTemplateId; } diff --git a/Source/Game/Maps/AreaBoundary.cs b/Source/Game/Maps/AreaBoundary.cs index 679d37955..c90af74aa 100644 --- a/Source/Game/Maps/AreaBoundary.cs +++ b/Source/Game/Maps/AreaBoundary.cs @@ -73,7 +73,7 @@ namespace Game.Maps return (offX * offX) + (offY * offY); } - public Position sync() + public Position Sync() { posX = (float)d_positionX; posY = (float)d_positionY; diff --git a/Source/Game/Maps/Cell.cs b/Source/Game/Maps/Cell.cs index 31a783223..1c19a11f9 100644 --- a/Source/Game/Maps/Cell.cs +++ b/Source/Game/Maps/Cell.cs @@ -25,19 +25,19 @@ namespace Game.Maps { public Cell(ICoord p) { - data.grid_x = p.x_coord / MapConst.MaxCells; - data.grid_y = p.y_coord / MapConst.MaxCells; - data.cell_x = p.x_coord % MapConst.MaxCells; - data.cell_y = p.y_coord % MapConst.MaxCells; + data.grid_x = p.X_coord / MapConst.MaxCells; + data.grid_y = p.Y_coord / MapConst.MaxCells; + data.cell_x = p.X_coord % MapConst.MaxCells; + data.cell_y = p.Y_coord % MapConst.MaxCells; } public Cell(float x, float y) { ICoord p = GridDefines.ComputeCellCoord(x, y); - data.grid_x = p.x_coord / MapConst.MaxCells; - data.grid_y = p.y_coord / MapConst.MaxCells; - data.cell_x = p.x_coord % MapConst.MaxCells; - data.cell_y = p.y_coord % MapConst.MaxCells; + data.grid_x = p.X_coord / MapConst.MaxCells; + data.grid_y = p.Y_coord / MapConst.MaxCells; + data.cell_x = p.X_coord % MapConst.MaxCells; + data.cell_y = p.Y_coord % MapConst.MaxCells; } public Cell(Cell cell) { data = cell.data; } @@ -153,7 +153,7 @@ namespace Game.Maps //if radius is known to reach cell area more than 4x4 then we should call optimized VisitCircle //currently this technique works with MAX_NUMBER_OF_CELLS 16 and higher, with lower values //there are nothing to optimize because SIZE_OF_GRID_CELL is too big... - if ((area.high_bound.x_coord > (area.low_bound.x_coord + 4)) && (area.high_bound.y_coord > (area.low_bound.y_coord + 4))) + if ((area.high_bound.X_coord > (area.low_bound.X_coord + 4)) && (area.high_bound.Y_coord > (area.low_bound.Y_coord + 4))) { VisitCircle(visitor, map, area.low_bound, area.high_bound); return; @@ -164,9 +164,9 @@ namespace Game.Maps map.Visit(this, visitor); // loop the cell range - for (uint x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x) + for (uint x = area.low_bound.X_coord; x <= area.high_bound.X_coord; ++x) { - for (uint y = area.low_bound.y_coord; y <= area.high_bound.y_coord; ++y) + for (uint y = area.low_bound.Y_coord; y <= area.high_bound.Y_coord; ++y) { CellCoord cellCoord = new CellCoord(x, y); //lets skip standing cell since we already visited it @@ -183,15 +183,15 @@ namespace Game.Maps void VisitCircle(Visitor visitor, Map map, ICoord begin_cell, ICoord end_cell) { //here is an algorithm for 'filling' circum-squared octagon - uint x_shift = (uint)Math.Ceiling((end_cell.x_coord - begin_cell.x_coord) * 0.3f - 0.5f); + uint x_shift = (uint)Math.Ceiling((end_cell.X_coord - begin_cell.X_coord) * 0.3f - 0.5f); //lets calculate x_start/x_end coords for central strip... - uint x_start = begin_cell.x_coord + x_shift; - uint x_end = end_cell.x_coord - x_shift; + uint x_start = begin_cell.X_coord + x_shift; + uint x_end = end_cell.X_coord - x_shift; //visit central strip with constant width... for (uint x = x_start; x <= x_end; ++x) { - for (uint y = begin_cell.y_coord; y <= end_cell.y_coord; ++y) + for (uint y = begin_cell.Y_coord; y <= end_cell.Y_coord; ++y) { CellCoord cellCoord = new CellCoord(x, y); Cell r_zone = new Cell(cellCoord); @@ -205,10 +205,10 @@ namespace Game.Maps if (x_shift == 0) return; - uint y_start = end_cell.y_coord; - uint y_end = begin_cell.y_coord; + uint y_start = end_cell.Y_coord; + uint y_end = begin_cell.Y_coord; //now we are visiting borders of an octagon... - for (uint step = 1; step <= (x_start - begin_cell.x_coord); ++step) + for (uint step = 1; step <= (x_start - begin_cell.X_coord); ++step) { //each step reduces strip height by 2 cells... y_end += 1; @@ -305,12 +305,12 @@ namespace Game.Maps { if (radius <= 0.0f) { - CellCoord center = (CellCoord)GridDefines.ComputeCellCoord(x, y).normalize(); + CellCoord center = (CellCoord)GridDefines.ComputeCellCoord(x, y).Normalize(); return new CellArea(center, center); } - CellCoord centerX = (CellCoord)GridDefines.ComputeCellCoord(x - radius, y - radius).normalize(); - CellCoord centerY = (CellCoord)GridDefines.ComputeCellCoord(x + radius, y + radius).normalize(); + CellCoord centerX = (CellCoord)GridDefines.ComputeCellCoord(x - radius, y - radius).Normalize(); + CellCoord centerY = (CellCoord)GridDefines.ComputeCellCoord(x + radius, y + radius).Normalize(); return new CellArea(centerX, centerY); } diff --git a/Source/Game/Maps/Grid.cs b/Source/Game/Maps/Grid.cs index c1a0be2be..6f423911b 100644 --- a/Source/Game/Maps/Grid.cs +++ b/Source/Game/Maps/Grid.cs @@ -39,32 +39,32 @@ namespace Game.Maps i_unloadExplicitLock = !unload; } - public TimeTracker getTimeTracker() + public TimeTracker GetTimeTracker() { return i_timer; } - public bool getUnloadLock() + public bool GetUnloadLock() { return i_unloadActiveLockCount != 0 || i_unloadExplicitLock; } - public void setUnloadExplicitLock(bool on) + public void SetUnloadExplicitLock(bool on) { i_unloadExplicitLock = on; } - public void incUnloadActiveLock() + public void IncUnloadActiveLock() { ++i_unloadActiveLockCount; } - public void decUnloadActiveLock() + public void DecUnloadActiveLock() { if (i_unloadActiveLockCount != 0) --i_unloadActiveLockCount; } - private void setTimer(TimeTracker pTimer) + private void SetTimer(TimeTracker pTimer) { i_timer = pTimer; } @@ -79,7 +79,7 @@ namespace Game.Maps i_timer.Update(diff); } - public PeriodicTimer getRelocationTimer() + public PeriodicTimer GetRelocationTimer() { return vis_Update; } @@ -137,54 +137,54 @@ namespace Game.Maps gridState = s; } - public uint getX() + public uint GetX() { return gridX; } - public uint getY() + public uint GetY() { return gridY; } - public bool isGridObjectDataLoaded() + public bool IsGridObjectDataLoaded() { return gridObjectDataLoaded; } - public void setGridObjectDataLoaded(bool pLoaded) + public void SetGridObjectDataLoaded(bool pLoaded) { gridObjectDataLoaded = pLoaded; } - public GridInfo getGridInfoRef() + public GridInfo GetGridInfoRef() { return gridInfo; } - private TimeTracker getTimeTracker() + private TimeTracker GetTimeTracker() { - return gridInfo.getTimeTracker(); + return gridInfo.GetTimeTracker(); } - public bool getUnloadLock() + public bool GetUnloadLock() { - return gridInfo.getUnloadLock(); + return gridInfo.GetUnloadLock(); } - public void setUnloadExplicitLock(bool on) + public void SetUnloadExplicitLock(bool on) { - gridInfo.setUnloadExplicitLock(on); + gridInfo.SetUnloadExplicitLock(on); } - public void incUnloadActiveLock() + public void IncUnloadActiveLock() { - gridInfo.incUnloadActiveLock(); + gridInfo.IncUnloadActiveLock(); } - public void decUnloadActiveLock() + public void DecUnloadActiveLock() { - gridInfo.decUnloadActiveLock(); + gridInfo.DecUnloadActiveLock(); } public void ResetTimeTracker(long interval) @@ -203,8 +203,8 @@ namespace Game.Maps { case GridState.Active: // Only check grid activity every (grid_expiry/10) ms, because it's really useless to do it every cycle - getGridInfoRef().UpdateTimeTracker(diff); - if (getGridInfoRef().getTimeTracker().Passed()) + GetGridInfoRef().UpdateTimeTracker(diff); + if (GetGridInfoRef().GetTimeTracker().Passed()) { if (GetWorldObjectCountInNGrid() == 0 && !map.ActiveObjectsNearGrid(this)) { @@ -212,7 +212,7 @@ namespace Game.Maps var visitor = new Visitor(worker, GridMapTypeMask.AllGrid); VisitAllGrids(visitor); SetGridState(GridState.Idle); - Log.outDebug(LogFilter.Maps, "Grid[{0}, {1}] on map {2} moved to IDLE state", getX(), getY(), + Log.outDebug(LogFilter.Maps, "Grid[{0}, {1}] on map {2} moved to IDLE state", GetX(), GetY(), map.GetId()); } else @@ -222,20 +222,20 @@ namespace Game.Maps case GridState.Idle: map.ResetGridExpiry(this); SetGridState(GridState.Removal); - Log.outDebug(LogFilter.Maps, "Grid[{0}, {1}] on map {2} moved to REMOVAL state", getX(), getY(), + Log.outDebug(LogFilter.Maps, "Grid[{0}, {1}] on map {2} moved to REMOVAL state", GetX(), GetY(), map.GetId()); break; case GridState.Removal: - if (!getGridInfoRef().getUnloadLock()) + if (!GetGridInfoRef().GetUnloadLock()) { - getGridInfoRef().UpdateTimeTracker(diff); - if (getGridInfoRef().getTimeTracker().Passed()) + GetGridInfoRef().UpdateTimeTracker(diff); + if (GetGridInfoRef().GetTimeTracker().Passed()) { if (!map.UnloadGrid(this, false)) { Log.outDebug(LogFilter.Maps, "Grid[{0}, {1}] for map {2} differed unloading due to players or active objects nearby", - getX(), getY(), map.GetId()); + GetX(), GetY(), map.GetId()); map.ResetGridExpiry(this); } } diff --git a/Source/Game/Maps/GridDefines.cs b/Source/Game/Maps/GridDefines.cs index 36c18c054..7bd65ccab 100644 --- a/Source/Game/Maps/GridDefines.cs +++ b/Source/Game/Maps/GridDefines.cs @@ -98,63 +98,63 @@ namespace Game.Maps public CellCoord(uint x, uint y) { - x_coord = x; - y_coord = y; + X_coord = x; + Y_coord = y; } public CellCoord(CellCoord obj) { - x_coord = obj.x_coord; - y_coord = obj.y_coord; + X_coord = obj.X_coord; + Y_coord = obj.Y_coord; } public bool IsCoordValid() { - return x_coord < Limit && y_coord < Limit; + return X_coord < Limit && Y_coord < Limit; } - public ICoord normalize() + public ICoord Normalize() { - x_coord = Math.Min(x_coord, Limit - 1); - y_coord = Math.Min(y_coord, Limit - 1); + X_coord = Math.Min(X_coord, Limit - 1); + Y_coord = Math.Min(Y_coord, Limit - 1); return this; } public uint GetId() { - return y_coord * Limit + x_coord; + return Y_coord * Limit + X_coord; } - public void dec_x(uint val) + public void Dec_x(uint val) { - if (x_coord > val) - x_coord -= val; + if (X_coord > val) + X_coord -= val; else - x_coord = 0; + X_coord = 0; } - public void inc_x(uint val) + public void Inc_x(uint val) { - if (x_coord + val < Limit) - x_coord += val; + if (X_coord + val < Limit) + X_coord += val; else - x_coord = Limit - 1; + X_coord = Limit - 1; } - public void dec_y(uint val) + public void Dec_y(uint val) { - if (y_coord > val) - y_coord -= val; + if (Y_coord > val) + Y_coord -= val; else - y_coord = 0; + Y_coord = 0; } - public void inc_y(uint val) + public void Inc_y(uint val) { - if (y_coord + val < Limit) - y_coord += val; + if (Y_coord + val < Limit) + Y_coord += val; else - y_coord = Limit - 1; + Y_coord = Limit - 1; } public static bool operator ==(CellCoord p1, CellCoord p2) { - return (p1.x_coord == p2.x_coord && p1.y_coord == p2.y_coord); + return (p1.X_coord == p2.X_coord && p1.Y_coord == p2.Y_coord); } public static bool operator !=(CellCoord p1, CellCoord p2) @@ -172,11 +172,11 @@ namespace Game.Maps public override int GetHashCode() { - return x_coord.GetHashCode() ^ y_coord.GetHashCode(); + return X_coord.GetHashCode() ^ Y_coord.GetHashCode(); } - public uint x_coord { get; set; } - public uint y_coord { get; set; } + public uint X_coord { get; set; } + public uint Y_coord { get; set; } } public class GridCoord : ICoord @@ -185,58 +185,58 @@ namespace Game.Maps public GridCoord(uint x, uint y) { - x_coord = x; - y_coord = y; + X_coord = x; + Y_coord = y; } public GridCoord(GridCoord obj) { - x_coord = obj.x_coord; - y_coord = obj.y_coord; + X_coord = obj.X_coord; + Y_coord = obj.Y_coord; } public bool IsCoordValid() { - return x_coord < Limit && y_coord < Limit; + return X_coord < Limit && Y_coord < Limit; } - public ICoord normalize() + public ICoord Normalize() { - x_coord = Math.Min(x_coord, Limit - 1); - y_coord = Math.Min(y_coord, Limit - 1); + X_coord = Math.Min(X_coord, Limit - 1); + Y_coord = Math.Min(Y_coord, Limit - 1); return this; } public uint GetId() { - return y_coord * Limit + x_coord; + return Y_coord * Limit + X_coord; } - public void dec_x(uint val) + public void Dec_x(uint val) { - if (x_coord > val) - x_coord -= val; + if (X_coord > val) + X_coord -= val; else - x_coord = 0; + X_coord = 0; } - public void inc_x(uint val) + public void Inc_x(uint val) { - if (x_coord + val < Limit) - x_coord += val; + if (X_coord + val < Limit) + X_coord += val; else - x_coord = Limit - 1; + X_coord = Limit - 1; } - public void dec_y(uint val) + public void Dec_y(uint val) { - if (y_coord > val) - y_coord -= val; + if (Y_coord > val) + Y_coord -= val; else - y_coord = 0; + Y_coord = 0; } - public void inc_y(uint val) + public void Inc_y(uint val) { - if (y_coord + val < Limit) - y_coord += val; + if (Y_coord + val < Limit) + Y_coord += val; else - y_coord = Limit - 1; + Y_coord = Limit - 1; } public static bool operator ==(GridCoord first, GridCoord other) @@ -244,7 +244,7 @@ namespace Game.Maps if (ReferenceEquals(first, other)) return true; - if ((object)first == null || (object)other == null) + if (ReferenceEquals(first, null) || ReferenceEquals(other, null)) return false; return first.Equals(other); @@ -262,30 +262,30 @@ namespace Game.Maps public bool Equals(GridCoord other) { - return other.x_coord == x_coord && other.y_coord == y_coord; + return other.X_coord == X_coord && other.Y_coord == Y_coord; } public override int GetHashCode() { - return new { x_coord, y_coord }.GetHashCode(); + return new { X_coord, Y_coord }.GetHashCode(); } - public uint x_coord { get; set; } - public uint y_coord { get; set; } + public uint X_coord { get; set; } + public uint Y_coord { get; set; } } public interface ICoord { bool IsCoordValid(); - ICoord normalize(); + ICoord Normalize(); uint GetId(); - void dec_x(uint val); - void inc_x(uint val); - void dec_y(uint val); - void inc_y(uint val); + void Dec_x(uint val); + void Inc_x(uint val); + void Dec_y(uint val); + void Inc_y(uint val); - uint x_coord { get; set; } - uint y_coord { get; set; } + uint X_coord { get; set; } + uint Y_coord { get; set; } } } diff --git a/Source/Game/Maps/GridMap.cs b/Source/Game/Maps/GridMap.cs index b64bb2bab..ad77a8641 100644 --- a/Source/Game/Maps/GridMap.cs +++ b/Source/Game/Maps/GridMap.cs @@ -30,22 +30,22 @@ namespace Game.Maps { // Height level data _gridHeight = MapConst.InvalidHeight; - _gridGetHeight = getHeightFromFlat; + _gridGetHeight = GetHeightFromFlat; // Liquid data _liquidLevel = MapConst.InvalidHeight; } - public bool loadData(string filename) + public bool LoadData(string filename) { - unloadData(); + UnloadData(); if (!File.Exists(filename)) return true; _fileExists = true; using (BinaryReader reader = new BinaryReader(new FileStream(filename, FileMode.Open, FileAccess.Read))) { - mapFileHeader header = reader.Read(); + MapFileHeader header = reader.Read(); if (header.mapMagic != MapConst.MapMagic || header.versionMagic != MapConst.MapVersionMagic) { Log.outError(LogFilter.Maps, $"Map file '{filename}' is from an incompatible map version. Please recreate using the mapextractor."); @@ -74,7 +74,7 @@ namespace Game.Maps } } - public void unloadData() + public void UnloadData() { _areaMap = null; m_V9 = null; @@ -82,14 +82,14 @@ namespace Game.Maps _liquidEntry = null; _liquidFlags = null; _liquidMap = null; - _gridGetHeight = getHeightFromFlat; + _gridGetHeight = GetHeightFromFlat; _fileExists = false; } bool LoadAreaData(BinaryReader reader, uint offset) { reader.BaseStream.Seek(offset, SeekOrigin.Begin); - map_AreaHeader areaHeader = reader.Read(); + MapAreaHeader areaHeader = reader.Read(); if (areaHeader.fourcc != MapConst.MapAreaMagic) return false; @@ -104,7 +104,7 @@ namespace Game.Maps bool LoadHeightData(BinaryReader reader, uint offset) { reader.BaseStream.Seek(offset, SeekOrigin.Begin); - map_HeightHeader mapHeader = reader.Read(); + MapHeightHeader mapHeader = reader.Read(); if (mapHeader.fourcc != MapConst.MapHeightMagic) return false; @@ -120,25 +120,25 @@ namespace Game.Maps m_uint16_V8 = reader.ReadArray(128 * 128); _gridIntHeightMultiplier = (mapHeader.gridMaxHeight - mapHeader.gridHeight) / 65535; - _gridGetHeight = getHeightFromUint16; + _gridGetHeight = GetHeightFromUint16; } else if (mapHeader.flags.HasAnyFlag(HeightHeaderFlags.HeightAsInt8)) { m_ubyte_V9 = reader.ReadBytes(129 * 129); m_ubyte_V8 = reader.ReadBytes(128 * 128); _gridIntHeightMultiplier = (mapHeader.gridMaxHeight - mapHeader.gridHeight) / 255; - _gridGetHeight = getHeightFromUint8; + _gridGetHeight = GetHeightFromUint8; } else { m_V9 = reader.ReadArray(129 * 129); m_V8 = reader.ReadArray(128 * 128); - _gridGetHeight = getHeightFromFloat; + _gridGetHeight = GetHeightFromFloat; } } else - _gridGetHeight = getHeightFromFlat; + _gridGetHeight = GetHeightFromFlat; if (mapHeader.flags.HasAnyFlag(HeightHeaderFlags.HeightHasFlightBounds)) { @@ -185,7 +185,7 @@ namespace Game.Maps bool LoadLiquidData(BinaryReader reader, uint offset) { reader.BaseStream.Seek(offset, SeekOrigin.Begin); - map_LiquidHeader liquidHeader = reader.Read(); + MapLiquidHeader liquidHeader = reader.Read(); if (liquidHeader.fourcc != MapConst.MapLiquidMagic) return false; @@ -210,7 +210,7 @@ namespace Game.Maps return true; } - public ushort getArea(float x, float y) + public ushort GetArea(float x, float y) { if (_areaMap == null) return _gridArea; @@ -222,12 +222,12 @@ namespace Game.Maps return _areaMap[lx * 16 + ly]; } - float getHeightFromFlat(float x, float y) + float GetHeightFromFlat(float x, float y) { return _gridHeight; } - float getHeightFromFloat(float x, float y) + float GetHeightFromFloat(float x, float y) { if (m_uint16_V8 == null || m_uint16_V9 == null) return _gridHeight; @@ -293,7 +293,7 @@ namespace Game.Maps return a * x + b * y + c; } - float getHeightFromUint8(float x, float y) + float GetHeightFromUint8(float x, float y) { if (m_ubyte_V8 == null || m_ubyte_V9 == null) return _gridHeight; @@ -366,7 +366,7 @@ namespace Game.Maps } } - float getHeightFromUint16(float x, float y) + float GetHeightFromUint16(float x, float y) { if (m_uint16_V8 == null || m_uint16_V9 == null) return _gridHeight; @@ -438,7 +438,7 @@ namespace Game.Maps } } - public float getMinHeight(float x, float y) + public float GetMinHeight(float x, float y) { if (_minHeightPlanes == null) return -500.0f; @@ -448,8 +448,8 @@ namespace Game.Maps int doubleGridX = (int)(Math.Floor(-(x - MapConst.MapHalfSize) / MapConst.CenterGridOffset)); int doubleGridY = (int)(Math.Floor(-(y - MapConst.MapHalfSize) / MapConst.CenterGridOffset)); - float gx = x - ((int)gridCoord.x_coord - MapConst.CenterGridId + 1) * MapConst.SizeofGrids; - float gy = y - ((int)gridCoord.y_coord - MapConst.CenterGridId + 1) * MapConst.SizeofGrids; + float gx = x - ((int)gridCoord.X_coord - MapConst.CenterGridId + 1) * MapConst.SizeofGrids; + float gy = y - ((int)gridCoord.Y_coord - MapConst.CenterGridId + 1) * MapConst.SizeofGrids; uint quarterIndex = 0; if (Convert.ToBoolean(doubleGridY & 1)) @@ -469,7 +469,7 @@ namespace Game.Maps return ray.intersection(_minHeightPlanes[quarterIndex]).Z; } - public float getLiquidLevel(float x, float y) + public float GetLiquidLevel(float x, float y) { if (_liquidMap == null) return _liquidLevel; @@ -489,7 +489,7 @@ namespace Game.Maps } // Why does this return LIQUID data? - public byte getTerrainType(float x, float y) + public byte GetTerrainType(float x, float y) { if (_liquidFlags == null) return 0; @@ -502,7 +502,7 @@ namespace Game.Maps } // Get water state on map - public ZLiquidStatus getLiquidStatus(float x, float y, float z, uint ReqLiquidType, LiquidData data) + public ZLiquidStatus GetLiquidStatus(float x, float y, float z, uint ReqLiquidType, LiquidData data) { // Check water type (if no water return) if (_liquidGlobalFlags == 0 && _liquidFlags == null) @@ -526,7 +526,7 @@ namespace Game.Maps uint liqTypeIdx = liquidEntry.SoundBank; if (entry < 21) { - var area = CliDB.AreaTableStorage.LookupByKey(getArea(x, y)); + var area = CliDB.AreaTableStorage.LookupByKey(GetArea(x, y)); if (area != null) { uint overrideLiquid = area.LiquidTypeID[liquidEntry.SoundBank]; @@ -566,7 +566,7 @@ namespace Game.Maps // Get water level float liquid_level = _liquidMap != null ? _liquidMap[lx_int * _liquidWidth + ly_int] : _liquidLevel; // Get ground level (sub 0.2 for fix some errors) - float ground_level = getHeight(x, y); + float ground_level = GetHeight(x, y); // Check water level and ground level if (liquid_level < ground_level || z < ground_level - 2) @@ -594,14 +594,14 @@ namespace Game.Maps return ZLiquidStatus.AboveWater; } - public float getHeight(float x, float y) { return _gridGetHeight(x, y); } + public float GetHeight(float x, float y) { return _gridGetHeight(x, y); } - public bool fileExists() { return _fileExists; } + public bool GileExists() { return _fileExists; } #region Fields - delegate float GetHeight(float x, float y); + delegate float GetHeightDel(float x, float y); - GetHeight _gridGetHeight; + GetHeightDel _gridGetHeight; uint _flags; public float[] m_V9; @@ -634,7 +634,7 @@ namespace Game.Maps #endregion } - public struct mapFileHeader + public struct MapFileHeader { public uint mapMagic; public uint versionMagic; @@ -649,14 +649,14 @@ namespace Game.Maps public uint holesSize; } - public struct map_AreaHeader + public struct MapAreaHeader { public uint fourcc; public AreaHeaderFlags flags; public ushort gridArea; } - public struct map_HeightHeader + public struct MapHeightHeader { public uint fourcc; public HeightHeaderFlags flags; @@ -664,7 +664,7 @@ namespace Game.Maps public float gridMaxHeight; } - public struct map_LiquidHeader + public struct MapLiquidHeader { public uint fourcc; public LiquidHeaderFlags flags; diff --git a/Source/Game/Maps/Instances/InstanceScript.cs b/Source/Game/Maps/Instances/InstanceScript.cs index 7c452ba15..05bd3018f 100644 --- a/Source/Game/Maps/Instances/InstanceScript.cs +++ b/Source/Game/Maps/Instances/InstanceScript.cs @@ -717,7 +717,7 @@ namespace Game.Maps { Group grp = player.GetGroup(); if (grp != null) - if (grp.isLFGGroup()) + if (grp.IsLFGGroup()) { Global.LFGMgr.FinishDungeon(grp.GetGUID(), dungeonId, instance); return; diff --git a/Source/Game/Maps/Instances/MapInstance.cs b/Source/Game/Maps/Instances/MapInstance.cs index 8c56aa303..dfcf0da21 100644 --- a/Source/Game/Maps/Instances/MapInstance.cs +++ b/Source/Game/Maps/Instances/MapInstance.cs @@ -252,8 +252,8 @@ namespace Game.Maps // should only unload VMaps if this is the last instance and grid unloading is enabled if (m_InstancedMaps.Count <= 1 && WorldConfig.GetBoolValue(WorldCfg.GridUnload)) { - Global.VMapMgr.unloadMap(pair.Value.GetId()); - Global.MMapMgr.unloadMap(pair.Value.GetId()); + Global.VMapMgr.UnloadMap(pair.Value.GetId()); + Global.MMapMgr.UnloadMap(pair.Value.GetId()); // in that case, unload grids of the base map, too // so in the next map creation, (EnsureGridCreated actually) VMaps will be reloaded base.UnloadAll(); diff --git a/Source/Game/Maps/MMapManager.cs b/Source/Game/Maps/MMapManager.cs index 9cc9f244d..e79a3aa32 100644 --- a/Source/Game/Maps/MMapManager.cs +++ b/Source/Game/Maps/MMapManager.cs @@ -43,7 +43,7 @@ namespace Game return loadedMMaps.LookupByKey(mapId); } - bool loadMapData(string basePath, uint mapId) + bool LoadMapData(string basePath, uint mapId) { // we already have this map loaded? if (loadedMMaps.ContainsKey(mapId) && loadedMMaps[mapId] != null) @@ -84,30 +84,30 @@ namespace Game } } - uint packTileID(uint x, uint y) + uint PackTileID(uint x, uint y) { return (x << 16 | y); } - public bool loadMap(string basePath, uint mapId, uint x, uint y) + public bool LoadMap(string basePath, uint mapId, uint x, uint y) { // make sure the mmap is loaded and ready to load tiles - if (!loadMapImpl(basePath, mapId, x, y)) + if (!LoadMapImpl(basePath, mapId, x, y)) return false; bool success = true; var childMaps = childMapData.LookupByKey(mapId); foreach (uint childMapId in childMaps) - if (!loadMapImpl(basePath, childMapId, x, y)) + if (!LoadMapImpl(basePath, childMapId, x, y)) success = false; return success; } - bool loadMapImpl(string basePath, uint mapId, uint x, uint y) + bool LoadMapImpl(string basePath, uint mapId, uint x, uint y) { // make sure the mmap is loaded and ready to load tiles - if (!loadMapData(basePath, mapId)) + if (!LoadMapData(basePath, mapId)) return false; // get this mmap data @@ -115,7 +115,7 @@ namespace Game Cypher.Assert(mmap.navMesh != null); // check if we already have this tile loaded - uint packedGridPos = packTileID(x, y); + uint packedGridPos = PackTileID(x, y); if (mmap.loadedTileRefs.ContainsKey(packedGridPos)) return false; @@ -167,23 +167,23 @@ namespace Game } } - public bool loadMapInstance(string basePath, uint mapId, uint instanceId) + public bool LoadMapInstance(string basePath, uint mapId, uint instanceId) { - if (!loadMapInstanceImpl(basePath, mapId, instanceId)) + if (!LoadMapInstanceImpl(basePath, mapId, instanceId)) return false; bool success = true; var childMaps = childMapData.LookupByKey(mapId); foreach (uint childMapId in childMaps) - if (!loadMapInstanceImpl(basePath, childMapId, instanceId)) + if (!LoadMapInstanceImpl(basePath, childMapId, instanceId)) success = false; return success; } - bool loadMapInstanceImpl(string basePath, uint mapId, uint instanceId) + bool LoadMapInstanceImpl(string basePath, uint mapId, uint instanceId) { - if (!loadMapData(basePath, mapId)) + if (!LoadMapData(basePath, mapId)) return false; MMapData mmap = loadedMMaps[mapId]; @@ -203,16 +203,16 @@ namespace Game return true; } - public bool unloadMap(uint mapId, uint x, uint y) + public bool UnloadMap(uint mapId, uint x, uint y) { var childMaps = childMapData.LookupByKey(mapId); foreach (uint childMapId in childMaps) - unloadMapImpl(childMapId, x, y); + UnloadMapImpl(childMapId, x, y); - return unloadMapImpl(mapId, x, y); + return UnloadMapImpl(mapId, x, y); } - bool unloadMapImpl(uint mapId, uint x, uint y) + bool UnloadMapImpl(uint mapId, uint x, uint y) { // check if we have this map loaded MMapData mmap = GetMMapData(mapId); @@ -224,7 +224,7 @@ namespace Game } // check if we have this tile loaded - uint packedGridPos = packTileID(x, y); + uint packedGridPos = PackTileID(x, y); if (!mmap.loadedTileRefs.ContainsKey(packedGridPos)) { // file may not exist, therefore not loaded @@ -255,7 +255,7 @@ namespace Game return false; } - public bool unloadMap(uint mapId) + public bool UnloadMap(uint mapId) { if (!loadedMMaps.ContainsKey(mapId)) { @@ -286,7 +286,7 @@ namespace Game return true; } - public bool unloadMapInstance(uint mapId, uint instanceId) + public bool UnloadMapInstance(uint mapId, uint instanceId) { // check if we have this map loaded MMapData mmap = GetMMapData(mapId); @@ -327,8 +327,8 @@ namespace Game return mmap.navMeshQueries[instanceId]; } - public uint getLoadedTilesCount() { return loadedTiles; } - public int getLoadedMapsCount() { return loadedMMaps.Count; } + public uint GetLoadedTilesCount() { return loadedTiles; } + public int GetLoadedMapsCount() { return loadedMMaps.Count; } Dictionary loadedMMaps = new Dictionary(); uint loadedTiles; diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index 64e6287cd..20e70899a 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -69,7 +69,7 @@ namespace Game.Maps { //z code GridMaps[x][y] = null; - setGrid(null, x, y); + SetGrid(null, x, y); } } @@ -80,7 +80,7 @@ namespace Game.Maps GetGuidSequenceGenerator(HighGuid.Transport).Set(Global.ObjectMgr.GetGenerator(HighGuid.Transport).GetNextAfterMaxUsed()); - Global.MMapMgr.loadMapInstance(Global.WorldMgr.GetDataPath(), GetId(), i_InstanceId); + Global.MMapMgr.LoadMapInstance(Global.WorldMgr.GetDataPath(), GetId(), i_InstanceId); Global.ScriptMgr.OnCreateMap(this); } @@ -103,7 +103,7 @@ namespace Game.Maps if (m_parentMap == this) m_childTerrainMaps = null; - Global.MMapMgr.unloadMapInstance(GetId(), i_InstanceId); + Global.MMapMgr.UnloadMapInstance(GetId(), i_InstanceId); } public static bool ExistMap(uint mapid, uint gx, uint gy) @@ -117,7 +117,7 @@ namespace Game.Maps using (var reader = new BinaryReader(new FileStream(fileName, FileMode.Open, FileAccess.Read))) { - var header = reader.Read(); + var header = reader.Read(); if (header.mapMagic != MapConst.MapMagic || header.versionMagic != MapConst.MapVersionMagic) { Log.outError(LogFilter.Maps, "Map file '{0}' is from an incompatible map version ({1}), {2} is expected. Please recreate using the mapextractor.", @@ -130,10 +130,10 @@ namespace Game.Maps public static bool ExistVMap(uint mapid, uint gx, uint gy) { - if (Global.VMapMgr.isMapLoadingEnabled()) + if (Global.VMapMgr.IsMapLoadingEnabled()) { - LoadResult result = Global.VMapMgr.existsMap(mapid, gx, gy); - string name = VMapManager.getMapFileName(mapid); + LoadResult result = Global.VMapMgr.ExistsMap(mapid, gx, gy); + string name = VMapManager.GetMapFileName(mapid); switch (result) { case LoadResult.Success: @@ -156,7 +156,7 @@ namespace Game.Maps if (!Global.DisableMgr.IsPathfindingEnabled(GetId())) return; - if (Global.MMapMgr.loadMap(Global.WorldMgr.GetDataPath(), GetId(), gx, gy)) + if (Global.MMapMgr.LoadMap(Global.WorldMgr.GetDataPath(), GetId(), gx, gy)) Log.outInfo(LogFilter.Maps, "MMAP loaded name:{0}, id:{1}, x:{2}, y:{3} (mmap rep.: x:{4}, y:{5})", GetMapName(), GetId(), gx, gy, gx, gy); else Log.outInfo(LogFilter.Maps, "Could not load MMAP name:{0}, id:{1}, x:{2}, y:{3} (mmap rep.: x:{4}, y:{5})", GetMapName(), GetId(), gx, gy, gx, gy); @@ -164,11 +164,11 @@ namespace Game.Maps void LoadVMap(uint gx, uint gy) { - if (!Global.VMapMgr.isMapLoadingEnabled()) + if (!Global.VMapMgr.IsMapLoadingEnabled()) return; // x and y are swapped !! - VMAPLoadResult vmapLoadResult = Global.VMapMgr.loadMap(GetId(), gx, gy); + VMAPLoadResult vmapLoadResult = Global.VMapMgr.LoadMap(GetId(), gx, gy); switch (vmapLoadResult) { case VMAPLoadResult.OK: @@ -214,7 +214,7 @@ namespace Game.Maps Log.outInfo(LogFilter.Maps, "Loading map {0}", filename); // loading data map.GridMaps[gx][gy] = new GridMap(); - if (!map.GridMaps[gx][gy].loadData(filename)) + if (!map.GridMaps[gx][gy].LoadData(filename)) Log.outError(LogFilter.Maps, "Error loading map file: {0}", filename); Global.ScriptMgr.OnLoadGridMap(map, map.GridMaps[gx][gy], gx, gy); @@ -236,7 +236,7 @@ namespace Game.Maps if ((--parent.GridMapReference[gx][gy]) == 0) { - parent.GridMaps[gx][gy].unloadData(); + parent.GridMaps[gx][gy].UnloadData(); parent.GridMaps[gx][gy] = null; } } @@ -267,11 +267,11 @@ namespace Game.Maps public void AddToGrid(T obj, Cell cell)where T : WorldObject { - Grid grid = getGrid(cell.GetGridX(), cell.GetGridY()); + Grid grid = GetGrid(cell.GetGridX(), cell.GetGridY()); switch (obj.GetTypeId()) { case TypeId.Corpse: - if (grid.isGridObjectDataLoaded()) + if (grid.IsGridObjectDataLoaded()) { // Corpses are a special object type - they can be added to grid via a call to AddToMap // or loaded through ObjectGridLoader. @@ -309,7 +309,7 @@ namespace Game.Maps if (cell == null) return; - Grid grid = getGrid(cell.GetGridX(), cell.GetGridY()); + Grid grid = GetGrid(cell.GetGridX(), cell.GetGridY()); if (grid == null) return; @@ -330,7 +330,7 @@ namespace Game.Maps if (!p.IsCoordValid()) { Log.outError(LogFilter.Maps, "Map.SwitchGridContainers: Object {0} has invalid coordinates X:{1} Y:{2} grid cell [{3}:{4}]", - obj.GetGUID(), obj.GetPositionX(), obj.GetPositionY(), p.x_coord, p.y_coord); + obj.GetGUID(), obj.GetPositionX(), obj.GetPositionY(), p.X_coord, p.Y_coord); return; } @@ -339,7 +339,7 @@ namespace Game.Maps return; Log.outDebug(LogFilter.Maps, "Switch object {0} from grid[{1}, {2}] {3}", obj.GetGUID(), cell.GetGridX(), cell.GetGridY(), on); - Grid ngrid = getGrid(cell.GetGridX(), cell.GetGridY()); + Grid ngrid = GetGrid(cell.GetGridX(), cell.GetGridY()); Cypher.Assert(ngrid != null); RemoveFromGrid(obj, cell); @@ -390,18 +390,18 @@ namespace Game.Maps void EnsureGridCreated_i(GridCoord p) { - if (getGrid(p.x_coord, p.y_coord) == null) + if (GetGrid(p.X_coord, p.Y_coord) == null) { - Log.outDebug(LogFilter.Maps, "Creating grid[{0}, {1}] for map {2} instance {3}", p.x_coord, p.y_coord, + Log.outDebug(LogFilter.Maps, "Creating grid[{0}, {1}] for map {2} instance {3}", p.X_coord, p.Y_coord, GetId(), i_InstanceId); - var grid = new Grid(p.x_coord * MapConst.MaxGrids + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, WorldConfig.GetBoolValue(WorldCfg.GridUnload)); + var grid = new Grid(p.X_coord * MapConst.MaxGrids + p.Y_coord, p.X_coord, p.Y_coord, i_gridExpiry, WorldConfig.GetBoolValue(WorldCfg.GridUnload)); grid.SetGridState(GridState.Idle); - setGrid(grid, p.x_coord, p.y_coord); + SetGrid(grid, p.X_coord, p.Y_coord); //z coord - uint gx = (MapConst.MaxGrids - 1) - p.x_coord; - uint gy = (MapConst.MaxGrids - 1) - p.y_coord; + uint gx = (MapConst.MaxGrids - 1) - p.X_coord; + uint gy = (MapConst.MaxGrids - 1) - p.Y_coord; if (GridMaps[gx][gy] == null) m_parentTerrainMap.LoadMapAndVMap(gx, gy); @@ -411,7 +411,7 @@ namespace Game.Maps void EnsureGridLoadedForActiveObject(Cell cell, WorldObject obj) { EnsureGridLoaded(cell); - Grid grid = getGrid(cell.GetGridX(), cell.GetGridY()); + Grid grid = GetGrid(cell.GetGridX(), cell.GetGridY()); // refresh grid state & timer if (grid.GetGridState() != GridState.Active) @@ -426,14 +426,14 @@ namespace Game.Maps private bool EnsureGridLoaded(Cell cell) { EnsureGridCreated(new GridCoord(cell.GetGridX(), cell.GetGridY())); - Grid grid = getGrid(cell.GetGridX(), cell.GetGridY()); + Grid grid = GetGrid(cell.GetGridX(), cell.GetGridY()); - if (!isGridObjectDataLoaded(cell.GetGridX(), cell.GetGridY())) + if (!IsGridObjectDataLoaded(cell.GetGridX(), cell.GetGridY())) { Log.outDebug(LogFilter.Maps, "Loading grid[{0}, {1}] for map {2} instance {3}", cell.GetGridX(), cell.GetGridY(), GetId(), i_InstanceId); - setGridObjectDataLoaded(true, cell.GetGridX(), cell.GetGridY()); + SetGridObjectDataLoaded(true, cell.GetGridX(), cell.GetGridY()); LoadGridObjects(grid, cell); @@ -513,7 +513,7 @@ namespace Game.Maps { Log.outError(LogFilter.Maps, "Map.Add: Object {0} has invalid coordinates X:{1} Y:{2} grid cell [{3}:{4}]", obj.GetGUID(), - obj.GetPositionX(), obj.GetPositionY(), cellCoord.x_coord, cellCoord.y_coord); + obj.GetPositionX(), obj.GetPositionY(), cellCoord.X_coord, cellCoord.Y_coord); return false; //Should delete object } @@ -549,7 +549,7 @@ namespace Game.Maps { Log.outError(LogFilter.Maps, "Map.Add: Object {0} has invalid coordinates X:{1} Y:{2} grid cell [{3}:{4}]", obj.GetGUID(), - obj.GetPositionX(), obj.GetPositionY(), cellCoord.x_coord, cellCoord.y_coord); + obj.GetPositionX(), obj.GetPositionY(), cellCoord.X_coord, cellCoord.Y_coord); return false; //Should delete object } @@ -580,7 +580,7 @@ namespace Game.Maps public bool IsGridLoaded(GridCoord p) { - return (getGrid(p.x_coord, p.y_coord) != null && isGridObjectDataLoaded(p.x_coord, p.y_coord)); + return (GetGrid(p.X_coord, p.Y_coord) != null && IsGridObjectDataLoaded(p.X_coord, p.Y_coord)); } void VisitNearbyCellsOf(WorldObject obj, Visitor gridVisitor, Visitor worldVisitor) @@ -592,17 +592,17 @@ namespace Game.Maps // Update mobs/objects in ALL visible cells around object! CellArea area = Cell.CalculateCellArea(obj.GetPositionX(), obj.GetPositionY(), obj.GetGridActivationRange()); - for (uint x = area.low_bound.x_coord; x <= area.high_bound.x_coord; ++x) + for (uint x = area.low_bound.X_coord; x <= area.high_bound.X_coord; ++x) { - for (uint y = area.low_bound.y_coord; y <= area.high_bound.y_coord; ++y) + for (uint y = area.low_bound.Y_coord; y <= area.high_bound.Y_coord; ++y) { // marked cells are those that have been visited // don't visit the same cell twice uint cell_id = (y * MapConst.TotalCellsPerMap) + x; - if (isCellMarked(cell_id)) + if (IsCellMarked(cell_id)) continue; - markCell(cell_id); + MarkCell(cell_id); var pair = new CellCoord(x, y); var cell = new Cell(pair); cell.SetNoCreate(); @@ -614,7 +614,7 @@ namespace Game.Maps public virtual void Update(uint diff) { - _dynamicTree.update(diff); + _dynamicTree.Update(diff); // update worldsessions for existing players for (var i = 0; i < m_activePlayers.Count; ++i) @@ -629,7 +629,7 @@ namespace Game.Maps } // update active cells around players and active objects - resetMarkedCells(); + ResetMarkedCells(); var update = new UpdaterNotifier(diff); @@ -656,7 +656,7 @@ namespace Game.Maps if (player.IsInCombat()) { List updateList = new List(); - HostileReference refe = player.GetHostileRefManager().getFirst(); + HostileReference refe = player.GetHostileRefManager().GetFirst(); while (refe != null) { @@ -665,7 +665,7 @@ namespace Game.Maps if (unit.ToCreature() && unit.GetMapId() == player.GetMapId() && !unit.IsWithinDistInMap(player, GetVisibilityRange(), false)) updateList.Add(unit.ToCreature()); - refe = refe.next(); + refe = refe.Next(); } // Process deferred update list for player @@ -729,29 +729,29 @@ namespace Game.Maps { for (uint y = 0; y < MapConst.MaxGrids; ++y) { - Grid grid = getGrid(x, y); + Grid grid = GetGrid(x, y); if (grid == null) continue; if (grid.GetGridState() != GridState.Active) continue; - grid.getGridInfoRef().getRelocationTimer().TUpdate((int)diff); - if (!grid.getGridInfoRef().getRelocationTimer().TPassed()) + grid.GetGridInfoRef().GetRelocationTimer().TUpdate((int)diff); + if (!grid.GetGridInfoRef().GetRelocationTimer().TPassed()) continue; - uint gx = grid.getX(); - uint gy = grid.getY(); + uint gx = grid.GetX(); + uint gy = grid.GetY(); var cell_min = new CellCoord(gx * MapConst.MaxCells, gy * MapConst.MaxCells); - var cell_max = new CellCoord(cell_min.x_coord + MapConst.MaxCells, cell_min.y_coord + MapConst.MaxCells); + var cell_max = new CellCoord(cell_min.X_coord + MapConst.MaxCells, cell_min.Y_coord + MapConst.MaxCells); - for (uint xx = cell_min.x_coord; xx < cell_max.x_coord; ++xx) + for (uint xx = cell_min.X_coord; xx < cell_max.X_coord; ++xx) { - for (uint yy = cell_min.y_coord; yy < cell_max.y_coord; ++yy) + for (uint yy = cell_min.Y_coord; yy < cell_max.Y_coord; ++yy) { uint cell_id = (yy * MapConst.TotalCellsPerMap) + xx; - if (!isCellMarked(cell_id)) + if (!IsCellMarked(cell_id)) continue; var pair = new CellCoord(xx, yy); @@ -776,31 +776,31 @@ namespace Game.Maps { for (uint y = 0; y < MapConst.MaxGrids; ++y) { - Grid grid = getGrid(x, y); + Grid grid = GetGrid(x, y); if (grid == null) continue; if (grid.GetGridState() != GridState.Active) continue; - if (!grid.getGridInfoRef().getRelocationTimer().TPassed()) + if (!grid.GetGridInfoRef().GetRelocationTimer().TPassed()) continue; - grid.getGridInfoRef().getRelocationTimer().TReset((int)diff, m_VisibilityNotifyPeriod); + grid.GetGridInfoRef().GetRelocationTimer().TReset((int)diff, m_VisibilityNotifyPeriod); - uint gx = grid.getX(); - uint gy = grid.getY(); + uint gx = grid.GetX(); + uint gy = grid.GetY(); var cell_min = new CellCoord(gx * MapConst.MaxCells, gy * MapConst.MaxCells); - var cell_max = new CellCoord(cell_min.x_coord + MapConst.MaxCells, - cell_min.y_coord + MapConst.MaxCells); + var cell_max = new CellCoord(cell_min.X_coord + MapConst.MaxCells, + cell_min.Y_coord + MapConst.MaxCells); - for (uint xx = cell_min.x_coord; xx < cell_max.x_coord; ++xx) + for (uint xx = cell_min.X_coord; xx < cell_max.X_coord; ++xx) { - for (uint yy = cell_min.y_coord; yy < cell_max.y_coord; ++yy) + for (uint yy = cell_min.Y_coord; yy < cell_max.Y_coord; ++yy) { uint cell_id = (yy * MapConst.TotalCellsPerMap) + xx; - if (!isCellMarked(cell_id)) + if (!IsCellMarked(cell_id)) continue; var pair = new CellCoord(xx, yy); @@ -818,7 +818,7 @@ namespace Game.Maps { Global.ScriptMgr.OnPlayerLeaveMap(this, player); - player.GetHostileRefManager().deleteReferences(); // multithreading crashfix + player.GetHostileRefManager().DeleteReferences(); // multithreading crashfix bool inWorld = player.IsInWorld; player.RemoveFromWorld(); @@ -935,7 +935,7 @@ namespace Game.Maps Cell old_cell = creature.GetCurrentCell(); var new_cell = new Cell(x, y); - if (!respawnRelocationOnFail && getGrid(new_cell.GetGridX(), new_cell.GetGridY()) == null) + if (!respawnRelocationOnFail && GetGrid(new_cell.GetGridX(), new_cell.GetGridY()) == null) return; //! If hovering, always increase our server-side Z position @@ -967,7 +967,7 @@ namespace Game.Maps Cell old_cell = go.GetCurrentCell(); var new_cell = new Cell(x, y); - if (!respawnRelocationOnFail && getGrid(new_cell.GetGridX(), new_cell.GetGridY()) == null) + if (!respawnRelocationOnFail && GetGrid(new_cell.GetGridX(), new_cell.GetGridY()) == null) return; // delay creature move for grid/cell to grid/cell moves @@ -999,7 +999,7 @@ namespace Game.Maps Cell new_cell = new Cell(x, y); - if (getGrid(new_cell.GetGridX(), new_cell.GetGridY()) == null) + if (GetGrid(new_cell.GetGridX(), new_cell.GetGridY()) == null) return; // delay creature move for grid/cell to grid/cell moves @@ -1033,7 +1033,7 @@ namespace Game.Maps Cypher.Assert(integrity_check == old_cell); Cell new_cell = new Cell(x, y); - if (getGrid(new_cell.GetGridX(), new_cell.GetGridY()) == null) + if (GetGrid(new_cell.GetGridX(), new_cell.GetGridY()) == null) return; // delay areatrigger move for grid/cell to grid/cell moves @@ -1557,8 +1557,8 @@ namespace Game.Maps public bool UnloadGrid(Grid grid, bool unloadAll) { - uint x = grid.getX(); - uint y = grid.getY(); + uint x = grid.GetX(); + uint y = grid.GetY(); if (!unloadAll) { @@ -1606,7 +1606,7 @@ namespace Game.Maps } Cypher.Assert(i_objectsToRemove.Empty()); - setGrid(null, x, y); + SetGrid(null, x, y); uint gx = (MapConst.MaxGrids - 1) - x; uint gy = (MapConst.MaxGrids - 1) - y; @@ -1615,8 +1615,8 @@ namespace Game.Maps if (GridMaps[gx][gy] != null) { m_parentTerrainMap.UnloadMap(gx, gy); - Global.VMapMgr.unloadMap(m_parentTerrainMap.GetId(), gx, gy); - Global.MMapMgr.unloadMap(m_parentTerrainMap.GetId(), gx, gy); + Global.VMapMgr.UnloadMap(m_parentTerrainMap.GetId(), gx, gy); + Global.MMapMgr.UnloadMap(m_parentTerrainMap.GetId(), gx, gy); } Log.outDebug(LogFilter.Maps, "Unloading grid[{0}, {1}] for map {2} finished", x, y, GetId()); @@ -1651,7 +1651,7 @@ namespace Game.Maps { for (uint y = 0; y < MapConst.MaxGrids; ++y) { - var grid = getGrid(x, y); + var grid = GetGrid(x, y); if (grid == null) continue; @@ -1702,7 +1702,7 @@ namespace Game.Maps GridMap grid = GridMaps[gx][gy]; var childMap = m_childTerrainMaps.Find(childTerrainMap => childTerrainMap.GetId() == mapId); - if (childMap != null && childMap.GridMaps[gx][gy].fileExists()) + if (childMap != null && childMap.GridMaps[gx][gy].GileExists()) grid = childMap.GridMaps[gx][gy]; return grid; @@ -1711,7 +1711,7 @@ namespace Game.Maps public bool HasGridMap(uint mapId, uint gx, uint gy) { var childMap = m_childTerrainMaps.Find(childTerrainMap => childTerrainMap.GetId() == mapId); - return childMap != null && childMap.GridMaps[gx][gy] != null && childMap.GridMaps[gx][gy].fileExists(); + return childMap != null && childMap.GridMaps[gx][gy] != null && childMap.GridMaps[gx][gy].GileExists(); } public float GetWaterOrGroundLevel(PhaseShift phaseShift, float x, float y, float z) @@ -1730,7 +1730,7 @@ namespace Game.Maps LiquidData liquid_status; - ZLiquidStatus res = getLiquidStatus(phaseShift, x, y, ground_z, MapConst.MapAllLiquidTypes, out liquid_status); + ZLiquidStatus res = GetLiquidStatus(phaseShift, x, y, ground_z, MapConst.MapAllLiquidTypes, out liquid_status); return res != ZLiquidStatus.NoWater ? liquid_status.level : ground_z; } @@ -1745,7 +1745,7 @@ namespace Game.Maps GridMap gmap = m_parentTerrainMap.GetGridMap(terrainMapId, x, y); if (gmap != null) { - float gridHeight = gmap.getHeight(x, y); + float gridHeight = gmap.GetHeight(x, y); // look from a bit higher pos to find the floor, ignore under surface case if (z + 2.0f > gridHeight) mapHeight = gridHeight; @@ -1754,8 +1754,8 @@ namespace Game.Maps float vmapHeight = MapConst.VMAPInvalidHeightValue; if (checkVMap) { - if (Global.VMapMgr.isHeightCalcEnabled()) - vmapHeight = Global.VMapMgr.getHeight(terrainMapId, x, y, z + 2.0f, maxSearchDist); + if (Global.VMapMgr.IsHeightCalcEnabled()) + vmapHeight = Global.VMapMgr.GetHeight(terrainMapId, x, y, z + 2.0f, maxSearchDist); // look from a bit higher pos to find the floor } @@ -1783,7 +1783,7 @@ namespace Game.Maps { GridMap grid = GetGridMap(x, y); if (grid != null) - return grid.getMinHeight(x, y); + return grid.GetMinHeight(x, y); return -500.0f; } @@ -1852,8 +1852,8 @@ namespace Game.Maps int drootId; int dgroupId; - bool hasVmapAreaInfo = Global.VMapMgr.getAreaInfo(terrainMapId, x, y, ref vmap_z, out vflags, out vadtId, out vrootId, out vgroupId); - bool hasDynamicAreaInfo = _dynamicTree.getAreaInfo(x, y, ref dynamic_z, phaseShift, out dflags, out dadtId, out drootId, out dgroupId); + bool hasVmapAreaInfo = Global.VMapMgr.GetAreaInfo(terrainMapId, x, y, ref vmap_z, out vflags, out vadtId, out vrootId, out vgroupId); + bool hasDynamicAreaInfo = _dynamicTree.GetAreaInfo(x, y, ref dynamic_z, phaseShift, out dflags, out dadtId, out drootId, out dgroupId); if (hasVmapAreaInfo) { @@ -1890,7 +1890,7 @@ namespace Game.Maps GridMap gmap = m_parentTerrainMap.GetGridMap(terrainMapId, x, y); if (gmap != null) { - float mapHeight = gmap.getHeight(x, y); + float mapHeight = gmap.GetHeight(x, y); // z + 2.0f condition taken from GetHeight(), not sure if it's such a great choice... if (z + 2.0f > mapHeight && mapHeight > check_z) return false; @@ -1931,7 +1931,7 @@ namespace Game.Maps { GridMap gmap = m_parentTerrainMap.GetGridMap(PhasingHandler.GetTerrainMapId(phaseShift, this, x, y), x, y); if (gmap != null) - areaId = gmap.getArea(x, y); + areaId = gmap.GetArea(x, y); // this used while not all *.map files generated (instances) if (areaId == 0) @@ -1970,17 +1970,17 @@ namespace Game.Maps { GridMap gmap = m_parentTerrainMap.GetGridMap(PhasingHandler.GetTerrainMapId(phaseShift, this, x, y), x, y); if (gmap != null) - return gmap.getTerrainType(x, y); + return gmap.GetTerrainType(x, y); return 0; } - public ZLiquidStatus getLiquidStatus(PhaseShift phaseShift, float x, float y, float z, uint ReqLiquidType) + public ZLiquidStatus GetLiquidStatus(PhaseShift phaseShift, float x, float y, float z, uint ReqLiquidType) { LiquidData throwaway; - return getLiquidStatus(phaseShift, x, y, z, ReqLiquidType, out throwaway); + return GetLiquidStatus(phaseShift, x, y, z, ReqLiquidType, out throwaway); } - public ZLiquidStatus getLiquidStatus(PhaseShift phaseShift, float x, float y, float z, uint ReqLiquidType, out LiquidData data) + public ZLiquidStatus GetLiquidStatus(PhaseShift phaseShift, float x, float y, float z, uint ReqLiquidType, out LiquidData data) { data = new LiquidData(); var result = ZLiquidStatus.NoWater; @@ -2050,7 +2050,7 @@ namespace Game.Maps if (gmap != null) { var map_data = new LiquidData(); - ZLiquidStatus map_result = gmap.getLiquidStatus(x, y, z, ReqLiquidType, map_data); + ZLiquidStatus map_result = gmap.GetLiquidStatus(x, y, z, ReqLiquidType, map_data); // Not override LIQUID_MAP_ABOVE_WATER with LIQUID_MAP_NO_WATER: if (map_result != ZLiquidStatus.NoWater && (map_data.level > ground_level)) { @@ -2070,23 +2070,23 @@ namespace Game.Maps { GridMap gmap = m_parentTerrainMap.GetGridMap(PhasingHandler.GetTerrainMapId(phaseShift, this, x, y), x, y); if (gmap != null) - return gmap.getLiquidLevel(x, y); + return gmap.GetLiquidLevel(x, y); return 0; } - public bool isInLineOfSight(PhaseShift phaseShift, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags) + public bool IsInLineOfSight(PhaseShift phaseShift, float x1, float y1, float z1, float x2, float y2, float z2, ModelIgnoreFlags ignoreFlags) { - return Global.VMapMgr.isInLineOfSight(PhasingHandler.GetTerrainMapId(phaseShift, this, x1, y1), x1, y1, z1, x2, y2, z2, ignoreFlags) - && _dynamicTree.isInLineOfSight(new Vector3(x1, y1, z1), new Vector3(x2, y2, z2), phaseShift); + return Global.VMapMgr.IsInLineOfSight(PhasingHandler.GetTerrainMapId(phaseShift, this, x1, y1), x1, y1, z1, x2, y2, z2, ignoreFlags) + && _dynamicTree.IsInLineOfSight(new Vector3(x1, y1, z1), new Vector3(x2, y2, z2), phaseShift); } - public bool getObjectHitPos(PhaseShift phaseShift, float x1, float y1, float z1, float x2, float y2, float z2, out float rx, out float ry, out float rz, float modifyDist) + public bool GetObjectHitPos(PhaseShift phaseShift, float x1, float y1, float z1, float x2, float y2, float z2, out float rx, out float ry, out float rz, float modifyDist) { var startPos = new Vector3(x1, y1, z1); var dstPos = new Vector3(x2, y2, z2); var resultPos = new Vector3(); - bool result = _dynamicTree.getObjectHitPos(startPos, dstPos, ref resultPos, modifyDist, phaseShift); + bool result = _dynamicTree.GetObjectHitPos(startPos, dstPos, ref resultPos, modifyDist, phaseShift); rx = resultPos.X; ry = resultPos.Y; @@ -2096,17 +2096,17 @@ namespace Game.Maps public float GetHeight(PhaseShift phaseShift, float x, float y, float z, bool vmap = true, float maxSearchDist = MapConst.DefaultHeightSearch) { - return Math.Max(GetStaticHeight(phaseShift, x, y, z, vmap, maxSearchDist), _dynamicTree.getHeight(x, y, z, maxSearchDist, phaseShift)); + return Math.Max(GetStaticHeight(phaseShift, x, y, z, vmap, maxSearchDist), _dynamicTree.GetHeight(x, y, z, maxSearchDist, phaseShift)); } public bool IsInWater(PhaseShift phaseShift, float x, float y, float pZ) { - return Convert.ToBoolean(getLiquidStatus(phaseShift, x, y, pZ, MapConst.MapAllLiquidTypes) & (ZLiquidStatus.InWater | ZLiquidStatus.UnderWater)); + return Convert.ToBoolean(GetLiquidStatus(phaseShift, x, y, pZ, MapConst.MapAllLiquidTypes) & (ZLiquidStatus.InWater | ZLiquidStatus.UnderWater)); } public bool IsUnderWater(PhaseShift phaseShift, float x, float y, float z) { - return Convert.ToBoolean(getLiquidStatus(phaseShift, x, y, z, MapConst.MapLiquidTypeWater | MapConst.MapLiquidTypeOcean) & ZLiquidStatus.UnderWater); + return Convert.ToBoolean(GetLiquidStatus(phaseShift, x, y, z, MapConst.MapLiquidTypeWater | MapConst.MapLiquidTypeOcean) & ZLiquidStatus.UnderWater); } private bool CheckGridIntegrity(Creature c, bool moved) @@ -2214,7 +2214,7 @@ namespace Game.Maps player.SendPacket(packet); } - void setGrid(Grid grid, uint x, uint y) + void SetGrid(Grid grid, uint x, uint y) { if (x >= MapConst.MaxGrids || y >= MapConst.MaxGrids) { @@ -2265,7 +2265,7 @@ namespace Game.Maps { for (uint y = 0; y < MapConst.MaxGrids; ++y) { - Grid grid = getGrid(x, y); + Grid grid = GetGrid(x, y); if (grid != null) grid.Update(this, diff); } @@ -2387,33 +2387,33 @@ namespace Game.Maps public bool ActiveObjectsNearGrid(Grid grid) { - var cell_min = new CellCoord(grid.getX() * MapConst.MaxCells, - grid.getY() * MapConst.MaxCells); - var cell_max = new CellCoord(cell_min.x_coord + MapConst.MaxCells, - cell_min.y_coord + MapConst.MaxCells); + var cell_min = new CellCoord(grid.GetX() * MapConst.MaxCells, + grid.GetY() * MapConst.MaxCells); + var cell_max = new CellCoord(cell_min.X_coord + MapConst.MaxCells, + cell_min.Y_coord + MapConst.MaxCells); //we must find visible range in cells so we unload only non-visible cells... float viewDist = GetVisibilityRange(); uint cell_range = (uint)Math.Ceiling(viewDist / MapConst.SizeofCells) + 1; - cell_min.dec_x(cell_range); - cell_min.dec_y(cell_range); - cell_max.inc_x(cell_range); - cell_max.inc_y(cell_range); + cell_min.Dec_x(cell_range); + cell_min.Dec_y(cell_range); + cell_max.Inc_x(cell_range); + cell_max.Inc_y(cell_range); foreach (Player pl in m_activePlayers) { CellCoord p = GridDefines.ComputeCellCoord(pl.GetPositionX(), pl.GetPositionY()); - if ((cell_min.x_coord <= p.x_coord && p.x_coord <= cell_max.x_coord) && - (cell_min.y_coord <= p.y_coord && p.y_coord <= cell_max.y_coord)) + if ((cell_min.X_coord <= p.X_coord && p.X_coord <= cell_max.X_coord) && + (cell_min.Y_coord <= p.Y_coord && p.Y_coord <= cell_max.Y_coord)) return true; } foreach (WorldObject obj in m_activeNonPlayers) { CellCoord p = GridDefines.ComputeCellCoord(obj.GetPositionX(), obj.GetPositionY()); - if ((cell_min.x_coord <= p.x_coord && p.x_coord <= cell_max.x_coord) && - (cell_min.y_coord <= p.y_coord && p.y_coord <= cell_max.y_coord)) + if ((cell_min.X_coord <= p.X_coord && p.X_coord <= cell_max.X_coord) && + (cell_min.Y_coord <= p.Y_coord && p.Y_coord <= cell_max.Y_coord)) return true; } @@ -2433,14 +2433,14 @@ namespace Game.Maps float x, y, z; c.GetRespawnPosition(out x, out y, out z); GridCoord p = GridDefines.ComputeGridCoord(x, y); - if (getGrid(p.x_coord, p.y_coord) != null) - getGrid(p.x_coord, p.y_coord).incUnloadActiveLock(); + if (GetGrid(p.X_coord, p.Y_coord) != null) + GetGrid(p.X_coord, p.Y_coord).IncUnloadActiveLock(); else { GridCoord p2 = GridDefines.ComputeGridCoord(c.GetPositionX(), c.GetPositionY()); Log.outError(LogFilter.Maps, "Active creature (GUID: {0} Entry: {1}) added to grid[{2}, {3}] but spawn grid[{4}, {5}] was not loaded.", - c.GetGUID().ToString(), c.GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); + c.GetGUID().ToString(), c.GetEntry(), p.X_coord, p.Y_coord, p2.X_coord, p2.Y_coord); } } } @@ -2464,14 +2464,14 @@ namespace Game.Maps float x, y, z; c.GetRespawnPosition(out x, out y, out z); GridCoord p = GridDefines.ComputeGridCoord(x, y); - if (getGrid(p.x_coord, p.y_coord) != null) - getGrid(p.x_coord, p.y_coord).decUnloadActiveLock(); + if (GetGrid(p.X_coord, p.Y_coord) != null) + GetGrid(p.X_coord, p.Y_coord).DecUnloadActiveLock(); else { GridCoord p2 = GridDefines.ComputeGridCoord(c.GetPositionX(), c.GetPositionY()); Log.outDebug(LogFilter.Maps, "Active creature (GUID: {0} Entry: {1}) removed from grid[{2}, {3}] but spawn grid[{4}, {5}] was not loaded.", - c.GetGUID().ToString(), c.GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); + c.GetGUID().ToString(), c.GetEntry(), p.X_coord, p.Y_coord, p2.X_coord, p2.Y_coord); } } } @@ -2968,18 +2968,18 @@ namespace Game.Maps public bool IsRemovalGrid(float x, float y) { GridCoord p = GridDefines.ComputeGridCoord(x, y); - return getGrid(p.x_coord, p.y_coord) == null || - getGrid(p.x_coord, p.y_coord).GetGridState() == GridState.Removal; + return GetGrid(p.X_coord, p.Y_coord) == null || + GetGrid(p.X_coord, p.Y_coord).GetGridState() == GridState.Removal; } private bool GetUnloadLock(GridCoord p) { - return getGrid(p.x_coord, p.y_coord).getUnloadLock(); + return GetGrid(p.X_coord, p.Y_coord).GetUnloadLock(); } void SetUnloadLock(GridCoord p, bool on) { - getGrid(p.x_coord, p.y_coord).setUnloadExplicitLock(on); + GetGrid(p.X_coord, p.Y_coord).SetUnloadExplicitLock(on); } public void ResetGridExpiry(Grid grid, float factor = 1) @@ -3106,17 +3106,17 @@ namespace Game.Maps return i_mapRecord.GetEntrancePos(out mapid, out x, out y); } - void resetMarkedCells() + void ResetMarkedCells() { marked_cells.SetAll(false); } - private bool isCellMarked(uint pCellId) + private bool IsCellMarked(uint pCellId) { return marked_cells.Get((int)pCellId); } - void markCell(uint pCellId) + void MarkCell(uint pCellId) { marked_cells.Set((int)pCellId, true); } @@ -3163,22 +3163,22 @@ namespace Game.Maps void Balance() { - _dynamicTree.balance(); + _dynamicTree.Balance(); } public void RemoveGameObjectModel(GameObjectModel model) { - _dynamicTree.remove(model); + _dynamicTree.Remove(model); } public void InsertGameObjectModel(GameObjectModel model) { - _dynamicTree.insert(model); + _dynamicTree.Insert(model); } public bool ContainsGameObjectModel(GameObjectModel model) { - return _dynamicTree.contains(model); + return _dynamicTree.Contains(model); } public virtual uint GetOwnerGuildId(Team team = Team.Other) @@ -3201,19 +3201,19 @@ namespace Game.Maps i_gridExpiry = t < MapConst.MinGridDelay ? MapConst.MinGridDelay : t; } - private Grid getGrid(uint x, uint y) + private Grid GetGrid(uint x, uint y) { return i_grids[x][y]; } - private bool isGridObjectDataLoaded(uint x, uint y) + private bool IsGridObjectDataLoaded(uint x, uint y) { - return getGrid(x, y).isGridObjectDataLoaded(); + return GetGrid(x, y).IsGridObjectDataLoaded(); } - void setGridObjectDataLoaded(bool pLoaded, uint x, uint y) + void SetGridObjectDataLoaded(bool pLoaded, uint x, uint y) { - getGrid(x, y).setGridObjectDataLoaded(pLoaded); + GetGrid(x, y).SetGridObjectDataLoaded(pLoaded); } public AreaTrigger GetAreaTrigger(ObjectGuid guid) @@ -3291,7 +3291,7 @@ namespace Game.Maps if (!cell.NoCreate() || IsGridLoaded(new GridCoord(x, y))) { EnsureGridLoaded(cell); - getGrid(x, y).VisitGrid(cell_x, cell_y, visitor); + GetGrid(x, y).VisitGrid(cell_x, cell_y, visitor); } } @@ -4414,7 +4414,7 @@ namespace Game.Maps Group group = player.GetGroup(); // increase current instances (hourly limit) - if (!group || !group.isLFGGroup()) + if (!group || !group.IsLFGGroup()) player.AddInstanceEnterTime(GetInstanceId(), Time.UnixTime); // get or create an instance save for the map diff --git a/Source/Game/Maps/MapManager.cs b/Source/Game/Maps/MapManager.cs index 82e778578..dc5c69000 100644 --- a/Source/Game/Maps/MapManager.cs +++ b/Source/Game/Maps/MapManager.cs @@ -155,7 +155,7 @@ namespace Game.Entities Group group = player.GetGroup(); if (entry.IsRaid() && entry.Expansion() >= (Expansion)WorldConfig.GetIntValue(WorldCfg.Expansion)) // can only enter in a raid group but raids from old expansion don't need a group - if ((!group || !group.isRaidGroup()) && WorldConfig.GetBoolValue(WorldCfg.InstanceIgnoreRaid)) + if ((!group || !group.IsRaidGroup()) && WorldConfig.GetBoolValue(WorldCfg.InstanceIgnoreRaid)) return EnterState.CannotEnterNotInRaid; if (!player.IsAlive()) @@ -198,7 +198,7 @@ namespace Game.Entities } } // players are only allowed to enter 10 instances per hour - if (entry.IsDungeon() && (player.GetGroup() == null || (player.GetGroup() != null && !player.GetGroup().isLFGGroup()))) + if (entry.IsDungeon() && (player.GetGroup() == null || (player.GetGroup() != null && !player.GetGroup().IsLFGGroup()))) { uint instaceIdToCheck = 0; InstanceSave save = player.GetInstanceSave(mapid); @@ -245,8 +245,8 @@ namespace Game.Entities { GridCoord p = GridDefines.ComputeGridCoord(x, y); - uint gx = 63 - p.x_coord; - uint gy = 63 - p.y_coord; + uint gx = 63 - p.X_coord; + uint gy = 63 - p.Y_coord; return Map.ExistMap(mapid, gx, gy) && Map.ExistVMap(mapid, gx, gy); } diff --git a/Source/Game/Maps/ObjectGridLoader.cs b/Source/Game/Maps/ObjectGridLoader.cs index c7311a273..b7feefa81 100644 --- a/Source/Game/Maps/ObjectGridLoader.cs +++ b/Source/Game/Maps/ObjectGridLoader.cs @@ -165,7 +165,7 @@ namespace Game.Maps creature.RemoveAllDynObjects(); creature.RemoveAllAreaTriggers(); - if (creature.IsInCombat() || !creature.GetThreatManager().areThreatListsEmpty()) + if (creature.IsInCombat() || !creature.GetThreatManager().IsThreatListsEmpty()) { creature.CombatStop(); creature.DeleteThreatList(); diff --git a/Source/Game/Maps/TransportManager.cs b/Source/Game/Maps/TransportManager.cs index 1792dc8a7..2ea5733de 100644 --- a/Source/Game/Maps/TransportManager.cs +++ b/Source/Game/Maps/TransportManager.cs @@ -115,8 +115,8 @@ namespace Game.Maps SplineRawInitializer initer = new SplineRawInitializer(allPoints); Spline orientationSpline = new Spline(); - orientationSpline.init_spline_custom(initer); - orientationSpline.initLengths(); + orientationSpline.InitSplineCustom(initer); + orientationSpline.InitLengths(); for (uint i = 0; i < path.Length; ++i) { @@ -204,12 +204,12 @@ namespace Game.Maps int extra = !keyFrames[i - 1].Teleport ? 1 : 0; Spline spline = new Spline(); Span span = splinePath.ToArray(); - spline.Init_Spline(span.Slice(start), i - start + extra, Spline.EvaluationMode.Catmullrom); - spline.initLengths(); + spline.InitSpline(span.Slice(start), i - start + extra, Spline.EvaluationMode.Catmullrom); + spline.InitLengths(); for (int j = start; j < i + extra; ++j) { keyFrames[j].Index = (uint)(j - start + 1); - keyFrames[j].DistFromPrev = spline.length(j - start, j + 1 - start); + keyFrames[j].DistFromPrev = spline.Length(j - start, j + 1 - start); if (j > 0) keyFrames[j - 1].NextDistFromPrev = keyFrames[j].DistFromPrev; keyFrames[j].Spline = spline; diff --git a/Source/Game/Miscellaneous/Formulas.cs b/Source/Game/Miscellaneous/Formulas.cs index a1bf6a089..148c37bdf 100644 --- a/Source/Game/Miscellaneous/Formulas.cs +++ b/Source/Game/Miscellaneous/Formulas.cs @@ -24,16 +24,16 @@ namespace Game { public class Formulas { - public static float hk_honor_at_level_f(uint level, float multiplier = 1.0f) + public static float HKHonorAtLevelF(uint level, float multiplier = 1.0f) { float honor = multiplier * level * 1.55f; Global.ScriptMgr.OnHonorCalculation(honor, level, multiplier); return honor; } - public static uint hk_honor_at_level(uint level, float multiplier = 1.0f) + public static uint HKHonorAtLevel(uint level, float multiplier = 1.0f) { - return (uint)Math.Ceiling(hk_honor_at_level_f(level, multiplier)); + return (uint)Math.Ceiling(HKHonorAtLevelF(level, multiplier)); } public static uint GetGrayLevel(uint pl_level) diff --git a/Source/Game/Movement/Generators/FleeingGenerator.cs b/Source/Game/Movement/Generators/FleeingGenerator.cs index 6b6c0eae1..264e43b4b 100644 --- a/Source/Game/Movement/Generators/FleeingGenerator.cs +++ b/Source/Game/Movement/Generators/FleeingGenerator.cs @@ -52,7 +52,7 @@ namespace Game.Movement _getPoint(owner, out x, out y, out z); Position mypos = owner.GetPosition(); - bool isInLOS = Global.VMapMgr.isInLineOfSight(PhasingHandler.GetTerrainMapId(owner.GetPhaseShift(), owner.GetMap(), mypos.posX, mypos.posY), mypos.posX, mypos.posY, mypos.posZ + 2.0f, x, y, z + 2.0f, ModelIgnoreFlags.Nothing); + bool isInLOS = Global.VMapMgr.IsInLineOfSight(PhasingHandler.GetTerrainMapId(owner.GetPhaseShift(), owner.GetMap(), mypos.posX, mypos.posY), mypos.posX, mypos.posY, mypos.posZ + 2.0f, x, y, z + 2.0f, ModelIgnoreFlags.Nothing); if (!isInLOS) { diff --git a/Source/Game/Movement/Generators/HomeMovement.cs b/Source/Game/Movement/Generators/HomeMovement.cs index 61fb9704f..45080dbef 100644 --- a/Source/Game/Movement/Generators/HomeMovement.cs +++ b/Source/Game/Movement/Generators/HomeMovement.cs @@ -59,7 +59,7 @@ namespace Game.AI MoveSplineInit init = new MoveSplineInit(owner); float x, y, z, o; // at apply we can select more nice return points base at current movegen - if (owner.GetMotionMaster().empty() || !owner.GetMotionMaster().top().GetResetPosition(owner, out x, out y, out z)) + if (owner.GetMotionMaster().Empty() || !owner.GetMotionMaster().Top().GetResetPosition(owner, out x, out y, out z)) { owner.GetHomePosition(out x, out y, out z, out o); init.SetFacing(o); diff --git a/Source/Game/Movement/Generators/IdleMovement.cs b/Source/Game/Movement/Generators/IdleMovement.cs index 43b395162..3843ae5ac 100644 --- a/Source/Game/Movement/Generators/IdleMovement.cs +++ b/Source/Game/Movement/Generators/IdleMovement.cs @@ -27,7 +27,7 @@ namespace Game.Movement return MovementGeneratorType.Idle; } - public bool isActive { get; set; } + public bool IsActive { get; set; } public override void Reset(Unit owner) { diff --git a/Source/Game/Movement/Generators/MovementGenerators.cs b/Source/Game/Movement/Generators/MovementGenerators.cs index 8061b9b81..08719d52c 100644 --- a/Source/Game/Movement/Generators/MovementGenerators.cs +++ b/Source/Game/Movement/Generators/MovementGenerators.cs @@ -33,7 +33,7 @@ namespace Game.Movement public abstract MovementGeneratorType GetMovementGeneratorType(); - public virtual void unitSpeedChanged() { } + public virtual void UnitSpeedChanged() { } // used by Evade code for select point to evade with expected restart default movement public virtual bool GetResetPosition(Unit u, out float x, out float y, out float z) @@ -48,7 +48,7 @@ namespace Game.Movement public override void Initialize(Unit owner) { DoInitialize((T)owner); - isActive = true; + IsActive = true; } public override void Finalize(Unit owner) { @@ -63,7 +63,7 @@ namespace Game.Movement return DoUpdate((T)owner, time_diff); } - public bool isActive { get; set; } + public bool IsActive { get; set; } public abstract void DoInitialize(T owner); public abstract void DoFinalize(T owner); @@ -71,21 +71,21 @@ namespace Game.Movement public abstract bool DoUpdate(T owner, uint time_diff); } - public class FollowerReference : Reference + public class FollowerReference : Reference { - public override void targetObjectBuildLink() + public override void TargetObjectBuildLink() { - getTarget().AddFollower(this); + GetTarget().AddFollower(this); } - public override void targetObjectDestroyLink() + public override void TargetObjectDestroyLink() { - getTarget().RemoveFollower(this); + GetTarget().RemoveFollower(this); } - public override void sourceObjectDestroyLink() + public override void SourceObjectDestroyLink() { - GetSource().stopFollowing(); + GetSource().StopFollowing(); } } } diff --git a/Source/Game/Movement/Generators/PathGenerator.cs b/Source/Game/Movement/Generators/PathGenerator.cs index 24daad403..e8e7e84bc 100644 --- a/Source/Game/Movement/Generators/PathGenerator.cs +++ b/Source/Game/Movement/Generators/PathGenerator.cs @@ -174,7 +174,7 @@ namespace Game.Movement // Check both start and end points, if they're both in water, then we can *safely* let the creature move for (uint i = 0; i < _pathPoints.Length; ++i) { - ZLiquidStatus status = _sourceUnit.GetMap().getLiquidStatus(_sourceUnit.GetPhaseShift(), _pathPoints[i].X, _pathPoints[i].Y, _pathPoints[i].Z, MapConst.MapAllLiquidTypes); + ZLiquidStatus status = _sourceUnit.GetMap().GetLiquidStatus(_sourceUnit.GetPhaseShift(), _pathPoints[i].X, _pathPoints[i].Y, _pathPoints[i].Z, MapConst.MapAllLiquidTypes); // One of the points is not in the water, cancel movement. if (status == ZLiquidStatus.NoWater) { @@ -839,7 +839,7 @@ namespace Game.Movement NavTerrainFlag GetNavTerrain(float x, float y, float z) { LiquidData data; - ZLiquidStatus liquidStatus = _sourceUnit.GetMap().getLiquidStatus(_sourceUnit.GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out data); + ZLiquidStatus liquidStatus = _sourceUnit.GetMap().GetLiquidStatus(_sourceUnit.GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out data); if (liquidStatus == ZLiquidStatus.NoWater) return NavTerrainFlag.Ground; diff --git a/Source/Game/Movement/Generators/PointMovement.cs b/Source/Game/Movement/Generators/PointMovement.cs index bb94e2d91..6e36c8ef8 100644 --- a/Source/Game/Movement/Generators/PointMovement.cs +++ b/Source/Game/Movement/Generators/PointMovement.cs @@ -123,7 +123,7 @@ namespace Game.Movement unit.ToCreature().GetAI().MovementInform(MovementGeneratorType.Point, (uint)id); } - public override void unitSpeedChanged() + public override void UnitSpeedChanged() { i_recalculateSpeed = true; } diff --git a/Source/Game/Movement/Generators/SplineChainMovementGenerator.cs b/Source/Game/Movement/Generators/SplineChainMovementGenerator.cs index cd9aaf892..9c0ac43bc 100644 --- a/Source/Game/Movement/Generators/SplineChainMovementGenerator.cs +++ b/Source/Game/Movement/Generators/SplineChainMovementGenerator.cs @@ -164,7 +164,7 @@ namespace Game.Movement else return new SplineChainResumeInfo(); } - return new SplineChainResumeInfo(_id, _chain, _walk, (byte)(_nextIndex - 1), (byte)(me.MoveSpline._currentSplineIdx()), _msToNext); + return new SplineChainResumeInfo(_id, _chain, _walk, (byte)(_nextIndex - 1), (byte)(me.MoveSpline.CurrentSplineIdx()), _msToNext); } public override void Reset(Unit owner) { } diff --git a/Source/Game/Movement/Generators/TargetMovement.cs b/Source/Game/Movement/Generators/TargetMovement.cs index a22015422..bdcada635 100644 --- a/Source/Game/Movement/Generators/TargetMovement.cs +++ b/Source/Game/Movement/Generators/TargetMovement.cs @@ -22,26 +22,26 @@ using System; namespace Game.Movement { - public interface TargetedMovementGeneratorBase + public interface ITargetedMovementGeneratorBase { - FollowerReference reftarget { get; set; } - void stopFollowing(); + FollowerReference Reftarget { get; set; } + void StopFollowing(); } - public abstract class TargetedMovementGeneratorMedium : MovementGeneratorMedium, TargetedMovementGeneratorBase where T : Unit + public abstract class TargetedMovementGeneratorMedium : MovementGeneratorMedium, ITargetedMovementGeneratorBase where T : Unit { - public FollowerReference reftarget { get; set; } - public Unit target + public FollowerReference Reftarget { get; set; } + public Unit Target { - get { return reftarget.getTarget(); } + get { return Reftarget.GetTarget(); } } - public void stopFollowing() { } + public void StopFollowing() { } protected TargetedMovementGeneratorMedium(Unit _target, float _offset = 0, float _angle = 0) { - reftarget = new FollowerReference(); - reftarget.link(_target, this); + Reftarget = new FollowerReference(); + Reftarget.Link(_target, this); recheckDistance = new TimeTrackerSmall(); offset = _offset; angle = _angle; @@ -51,7 +51,7 @@ namespace Game.Movement public override bool DoUpdate(T owner, uint time_diff) { - if (!reftarget.isValid() || !target.IsInWorld) + if (!Reftarget.IsValid() || !Target.IsInWorld) return false; if (owner == null || !owner.IsAlive()) @@ -86,7 +86,7 @@ namespace Game.Movement //More distance let have better performance, less distance let have more sensitive reaction at target move. float allowed_dist = 0.0f;// owner.GetCombatReach() + WorldConfig.GetFloatValue(WorldCfg.RateTargetPosRecalculationRange); - if (owner.IsPet() && (owner.GetCharmerOrOwnerGUID() == target.GetGUID())) + if (owner.IsPet() && (owner.GetCharmerOrOwnerGUID() == Target.GetGUID())) allowed_dist = 1.0f; // pet following owner else allowed_dist = owner.GetCombatReach() + WorldConfig.GetFloatValue(WorldCfg.RateTargetPosRecalculationRange); @@ -102,14 +102,14 @@ namespace Game.Movement // First check distance if (owner.IsTypeId(TypeId.Unit) && (owner.ToCreature().CanFly() || owner.ToCreature().CanSwim())) - targetMoved = !target.IsWithinDist3d(dest.X, dest.Y, dest.Z, allowed_dist); + targetMoved = !Target.IsWithinDist3d(dest.X, dest.Y, dest.Z, allowed_dist); else - targetMoved = !target.IsWithinDist2d(dest.X, dest.Y, allowed_dist); + targetMoved = !Target.IsWithinDist2d(dest.X, dest.Y, allowed_dist); // then, if the target is in range, check also Line of Sight. if (!targetMoved) - targetMoved = !target.IsWithinLOSInMap(owner); + targetMoved = !Target.IsWithinLOSInMap(owner); } if (recalculateTravel || targetMoved) @@ -118,8 +118,8 @@ namespace Game.Movement if (owner.MoveSpline.Finalized()) { MovementInform(owner); - if (angle == 0.0f && !owner.HasInArc(0.01f, target)) - owner.SetInFront(target); + if (angle == 0.0f && !owner.HasInArc(0.01f, Target)) + owner.SetInFront(Target); if (!targetReached) { @@ -131,14 +131,14 @@ namespace Game.Movement return true; } - public override void unitSpeedChanged() + public override void UnitSpeedChanged() { recalculateTravel = true; } public void _setTargetLocation(T owner, bool updateDestination) { - if (!reftarget.isValid() || !target.IsInWorld) + if (!Reftarget.IsValid() || !Target.IsInWorld) return; if (owner.HasUnitState(UnitState.NotMove)) @@ -147,7 +147,7 @@ namespace Game.Movement if (owner.IsMovementPreventedByCasting()) return; - if (owner.IsTypeId(TypeId.Unit) && !target.IsInAccessiblePlaceFor(owner.ToCreature())) + if (owner.IsTypeId(TypeId.Unit) && !Target.IsInAccessiblePlaceFor(owner.ToCreature())) { owner.ToCreature().SetCannotReachTarget(true); return; @@ -161,11 +161,11 @@ namespace Game.Movement { if (offset == 0) { - if (target.IsWithinDistInMap(owner, SharedConst.ContactDistance)) + if (Target.IsWithinDistInMap(owner, SharedConst.ContactDistance)) return; // to nearest contact position - target.GetContactPoint(owner, out x, out y, out z); + Target.GetContactPoint(owner, out x, out y, out z); } else { @@ -178,7 +178,7 @@ namespace Game.Movement // be (GetCombatReach() + i_offset) away. // Only applies when i_target is pet's owner otherwise pets and mobs end up // doing a "dance" while fighting - if (owner.IsPet() && target.IsTypeId(TypeId.Player)) + if (owner.IsPet() && Target.IsTypeId(TypeId.Player)) { dist = 1.0f;// target.GetCombatReach(); size = 1.0f;// target.GetCombatReach() - target.GetObjectSize(); @@ -189,11 +189,11 @@ namespace Game.Movement size = owner.GetObjectSize(); } - if (target.IsWithinDistInMap(owner, dist)) + if (Target.IsWithinDistInMap(owner, dist)) return; // to at i_offset distance from target and i_angle from target facing - target.GetClosePoint(out x, out y, out z, size, offset, angle); + Target.GetClosePoint(out x, out y, out z, size, offset, angle); } } else @@ -235,7 +235,7 @@ namespace Game.Movement // Using the same condition for facing target as the one that is used for SetInFront on movement end // - applies to ChaseMovementGenerator mostly if (angle == 0.0f) - init.SetFacing(target); + init.SetFacing(Target); init.Launch(); } @@ -302,7 +302,7 @@ namespace Game.Movement public override bool _lostTarget(T u) { - return u.GetVictim() != target; + return u.GetVictim() != Target; } public override void _clearUnitStateMove(T u) { @@ -318,8 +318,8 @@ namespace Game.Movement public override void _reachTarget(T owner) { _clearUnitStateMove(owner); - if (owner.IsWithinMeleeRange(target)) - owner.Attack(target, true); + if (owner.IsWithinMeleeRange(Target)) + owner.Attack(Target, true); if (owner.IsTypeId(TypeId.Unit)) owner.ToCreature().SetCannotReachTarget(false); } @@ -329,7 +329,7 @@ namespace Game.Movement { // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle if (unit.ToCreature().GetAI() != null) - unit.ToCreature().GetAI().MovementInform(MovementGeneratorType.Chase, (uint)target.GetGUID().GetCounter()); + unit.ToCreature().GetAI().MovementInform(MovementGeneratorType.Chase, (uint)Target.GetGUID().GetCounter()); } } } @@ -376,21 +376,21 @@ namespace Game.Movement // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle if (unit.ToCreature().GetAI() != null) - unit.ToCreature().GetAI().MovementInform(MovementGeneratorType.Follow, (uint)target.GetGUID().GetCounter()); + unit.ToCreature().GetAI().MovementInform(MovementGeneratorType.Follow, (uint)Target.GetGUID().GetCounter()); } public override bool EnableWalking() { if (typeof(T) == typeof(Player)) return false; else - return reftarget.isValid() && target.IsWalking(); + return Reftarget.IsValid() && Target.IsWalking(); } public override void _updateSpeed(T owner) { if (owner.IsTypeId(TypeId.Player)) return; - if (!owner.IsPet() || !owner.IsInWorld || !reftarget.isValid() && target.GetGUID() != owner.GetOwnerGUID()) + if (!owner.IsPet() || !owner.IsInWorld || !Reftarget.IsValid() && Target.GetGUID() != owner.GetOwnerGUID()) return; owner.UpdateSpeed(UnitMoveType.Run); diff --git a/Source/Game/Movement/Generators/WaypointMovement.cs b/Source/Game/Movement/Generators/WaypointMovement.cs index 339a65dec..0022a673c 100644 --- a/Source/Game/Movement/Generators/WaypointMovement.cs +++ b/Source/Game/Movement/Generators/WaypointMovement.cs @@ -360,7 +360,7 @@ namespace Game.Movement if (owner.m_taxi.Empty()) { - owner.GetHostileRefManager().setOnlineOfflineState(true); + owner.GetHostileRefManager().SetOnlineOfflineState(true); // update z position to ground and orientation for landing point // this prevent cheating with landing point at lags // when client side flight end early in comparison server side @@ -374,7 +374,7 @@ namespace Game.Movement public override void DoReset(Player owner) { - owner.GetHostileRefManager().setOnlineOfflineState(false); + owner.GetHostileRefManager().SetOnlineOfflineState(false); owner.AddUnitState(UnitState.InFlight); owner.AddUnitFlag(UnitFlags.RemoveClientControl | UnitFlags.TaxiFlight); @@ -397,7 +397,7 @@ namespace Game.Movement public override bool DoUpdate(Player player, uint time_diff) { - uint pointId = (uint)player.MoveSpline.currentPathIdx(); + uint pointId = (uint)player.MoveSpline.CurrentPathIdx(); if (pointId > i_currentNode) { bool departureEvent = true; diff --git a/Source/Game/Movement/MotionMaster.cs b/Source/Game/Movement/MotionMaster.cs index cdc4996ff..7d9d21d63 100644 --- a/Source/Game/Movement/MotionMaster.cs +++ b/Source/Game/Movement/MotionMaster.cs @@ -47,10 +47,10 @@ namespace Game.Movement public void Initialize() { - while (!empty()) + while (!Empty()) { - IMovementGenerator curr = top(); - pop(); + IMovementGenerator curr = Top(); + Pop(); if (curr != null) DirectDelete(curr); } @@ -77,10 +77,10 @@ namespace Game.Movement if (_owner.HasUnitState(UnitState.Root | UnitState.Stunned)) return; - Cypher.Assert(!empty()); + Cypher.Assert(!Empty()); _cleanFlag |= MMCleanFlag.Update; - bool isMoveGenUpdateSuccess = top().Update(_owner, diff); + bool isMoveGenUpdateSuccess = Top().Update(_owner, diff); _cleanFlag &= ~MMCleanFlag.Update; if (!isMoveGenUpdateSuccess) @@ -114,12 +114,12 @@ namespace Game.Movement _expireList = null; - if (empty()) + if (Empty()) Initialize(); else if (NeedInitTop()) InitTop(); else if (Convert.ToBoolean(_cleanFlag & MMCleanFlag.Reset)) - top().Reset(_owner); + Top().Reset(_owner); _cleanFlag &= ~MMCleanFlag.Reset; } @@ -140,10 +140,10 @@ namespace Game.Movement public MovementGeneratorType GetCurrentMovementGeneratorType() { - if (empty()) + if (Empty()) return MovementGeneratorType.Idle; - return top().GetMovementGeneratorType(); + return Top().GetMovementGeneratorType(); } public MovementGeneratorType GetMotionSlotType(MovementSlot slot) @@ -160,12 +160,12 @@ namespace Game.Movement return _slot[slot]; } - public void propagateSpeedChange() + public void PropagateSpeedChange() { for (int i = 0; i <= _top; ++i) { if (_slot[i] != null) - _slot[i].unitSpeedChanged(); + _slot[i].UnitSpeedChanged(); } } @@ -186,7 +186,7 @@ namespace Game.Movement public void MoveIdle() { - if (empty() || !IsStatic(top())) + if (Empty() || !IsStatic(Top())) StartMovement(staticIdleMovement, MovementSlot.Idle); } @@ -357,7 +357,7 @@ namespace Game.Movement float x, y, z; float moveTimeHalf = (float)(speedZ / gravity); float dist = 2 * moveTimeHalf * speedXY; - float max_height = -MoveSpline.computeFallElevation(moveTimeHalf, false, -speedZ); + float max_height = -MoveSpline.ComputeFallElevation(moveTimeHalf, false, -speedZ); _owner.GetNearPoint(_owner, out x, out y, out z, _owner.GetObjectSize(), dist, _owner.GetAngle(srcX, srcY) + MathFunctions.PI); @@ -400,7 +400,7 @@ namespace Game.Movement return; float moveTimeHalf = (float)(speedZ / gravity); - float max_height = -MoveSpline.computeFallElevation(moveTimeHalf, false, -speedZ); + float max_height = -MoveSpline.ComputeFallElevation(moveTimeHalf, false, -speedZ); MoveSplineInit init = new MoveSplineInit(_owner); init.MoveTo(x, y, z, false); @@ -611,19 +611,19 @@ namespace Game.Movement StartMovement(new RotateMovementGenerator(time, direction), MovementSlot.Active); } - void pop() + void Pop() { - if (empty()) + if (Empty()) return; _slot[_top] = null; - while (!empty() && top() == null) + while (!Empty() && Top() == null) --_top; } bool NeedInitTop() { - if (empty()) + if (Empty()) return false; return _initialize[_top]; @@ -631,7 +631,7 @@ namespace Game.Movement void InitTop() { - top().Initialize(_owner); + Top().Initialize(_owner); _initialize[_top] = false; } @@ -663,29 +663,29 @@ namespace Game.Movement void DirectClean(bool reset) { - while (size() > 1) + while (Size() > 1) { - IMovementGenerator curr = top(); - pop(); + IMovementGenerator curr = Top(); + Pop(); if (curr != null) DirectDelete(curr); } - if (empty()) + if (Empty()) return; if (NeedInitTop()) InitTop(); else if (reset) - top().Reset(_owner); + Top().Reset(_owner); } void DelayedClean() { - while (size() > 1) + while (Size() > 1) { - IMovementGenerator curr = top(); - pop(); + IMovementGenerator curr = Top(); + Pop(); if (curr != null) DelayedDelete(curr); } @@ -693,34 +693,34 @@ namespace Game.Movement void DirectExpire(bool reset) { - if (size() > 1) + if (Size() > 1) { - IMovementGenerator curr = top(); - pop(); + IMovementGenerator curr = Top(); + Pop(); DirectDelete(curr); } - while (!empty() && top() == null)//not sure this will work + while (!Empty() && Top() == null)//not sure this will work --_top; - if (empty()) + if (Empty()) Initialize(); else if (NeedInitTop()) InitTop(); else if (reset) - top().Reset(_owner); + Top().Reset(_owner); } void DelayedExpire() { - if (size() > 1) + if (Size() > 1) { - IMovementGenerator curr = top(); - pop(); + IMovementGenerator curr = Top(); + Pop(); DelayedDelete(curr); } - while (!empty() && top() == null) + while (!Empty() && Top() == null) --_top; } @@ -740,13 +740,13 @@ namespace Game.Movement _expireList.Add(curr); } - public bool empty() { return (_top < 0); } + public bool Empty() { return (_top < 0); } - int size() { return _top + 1; } + int Size() { return _top + 1; } - public IMovementGenerator top() + public IMovementGenerator Top() { - Cypher.Assert(!empty()); + Cypher.Assert(!Empty()); return _slot[_top]; } diff --git a/Source/Game/Movement/MoveSpline.cs b/Source/Game/Movement/MoveSpline.cs index ec9bd9392..dbb43cefc 100644 --- a/Source/Game/Movement/MoveSpline.cs +++ b/Source/Game/Movement/MoveSpline.cs @@ -54,20 +54,20 @@ namespace Game.Movement splineIsFacingOnly = args.path.Length == 2 && args.facing.type != MonsterMoveType.Normal && ((args.path[1] - args.path[0]).GetLength() < 0.1f); // Check if its a stop spline - if (args.flags.hasFlag(SplineFlag.Done)) + if (args.flags.HasFlag(SplineFlag.Done)) { - spline.clear(); + spline.Clear(); return; } - init_spline(args); + InitSpline(args); // init parabolic / animation // spline initialized, duration known and i able to compute parabolic acceleration - if (args.flags.hasFlag(SplineFlag.Parabolic | SplineFlag.Animation | SplineFlag.FadeObject)) + if (args.flags.HasFlag(SplineFlag.Parabolic | SplineFlag.Animation | SplineFlag.FadeObject)) { effect_start_time = (int)(Duration() * args.time_perc); - if (args.flags.hasFlag(SplineFlag.Parabolic) && effect_start_time < Duration()) + if (args.flags.HasFlag(SplineFlag.Parabolic) && effect_start_time < Duration()) { float f_duration = (float)TimeSpan.FromMilliseconds(Duration() - effect_start_time).TotalSeconds; vertical_acceleration = args.parabolic_amplitude * 8.0f / (f_duration * f_duration); @@ -75,77 +75,77 @@ namespace Game.Movement } } - void init_spline(MoveSplineInitArgs args) + void InitSpline(MoveSplineInitArgs args) { Spline.EvaluationMode[] modes = new Spline.EvaluationMode[2] { Spline.EvaluationMode.Linear, Spline.EvaluationMode.Catmullrom }; - if (args.flags.hasFlag(SplineFlag.Cyclic)) + if (args.flags.HasFlag(SplineFlag.Cyclic)) { - spline.init_cyclic_spline(args.path, args.path.Length, modes[Convert.ToInt32(args.flags.isSmooth())], 0); + spline.InitCyclicSpline(args.path, args.path.Length, modes[Convert.ToInt32(args.flags.IsSmooth())], 0); } else { - spline.Init_Spline(args.path, args.path.Length, modes[Convert.ToInt32(args.flags.isSmooth())]); + spline.InitSpline(args.path, args.path.Length, modes[Convert.ToInt32(args.flags.IsSmooth())]); } // init spline timestamps - if (splineflags.hasFlag(SplineFlag.Falling)) + if (splineflags.HasFlag(SplineFlag.Falling)) { - FallInitializer init = new FallInitializer(spline.getPoint(spline.first()).Z); - spline.initLengths(init); + FallInitializer init = new FallInitializer(spline.GetPoint(spline.First()).Z); + spline.InitLengths(init); } else { CommonInitializer init = new CommonInitializer(args.velocity); - spline.initLengths(init); + spline.InitLengths(init); } // TODO: what to do in such cases? problem is in input data (all points are at same coords) - if (spline.length() < 1) + if (spline.Length() < 1) { Log.outError(LogFilter.Unit, "MoveSpline.init_spline: zero length spline, wrong input data?"); - spline.set_length(spline.last(), spline.isCyclic() ? 1000 : 1); + spline.Set_length(spline.Last(), spline.IsCyclic() ? 1000 : 1); } - point_Idx = spline.first(); + point_Idx = spline.First(); } - public int currentPathIdx() + public int CurrentPathIdx() { - int point = point_Idx_offset + point_Idx - spline.first() + (Finalized() ? 1 : 0); - if (isCyclic()) - point = point % (spline.last() - spline.first()); + int point = point_Idx_offset + point_Idx - spline.First() + (Finalized() ? 1 : 0); + if (IsCyclic()) + point = point % (spline.Last() - spline.First()); return point; } - public Vector3[] getPath() { return spline.getPoints(); } - public int timePassed() { return time_passed; } + public Vector3[] GetPath() { return spline.GetPoints(); } + public int TimePassed() { return time_passed; } - public int Duration() { return spline.length(); } - public int _currentSplineIdx() { return point_Idx; } + public int Duration() { return spline.Length(); } + public int CurrentSplineIdx() { return point_Idx; } public uint GetId() { return m_Id; } - public bool Finalized() { return splineflags.hasFlag(SplineFlag.Done); } + public bool Finalized() { return splineflags.HasFlag(SplineFlag.Done); } void _Finalize() { splineflags.SetUnsetFlag(SplineFlag.Done); - point_Idx = spline.last() - 1; + point_Idx = spline.Last() - 1; time_passed = Duration(); } - public Vector4 computePosition(int time_point, int point_index) + public Vector4 ComputePosition(int time_point, int point_index) { float u = 1.0f; - int seg_time = spline.length(point_index, point_index + 1); + int seg_time = spline.Length(point_index, point_index + 1); if (seg_time > 0) - u = (time_point - spline.length(point_index)) / (float)seg_time; + u = (time_point - spline.Length(point_index)) / (float)seg_time; Vector3 c; float orientation = initialOrientation; spline.Evaluate_Percent(point_index, u, out c); - if (splineflags.hasFlag(SplineFlag.Parabolic)) - computeParabolicElevation(time_point, ref c.Z); - else if (splineflags.hasFlag(SplineFlag.Falling)) - computeFallElevation(time_point, ref c.Z); + if (splineflags.HasFlag(SplineFlag.Parabolic)) + ComputeParabolicElevation(time_point, ref c.Z); + else if (splineflags.HasFlag(SplineFlag.Falling)) + ComputeFallElevation(time_point, ref c.Z); - if (splineflags.hasFlag(SplineFlag.Done) && facing.type != MonsterMoveType.Normal) + if (splineflags.HasFlag(SplineFlag.Done) && facing.type != MonsterMoveType.Normal) { if (facing.type == MonsterMoveType.FacingAngle) orientation = facing.angle; @@ -155,14 +155,14 @@ namespace Game.Movement } else { - if (!splineflags.hasFlag(SplineFlag.OrientationFixed | SplineFlag.Falling | SplineFlag.Unknown0)) + if (!splineflags.HasFlag(SplineFlag.OrientationFixed | SplineFlag.Falling | SplineFlag.Unknown0)) { Vector3 hermite; spline.Evaluate_Derivative(point_Idx, u, out hermite); orientation = (float)Math.Atan2(hermite.Y, hermite.X); } - if (splineflags.hasFlag(SplineFlag.Backward)) + if (splineflags.HasFlag(SplineFlag.Backward)) orientation = orientation - (float)Math.PI; } @@ -170,27 +170,27 @@ namespace Game.Movement } public Vector4 ComputePosition() { - return computePosition(time_passed, point_Idx); + return ComputePosition(time_passed, point_Idx); } public Vector4 ComputePosition(int time_offset) { int time_point = time_passed + time_offset; if (time_point >= Duration()) - return computePosition(Duration(), spline.last() - 1); + return ComputePosition(Duration(), spline.Last() - 1); if (time_point <= 0) - return computePosition(0, spline.first()); + return ComputePosition(0, spline.First()); // find point_index where spline.length(point_index) < time_point < spline.length(point_index + 1) int point_index = point_Idx; - while (time_point >= spline.length(point_index + 1)) + while (time_point >= spline.Length(point_index + 1)) ++point_index; - while (time_point < spline.length(point_index)) + while (time_point < spline.Length(point_index)) --point_index; - return computePosition(time_point, point_index); + return ComputePosition(time_point, point_index); } - public void computeParabolicElevation(int time_point, ref float el) + public void ComputeParabolicElevation(int time_point, ref float el) { if (time_point > effect_start_time) { @@ -202,13 +202,13 @@ namespace Game.Movement el += (t_durationf - t_passedf) * 0.5f * vertical_acceleration * t_passedf; } } - public void computeFallElevation(int time_point, ref float el) + public void ComputeFallElevation(int time_point, ref float el) { - float z_now = spline.getPoint(spline.first()).Z - computeFallElevation(MSToSec((uint)time_point), false); + float z_now = spline.GetPoint(spline.First()).Z - ComputeFallElevation(MSToSec((uint)time_point), false); float final_z = FinalDestination().Z; el = Math.Max(z_now, final_z); } - public static float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity = 0.0f) + public static float ComputeFallElevation(float t_passed, bool isSafeFall, float start_velocity = 0.0f) { float termVel; float result; @@ -241,14 +241,14 @@ namespace Game.Movement } public void Interrupt() { splineflags.SetUnsetFlag(SplineFlag.Done); } - public void updateState(int difftime) + public void UpdateState(int difftime) { do { - _updateState(ref difftime); + UpdateState(ref difftime); } while (difftime > 0); } - UpdateResult _updateState(ref int ms_time_diff) + UpdateResult UpdateState(ref int ms_time_diff) { if (Finalized()) { @@ -257,22 +257,22 @@ namespace Game.Movement } UpdateResult result = UpdateResult.None; - int minimal_diff = Math.Min(ms_time_diff, segment_time_elapsed()); + int minimal_diff = Math.Min(ms_time_diff, SegmentTimeElapsed()); time_passed += minimal_diff; ms_time_diff -= minimal_diff; - if (time_passed >= next_timestamp()) + if (time_passed >= NextTimestamp()) { ++point_Idx; - if (point_Idx < spline.last()) + if (point_Idx < spline.Last()) { result = UpdateResult.NextSegment; } else { - if (spline.isCyclic()) + if (spline.IsCyclic()) { - point_Idx = spline.first(); + point_Idx = spline.First(); time_passed = time_passed % Duration(); result = UpdateResult.NextCycle; } @@ -287,12 +287,12 @@ namespace Game.Movement return result; } - int next_timestamp() { return spline.length(point_Idx + 1); } - int segment_time_elapsed() { return next_timestamp() - time_passed; } - public bool isCyclic() { return splineflags.hasFlag(SplineFlag.Cyclic); } - public bool isFalling() { return splineflags.hasFlag(SplineFlag.Falling); } - public bool Initialized() { return !spline.empty(); } - public Vector3 FinalDestination() { return Initialized() ? spline.getPoint(spline.last()) : new Vector3(); } + int NextTimestamp() { return spline.Length(point_Idx + 1); } + int SegmentTimeElapsed() { return NextTimestamp() - time_passed; } + public bool IsCyclic() { return splineflags.HasFlag(SplineFlag.Cyclic); } + public bool IsFalling() { return splineflags.HasFlag(SplineFlag.Falling); } + public bool Initialized() { return !spline.Empty(); } + public Vector3 FinalDestination() { return Initialized() ? spline.GetPoint(spline.Last()) : new Vector3(); } #region Fields public MoveSplineInitArgs InitArgs; @@ -311,7 +311,7 @@ namespace Game.Movement public Optional spell_effect_extra; #endregion - public class CommonInitializer : Initializer + public class CommonInitializer : IInitializer { public CommonInitializer(float _velocity) { @@ -326,7 +326,7 @@ namespace Game.Movement return time; } } - public class FallInitializer : Initializer + public class FallInitializer : IInitializer { public FallInitializer(float startelevation) { @@ -335,10 +335,10 @@ namespace Game.Movement float startElevation; public int SetGetTime(Spline s, int i) { - return (int)(computeFallTime(startElevation - s.getPoint(i + 1).Z, false) * 1000.0f); + return (int)(ComputeFallTime(startElevation - s.GetPoint(i + 1).Z, false) * 1000.0f); } - float computeFallTime(float path_length, bool isSafeFall) + float ComputeFallTime(float path_length, bool isSafeFall) { if (path_length < 0.0f) return 0.0f; @@ -370,7 +370,7 @@ namespace Game.Movement NextSegment = 0x08 } } - public interface Initializer + public interface IInitializer { int SetGetTime(Spline s, int i); } diff --git a/Source/Game/Movement/MoveSplineFlags.cs b/Source/Game/Movement/MoveSplineFlags.cs index f7b6c82dc..4c40724c6 100644 --- a/Source/Game/Movement/MoveSplineFlags.cs +++ b/Source/Game/Movement/MoveSplineFlags.cs @@ -26,12 +26,12 @@ namespace Game.Movement public MoveSplineFlag(SplineFlag f) { Flags = f; } public MoveSplineFlag(MoveSplineFlag f) { Flags = f.Flags; } - public bool isSmooth() { return Flags.HasAnyFlag(SplineFlag.Catmullrom); } - public bool isLinear() { return !isSmooth(); } + public bool IsSmooth() { return Flags.HasAnyFlag(SplineFlag.Catmullrom); } + public bool IsLinear() { return !IsSmooth(); } - public byte getAnimTier() { return animTier; } - public bool hasAllFlags(SplineFlag f) { return (Flags & f) == f; } - public bool hasFlag(SplineFlag f) { return (Flags & f) != 0; } + public byte GetAnimTier() { return animTier; } + public bool HasAllFlags(SplineFlag f) { return (Flags & f) == f; } + public bool HasFlag(SplineFlag f) { return (Flags & f) != 0; } public void SetUnsetFlag(SplineFlag f, bool Set = true) { diff --git a/Source/Game/Movement/MoveSplineInit.cs b/Source/Game/Movement/MoveSplineInit.cs index 33d676c15..dfab01cd6 100644 --- a/Source/Game/Movement/MoveSplineInit.cs +++ b/Source/Game/Movement/MoveSplineInit.cs @@ -103,7 +103,7 @@ namespace Game.Movement move_spline.onTransport = !unit.GetTransGUID().IsEmpty(); MovementFlag moveFlags = unit.m_movementInfo.GetMovementFlags(); - if (!args.flags.hasFlag(SplineFlag.Backward)) + if (!args.flags.HasFlag(SplineFlag.Backward)) moveFlags = (moveFlags & ~MovementFlag.Backward) | MovementFlag.Forward; else moveFlags = (moveFlags & ~MovementFlag.Forward) | MovementFlag.Backward; diff --git a/Source/Game/Movement/MoveSplineInitArgs.cs b/Source/Game/Movement/MoveSplineInitArgs.cs index 8eb0ecf0b..28977130a 100644 --- a/Source/Game/Movement/MoveSplineInitArgs.cs +++ b/Source/Game/Movement/MoveSplineInitArgs.cs @@ -54,15 +54,15 @@ namespace Game.Movement // Returns true to show that the arguments were configured correctly and MoveSpline initialization will succeed. public bool Validate(Unit unit) { - Func CHECK = exp => + bool CHECK(bool exp) { - if (!(exp)) + if (!exp) { Log.outError(LogFilter.Misc, "MoveSplineInitArgs::Validate: expression '{0}' failed for {1} Entry: {2}", exp.ToString(), unit.GetGUID().ToString(), unit.GetEntry()); return false; } return true; - }; + } if (!CHECK(path.Length > 1)) return false; diff --git a/Source/Game/Movement/Spline.cs b/Source/Game/Movement/Spline.cs index fd57b6622..e87db2d77 100644 --- a/Source/Game/Movement/Spline.cs +++ b/Source/Game/Movement/Spline.cs @@ -25,18 +25,18 @@ namespace Game.Movement { public class Spline { - public int getPointCount() { return points.Length; } - public Vector3 getPoint(int i) { return points[i]; } - public Vector3[] getPoints() { return points; } + public int GetPointCount() { return points.Length; } + public Vector3 GetPoint(int i) { return points[i]; } + public Vector3[] GetPoints() { return points; } - public void clear() + public void Clear() { Array.Clear(points, 0, points.Length); } - public int first() { return index_lo; } - public int last() { return index_hi; } + public int First() { return index_lo; } + public int Last() { return index_hi; } - public bool isCyclic() { return _cyclic;} + public bool IsCyclic() { return _cyclic;} #region Evaluate public void Evaluate_Percent(int Idx, float u, out Vector3 c) @@ -75,18 +75,18 @@ namespace Game.Movement #endregion #region Init - public void init_spline_custom(SplineRawInitializer initializer) + public void InitSplineCustom(SplineRawInitializer initializer) { initializer.Initialize(ref m_mode, ref _cyclic, ref points, ref index_lo, ref index_hi); } - public void init_cyclic_spline(Vector3[] controls, int count, EvaluationMode m, int cyclic_point) + public void InitCyclicSpline(Vector3[] controls, int count, EvaluationMode m, int cyclic_point) { m_mode = m; _cyclic = true; - Init_Spline(controls, count, m); + InitSpline(controls, count, m); } - public void Init_Spline(Span controls, int count, EvaluationMode m) + public void InitSpline(Span controls, int count, EvaluationMode m) { m_mode = m; _cyclic = false; @@ -261,16 +261,16 @@ namespace Game.Movement } #endregion - public void computeIndex(float t, ref int index, ref float u) + public void ComputeIndex(float t, ref int index, ref float u) { //ASSERT(t >= 0.f && t <= 1.f); - int length_ = (int)(t * length()); - index = computeIndexInBounds(length_); + int length_ = (int)(t * Length()); + index = ComputeIndexInBounds(length_); //ASSERT(index < index_hi); - u = (length_ - length(index)) / (float)length(index, index + 1); + u = (length_ - Length(index)) / (float)Length(index, index + 1); } - int computeIndexInBounds(int length_) + int ComputeIndexInBounds(int length_) { // Temporary disabled: causes infinite loop with t = 1.f /* @@ -317,15 +317,15 @@ namespace Game.Movement + vertice[2] * weights[2] + vertice[3] * weights[3]; } - public int length() { return lengths[index_hi];} + public int Length() { return lengths[index_hi];} - public int length(int first, int last) { return lengths[last] - lengths[first]; } + public int Length(int first, int last) { return lengths[last] - lengths[first]; } - public int length(int Idx) { return lengths[Idx]; } + public int Length(int Idx) { return lengths[Idx]; } - public void set_length(int i, int length) { lengths[i] = length; } + public void Set_length(int i, int length) { lengths[i] = length; } - public void initLengths(Initializer cacher) + public void InitLengths(IInitializer cacher) { int i = index_lo; Array.Resize(ref lengths, index_hi+1); @@ -341,7 +341,7 @@ namespace Game.Movement } } - public void initLengths() + public void InitLengths() { int i = index_lo; int length = 0; @@ -353,7 +353,7 @@ namespace Game.Movement } } - public bool empty() { return index_lo == index_hi;} + public bool Empty() { return index_lo == index_hi;} int[] lengths = new int[0]; Vector3[] points = new Vector3[0]; diff --git a/Source/Game/Network/PacketManager.cs b/Source/Game/Network/PacketManager.cs index 7074d6f17..4035ed799 100644 --- a/Source/Game/Network/PacketManager.cs +++ b/Source/Game/Network/PacketManager.cs @@ -124,7 +124,7 @@ namespace Game.Network { methodCaller = (Action)GetType().GetMethod("CreateDelegate", BindingFlags.Static | BindingFlags.NonPublic).MakeGenericMethod(type).Invoke(null, new object[] { info }); sessionStatus = status; - processingPlace = processingplace; + ProcessingPlace = processingplace; packetType = type; } @@ -153,7 +153,7 @@ namespace Game.Network Action methodCaller; Type packetType; - public PacketProcessing processingPlace { get; private set; } + public PacketProcessing ProcessingPlace { get; private set; } public SessionStatus sessionStatus { get; private set; } } @@ -179,11 +179,11 @@ namespace Game.Network { PacketHandler opHandle = PacketManager.GetHandler((ClientOpcodes)packet.GetOpcode()); //check if packet handler is supposed to be safe - if (opHandle.processingPlace == PacketProcessing.Inplace) + if (opHandle.ProcessingPlace == PacketProcessing.Inplace) return true; //we do not process thread-unsafe packets - if (opHandle.processingPlace == PacketProcessing.ThreadUnsafe) + if (opHandle.ProcessingPlace == PacketProcessing.ThreadUnsafe) return false; Player player = m_pSession.GetPlayer(); @@ -203,11 +203,11 @@ namespace Game.Network { PacketHandler opHandle = PacketManager.GetHandler((ClientOpcodes)packet.GetOpcode()); //check if packet handler is supposed to be safe - if (opHandle.processingPlace == PacketProcessing.Inplace) + if (opHandle.ProcessingPlace == PacketProcessing.Inplace) return true; //thread-unsafe packets should be processed in World.UpdateSessions() - if (opHandle.processingPlace == PacketProcessing.ThreadUnsafe) + if (opHandle.ProcessingPlace == PacketProcessing.ThreadUnsafe) return true; //no player attached? . our client! ^^ diff --git a/Source/Game/Network/Packets/MovementPackets.cs b/Source/Game/Network/Packets/MovementPackets.cs index 6089b22a0..c3c47be52 100644 --- a/Source/Game/Network/Packets/MovementPackets.cs +++ b/Source/Game/Network/Packets/MovementPackets.cs @@ -188,7 +188,7 @@ namespace Game.Network.Packets { data.WriteUInt32(moveSpline.GetId()); // ID - if (!moveSpline.isCyclic()) // Destination + if (!moveSpline.IsCyclic()) // Destination data.WriteVector3(moveSpline.FinalDestination()); else data.WriteVector3(Vector3.Zero); @@ -199,17 +199,17 @@ namespace Game.Network.Packets if (hasSplineMove) { data.WriteUInt32((uint)moveSpline.splineflags.Flags); // SplineFlags - data.WriteInt32(moveSpline.timePassed()); // Elapsed + data.WriteInt32(moveSpline.TimePassed()); // Elapsed data.WriteInt32(moveSpline.Duration()); // Duration data.WriteFloat(1.0f); // DurationModifier data.WriteFloat(1.0f); // NextDurationModifier data.WriteBits((byte)moveSpline.facing.type, 2); // Face - bool hasFadeObjectTime = data.WriteBit(moveSpline.splineflags.hasFlag(SplineFlag.FadeObject) && moveSpline.effect_start_time < moveSpline.Duration()); - data.WriteBits(moveSpline.getPath().Length, 16); + bool hasFadeObjectTime = data.WriteBit(moveSpline.splineflags.HasFlag(SplineFlag.FadeObject) && moveSpline.effect_start_time < moveSpline.Duration()); + data.WriteBits(moveSpline.GetPath().Length, 16); data.WriteBits((byte)moveSpline.spline.m_mode, 2); // Mode data.WriteBit(0); // HasSplineFilter data.WriteBit(moveSpline.spell_effect_extra.HasValue); // HasSpellEffectExtraData - data.WriteBit(moveSpline.splineflags.hasFlag(SplineFlag.Parabolic)); // HasJumpExtraData + data.WriteBit(moveSpline.splineflags.HasFlag(SplineFlag.Parabolic)); // HasJumpExtraData data.FlushBits(); //if (HasSplineFilterKey) @@ -241,7 +241,7 @@ namespace Game.Network.Packets if (hasFadeObjectTime) data.WriteInt32(moveSpline.effect_start_time); // FadeObjectTime - foreach (var vec in moveSpline.getPath()) + foreach (var vec in moveSpline.GetPath()) data.WriteVector3(vec); if (moveSpline.spell_effect_extra.HasValue) @@ -252,7 +252,7 @@ namespace Game.Network.Packets data.WriteUInt32(moveSpline.spell_effect_extra.Value.ParabolicCurveId); } - if (moveSpline.splineflags.hasFlag(SplineFlag.Parabolic)) + if (moveSpline.splineflags.HasFlag(SplineFlag.Parabolic)) { data.WriteFloat(moveSpline.vertical_acceleration); data.WriteInt32(moveSpline.effect_start_time); @@ -263,8 +263,8 @@ namespace Game.Network.Packets public static void WriteCreateObjectAreaTriggerSpline(Spline spline, WorldPacket data) { - data.WriteBits(spline.getPoints().Length, 16); - foreach (var point in spline.getPoints()) + data.WriteBits(spline.GetPoints().Length, 16); + foreach (var point in spline.GetPoints()) data.WriteVector3(point); } @@ -344,29 +344,29 @@ namespace Game.Network.Packets MovementSpline movementSpline = SplineData.Move; MoveSplineFlag splineFlags = moveSpline.splineflags; - splineFlags.SetUnsetFlag(SplineFlag.Cyclic, moveSpline.isCyclic()); + splineFlags.SetUnsetFlag(SplineFlag.Cyclic, moveSpline.IsCyclic()); movementSpline.Flags = (uint)(splineFlags.Flags & ~SplineFlag.MaskNoMonsterMove); movementSpline.Face = moveSpline.facing.type; movementSpline.FaceDirection = moveSpline.facing.angle; movementSpline.FaceGUID = moveSpline.facing.target; movementSpline.FaceSpot = moveSpline.facing.f; - if (splineFlags.hasFlag(SplineFlag.Animation)) + if (splineFlags.HasFlag(SplineFlag.Animation)) { - movementSpline.AnimTier = splineFlags.getAnimTier(); + movementSpline.AnimTier = splineFlags.GetAnimTier(); movementSpline.TierTransStartTime = (uint)moveSpline.effect_start_time; } movementSpline.MoveTime = (uint)moveSpline.Duration(); - if (splineFlags.hasFlag(SplineFlag.Parabolic)) + if (splineFlags.HasFlag(SplineFlag.Parabolic)) { movementSpline.JumpExtraData.HasValue = true; movementSpline.JumpExtraData.Value.JumpGravity = moveSpline.vertical_acceleration; movementSpline.JumpExtraData.Value.StartTime = (uint)moveSpline.effect_start_time; } - if (splineFlags.hasFlag(SplineFlag.FadeObject)) + if (splineFlags.HasFlag(SplineFlag.FadeObject)) movementSpline.FadeObjectTime = (uint)moveSpline.effect_start_time; if (moveSpline.spell_effect_extra.HasValue) @@ -380,19 +380,19 @@ namespace Game.Network.Packets } Spline spline = moveSpline.spline; - Vector3[] array = spline.getPoints(); + Vector3[] array = spline.GetPoints(); - if (splineFlags.hasFlag(SplineFlag.UncompressedPath)) + if (splineFlags.HasFlag(SplineFlag.UncompressedPath)) { - if (!splineFlags.hasFlag(SplineFlag.Cyclic)) + if (!splineFlags.HasFlag(SplineFlag.Cyclic)) { - int count = spline.getPointCount() - 3; + int count = spline.GetPointCount() - 3; for (uint i = 0; i < count; ++i) movementSpline.Points.Add(array[i + 2]); } else { - int count = spline.getPointCount() - 3; + int count = spline.GetPointCount() - 3; movementSpline.Points.Add(array[1]); for (uint i = 0; i < count; ++i) movementSpline.Points.Add(array[i + 1]); @@ -400,8 +400,8 @@ namespace Game.Network.Packets } else { - int lastIdx = spline.getPointCount() - 3; - Span realPath = new Span(spline.getPoints()).Slice(1); + int lastIdx = spline.GetPointCount() - 3; + Span realPath = new Span(spline.GetPoints()).Slice(1); movementSpline.Points.Add(realPath[lastIdx]); diff --git a/Source/Game/OutdoorPVP/OutdoorPvP.cs b/Source/Game/OutdoorPVP/OutdoorPvP.cs index c1c1d4e30..74ef2f85d 100644 --- a/Source/Game/OutdoorPVP/OutdoorPvP.cs +++ b/Source/Game/OutdoorPVP/OutdoorPvP.cs @@ -93,7 +93,7 @@ namespace Game.PvP Group group = killer.GetGroup(); if (group) { - for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.next()) + for (GroupReference refe = group.GetFirstMember(); refe != null; refe = refe.Next()) { Player groupGuy = refe.GetSource(); @@ -316,9 +316,9 @@ namespace Game.PvP public OPvPCapturePoint(OutdoorPvP pvp) { m_team = TeamId.Neutral; - m_OldState = ObjectiveStates.Neutral; - m_State = ObjectiveStates.Neutral; - m_PvP = pvp; + OldState = ObjectiveStates.Neutral; + State = ObjectiveStates.Neutral; + PvP = pvp; m_activePlayers[0] = new HashSet(); m_activePlayers[1] = new HashSet(); @@ -433,7 +433,7 @@ namespace Game.PvP } ulong spawnId = m_Creatures[type]; - var bounds = m_PvP.GetMap().GetCreatureBySpawnIdStore().LookupByKey(spawnId); + var bounds = PvP.GetMap().GetCreatureBySpawnIdStore().LookupByKey(spawnId); foreach (var creature in bounds) { // Don't save respawn time @@ -447,7 +447,7 @@ namespace Game.PvP // delete respawn time for this creature PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CREATURE_RESPAWN); stmt.AddValue(0, spawnId); - stmt.AddValue(1, m_PvP.GetMap().GetId()); + stmt.AddValue(1, PvP.GetMap().GetId()); stmt.AddValue(2, 0); // instance id, always 0 for world maps DB.Characters.Execute(stmt); @@ -463,7 +463,7 @@ namespace Game.PvP return false; ulong spawnId = m_Objects[type]; - var bounds = m_PvP.GetMap().GetGameObjectBySpawnIdStore().LookupByKey(spawnId); + var bounds = PvP.GetMap().GetGameObjectBySpawnIdStore().LookupByKey(spawnId); foreach (var gameobject in bounds) { // Don't save respawn time @@ -545,7 +545,7 @@ namespace Game.PvP if (fact_diff < 0) { // horde is in majority, but it's already horde-controlled . no change - if (m_State == ObjectiveStates.Horde && m_value <= -m_maxValue) + if (State == ObjectiveStates.Horde && m_value <= -m_maxValue) return false; if (fact_diff < -maxDiff) @@ -556,7 +556,7 @@ namespace Game.PvP else { // ally is in majority, but it's already ally-controlled . no change - if (m_State == ObjectiveStates.Alliance && m_value >= m_maxValue) + if (State == ObjectiveStates.Alliance && m_value >= m_maxValue) return false; if (fact_diff > maxDiff) @@ -568,7 +568,7 @@ namespace Game.PvP float oldValue = m_value; uint oldTeam = m_team; - m_OldState = m_State; + OldState = State; m_value += fact_diff; @@ -576,40 +576,40 @@ namespace Game.PvP { if (m_value < -m_maxValue) m_value = -m_maxValue; - m_State = ObjectiveStates.Horde; + State = ObjectiveStates.Horde; m_team = TeamId.Horde; } else if (m_value > m_minValue) // blue { if (m_value > m_maxValue) m_value = m_maxValue; - m_State = ObjectiveStates.Alliance; + State = ObjectiveStates.Alliance; m_team = TeamId.Alliance; } else if (oldValue * m_value <= 0) // grey, go through mid point { // if challenger is ally, then n.a challenge if (Challenger == Team.Alliance) - m_State = ObjectiveStates.NeutralAllianceChallenge; + State = ObjectiveStates.NeutralAllianceChallenge; // if challenger is horde, then n.h challenge else if (Challenger == Team.Horde) - m_State = ObjectiveStates.NeutralHordeChallenge; + State = ObjectiveStates.NeutralHordeChallenge; m_team = TeamId.Neutral; } else // grey, did not go through mid point { // old phase and current are on the same side, so one team challenges the other - if (Challenger == Team.Alliance && (m_OldState == ObjectiveStates.Horde || m_OldState == ObjectiveStates.NeutralHordeChallenge)) - m_State = ObjectiveStates.HordeAllianceChallenge; - else if (Challenger == Team.Horde && (m_OldState == ObjectiveStates.Alliance || m_OldState == ObjectiveStates.NeutralAllianceChallenge)) - m_State = ObjectiveStates.AllianceHordeChallenge; + if (Challenger == Team.Alliance && (OldState == ObjectiveStates.Horde || OldState == ObjectiveStates.NeutralHordeChallenge)) + State = ObjectiveStates.HordeAllianceChallenge; + else if (Challenger == Team.Horde && (OldState == ObjectiveStates.Alliance || OldState == ObjectiveStates.NeutralAllianceChallenge)) + State = ObjectiveStates.AllianceHordeChallenge; m_team = TeamId.Neutral; } if (m_value != oldValue) SendChangePhase(); - if (m_OldState != m_State) + if (OldState != State) { if (oldTeam != m_team) ChangeTeam(oldTeam); @@ -637,7 +637,7 @@ namespace Game.PvP public void SendObjectiveComplete(uint id, ObjectGuid guid) { uint team; - switch (m_State) + switch (State) { case ObjectiveStates.Alliance: team = 0; @@ -714,12 +714,12 @@ namespace Game.PvP public float m_value; uint m_team; // objective states - public ObjectiveStates m_OldState { get; set; } - public ObjectiveStates m_State { get; set; } + public ObjectiveStates OldState { get; set; } + public ObjectiveStates State { get; set; } // neutral value on capture bar public uint m_neutralValuePct; // pointer to the OutdoorPvP this objective belongs to - public OutdoorPvP m_PvP { get; set; } + public OutdoorPvP PvP { get; set; } public Dictionary m_Objects = new Dictionary(); public Dictionary m_Creatures = new Dictionary(); diff --git a/Source/Game/OutdoorPVP/Zones/HellfirePeninsulaPvP.cs b/Source/Game/OutdoorPVP/Zones/HellfirePeninsulaPvP.cs index ba3a7a7af..438b2667d 100644 --- a/Source/Game/OutdoorPVP/Zones/HellfirePeninsulaPvP.cs +++ b/Source/Game/OutdoorPVP/Zones/HellfirePeninsulaPvP.cs @@ -178,22 +178,22 @@ namespace Game.PvP public override void ChangeState() { uint field = 0; - switch (m_OldState) + switch (OldState) { case ObjectiveStates.Neutral: field = HPConst.Map_N[m_TowerType]; break; case ObjectiveStates.Alliance: field = HPConst.Map_A[m_TowerType]; - uint alliance_towers = ((HellfirePeninsulaPvP)m_PvP).GetAllianceTowersControlled(); + uint alliance_towers = ((HellfirePeninsulaPvP)PvP).GetAllianceTowersControlled(); if (alliance_towers != 0) - ((HellfirePeninsulaPvP)m_PvP).SetAllianceTowersControlled(--alliance_towers); + ((HellfirePeninsulaPvP)PvP).SetAllianceTowersControlled(--alliance_towers); break; case ObjectiveStates.Horde: field = HPConst.Map_H[m_TowerType]; - uint horde_towers = ((HellfirePeninsulaPvP)m_PvP).GetHordeTowersControlled(); + uint horde_towers = ((HellfirePeninsulaPvP)PvP).GetHordeTowersControlled(); if (horde_towers != 0) - ((HellfirePeninsulaPvP)m_PvP).SetHordeTowersControlled(--horde_towers); + ((HellfirePeninsulaPvP)PvP).SetHordeTowersControlled(--horde_towers); break; case ObjectiveStates.NeutralAllianceChallenge: field = HPConst.Map_N[m_TowerType]; @@ -212,12 +212,12 @@ namespace Game.PvP // send world state update if (field != 0) { - m_PvP.SendUpdateWorldState(field, 0); + PvP.SendUpdateWorldState(field, 0); field = 0; } uint artkit = 21; uint artkit2 = HPConst.TowerArtKit_N[m_TowerType]; - switch (m_State) + switch (State) { case ObjectiveStates.Neutral: field = HPConst.Map_N[m_TowerType]; @@ -227,10 +227,10 @@ namespace Game.PvP field = HPConst.Map_A[m_TowerType]; artkit = 2; artkit2 = HPConst.TowerArtKit_A[m_TowerType]; - uint alliance_towers = ((HellfirePeninsulaPvP)m_PvP).GetAllianceTowersControlled(); + uint alliance_towers = ((HellfirePeninsulaPvP)PvP).GetAllianceTowersControlled(); if (alliance_towers < 3) - ((HellfirePeninsulaPvP)m_PvP).SetAllianceTowersControlled(++alliance_towers); - m_PvP.SendDefenseMessage(HPConst.BuffZones[0], HPConst.LangCapture_A[m_TowerType]); + ((HellfirePeninsulaPvP)PvP).SetAllianceTowersControlled(++alliance_towers); + PvP.SendDefenseMessage(HPConst.BuffZones[0], HPConst.LangCapture_A[m_TowerType]); break; } case ObjectiveStates.Horde: @@ -238,10 +238,10 @@ namespace Game.PvP field = HPConst.Map_H[m_TowerType]; artkit = 1; artkit2 = HPConst.TowerArtKit_H[m_TowerType]; - uint horde_towers = ((HellfirePeninsulaPvP)m_PvP).GetHordeTowersControlled(); + uint horde_towers = ((HellfirePeninsulaPvP)PvP).GetHordeTowersControlled(); if (horde_towers < 3) - ((HellfirePeninsulaPvP)m_PvP).SetHordeTowersControlled(++horde_towers); - m_PvP.SendDefenseMessage(HPConst.BuffZones[0], HPConst.LangCapture_H[m_TowerType]); + ((HellfirePeninsulaPvP)PvP).SetHordeTowersControlled(++horde_towers); + PvP.SendDefenseMessage(HPConst.BuffZones[0], HPConst.LangCapture_H[m_TowerType]); break; } case ObjectiveStates.NeutralAllianceChallenge: @@ -273,16 +273,16 @@ namespace Game.PvP // send world state update if (field != 0) - m_PvP.SendUpdateWorldState(field, 1); + PvP.SendUpdateWorldState(field, 1); // complete quest objective - if (m_State == ObjectiveStates.Alliance || m_State == ObjectiveStates.Horde) + if (State == ObjectiveStates.Alliance || State == ObjectiveStates.Horde) SendObjectiveComplete(HPConst.CreditMarker[m_TowerType], ObjectGuid.Empty); } public override void FillInitialWorldStates(InitWorldStates packet) { - switch (m_State) + switch (State) { case ObjectiveStates.Alliance: case ObjectiveStates.AllianceHordeChallenge: diff --git a/Source/Game/Phasing/PhasingHandler.cs b/Source/Game/Phasing/PhasingHandler.cs index 6dcbcabd9..1207ba5bf 100644 --- a/Source/Game/Phasing/PhasingHandler.cs +++ b/Source/Game/Phasing/PhasingHandler.cs @@ -471,8 +471,8 @@ namespace Game return phaseShift.VisibleMapIds.First().Key; GridCoord gridCoord = GridDefines.ComputeGridCoord(x, y); - uint gx = (uint)((MapConst.MaxGrids - 1) - gridCoord.x_coord); - uint gy = (uint)((MapConst.MaxGrids - 1) - gridCoord.y_coord); + uint gx = (uint)((MapConst.MaxGrids - 1) - gridCoord.X_coord); + uint gy = (uint)((MapConst.MaxGrids - 1) - gridCoord.Y_coord); uint gxbegin = Math.Max(gx - 1, 0); uint gxend = Math.Min(gx + 1, MapConst.MaxGrids); diff --git a/Source/Game/Pools/PoolManager.cs b/Source/Game/Pools/PoolManager.cs index 14329d475..f28eac639 100644 --- a/Source/Game/Pools/PoolManager.cs +++ b/Source/Game/Pools/PoolManager.cs @@ -269,7 +269,7 @@ namespace Game List creBounds; List goBounds; - Dictionary poolTypeMap = new Dictionary(); + Dictionary poolTypeMap = new Dictionary(); uint count = 0; do { @@ -298,10 +298,10 @@ namespace Game continue; } - if (poolTypeMap[pool_id] == eQuestTypes.None) - poolTypeMap[pool_id] = quest.IsDaily() ? eQuestTypes.Daily : eQuestTypes.Weekly; + if (poolTypeMap[pool_id] == QuestTypes.None) + poolTypeMap[pool_id] = quest.IsDaily() ? QuestTypes.Daily : QuestTypes.Weekly; - eQuestTypes currType = quest.IsDaily() ? eQuestTypes.Daily : eQuestTypes.Weekly; + QuestTypes currType = quest.IsDaily() ? QuestTypes.Daily : QuestTypes.Weekly; if (poolTypeMap[pool_id] != currType) { @@ -391,7 +391,7 @@ namespace Game foreach (var questPoolGroup in mPoolQuestGroups.Values) { - if (questPoolGroup.isEmpty()) + if (questPoolGroup.IsEmpty()) continue; PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_QUEST_POOL_SAVE); stmt.AddValue(0, questPoolGroup.GetPoolId()); @@ -451,19 +451,19 @@ namespace Game switch (typeof(T).Name) { case "Creature": - if (mPoolCreatureGroups.ContainsKey(pool_id) && !mPoolCreatureGroups[pool_id].isEmpty()) + if (mPoolCreatureGroups.ContainsKey(pool_id) && !mPoolCreatureGroups[pool_id].IsEmpty()) mPoolCreatureGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); break; case "GameObject": - if (mPoolGameobjectGroups.ContainsKey(pool_id) && !mPoolGameobjectGroups[pool_id].isEmpty()) + if (mPoolGameobjectGroups.ContainsKey(pool_id) && !mPoolGameobjectGroups[pool_id].IsEmpty()) mPoolGameobjectGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); break; case "Pool": - if (mPoolPoolGroups.ContainsKey(pool_id) && !mPoolPoolGroups[pool_id].isEmpty()) + if (mPoolPoolGroups.ContainsKey(pool_id) && !mPoolPoolGroups[pool_id].IsEmpty()) mPoolPoolGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); break; case "Quest": - if (mPoolQuestGroups.ContainsKey(pool_id) && !mPoolQuestGroups[pool_id].isEmpty()) + if (mPoolQuestGroups.ContainsKey(pool_id) && !mPoolQuestGroups[pool_id].IsEmpty()) mPoolQuestGroups[pool_id].SpawnObject(mSpawnedData, mPoolTemplate[pool_id].MaxLimit, db_guid); break; } @@ -479,16 +479,16 @@ namespace Game public void DespawnPool(uint pool_id) { - if (mPoolCreatureGroups.ContainsKey(pool_id) && !mPoolCreatureGroups[pool_id].isEmpty()) + if (mPoolCreatureGroups.ContainsKey(pool_id) && !mPoolCreatureGroups[pool_id].IsEmpty()) mPoolCreatureGroups[pool_id].DespawnObject(mSpawnedData); - if (mPoolGameobjectGroups.ContainsKey(pool_id) && !mPoolGameobjectGroups[pool_id].isEmpty()) + if (mPoolGameobjectGroups.ContainsKey(pool_id) && !mPoolGameobjectGroups[pool_id].IsEmpty()) mPoolGameobjectGroups[pool_id].DespawnObject(mSpawnedData); - if (mPoolPoolGroups.ContainsKey(pool_id) && !mPoolPoolGroups[pool_id].isEmpty()) + if (mPoolPoolGroups.ContainsKey(pool_id) && !mPoolPoolGroups[pool_id].IsEmpty()) mPoolPoolGroups[pool_id].DespawnObject(mSpawnedData); - if (mPoolQuestGroups.ContainsKey(pool_id) && !mPoolQuestGroups[pool_id].isEmpty()) + if (mPoolQuestGroups.ContainsKey(pool_id) && !mPoolQuestGroups[pool_id].IsEmpty()) mPoolQuestGroups[pool_id].DespawnObject(mSpawnedData); } @@ -534,7 +534,7 @@ namespace Game return 0; } - public enum eQuestTypes + public enum QuestTypes { None = 0, Daily = 1, @@ -921,7 +921,7 @@ namespace Game public void SetPoolId(uint pool_id) { poolId = pool_id; } - public bool isEmpty() { return ExplicitlyChanced.Empty() && EqualChanced.Empty(); } + public bool IsEmpty() { return ExplicitlyChanced.Empty() && EqualChanced.Empty(); } public ulong GetFirstEqualChancedObjectId() { diff --git a/Source/Game/Scripting/SpellScript.cs b/Source/Game/Scripting/SpellScript.cs index fb714a186..53e4cd0ba 100644 --- a/Source/Game/Scripting/SpellScript.cs +++ b/Source/Game/Scripting/SpellScript.cs @@ -743,7 +743,7 @@ namespace Game.Scripting public void FinishCast(SpellCastResult result, uint? param1 = null, uint? param2 = null) { m_spell.SendCastResult(result, param1, param2); - m_spell.finish(result == SpellCastResult.SpellCastOk); + m_spell.Finish(result == SpellCastResult.SpellCastOk); } public void SetCustomCastResultMessage(SpellCustomErrors result) diff --git a/Source/Game/Server/WorldManager.cs b/Source/Game/Server/WorldManager.cs index aa5817fb2..a498d74b4 100644 --- a/Source/Game/Server/WorldManager.cs +++ b/Source/Game/Server/WorldManager.cs @@ -1083,8 +1083,8 @@ namespace Game if (!EnableHeight) Log.outError(LogFilter.ServerLoading, "VMap height checking Disabled! Creatures movements and other various things WILL be broken! Expect no support."); - Global.VMapMgr.setEnableLineOfSightCalc(EnableLOS); - Global.VMapMgr.setEnableHeightCalc(EnableHeight); + Global.VMapMgr.SetEnableLineOfSightCalc(EnableLOS); + Global.VMapMgr.SetEnableHeightCalc(EnableHeight); Log.outInfo(LogFilter.ServerLoading, "VMap support included. LineOfSight: {0}, getHeight: {1}, indoorCheck: {2}", EnableLOS, EnableHeight, EnableIndoor); Log.outInfo(LogFilter.ServerLoading, @"VMap data directory is: {0}\vmaps", GetDataPath()); @@ -1807,7 +1807,7 @@ namespace Game void InitWeeklyQuestResetTime() { - long wstime = getWorldState(WorldStates.WeeklyQuestResetTime); + long wstime = GetWorldState(WorldStates.WeeklyQuestResetTime); long curtime = Time.UnixTime; m_NextWeeklyQuestReset = wstime < curtime ? curtime : wstime; } @@ -1844,14 +1844,14 @@ namespace Game void InitMonthlyQuestResetTime() { - long wstime = getWorldState(WorldStates.MonthlyQuestResetTime); + long wstime = GetWorldState(WorldStates.MonthlyQuestResetTime); long curtime = Time.UnixTime; m_NextMonthlyQuestReset = wstime < curtime ? curtime : wstime; } void InitRandomBGResetTime() { - long bgtime = getWorldState(WorldStates.BGDailyResetTime); + long bgtime = GetWorldState(WorldStates.BGDailyResetTime); if (bgtime == 0) m_NextRandomBGReset = Time.UnixTime; // game time not yet init @@ -1869,12 +1869,12 @@ namespace Game m_NextRandomBGReset = bgtime < curTime ? nextDayResetTime - Time.Day : nextDayResetTime; if (bgtime == 0) - setWorldState(WorldStates.BGDailyResetTime, (ulong)m_NextRandomBGReset); + SetWorldState(WorldStates.BGDailyResetTime, (ulong)m_NextRandomBGReset); } void InitGuildResetTime() { - long gtime = getWorldState(WorldStates.GuildDailyResetTime); + long gtime = GetWorldState(WorldStates.GuildDailyResetTime); if (gtime == 0) m_NextGuildReset = Time.UnixTime; // game time not yet init @@ -1888,12 +1888,12 @@ namespace Game m_NextGuildReset = gtime < curTime ? nextDayResetTime - Time.Day : nextDayResetTime; if (gtime == 0) - setWorldState(WorldStates.GuildDailyResetTime, (ulong)m_NextGuildReset); + SetWorldState(WorldStates.GuildDailyResetTime, (ulong)m_NextGuildReset); } void InitCurrencyResetTime() { - long currencytime = getWorldState(WorldStates.CurrencyResetTime); + long currencytime = GetWorldState(WorldStates.CurrencyResetTime); if (currencytime == 0) m_NextCurrencyReset = Time.UnixTime; // game time not yet init @@ -1910,7 +1910,7 @@ namespace Game m_NextCurrencyReset = currencytime < curTime ? nextWeekResetTime - WorldConfig.GetIntValue(WorldCfg.CurrencyResetInterval) * Time.Day : nextWeekResetTime; if (currencytime == 0) - setWorldState(WorldStates.CurrencyResetTime, (ulong)m_NextCurrencyReset); + SetWorldState(WorldStates.CurrencyResetTime, (ulong)m_NextCurrencyReset); } void DailyReset() @@ -1941,7 +1941,7 @@ namespace Game session.GetPlayer().ResetCurrencyWeekCap(); m_NextCurrencyReset = m_NextCurrencyReset + Time.Day * WorldConfig.GetIntValue(WorldCfg.CurrencyResetInterval); - setWorldState(WorldStates.CurrencyResetTime, (ulong)m_NextCurrencyReset); + SetWorldState(WorldStates.CurrencyResetTime, (ulong)m_NextCurrencyReset); } public void LoadDBAllowedSecurityLevel() @@ -1975,7 +1975,7 @@ namespace Game session.GetPlayer().ResetWeeklyQuestStatus(); m_NextWeeklyQuestReset = (m_NextWeeklyQuestReset + Time.Week); - setWorldState(WorldStates.WeeklyQuestResetTime, (ulong)m_NextWeeklyQuestReset); + SetWorldState(WorldStates.WeeklyQuestResetTime, (ulong)m_NextWeeklyQuestReset); // change available weeklies Global.PoolMgr.ChangeWeeklyQuests(); @@ -2003,7 +2003,7 @@ namespace Game // plan next reset time m_NextMonthlyQuestReset = (curTime >= nextMonthResetTime) ? nextMonthResetTime + Time.Month : nextMonthResetTime; - setWorldState(WorldStates.MonthlyQuestResetTime, (ulong)m_NextMonthlyQuestReset); + SetWorldState(WorldStates.MonthlyQuestResetTime, (ulong)m_NextMonthlyQuestReset); } public void ResetEventSeasonalQuests(ushort event_id) @@ -2029,18 +2029,18 @@ namespace Game session.GetPlayer().SetRandomWinner(false); m_NextRandomBGReset = m_NextRandomBGReset + Time.Day; - setWorldState(WorldStates.BGDailyResetTime, (ulong)m_NextRandomBGReset); + SetWorldState(WorldStates.BGDailyResetTime, (ulong)m_NextRandomBGReset); } void ResetGuildCap() { m_NextGuildReset = (m_NextGuildReset + Time.Day); - setWorldState(WorldStates.GuildDailyResetTime, (ulong)m_NextGuildReset); - ulong week = getWorldState(WorldStates.GuildWeeklyResetTime); + SetWorldState(WorldStates.GuildDailyResetTime, (ulong)m_NextGuildReset); + ulong week = GetWorldState(WorldStates.GuildWeeklyResetTime); week = week < 7 ? week + 1 : 1; Log.outInfo(LogFilter.Server, "Guild Daily Cap reset. Week: {0}", week == 1); - setWorldState(WorldStates.GuildWeeklyResetTime, week); + SetWorldState(WorldStates.GuildWeeklyResetTime, week); Global.GuildMgr.ResetTimes(week == 1); } @@ -2101,12 +2101,12 @@ namespace Game Log.outInfo(LogFilter.ServerLoading, "Loaded {0} world states in {1} ms", count, Time.GetMSTimeDiffToNow(oldMSTime)); } - public void setWorldState(WorldStates index, ulong value) + public void SetWorldState(WorldStates index, ulong value) { - setWorldState((uint)index, value); + SetWorldState((uint)index, value); } - public void setWorldState(uint index, object value) + public void SetWorldState(uint index, object value) { PreparedStatement stmt; @@ -2130,12 +2130,12 @@ namespace Game m_worldstates[index] = Convert.ToUInt32(value); } - public uint getWorldState(WorldStates index) + public uint GetWorldState(WorldStates index) { - return getWorldState((uint)index); + return GetWorldState((uint)index); } - public uint getWorldState(uint index) + public uint GetWorldState(uint index) { return m_worldstates.LookupByKey(index); } diff --git a/Source/Game/Server/WorldSession.cs b/Source/Game/Server/WorldSession.cs index 2e2becdd8..df5c55192 100644 --- a/Source/Game/Server/WorldSession.cs +++ b/Source/Game/Server/WorldSession.cs @@ -101,7 +101,7 @@ namespace Game //FIXME: logout must be delayed in case lost connection with client in time of combat if (GetPlayer().GetDeathTimer() != 0) { - _player.GetHostileRefManager().deleteReferences(); + _player.GetHostileRefManager().DeleteReferences(); _player.BuildPlayerRepop(); _player.RepopAtGraveyard(); } @@ -179,7 +179,7 @@ namespace Game // remove player from the group if he is: // a) in group; b) not in raid group; c) logging out normally (not being kicked or disconnected) - if (_player.GetGroup() && !_player.GetGroup().isRaidGroup() && m_Socket[(int)ConnectionType.Realm] != null) + if (_player.GetGroup() && !_player.GetGroup().IsRaidGroup() && m_Socket[(int)ConnectionType.Realm] != null) _player.RemoveFromGroup(); //! Send update to group and reset stored max enchanting level @@ -622,7 +622,7 @@ namespace Game public string GetOS() { return _os; } public void SetInQueue(bool state) { m_inQueue = state; } - public bool isLogingOut() { return _logoutTime != 0 || m_playerLogout; } + public bool IsLogingOut() { return _logoutTime != 0 || m_playerLogout; } public ulong GetConnectToInstanceKey() { return _instanceConnectKey.Raw; } diff --git a/Source/Game/Spells/Auras/Aura.cs b/Source/Game/Spells/Auras/Aura.cs index b6fa880a4..b786fc9e7 100644 --- a/Source/Game/Spells/Auras/Aura.cs +++ b/Source/Game/Spells/Auras/Aura.cs @@ -2715,7 +2715,7 @@ namespace Game.Spells if (ReferenceEquals(first, other)) return true; - if ((object)first == null || (object)other == null) + if (ReferenceEquals(first, null) || ReferenceEquals(other, null)) return false; return first.Equals(other); diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 9521e2ff2..57945cce0 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -1727,7 +1727,7 @@ namespace Game.Spells if (GetCasterGUID() == target.GetGUID() && target.GetCurrentSpell(CurrentSpellTypes.Generic) != null) target.FinishSpell(CurrentSpellTypes.Generic, false); target.InterruptNonMeleeSpells(true); - target.GetHostileRefManager().deleteReferences(); + target.GetHostileRefManager().DeleteReferences(); // stop handling the effect if it was removed by linked event if (aurApp.HasRemoveMode()) @@ -2375,7 +2375,7 @@ namespace Game.Spells Unit caster = GetCaster(); if (caster != null && caster.IsAlive()) - target.GetHostileRefManager().addTempThreat(GetAmount(), apply); + target.GetHostileRefManager().AddTempThreat(GetAmount(), apply); } [AuraEffectHandler(AuraType.ModTaunt)] @@ -5237,7 +5237,7 @@ namespace Game.Spells { Creature c = target.ToCreature(); if (c == null || caster == null || !Global.ScriptMgr.OnDummyEffect(caster, GetId(), GetEffIndex(), target.ToCreature()) || - !c.GetAI().sOnDummyEffect(caster, GetId(), GetEffIndex())) + !c.GetAI().OnDummyEffect(caster, GetId(), GetEffIndex())) Log.outDebug(LogFilter.Spells, "AuraEffect.HandlePeriodicTriggerSpellAuraTick: Spell {0} has non-existent spell {1} in EffectTriggered[{2}] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex()); } } @@ -5511,7 +5511,7 @@ namespace Game.Spells HealInfo healInfo = new HealInfo(caster, caster, heal, GetSpellInfo(), GetSpellInfo().GetSchoolMask()); caster.HealBySpell(healInfo); - caster.GetHostileRefManager().threatAssist(caster, healInfo.GetEffectiveHeal() * 0.5f, GetSpellInfo()); + caster.GetHostileRefManager().ThreatAssist(caster, healInfo.GetEffectiveHeal() * 0.5f, GetSpellInfo()); caster.ProcSkillsAndAuras(caster, ProcFlags.DonePeriodic, ProcFlags.TakenPeriodic, ProcFlagsSpellType.Heal, ProcFlagsSpellPhase.None, hitMask, null, null, healInfo); } @@ -5634,7 +5634,7 @@ namespace Game.Spells SpellPeriodicAuraLogInfo pInfo = new SpellPeriodicAuraLogInfo(this, heal, (uint)damage, heal - healInfo.GetEffectiveHeal(), healInfo.GetAbsorb(), 0, 0.0f, crit); target.SendPeriodicAuraLog(pInfo); - target.GetHostileRefManager().threatAssist(caster, healInfo.GetEffectiveHeal() * 0.5f, GetSpellInfo()); + target.GetHostileRefManager().ThreatAssist(caster, healInfo.GetEffectiveHeal() * 0.5f, GetSpellInfo()); // %-based heal - does not proc auras if (GetAuraType() == AuraType.ObsModHealth) @@ -5728,7 +5728,7 @@ namespace Game.Spells int gain = target.ModifyPower(powerType, amount); if (caster != null) - target.GetHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); + target.GetHostileRefManager().ThreatAssist(caster, gain * 0.5f, GetSpellInfo()); target.SendPeriodicAuraLog(pInfo); } @@ -5756,7 +5756,7 @@ namespace Game.Spells int gain = target.ModifyPower(powerType, amount); if (caster != null) - target.GetHostileRefManager().threatAssist(caster, gain * 0.5f, GetSpellInfo()); + target.GetHostileRefManager().ThreatAssist(caster, gain * 0.5f, GetSpellInfo()); target.SendPeriodicAuraLog(pInfo); } diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index d8e744352..593de142c 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -550,7 +550,7 @@ namespace Game.Spells else { SendCastResult(SpellCastResult.BadImplicitTargets); - finish(false); + Finish(false); } return; } @@ -567,7 +567,7 @@ namespace Game.Spells else { SendCastResult(SpellCastResult.BadImplicitTargets); - finish(false); + Finish(false); } return; } @@ -582,7 +582,7 @@ namespace Game.Spells { Log.outDebug(LogFilter.Spells, "Spell.SelectImplicitNearbyTargets: cannot find nearby target for spell ID {0}, effect {1}", m_spellInfo.Id, effIndex); SendCastResult(SpellCastResult.BadImplicitTargets); - finish(false); + Finish(false); return; } @@ -591,7 +591,7 @@ namespace Game.Spells { Log.outDebug(LogFilter.Spells, $"Spell.SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {m_spellInfo.Id} set NULL target, effect {effIndex}"); SendCastResult(SpellCastResult.BadImplicitTargets); - finish(false); + Finish(false); return; } @@ -605,7 +605,7 @@ namespace Game.Spells { Log.outDebug(LogFilter.Spells, $"Spell.SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {m_spellInfo.Id} set object of wrong type, expected unit, got {target.GetGUID().GetHigh()}, effect {effMask}"); SendCastResult(SpellCastResult.BadImplicitTargets); - finish(false); + Finish(false); return; } break; @@ -617,7 +617,7 @@ namespace Game.Spells { Log.outDebug(LogFilter.Spells, $"Spell.SelectImplicitNearbyTargets: OnObjectTargetSelect script hook for spell Id {m_spellInfo.Id} set object of wrong type, expected gameobject, got {target.GetGUID().GetHigh()}, effect {effMask}"); SendCastResult(SpellCastResult.BadImplicitTargets); - finish(false); + Finish(false); return; } break; @@ -802,14 +802,14 @@ namespace Game.Spells float ground = m_caster.GetMap().GetHeight(m_caster.GetPhaseShift(), x, y, z, true, 50.0f); float liquidLevel = MapConst.VMAPInvalidHeightValue; LiquidData liquidData; - if (m_caster.GetMap().getLiquidStatus(m_caster.GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out liquidData) != 0) + if (m_caster.GetMap().GetLiquidStatus(m_caster.GetPhaseShift(), x, y, z, MapConst.MapAllLiquidTypes, out liquidData) != 0) liquidLevel = liquidData.level; if (liquidLevel <= ground) // When there is no liquid Map.GetWaterOrGroundLevel returns ground level { SendCastResult(SpellCastResult.NotHere); SendChannelUpdate(0); - finish(false); + Finish(false); return; } @@ -817,7 +817,7 @@ namespace Game.Spells { SendCastResult(SpellCastResult.TooShallow); SendChannelUpdate(0); - finish(false); + Finish(false); return; } @@ -1045,7 +1045,7 @@ namespace Game.Spells } } - float tangent(float x) + float Tangent(float x) { x = (float)Math.Tan(x); if (x < 100000.0f && x > -100000.0f) return x; @@ -1077,7 +1077,7 @@ namespace Game.Spells targets.Sort(new ObjectDistanceOrderPred(m_caster)); - float b = tangent(m_targets.GetPitch()); + float b = Tangent(m_targets.GetPitch()); float a = (srcToDestDelta - dist2d * b) / (dist2d * dist2d); if (a > -0.0001f) a = 0; @@ -1424,7 +1424,7 @@ namespace Game.Spells return searcher.GetTarget(); } - void prepareDataForTriggerSystem() + void PrepareDataForTriggerSystem() { //========================================================================================== // Now fill data for trigger system, need know: @@ -1733,7 +1733,7 @@ namespace Game.Spells if (unit.IsAlive() != target.alive) return; - if (getState() == SpellState.Delayed && !m_spellInfo.IsPositive() && (GameTime.GetGameTimeMS() - target.timeDelay) <= unit.LastSanctuaryTime) + if (GetState() == SpellState.Delayed && !m_spellInfo.IsPositive() && (GameTime.GetGameTimeMS() - target.timeDelay) <= unit.LastSanctuaryTime) return; // No missinfo in that case // Get original caster (if exist) and calculate damage/healing from him data @@ -1869,7 +1869,7 @@ namespace Game.Spells HealInfo healInfo = new HealInfo(caster, unitTarget, addhealth, m_spellInfo, m_spellInfo.GetSchoolMask()); caster.HealBySpell(healInfo, crit); - unitTarget.GetHostileRefManager().threatAssist(caster, healInfo.GetEffectiveHeal() * 0.5f, m_spellInfo); + unitTarget.GetHostileRefManager().ThreatAssist(caster, healInfo.GetEffectiveHeal() * 0.5f, m_spellInfo); m_healing = (int)healInfo.GetEffectiveHeal(); // Do triggers for unit @@ -2040,7 +2040,7 @@ namespace Game.Spells if (unit.IsInCombat() && m_spellInfo.HasInitialAggro()) { m_caster.SetInCombatState(unit.GetCombatTimer() > 0, unit); - unit.GetHostileRefManager().threatAssist(m_caster, 0.0f); + unit.GetHostileRefManager().ThreatAssist(m_caster, 0.0f); } } } @@ -2323,7 +2323,7 @@ namespace Game.Spells return channelTargetEffectMask == 0; } - public void prepare(SpellCastTargets targets, AuraEffect triggeredByAura = null) + public void Prepare(SpellCastTargets targets, AuraEffect triggeredByAura = null) { if (m_CastItem != null) { @@ -2338,7 +2338,7 @@ namespace Game.Spells else { SendCastResult(SpellCastResult.EquippedItem); - finish(false); + Finish(false); return; } } @@ -2361,14 +2361,14 @@ namespace Game.Spells if (!Convert.ToBoolean(_triggeredCastFlags & TriggerCastFlags.IgnoreCastInProgress) && m_caster.IsNonMeleeSpellCast(false, true, true) && !m_castId.IsEmpty()) { SendCastResult(SpellCastResult.SpellInProgress); - finish(false); + Finish(false); return; } if (Global.DisableMgr.IsDisabledFor(DisableType.Spell, m_spellInfo.Id, m_caster)) { SendCastResult(SpellCastResult.SpellUnavailable); - finish(false); + Finish(false); return; } LoadScripts(); @@ -2404,12 +2404,12 @@ namespace Game.Spells else SendCastResult(result); - finish(false); + Finish(false); return; } // Prepare data for triggers - prepareDataForTriggerSystem(); + PrepareDataForTriggerSystem(); if (m_caster.IsTypeId(TypeId.Player)) { @@ -2446,7 +2446,7 @@ namespace Game.Spells if (m_casttime != 0 || !m_spellInfo.IsMoveAllowedChannel()) { SendCastResult(SpellCastResult.Moving); - finish(false); + Finish(false); return; } } @@ -2460,7 +2460,7 @@ namespace Game.Spells // @todoApply this to all casted spells if needed // Why check duration? 29350: channelled triggers channelled if (_triggeredCastFlags.HasAnyFlag(TriggerCastFlags.CastDirectly) && (!m_spellInfo.IsChanneled() || m_spellInfo.GetMaxDuration() == 0)) - cast(true); + Cast(true); else { // stealth must be removed at cast starting (at show channel bar) @@ -2491,11 +2491,11 @@ namespace Game.Spells // the easiest bug to observe is LoS check in AddUnitTarget, even if spell passed the CheckCast LoS check the situation can change in spell::update // because target could be relocated in the meantime, making the spell fly to the air (no targets can be registered, so no effects processed, nothing in combat log) if (m_casttime == 0 && /*m_spellInfo.StartRecoveryTime == 0 && */ m_castItemGUID.IsEmpty() && GetCurrentContainer() == CurrentSpellTypes.Generic) - cast(true); + Cast(true); } } - public void cancel() + public void Cancel() { if (m_spellState == SpellState.Finished) return; @@ -2547,10 +2547,10 @@ namespace Game.Spells //set state back so finish will be processed m_spellState = oldState; - finish(false); + Finish(false); } - public void cast(bool skipCheck = false) + public void Cast(bool skipCheck = false) { Player modOwner = m_caster.GetSpellModOwner(); Spell lastSpellMod = null; @@ -2572,14 +2572,14 @@ namespace Game.Spells if (!UpdatePointers()) { // cancel the spell if UpdatePointers() returned false, something wrong happened there - cancel(); + Cancel(); return; } // cancel at lost explicit target during cast if (!m_targets.GetObjectTargetGUID().IsEmpty() && m_targets.GetObjectTarget() == null) { - cancel(); + Cancel(); return; } @@ -2631,7 +2631,7 @@ namespace Game.Spells if (m_caster.IsTypeId(TypeId.Player)) m_caster.ToPlayer().SetSpellModTakingSpell(this, false); - finish(false); + Finish(false); SetExecutedCurrently(false); return; } @@ -2654,7 +2654,7 @@ namespace Game.Spells m_caster.ToPlayer().SetSpellModTakingSpell(this, false); - finish(false); + Finish(false); SetExecutedCurrently(false); return; } @@ -2685,7 +2685,7 @@ namespace Game.Spells if (m_caster.IsTypeId(TypeId.Player)) m_caster.ToPlayer().SetSpellModTakingSpell(this, false); - finish(false); + Finish(false); SetExecutedCurrently(false); return; } @@ -2763,7 +2763,7 @@ namespace Game.Spells else { // Immediate spell, no big deal - handle_immediate(); + HandleImmediate(); } CallScriptAfterCastHandlers(); @@ -2824,7 +2824,7 @@ namespace Game.Spells caster.GetAI().OnSuccessfulSpellCast(GetSpellInfo()); } - void handle_immediate() + void HandleImmediate() { // start channeling if applicable if (m_spellInfo.IsChanneled()) @@ -2878,15 +2878,15 @@ namespace Game.Spells TakeCastItem(); if (m_spellState != SpellState.Casting) - finish(true); // successfully finish spell cast (not last in case autorepeat or channel spell) + Finish(true); // successfully finish spell cast (not last in case autorepeat or channel spell) } - public ulong handle_delayed(ulong t_offset) + public ulong HandleDelayed(ulong offset) { if (!UpdatePointers()) { // finish the spell if UpdatePointers() returned false, something wrong happened there - finish(false); + Finish(false); return 0; } @@ -2896,12 +2896,12 @@ namespace Game.Spells if (!m_launchHandled) { ulong launchMoment = (ulong)Math.Floor(m_spellInfo.LaunchDelay * 1000.0f); - if (launchMoment > t_offset) + if (launchMoment > offset) return launchMoment; HandleLaunchPhase(); m_launchHandled = true; - if (m_delayMoment > t_offset) + if (m_delayMoment > offset) { if (single_missile) return m_delayMoment; @@ -2909,12 +2909,12 @@ namespace Game.Spells next_time = m_delayMoment; if ((m_UniqueTargetInfo.Count > 2 || (m_UniqueTargetInfo.Count == 1 && m_UniqueTargetInfo[0].targetGUID == m_caster.GetGUID())) || !m_UniqueGOTargetInfo.Empty()) { - t_offset = 0; // if LaunchDelay was present then the only target that has timeDelay = 0 is m_caster - and that is the only target we want to process now + offset = 0; // if LaunchDelay was present then the only target that has timeDelay = 0 is m_caster - and that is the only target we want to process now } } } - if (single_missile && t_offset == 0) + if (single_missile && offset == 0) return m_delayMoment; if (m_caster.IsTypeId(TypeId.Player)) @@ -2922,7 +2922,7 @@ namespace Game.Spells PrepareTargetProcessing(); - if (!m_immediateHandled && t_offset != 0) + if (!m_immediateHandled && offset != 0) { _handle_immediate_phase(); m_immediateHandled = true; @@ -2933,9 +2933,9 @@ namespace Game.Spells { if (!ihit.processed) { - if (single_missile || ihit.timeDelay <= t_offset) + if (single_missile || ihit.timeDelay <= offset) { - ihit.timeDelay = t_offset; + ihit.timeDelay = offset; DoAllEffectOnTarget(ihit); } else if (next_time == 0 || ihit.timeDelay < next_time) @@ -2948,7 +2948,7 @@ namespace Game.Spells { if (!ighit.processed) { - if (single_missile || ighit.timeDelay <= t_offset) + if (single_missile || ighit.timeDelay <= offset) DoAllEffectOnTarget(ighit); else if (next_time == 0 || ighit.timeDelay < next_time) next_time = ighit.timeDelay; @@ -2966,7 +2966,7 @@ namespace Game.Spells // spell is finished, perform some last features of the spell here _handle_finish_phase(); - finish(true); // successfully finish spell cast + Finish(true); // successfully finish spell cast // return zero, spell is finished now return 0; @@ -3049,19 +3049,19 @@ namespace Game.Spells m_caster.GetSpellHistory().HandleCooldowns(m_spellInfo, m_castItemEntry, this); } - public void update(uint difftime) + public void Update(uint difftime) { if (!UpdatePointers()) { // cancel the spell if UpdatePointers() returned false, something wrong happened there - cancel(); + Cancel(); return; } if (!m_targets.GetUnitTargetGUID().IsEmpty() && m_targets.GetUnitTarget() == null) { Log.outDebug(LogFilter.Spells, "Spell {0} is cancelled due to removal of target.", m_spellInfo.Id); - cancel(); + Cancel(); return; } @@ -3080,7 +3080,7 @@ namespace Game.Spells // @todo this is a hack, "creature" movesplines don't differentiate turning/moving right now // however, checking what type of movement the spline is for every single spline would be really expensive if (!m_caster.GetCharmerGUID().IsCreature()) - cancel(); + Cancel(); } } @@ -3098,7 +3098,7 @@ namespace Game.Spells if (m_timer == 0 && !m_spellInfo.IsNextMeleeSwingSpell() && !IsAutoRepeat()) // don't CheckCast for instant spells - done in spell.prepare, skip duplicate checks, needed for range checks for example - cast(m_casttime == 0); + Cast(m_casttime == 0); break; } case SpellState.Casting: @@ -3132,7 +3132,7 @@ namespace Game.Spells if (m_timer == 0) { SendChannelUpdate(0); - finish(); + Finish(); } break; } @@ -3141,7 +3141,7 @@ namespace Game.Spells } } - public void finish(bool ok = true) + public void Finish(bool ok = true) { if (!m_caster) return; @@ -4258,7 +4258,7 @@ namespace Game.Spells // positive spells distribute threat among all units that are in combat with target, like healing if (m_spellInfo.IsPositive()) - target.GetHostileRefManager().threatAssist(m_caster, threatToAdd, m_spellInfo); + target.GetHostileRefManager().ThreatAssist(m_caster, threatToAdd, m_spellInfo); // for negative spells threat gets distributed among affected targets else { @@ -4352,7 +4352,7 @@ namespace Game.Spells return SpellCastResult.DontReport; } - if (m_caster.IsTypeId(TypeId.Player) && Global.VMapMgr.isLineOfSightCalcEnabled()) + if (m_caster.IsTypeId(TypeId.Player) && Global.VMapMgr.IsLineOfSightCalcEnabled()) { if (m_spellInfo.HasAttribute(SpellAttr0.OutdoorsOnly) && !m_caster.GetMap().IsOutdoors(m_caster.GetPhaseShift(), m_caster.posX, m_caster.posY, m_caster.posZ)) @@ -4878,7 +4878,7 @@ namespace Game.Spells return SpellCastResult.TargetUnskinnable; Creature creature = m_targets.GetUnitTarget().ToCreature(); - if (!creature.IsCritter() && !creature.loot.isLooted()) + if (!creature.IsCritter() && !creature.loot.IsLooted()) return SpellCastResult.TargetNotLooted; SkillType skill = creature.GetCreatureTemplate().GetRequiredLootSkill(); @@ -6282,7 +6282,7 @@ namespace Game.Spells if (m_caster == null) return; - if (isDelayableNoMore()) // Spells may only be delayed twice + if (IsDelayableNoMore()) // Spells may only be delayed twice return; //check pushback reduce @@ -6314,10 +6314,10 @@ namespace Game.Spells public void DelayedChannel() { - if (m_caster == null || !m_caster.IsTypeId(TypeId.Player) || getState() != SpellState.Casting) + if (m_caster == null || !m_caster.IsTypeId(TypeId.Player) || GetState() != SpellState.Casting) return; - if (isDelayableNoMore()) // Spells may only be delayed twice + if (IsDelayableNoMore()) // Spells may only be delayed twice return; //check pushback reduce @@ -7131,11 +7131,11 @@ namespace Game.Spells return m_caster.CalculateSpellDamage(target, m_spellInfo, i, out variance, basePoint, m_castItemLevel); } - public SpellState getState() + public SpellState GetState() { return m_spellState; } - public void setState(SpellState state) + public void SetState(SpellState state) { m_spellState = state; } @@ -7218,7 +7218,7 @@ namespace Game.Spells return m_powerCost; } - bool isDelayableNoMore() + bool IsDelayableNoMore() { if (m_delayAtDamageCount >= 2) return true; @@ -7801,11 +7801,11 @@ namespace Game.Spells public override bool Execute(ulong e_time, uint p_time) { // update spell if it is not finished - if (m_Spell.getState() != SpellState.Finished) - m_Spell.update(p_time); + if (m_Spell.GetState() != SpellState.Finished) + m_Spell.Update(p_time); // check spell state to process - switch (m_Spell.getState()) + switch (m_Spell.GetState()) { case SpellState.Finished: { @@ -7825,7 +7825,7 @@ namespace Game.Spells { // run the spell handler and think about what we can do next ulong t_offset = e_time - m_Spell.GetDelayStart(); - ulong n_offset = m_Spell.handle_delayed(t_offset); + ulong n_offset = m_Spell.HandleDelayed(t_offset); if (n_offset != 0) { // re-add us to the queue @@ -7840,7 +7840,7 @@ namespace Game.Spells // delaying had just started, record the moment m_Spell.SetDelayStart(e_time); // handle effects on caster if the spell has travel time but also affects the caster in some way - ulong n_offset = m_Spell.handle_delayed(0); + ulong n_offset = m_Spell.HandleDelayed(0); if (m_Spell.m_spellInfo.LaunchDelay != 0) Cypher.Assert(n_offset == (ulong)Math.Floor(m_Spell.m_spellInfo.LaunchDelay * 1000.0f)); else @@ -7867,8 +7867,8 @@ namespace Game.Spells public override void Abort(ulong e_time) { // oops, the spell we try to do is aborted - if (m_Spell.getState() != SpellState.Finished) - m_Spell.cancel(); + if (m_Spell.GetState() != SpellState.Finished) + m_Spell.Cancel(); } public override bool IsDeletable() { diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index 8cb41af1d..e927e288f 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -106,7 +106,7 @@ namespace Game.Spells return; if (m_caster == unitTarget) // prevent interrupt message - finish(); + Finish(); SpellInstakillLog data = new SpellInstakillLog(); data.Target = unitTarget.GetGUID(); @@ -561,7 +561,7 @@ namespace Game.Spells return; } - finish(); + Finish(); m_caster.CastSpell(null, spellInfo, false); } @@ -2336,7 +2336,7 @@ namespace Game.Spells return; // cast finish successfully - finish(); + Finish(); Pet pet = m_caster.CreateTamedPetFrom(creatureTarget, m_spellInfo.Id); if (pet == null) // in very specific state like near world end/etc. @@ -2489,18 +2489,18 @@ namespace Game.Spells return; } - if (!unitTarget.GetThreatManager().getOnlineContainer().empty()) + if (!unitTarget.GetThreatManager().GetOnlineContainer().Empty()) { // Also use this effect to set the taunter's threat to the taunted creature's highest value - float myThreat = unitTarget.GetThreatManager().getThreat(m_caster); - float topThreat = unitTarget.GetThreatManager().getOnlineContainer().getMostHated().getThreat(); + float myThreat = unitTarget.GetThreatManager().GetThreat(m_caster); + float topThreat = unitTarget.GetThreatManager().GetOnlineContainer().GetMostHated().GetThreat(); if (topThreat > myThreat) - unitTarget.GetThreatManager().addThreat(m_caster, topThreat - myThreat); + unitTarget.GetThreatManager().AddThreat(m_caster, topThreat - myThreat); //Set aggro victim to caster - HostileReference forcedVictim = unitTarget.GetThreatManager().getOnlineContainer().getReferenceByTarget(m_caster); + HostileReference forcedVictim = unitTarget.GetThreatManager().GetOnlineContainer().GetReferenceByTarget(m_caster); if (forcedVictim != null) - unitTarget.GetThreatManager().setCurrentVictim(forcedVictim); + unitTarget.GetThreatManager().SetCurrentVictim(forcedVictim); } if (unitTarget.ToCreature().IsAIEnabled && !unitTarget.ToCreature().HasReactState(ReactStates.Passive)) @@ -2774,8 +2774,8 @@ namespace Game.Spells { SpellInfo curSpellInfo = spell.m_spellInfo; // check if we can interrupt spell - if ((spell.getState() == SpellState.Casting - || (spell.getState() == SpellState.Preparing && spell.GetCastTime() > 0.0f)) + if ((spell.GetState() == SpellState.Casting + || (spell.GetState() == SpellState.Preparing && spell.GetCastTime() > 0.0f)) && (curSpellInfo.PreventionType.HasAnyFlag(SpellPreventionType.Silence)) && ((i == CurrentSpellTypes.Generic && curSpellInfo.InterruptFlags.HasAnyFlag(SpellInterruptFlags.Interrupt)) || (i == CurrentSpellTypes.Channeled && curSpellInfo.HasChannelInterruptFlag(SpellChannelInterruptFlags.Interrupt)))) @@ -4329,7 +4329,7 @@ namespace Game.Spells return; Group group = player.GetGroup(); - if (!group || (group.isRaidGroup() && !group.IsLeader(player.GetGUID()) && !group.IsAssistant(player.GetGUID()))) + if (!group || (group.IsRaidGroup() && !group.IsLeader(player.GetGUID()) && !group.IsAssistant(player.GetGUID()))) return; float x, y, z; @@ -4513,7 +4513,7 @@ namespace Game.Spells if (unitTarget == null) return; - unitTarget.GetThreatManager().modifyThreatPercent(m_caster, damage); + unitTarget.GetThreatManager().ModifyThreatPercent(m_caster, damage); } [SpellEffectHandler(SpellEffectName.TransDoor)] diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index 207d55d56..6b838f93d 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -1659,10 +1659,10 @@ namespace Game.Spells public void _LoadSpellDiminishInfo() { SpellDiminishInfo diminishInfo = new SpellDiminishInfo(); - diminishInfo.DiminishGroup = diminishingGroupCompute(); - diminishInfo.DiminishReturnType = diminishingTypeCompute(diminishInfo.DiminishGroup); - diminishInfo.DiminishMaxLevel = diminishingMaxLevelCompute(diminishInfo.DiminishGroup); - diminishInfo.DiminishDurationLimit = diminishingLimitDurationCompute(); + diminishInfo.DiminishGroup = DiminishingGroupCompute(); + diminishInfo.DiminishReturnType = DiminishingTypeCompute(diminishInfo.DiminishGroup); + diminishInfo.DiminishMaxLevel = DiminishingMaxLevelCompute(diminishInfo.DiminishGroup); + diminishInfo.DiminishDurationLimit = DiminishingLimitDurationCompute(); _diminishInfo = diminishInfo; } @@ -1687,7 +1687,7 @@ namespace Game.Spells return _diminishInfo.DiminishDurationLimit; } - DiminishingGroup diminishingGroupCompute() + DiminishingGroup DiminishingGroupCompute() { if (IsPositive()) return DiminishingGroup.None; @@ -2042,7 +2042,7 @@ namespace Game.Spells return DiminishingGroup.None; } - DiminishingReturnsType diminishingTypeCompute(DiminishingGroup group) + DiminishingReturnsType DiminishingTypeCompute(DiminishingGroup group) { switch (group) { @@ -2057,7 +2057,7 @@ namespace Game.Spells } } - DiminishingLevels diminishingMaxLevelCompute(DiminishingGroup group) + DiminishingLevels DiminishingMaxLevelCompute(DiminishingGroup group) { switch (group) { @@ -2070,7 +2070,7 @@ namespace Game.Spells } } - int diminishingLimitDurationCompute() + int DiminishingLimitDurationCompute() { // Explicit diminishing duration switch (SpellFamilyName) @@ -3378,7 +3378,7 @@ namespace Game.Spells continue; // if non-positive trigger cast targeted to positive target this main cast is non-positive // this will place this spell auras as debuffs - if (_IsPositiveTarget(eff.TargetA.getTarget(), eff.TargetB.getTarget()) && !spellTriggeredProto._IsPositiveEffect(eff.EffectIndex, true)) + if (_IsPositiveTarget(eff.TargetA.GetTarget(), eff.TargetB.GetTarget()) && !spellTriggeredProto._IsPositiveEffect(eff.EffectIndex, true)) return false; } } @@ -3483,7 +3483,7 @@ namespace Game.Spells // non-positive targets - if (!_IsPositiveTarget(effect.TargetA.getTarget(), effect.TargetB.getTarget())) + if (!_IsPositiveTarget(effect.TargetA.GetTarget(), effect.TargetB.GetTarget())) return false; // negative spell if triggered spell is negative @@ -3510,10 +3510,10 @@ namespace Game.Spells return true; } - bool _IsPositiveTarget(uint targetA, uint targetB) + bool _IsPositiveTarget(Targets targetA, Targets targetB) { // non-positive targets - switch ((Targets)targetA) + switch (targetA) { case Targets.UnitNearbyEnemy: case Targets.UnitEnemy: @@ -4630,10 +4630,6 @@ namespace Game.Spells { return _target; } - public uint getTarget() - { - return (uint)_target; - } public SpellCastTargetFlags GetExplicitTargetMask(bool srcSet, bool dstSet) { diff --git a/Source/Game/Spells/SpellManager.cs b/Source/Game/Spells/SpellManager.cs index 2cf2d0c62..d0025ec2e 100644 --- a/Source/Game/Spells/SpellManager.cs +++ b/Source/Game/Spells/SpellManager.cs @@ -58,13 +58,13 @@ namespace Game.Entities continue; } - if (AuraEffectHandlers.ContainsKey(auraEffect.auraType)) + if (AuraEffectHandlers.ContainsKey(auraEffect.AuraType)) { - Log.outError(LogFilter.ServerLoading, "Tried to override AuraEffectHandler of {0} with {1} (AuraType {2}).", AuraEffectHandlers[auraEffect.auraType].ToString(), methodInfo.Name, auraEffect.auraType); + Log.outError(LogFilter.ServerLoading, "Tried to override AuraEffectHandler of {0} with {1} (AuraType {2}).", AuraEffectHandlers[auraEffect.AuraType].ToString(), methodInfo.Name, auraEffect.AuraType); continue; } - AuraEffectHandlers.Add(auraEffect.auraType, (AuraEffectHandler)methodInfo.CreateDelegate(typeof(AuraEffectHandler))); + AuraEffectHandlers.Add(auraEffect.AuraType, (AuraEffectHandler)methodInfo.CreateDelegate(typeof(AuraEffectHandler))); } @@ -86,13 +86,13 @@ namespace Game.Entities continue; } - if (SpellEffectsHandlers.ContainsKey(spellEffect.effectName)) + if (SpellEffectsHandlers.ContainsKey(spellEffect.EffectName)) { - Log.outError(LogFilter.ServerLoading, "Tried to override SpellEffectsHandler of {0} with {1} (EffectName {2}).", SpellEffectsHandlers[spellEffect.effectName].ToString(), methodInfo.Name, spellEffect.effectName); + Log.outError(LogFilter.ServerLoading, "Tried to override SpellEffectsHandler of {0} with {1} (EffectName {2}).", SpellEffectsHandlers[spellEffect.EffectName].ToString(), methodInfo.Name, spellEffect.EffectName); continue; } - SpellEffectsHandlers.Add(spellEffect.effectName, (SpellEffectHandler)methodInfo.CreateDelegate(typeof(SpellEffectHandler))); + SpellEffectsHandlers.Add(spellEffect.EffectName, (SpellEffectHandler)methodInfo.CreateDelegate(typeof(SpellEffectHandler))); } } } @@ -1304,11 +1304,11 @@ namespace Game.Entities if (auraName == 0) continue; - if (!isTriggerAura(auraName)) + if (!IsTriggerAura(auraName)) continue; - procSpellTypeMask |= getSpellTypeMask(auraName); - if (isAlwaysTriggeredAura(auraName)) + procSpellTypeMask |= GetSpellTypeMask(auraName); + if (IsAlwaysTriggeredAura(auraName)) addTriggerFlag = true; // many proc auras with taken procFlag mask don't have attribute "can proc with triggered" @@ -1347,7 +1347,7 @@ namespace Game.Entities procEntry.ProcFlags = spellInfo.ProcFlags; procEntry.SpellFamilyName = 0; foreach (SpellEffectInfo effect in spellInfo.GetEffectsForDifficulty(Difficulty.None)) - if (effect != null && effect.IsEffect() && isTriggerAura(effect.ApplyAuraName)) + if (effect != null && effect.IsEffect() && IsTriggerAura(effect.ApplyAuraName)) procEntry.SpellFamilyMask |= effect.SpellClassMask; if (procEntry.SpellFamilyMask) @@ -3155,7 +3155,7 @@ namespace Game.Entities } #endregion - bool isTriggerAura(AuraType type) + bool IsTriggerAura(AuraType type) { switch (type) { @@ -3208,7 +3208,7 @@ namespace Game.Entities } return false; } - bool isAlwaysTriggeredAura(AuraType type) + bool IsAlwaysTriggeredAura(AuraType type) { switch (type) { @@ -3227,7 +3227,7 @@ namespace Game.Entities } return false; } - ProcFlagsSpellType getSpellTypeMask(AuraType type) + ProcFlagsSpellType GetSpellTypeMask(AuraType type) { switch (type) { @@ -3397,10 +3397,10 @@ namespace Game.Entities { public AuraEffectHandlerAttribute(AuraType type) { - auraType = type; + AuraType = type; } - public AuraType auraType { get; set; } + public AuraType AuraType { get; set; } } [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] @@ -3408,10 +3408,10 @@ namespace Game.Entities { public SpellEffectHandlerAttribute(SpellEffectName effectName) { - this.effectName = effectName; + EffectName = effectName; } - public SpellEffectName effectName { get; set; } + public SpellEffectName EffectName { get; set; } } public class SpellInfoLoadHelper diff --git a/Source/Scripts/EasternKingdoms/Karazhan/AttumenMidnight.cs b/Source/Scripts/EasternKingdoms/Karazhan/AttumenMidnight.cs index 43792dce2..a840909b8 100644 --- a/Source/Scripts/EasternKingdoms/Karazhan/AttumenMidnight.cs +++ b/Source/Scripts/EasternKingdoms/Karazhan/AttumenMidnight.cs @@ -177,12 +177,12 @@ namespace Scripts.EasternKingdoms.Karazhan.Midnight _scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25), task => { Unit target = null; - var t_list = me.GetThreatManager().getThreatList(); + var t_list = me.GetThreatManager().GetThreatList(); List target_list = new List(); foreach (var itr in t_list) { - target = Global.ObjAccessor.GetUnit(me, itr.getUnitGuid()); + target = Global.ObjAccessor.GetUnit(me, itr.GetUnitGuid()); if (target && !target.IsWithinDist(me, 8.00f, false) && target.IsWithinDist(me, 25.0f, false)) target_list.Add(target); diff --git a/Source/Scripts/EasternKingdoms/Karazhan/OperaEvent.cs b/Source/Scripts/EasternKingdoms/Karazhan/OperaEvent.cs index e1dc915e2..a27499b7e 100644 --- a/Source/Scripts/EasternKingdoms/Karazhan/OperaEvent.cs +++ b/Source/Scripts/EasternKingdoms/Karazhan/OperaEvent.cs @@ -692,7 +692,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent { public npc_grandmother(Creature creature) : base(creature) { } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { if (menuId == RedRidingHood.OptionWhatPhatLewtsYouHave && gossipListId == 0) { @@ -1378,7 +1378,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent { public npc_barnes() : base("npc_barnes") { } - class npc_barnesAI : npc_escortAI + class npc_barnesAI : NpcEscortAI { public npc_barnesAI(Creature creature) : base(creature) { @@ -1518,7 +1518,7 @@ namespace Scripts.EasternKingdoms.Karazhan.OperaEvent { base.UpdateAI(diff); - if (HasEscortState(eEscortState.Paused)) + if (HasEscortState(EscortState.Paused)) { if (TalkTimer <= diff) { diff --git a/Source/Scripts/EasternKingdoms/ScarletEnclave/Chapter1.cs b/Source/Scripts/EasternKingdoms/ScarletEnclave/Chapter1.cs index ce6adc2bb..eae738fda 100644 --- a/Source/Scripts/EasternKingdoms/ScarletEnclave/Chapter1.cs +++ b/Source/Scripts/EasternKingdoms/ScarletEnclave/Chapter1.cs @@ -681,7 +681,7 @@ namespace Scripts.EasternKingdoms { public npc_salanar_the_horseman(Creature creature) : base(creature) { } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { if (menuId == MiscConst.GossipSalanarMenu && gossipListId == MiscConst.GossipSalanarOption) { @@ -939,7 +939,7 @@ namespace Scripts.EasternKingdoms } [Script] - class npc_scarlet_miner : npc_escortAI + class npc_scarlet_miner : NpcEscortAI { public npc_scarlet_miner(Creature creature) : base(creature) { diff --git a/Source/Scripts/Kalimdor/ZoneAshenvale.cs b/Source/Scripts/Kalimdor/ZoneAshenvale.cs index ab87fbba8..ecebcdca5 100644 --- a/Source/Scripts/Kalimdor/ZoneAshenvale.cs +++ b/Source/Scripts/Kalimdor/ZoneAshenvale.cs @@ -111,7 +111,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale [Script] - class npc_ruul_snowhoof : npc_escortAI + class npc_ruul_snowhoof : NpcEscortAI { public npc_ruul_snowhoof(Creature creature) : base(creature) { } @@ -129,7 +129,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale summoned.GetAI().AttackStart(me); } - public override void sQuestAccept(Player player, Quest quest) + public override void QuestAccept(Player player, Quest quest) { if (quest.Id == QuestIds.FreedomToRuul) { @@ -170,7 +170,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale } [Script] - public class npc_muglash : npc_escortAI + public class npc_muglash : NpcEscortAI { public npc_muglash(Creature creature) : base(creature) { @@ -194,7 +194,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale Player player = GetPlayerForEscort(); if (player) { - if (HasEscortState(eEscortState.Paused)) + if (HasEscortState(EscortState.Paused)) { if (Convert.ToBoolean(RandomHelper.URand(0, 1))) Talk(TextIds.SayMugOnGuard, player); @@ -205,7 +205,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale public override void JustDied(Unit killer) { - if (HasEscortState(eEscortState.Escorting)) + if (HasEscortState(EscortState.Escorting)) { Player player = GetPlayerForEscort(); if (player) @@ -218,7 +218,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale summoned.GetAI().AttackStart(me); } - public override void sQuestAccept(Player player, Quest quest) + public override void QuestAccept(Player player, Quest quest) { if (quest.Id == QuestIds.Vorsha) { @@ -292,7 +292,7 @@ namespace Scripts.Kalimdor.ZoneAshenvale if (!me.GetVictim()) { - if (HasEscortState(eEscortState.Paused) && _isBrazierExtinguished) + if (HasEscortState(EscortState.Paused) && _isBrazierExtinguished) { if (eventTimer < diff) { diff --git a/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossNadronox.cs b/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossNadronox.cs index 6267a2234..40ff7fa45 100644 --- a/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossNadronox.cs +++ b/Source/Scripts/Northrend/AzjolNerub/AzjolNerub/BossNadronox.cs @@ -182,10 +182,10 @@ namespace Scripts.Northrend.AzjolNerub.AzjolNerub.Nadronox bool IsInCombatWithPlayer() { - List refs = me.GetThreatManager().getThreatList(); + List refs = me.GetThreatManager().GetThreatList(); foreach (HostileReference hostileRef in refs) { - Unit target = hostileRef.getTarget(); + Unit target = hostileRef.GetTarget(); if (target) if (target.IsControlledByPlayer()) return true; diff --git a/Source/Scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/GrandChampions.cs b/Source/Scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/GrandChampions.cs index 416327a28..991454b82 100644 --- a/Source/Scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/GrandChampions.cs +++ b/Source/Scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/GrandChampions.cs @@ -72,7 +72,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion } [Script] - class generic_vehicleAI_toc5 : npc_escortAI + class generic_vehicleAI_toc5 : NpcEscortAI { public generic_vehicleAI_toc5(Creature creature) : base(creature) { diff --git a/Source/Scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/TrialOfTheCrusader.cs b/Source/Scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/TrialOfTheCrusader.cs index e6d98e579..d121cff2c 100644 --- a/Source/Scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/TrialOfTheCrusader.cs +++ b/Source/Scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/TrialOfTheCrusader.cs @@ -1313,7 +1313,7 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheCrusader break; case 400: Talk(Texts.Stage_0_06); - me.GetThreatManager().clearReferences(); + me.GetThreatManager().ClearReferences(); _updateTimer = 5 * Time.InMilliseconds; _instance.SetData(DataTypes.Event, 0); break; diff --git a/Source/Scripts/Northrend/FrozenHalls/ForgeOfSouls/InstanceForgeOfSouls.cs b/Source/Scripts/Northrend/FrozenHalls/ForgeOfSouls/InstanceForgeOfSouls.cs index b6a785b17..c2f00e468 100644 --- a/Source/Scripts/Northrend/FrozenHalls/ForgeOfSouls/InstanceForgeOfSouls.cs +++ b/Source/Scripts/Northrend/FrozenHalls/ForgeOfSouls/InstanceForgeOfSouls.cs @@ -220,7 +220,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls Initialize(); } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { if (menuId == Misc.MenuIdSylvanas && gossipListId == Misc.GossipOptionId) { @@ -304,7 +304,7 @@ namespace Scripts.Northrend.FrozenHalls.ForgeOfSouls Initialize(); } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { if (menuId == Misc.MenuIdJaina && gossipListId == Misc.GossipOptionId) { diff --git a/Source/Scripts/Northrend/FrozenHalls/PitOfSaron/BossKrickAndIck.cs b/Source/Scripts/Northrend/FrozenHalls/PitOfSaron/BossKrickAndIck.cs index 524429815..c61351dbf 100644 --- a/Source/Scripts/Northrend/FrozenHalls/PitOfSaron/BossKrickAndIck.cs +++ b/Source/Scripts/Northrend/FrozenHalls/PitOfSaron/BossKrickAndIck.cs @@ -183,7 +183,7 @@ namespace Scripts.Northrend.FrozenHalls.PitOfSaron.BossKrickAndIck if (!me.IsInCombat()) return; - if (!me.GetVictim() && me.GetThreatManager().isThreatListEmpty()) + if (!me.GetVictim() && me.GetThreatManager().IsThreatListEmpty()) { EnterEvadeMode(EvadeReason.NoHostiles); return; @@ -616,7 +616,7 @@ namespace Scripts.Northrend.FrozenHalls.PitOfSaron.BossKrickAndIck { ick.GetAI().Talk(TextIds.SayIckChase1, target); ick.AddAura(GetSpellInfo().Id, target); - ick.GetAI().SetTempThreat(ick.GetThreatManager().getThreat(target)); + ick.GetAI().SetTempThreat(ick.GetThreatManager().GetThreat(target)); ick.AddThreat(target, GetEffectValue()); target.AddThreat(ick, GetEffectValue()); } diff --git a/Source/Scripts/Northrend/IcecrownCitadel/GunshipBattle.cs b/Source/Scripts/Northrend/IcecrownCitadel/GunshipBattle.cs index 9d48658bc..3c2cc413f 100644 --- a/Source/Scripts/Northrend/IcecrownCitadel/GunshipBattle.cs +++ b/Source/Scripts/Northrend/IcecrownCitadel/GunshipBattle.cs @@ -645,7 +645,7 @@ namespace Scripts.Northrend.IcecrownCitadel AttackStart(victim); return me.GetVictim(); } - else if (me.GetThreatManager().isThreatListEmpty()) + else if (me.GetThreatManager().IsThreatListEmpty()) { EnterEvadeMode(EvadeReason.Other); return false; @@ -955,7 +955,7 @@ namespace Scripts.Northrend.IcecrownCitadel } } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { me.RemoveNpcFlag(NPCFlags.Gossip); me.GetTransport().EnableMovement(true); @@ -1200,7 +1200,7 @@ namespace Scripts.Northrend.IcecrownCitadel } } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { me.RemoveNpcFlag(NPCFlags.Gossip); me.GetTransport().EnableMovement(true); @@ -1358,7 +1358,7 @@ namespace Scripts.Northrend.IcecrownCitadel me.SetReactState(ReactStates.Passive); } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { player.AddItem(GunshipMiscData.ItemGoblinRocketPack, 1); player.PlayerTalkClass.SendCloseGossip(); diff --git a/Source/Scripts/Northrend/IcecrownCitadel/IcecrownCitadel.cs b/Source/Scripts/Northrend/IcecrownCitadel/IcecrownCitadel.cs index 9520c7408..3689808e0 100644 --- a/Source/Scripts/Northrend/IcecrownCitadel/IcecrownCitadel.cs +++ b/Source/Scripts/Northrend/IcecrownCitadel/IcecrownCitadel.cs @@ -656,7 +656,7 @@ namespace Scripts.Northrend.IcecrownCitadel } [Script] - class npc_crok_scourgebane : npc_escortAI + class npc_crok_scourgebane : NpcEscortAI { public npc_crok_scourgebane(Creature creature) : base(creature) { diff --git a/Source/Scripts/Northrend/IcecrownCitadel/LadyDeathwhisper.cs b/Source/Scripts/Northrend/IcecrownCitadel/LadyDeathwhisper.cs index 879b619cb..cb799952c 100644 --- a/Source/Scripts/Northrend/IcecrownCitadel/LadyDeathwhisper.cs +++ b/Source/Scripts/Northrend/IcecrownCitadel/LadyDeathwhisper.cs @@ -380,7 +380,7 @@ namespace Scripts.Northrend.IcecrownCitadel Group group = owner.GetGroup(); if (group) { - for (GroupReference groupRefe = group.GetFirstMember(); groupRefe != null; groupRefe = groupRefe.next()) + for (GroupReference groupRefe = group.GetFirstMember(); groupRefe != null; groupRefe = groupRefe.Next()) { Player member = groupRefe.GetSource(); if (member) @@ -857,7 +857,7 @@ namespace Scripts.Northrend.IcecrownCitadel Group group = owner.GetGroup(); if (group) { - for (GroupReference groupRefe = group.GetFirstMember(); groupRefe != null; groupRefe = groupRefe.next()) + for (GroupReference groupRefe = group.GetFirstMember(); groupRefe != null; groupRefe = groupRefe.Next()) { Player member = groupRefe.GetSource(); if (member) diff --git a/Source/Scripts/Northrend/Nexus/EyeOfEternity/EyeOfEternity.cs b/Source/Scripts/Northrend/Nexus/EyeOfEternity/EyeOfEternity.cs index cb0f96cb4..73249518b 100644 --- a/Source/Scripts/Northrend/Nexus/EyeOfEternity/EyeOfEternity.cs +++ b/Source/Scripts/Northrend/Nexus/EyeOfEternity/EyeOfEternity.cs @@ -235,7 +235,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity Creature malygos = instance.GetCreature(malygosGUID); if (malygos) { - var threatList = malygos.GetThreatManager().getThreatList(); + var threatList = malygos.GetThreatManager().GetThreatList(); foreach (var guid in vortexTriggers) { if (threatList.Empty()) @@ -251,7 +251,7 @@ namespace Scripts.Northrend.Nexus.EyeOfEternity if (counter >= 5) break; - Unit target = refe.getTarget(); + Unit target = refe.GetTarget(); if (target) { Player player = target.ToPlayer(); diff --git a/Source/Scripts/Northrend/Ulduar/FlameLeviathan.cs b/Source/Scripts/Northrend/Ulduar/FlameLeviathan.cs index 948e97f5e..1e4491018 100644 --- a/Source/Scripts/Northrend/Ulduar/FlameLeviathan.cs +++ b/Source/Scripts/Northrend/Ulduar/FlameLeviathan.cs @@ -867,7 +867,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan } [Script] - class npc_mimirons_inferno : npc_escortAI + class npc_mimirons_inferno : NpcEscortAI { public npc_mimirons_inferno(Creature creature) : base(creature) @@ -893,7 +893,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan { base.UpdateAI(diff); - if (!HasEscortState(eEscortState.Escorting)) + if (!HasEscortState(EscortState.Escorting)) Start(false, true, ObjectGuid.Empty, null, false, true); else { @@ -1034,7 +1034,7 @@ namespace Scripts.Northrend.Ulduar.FlameLeviathan } } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { if (menuId == GossipIds.MenuLoreKeeper && gossipListId == GossipIds.OptionLoreKeeper) { diff --git a/Source/Scripts/Outlands/HellfirePeninsula.cs b/Source/Scripts/Outlands/HellfirePeninsula.cs index 1aa693e3f..0081d4e3d 100644 --- a/Source/Scripts/Outlands/HellfirePeninsula.cs +++ b/Source/Scripts/Outlands/HellfirePeninsula.cs @@ -115,7 +115,7 @@ namespace Scripts.Outlands } [Script] - class npc_ancestral_wolf : npc_escortAI + class npc_ancestral_wolf : NpcEscortAI { public npc_ancestral_wolf(Creature creature) : base(creature) { @@ -167,7 +167,7 @@ namespace Scripts.Outlands } [Script] - class npc_wounded_blood_elf : npc_escortAI + class npc_wounded_blood_elf : NpcEscortAI { public npc_wounded_blood_elf(Creature creature) : base(creature) { } @@ -175,7 +175,7 @@ namespace Scripts.Outlands public override void EnterCombat(Unit who) { - if (HasEscortState(eEscortState.Escorting)) + if (HasEscortState(EscortState.Escorting)) Talk(SAY_ELF_AGGRO); } @@ -184,7 +184,7 @@ namespace Scripts.Outlands summoned.GetAI().AttackStart(me); } - public override void sQuestAccept(Player player, Quest quest) + public override void QuestAccept(Player player, Quest quest) { if (quest.Id == QUEST_ROAD_TO_FALCON_WATCH) { diff --git a/Source/Scripts/Outlands/Zangarmarsh.cs b/Source/Scripts/Outlands/Zangarmarsh.cs index 9037047ef..4028ce8e3 100644 --- a/Source/Scripts/Outlands/Zangarmarsh.cs +++ b/Source/Scripts/Outlands/Zangarmarsh.cs @@ -267,7 +267,7 @@ namespace Scripts.Outlands { public npc_kayra_longmane() : base("npc_kayra_longmane") { } - class npc_kayra_longmaneAI : npc_escortAI + class npc_kayra_longmaneAI : NpcEscortAI { public npc_kayra_longmaneAI(Creature creature) : base(creature) { } @@ -312,7 +312,7 @@ namespace Scripts.Outlands { creature.GetAI().Talk(SAY_START, player); - npc_escortAI pEscortAI = (npc_kayra_longmaneAI)creature.GetAI(); + NpcEscortAI pEscortAI = (npc_kayra_longmaneAI)creature.GetAI(); if (pEscortAI != null) pEscortAI.Start(false, false, player.GetGUID()); } diff --git a/Source/Scripts/Pets/Mage.cs b/Source/Scripts/Pets/Mage.cs index 546c6469c..4cd59de10 100644 --- a/Source/Scripts/Pets/Mage.cs +++ b/Source/Scripts/Pets/Mage.cs @@ -71,17 +71,17 @@ namespace Scripts.Pets continue; } // else compare best fit unit with current unit - var triggers = unit.GetThreatManager().getThreatList(); + var triggers = unit.GetThreatManager().GetThreatList(); foreach (var reference in triggers) { // Try to find threat referenced to owner - if (reference.getTarget() == owner) + if (reference.GetTarget() == owner) { // Check if best fit hostile unit hs lower threat than this current unit - if (highestThreat < reference.getThreat()) + if (highestThreat < reference.GetThreat()) { // If so, update best fit unit - highestThreat = reference.getThreat(); + highestThreat = reference.GetThreat(); highestThreatUnit = unit; break; } @@ -120,11 +120,11 @@ namespace Scripts.Pets // Consider only units without CC if (!unit.HasBreakableByDamageCrowdControlAura(unit)) { - var triggers = unit.GetThreatManager().getThreatList(); + var triggers = unit.GetThreatManager().GetThreatList(); foreach (var reference in triggers) { // Try to find threat referenced to owner - if (reference.getTarget() == owner) + if (reference.GetTarget() == owner) return true; } } diff --git a/Source/Scripts/Spells/Warlock.cs b/Source/Scripts/Spells/Warlock.cs index c6b1c11df..1afa5131c 100644 --- a/Source/Scripts/Spells/Warlock.cs +++ b/Source/Scripts/Spells/Warlock.cs @@ -953,7 +953,7 @@ namespace Scripts.Spells.Warlock Unit caster = GetCaster(); Unit target = GetHitUnit(); if (target) - if (target.CanHaveThreatList() && target.GetThreatManager().getThreat(caster) > 0.0f) + if (target.CanHaveThreatList() && target.GetThreatManager().GetThreat(caster) > 0.0f) caster.CastSpell(target, SpellIds.Soulshatter, true); } diff --git a/Source/Scripts/World/NpcSpecial.cs b/Source/Scripts/World/NpcSpecial.cs index 7ca38f648..1db34972c 100644 --- a/Source/Scripts/World/NpcSpecial.cs +++ b/Source/Scripts/World/NpcSpecial.cs @@ -1170,7 +1170,7 @@ namespace Scripts.World.NpcSpecial } [Script] - class npc_garments_of_quests : npc_escortAI + class npc_garments_of_quests : NpcEscortAI { public npc_garments_of_quests(Creature creature) : base(creature) { @@ -1582,7 +1582,7 @@ namespace Scripts.World.NpcSpecial { Unit unit = Global.ObjAccessor.GetUnit(me, pair.Key); if (unit) - unit.GetHostileRefManager().deleteReference(me); + unit.GetHostileRefManager().DeleteReference(me); _damageTimes.Remove(pair.Key); } @@ -2222,7 +2222,7 @@ namespace Scripts.World.NpcSpecial }); } - public override void sGossipSelect(Player player, uint menuId, uint gossipListId) + public override void GossipSelect(Player player, uint menuId, uint gossipListId) { switch (gossipListId) {