More refactoring of code.

This commit is contained in:
hondacrx
2019-09-23 21:41:13 -04:00
parent 2418715800
commit 570aebce26
176 changed files with 2261 additions and 2265 deletions
@@ -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
+4 -4
View File
@@ -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))
{
+11 -11
View File
@@ -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);
+5 -5
View File
@@ -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;
}
+4 -4
View File
@@ -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)
+3 -3
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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);
+22 -22
View File
@@ -32,7 +32,7 @@ namespace Game.Entities
List<Player> nearMembers = new List<Player>();
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; }
+12 -12
View File
@@ -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;
+2 -2
View File
@@ -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);
+4 -4
View File
@@ -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: <rank> 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))
+6 -6
View File
@@ -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)
+4 -4
View File
@@ -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);
}
}
+15 -15
View File
@@ -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)
+1 -1
View File
@@ -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))
+26 -26
View File
@@ -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<Unit> nearMembers = new List<Unit>();
// 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)
+1 -1
View File
@@ -40,7 +40,7 @@ namespace Game.Entities
//Movement
protected float[] m_speed_rate = new float[(int)UnitMoveType.Max];
RefManager<Unit, TargetedMovementGeneratorBase> m_FollowingRefManager;
RefManager<Unit, ITargetedMovementGeneratorBase> m_FollowingRefManager;
public MoveSpline MoveSpline { get; set; }
MotionMaster i_motionMaster;
public uint m_movementCounter; //< Incrementing counter used in movement packets
+6 -6
View File
@@ -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)
+1 -1
View File
@@ -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)
+13 -13
View File
@@ -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())))
+14 -14
View File
@@ -44,7 +44,7 @@ namespace Game.Entities
UnitTypeMask = UnitTypeMask.None;
hostileRefManager = new HostileRefManager(this);
_spellHistory = new SpellHistory(this);
m_FollowingRefManager = new RefManager<Unit, TargetedMovementGeneratorBase>();
m_FollowingRefManager = new RefManager<Unit, ITargetedMovementGeneratorBase>();
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<HostileReference> threatList = GetThreatManager().getThreatList();
List<HostileReference> offlineThreatList = GetThreatManager().getOfflineThreatList();
List<HostileReference> threatList = GetThreatManager().GetThreatList();
List<HostileReference> 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();