Core/Refactor: Part 4
This commit is contained in:
@@ -254,7 +254,6 @@ namespace Game.Misc
|
||||
packet.GossipID = (int)_gossipMenu.GetMenuId();
|
||||
packet.TextID = (int)titleTextId;
|
||||
|
||||
uint count = 0;
|
||||
foreach (var pair in _gossipMenu.GetMenuItems())
|
||||
{
|
||||
ClientGossipOptions opt = new ClientGossipOptions();
|
||||
@@ -267,10 +266,8 @@ namespace Game.Misc
|
||||
opt.Confirm = item.BoxMessage; // accept text (related to money) pop up box, 2.0.3
|
||||
packet.GossipOptions.Add(opt);
|
||||
|
||||
++count;
|
||||
}
|
||||
|
||||
count = 0;
|
||||
for (byte i = 0; i < _questMenu.GetMenuItemCount(); ++i)
|
||||
{
|
||||
QuestMenuItem item = _questMenu.GetItem(i);
|
||||
@@ -297,7 +294,6 @@ namespace Game.Misc
|
||||
}
|
||||
|
||||
packet.GossipText.Add(text);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2731,9 +2731,8 @@ namespace Game.Entities
|
||||
public void MovePosition(ref Position pos, float dist, float angle)
|
||||
{
|
||||
angle += GetOrientation();
|
||||
float destx, desty, destz, ground, floor;
|
||||
destx = pos.posX + dist * (float)Math.Cos(angle);
|
||||
desty = pos.posY + dist * (float)Math.Sin(angle);
|
||||
float destx = pos.posX + dist * (float)Math.Cos(angle);
|
||||
float desty = pos.posY + dist * (float)Math.Sin(angle);
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!GridDefines.IsValidMapCoord(destx, desty, pos.posZ))
|
||||
@@ -2742,9 +2741,9 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
ground = GetMap().GetHeight(GetPhaseShift(), destx, desty, MapConst.MaxHeight, true);
|
||||
floor = GetMap().GetHeight(GetPhaseShift(), destx, desty, pos.posZ, true);
|
||||
destz = Math.Abs(ground - pos.posZ) <= Math.Abs(floor - pos.posZ) ? ground : floor;
|
||||
float ground = GetMap().GetHeight(GetPhaseShift(), destx, desty, MapConst.MaxHeight, true);
|
||||
float floor = GetMap().GetHeight(GetPhaseShift(), destx, desty, pos.posZ, true);
|
||||
float destz = Math.Abs(ground - pos.posZ) <= Math.Abs(floor - pos.posZ) ? ground : floor;
|
||||
|
||||
float step = dist / 10.0f;
|
||||
|
||||
@@ -2802,9 +2801,8 @@ namespace Game.Entities
|
||||
public void MovePositionToFirstCollision(ref Position pos, float dist, float angle)
|
||||
{
|
||||
angle += GetOrientation();
|
||||
float destx, desty, destz;
|
||||
destx = pos.posX + dist * (float)Math.Cos(angle);
|
||||
desty = pos.posY + dist * (float)Math.Sin(angle);
|
||||
float destx = pos.posX + dist * (float)Math.Cos(angle);
|
||||
float desty = pos.posY + dist * (float)Math.Sin(angle);
|
||||
|
||||
// Prevent invalid coordinates here, position is unchanged
|
||||
if (!GridDefines.IsValidMapCoord(destx, desty))
|
||||
@@ -2813,7 +2811,7 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
destz = NormalizeZforCollision(this, destx, desty, pos.GetPositionZ());
|
||||
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);
|
||||
|
||||
// collision occured
|
||||
|
||||
@@ -3112,10 +3112,9 @@ namespace Game.Entities
|
||||
UpdateHonorFields();
|
||||
|
||||
SQLTransaction trans = new SQLTransaction();
|
||||
PreparedStatement stmt;
|
||||
var index = 0;
|
||||
|
||||
stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_FISHINGSTEPS);
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_CHAR_FISHINGSTEPS);
|
||||
stmt.AddValue(0, GetGUID().GetCounter());
|
||||
trans.Append(stmt);
|
||||
|
||||
|
||||
@@ -178,9 +178,10 @@ namespace Game.Entities
|
||||
// Rejoining the last group should not reset the sequence
|
||||
if (m_groupUpdateSequences[(int)category].GroupGuid != group.GetGUID())
|
||||
{
|
||||
var groupUpdate = m_groupUpdateSequences[(int)category];
|
||||
GroupUpdateCounter groupUpdate;
|
||||
groupUpdate.GroupGuid = group.GetGUID();
|
||||
groupUpdate.UpdateSequenceNumber = 1;
|
||||
m_groupUpdateSequences[(int) category] = groupUpdate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4578,8 +4578,6 @@ namespace Game.Entities
|
||||
// prevent existence 2 corpse for player
|
||||
SpawnCorpseBones();
|
||||
|
||||
uint _cfb1, _cfb2;
|
||||
|
||||
Corpse corpse = new Corpse(Convert.ToBoolean(m_ExtraFlags & PlayerExtraFlags.PVPDeath) ? CorpseType.ResurrectablePVP : CorpseType.ResurrectablePVE);
|
||||
SetPvPDeath(false);
|
||||
|
||||
@@ -4594,8 +4592,8 @@ namespace Game.Entities
|
||||
byte haircolor = GetByteValue(PlayerFields.Bytes, PlayerFieldOffsets.BytesOffsetHairColorId);
|
||||
byte facialhair = GetByteValue(PlayerFields.Bytes2, PlayerFieldOffsets.Bytes2OffsetFacialStyle);
|
||||
|
||||
_cfb1 = (uint)((0x00) | ((int)GetRace() << 8) | (GetByteValue(PlayerFields.Bytes3, PlayerFieldOffsets.Bytes3OffsetGender) << 16) | (skin << 24));
|
||||
_cfb2 = (uint)((face) | (hairstyle << 8) | (haircolor << 16) | (facialhair << 24));
|
||||
uint _cfb1 = (uint)((0x00) | ((int)GetRace() << 8) | (GetByteValue(PlayerFields.Bytes3, PlayerFieldOffsets.Bytes3OffsetGender) << 16) | (skin << 24));
|
||||
uint _cfb2 = (uint)((face) | (hairstyle << 8) | (haircolor << 16) | (facialhair << 24));
|
||||
|
||||
corpse.SetUInt32Value(CorpseFields.Bytes1, _cfb1);
|
||||
corpse.SetUInt32Value(CorpseFields.Bytes2, _cfb2);
|
||||
@@ -6022,30 +6020,27 @@ namespace Game.Entities
|
||||
}
|
||||
}
|
||||
}
|
||||
void UpdateVisibilityOf_helper<T>(List<ObjectGuid> s64, GameObject target, List<Unit> v)
|
||||
void UpdateVisibilityOf_helper<T>(List<ObjectGuid> s64, T target, List<Unit> v) where T : WorldObject
|
||||
{
|
||||
// @HACK: This is to prevent objects like deeprun tram from disappearing when player moves far from its spawn point while riding it
|
||||
// But exclude stoppable elevators from this hack - they would be teleporting from one end to another
|
||||
// if affected transports move so far horizontally that it causes them to run out of visibility range then you are out of luck
|
||||
// fix visibility instead of adding hacks here
|
||||
if (target.IsDynTransport())
|
||||
s64.Add(target.GetGUID());
|
||||
}
|
||||
void UpdateVisibilityOf_helper(List<ObjectGuid> s64, Creature target, List<Unit> v)
|
||||
{
|
||||
s64.Add(target.GetGUID());
|
||||
v.Add(target);
|
||||
}
|
||||
|
||||
void UpdateVisibilityOf_helper(List<ObjectGuid> s64, Player target, List<Unit> v)
|
||||
{
|
||||
s64.Add(target.GetGUID());
|
||||
v.Add(target);
|
||||
}
|
||||
|
||||
void UpdateVisibilityOf_helper<T>(List<ObjectGuid> s64, T target, List<Unit> v) where T : WorldObject
|
||||
{
|
||||
s64.Add(target.GetGUID());
|
||||
switch (target.GetTypeId())
|
||||
{
|
||||
case TypeId.GameObject:
|
||||
// @HACK: This is to prevent objects like deeprun tram from disappearing when player moves far from its spawn point while riding it
|
||||
// But exclude stoppable elevators from this hack - they would be teleporting from one end to another
|
||||
// if affected transports move so far horizontally that it causes them to run out of visibility range then you are out of luck
|
||||
// fix visibility instead of adding hacks here
|
||||
if (target.ToGameObject().IsDynTransport())
|
||||
s64.Add(target.GetGUID());
|
||||
break;
|
||||
case TypeId.Unit:
|
||||
s64.Add(target.GetGUID());
|
||||
v.Add(target.ToCreature());
|
||||
break;
|
||||
case TypeId.Player:
|
||||
s64.Add(target.GetGUID());
|
||||
v.Add(target.ToPlayer());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void SendInitialVisiblePackets(Unit target)
|
||||
|
||||
@@ -3411,8 +3411,6 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
uint spellId = auraToRemove.GetId();
|
||||
|
||||
var range = m_ownedAuras.LookupByKey(spellId);
|
||||
foreach (var pair in GetOwnedAuras())
|
||||
{
|
||||
if (pair.Key != spellId)
|
||||
@@ -3444,7 +3442,6 @@ namespace Game.Entities
|
||||
}
|
||||
public void RemoveAurasDueToSpellByDispel(uint spellId, uint dispellerSpellId, ObjectGuid casterGUID, Unit dispeller, byte chargesRemoved = 1)
|
||||
{
|
||||
var range = m_ownedAuras.LookupByKey(spellId);
|
||||
foreach (var pair in GetOwnedAuras())
|
||||
{
|
||||
if (pair.Key != spellId)
|
||||
@@ -4139,8 +4136,7 @@ namespace Game.Entities
|
||||
else
|
||||
bp = effect.BasePoints;
|
||||
|
||||
int oldBP = eff.m_baseAmount;
|
||||
oldBP = bp;
|
||||
eff.m_baseAmount = bp;
|
||||
}
|
||||
|
||||
// correct cast item guid if needed
|
||||
|
||||
Reference in New Issue
Block a user