Misc cleanups/Fixes
This commit is contained in:
@@ -474,8 +474,8 @@ namespace Game.Entities
|
||||
uint visualStateAfter = (m_goValue.Transport.StateUpdateTimer / 20000) & 1;
|
||||
if (visualStateBefore != visualStateAfter)
|
||||
{
|
||||
m_gameObjectData.ModifyValue(m_gameObjectData.Level);
|
||||
m_gameObjectData.ModifyValue(m_gameObjectData.State);
|
||||
m_values.ModifyValue(m_gameObjectData).ModifyValue(m_gameObjectData.Level);
|
||||
m_values.ModifyValue(m_gameObjectData).ModifyValue(m_gameObjectData.State);
|
||||
ForceUpdateFieldChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace Game.Entities
|
||||
float verticalDelta = GetPositionZ() - center.GetPositionZ();
|
||||
return IsInDist2d(center, radius) && Math.Abs(verticalDelta) <= height;
|
||||
}
|
||||
|
||||
|
||||
public bool HasInArc(float arc, Position obj, float border = 2.0f)
|
||||
{
|
||||
// always have self in arc
|
||||
|
||||
@@ -1504,6 +1504,11 @@ namespace Game.Entities
|
||||
return summon;
|
||||
}
|
||||
|
||||
public void SummonCreatureGroup(byte group)
|
||||
{
|
||||
SummonCreatureGroup(group, out _);
|
||||
}
|
||||
|
||||
public void SummonCreatureGroup(byte group, out List<TempSummon> list)
|
||||
{
|
||||
Cypher.Assert((IsTypeId(TypeId.GameObject) || IsTypeId(TypeId.Unit)), "Only GOs and creatures can summon npc groups!");
|
||||
@@ -2028,12 +2033,11 @@ namespace Game.Entities
|
||||
UpdateGroundPositionZ(rand_x, rand_y, ref rand_z); // update to LOS height if available
|
||||
}
|
||||
|
||||
public void GetRandomPoint(Position srcPos, float distance, out Position pos)
|
||||
public Position GetRandomPoint(Position srcPos, float distance)
|
||||
{
|
||||
pos = new Position();
|
||||
float x, y, z;
|
||||
GetRandomPoint(srcPos, distance, out x, out y, out z);
|
||||
pos.Relocate(x, y, z, GetOrientation());
|
||||
return new Position(x, y, z, GetOrientation());
|
||||
}
|
||||
|
||||
public void UpdateGroundPositionZ(float x, float y, ref float z)
|
||||
|
||||
@@ -7692,14 +7692,17 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
//Helpers
|
||||
public void ADD_GOSSIP_ITEM(GossipOptionIcon icon, string message, uint sender, uint action) { PlayerTalkClass.GetGossipMenu().AddMenuItem(-1, icon, message, sender, action, "", 0); }
|
||||
public void AddGossipItem(GossipOptionIcon icon, string message, uint sender, uint action) { PlayerTalkClass.GetGossipMenu().AddMenuItem(-1, icon, message, sender, action, "", 0); }
|
||||
public void ADD_GOSSIP_ITEM_DB(uint menuId, uint menuItemId, uint sender, uint action) { PlayerTalkClass.GetGossipMenu().AddMenuItem(menuId, menuItemId, sender, action); }
|
||||
public void ADD_GOSSIP_ITEM_EXTENDED(GossipOptionIcon icon, string message, uint sender, uint action, string boxmessage, uint boxmoney, bool coded) { PlayerTalkClass.GetGossipMenu().AddMenuItem(-1, icon, message, sender, action, boxmessage, boxmoney, coded); }
|
||||
|
||||
// This fuction Sends the current menu to show to client, a - NPCTEXTID(uint32), b - npc guid(uint64)
|
||||
public void SEND_GOSSIP_MENU(uint titleId, ObjectGuid objGUID) { PlayerTalkClass.SendGossipMenu(titleId, objGUID); }
|
||||
public void SendGossipMenu(uint titleId, ObjectGuid objGUID) { PlayerTalkClass.SendGossipMenu(titleId, objGUID); }
|
||||
|
||||
// Closes the Menu
|
||||
public void CLOSE_GOSSIP_MENU() { PlayerTalkClass.SendCloseGossip(); }
|
||||
public void CloseGossipMenu() { PlayerTalkClass.SendCloseGossip(); }
|
||||
|
||||
//Clears the Menu
|
||||
public void ClearGossipMenu() { PlayerTalkClass.ClearMenus(); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,9 +514,9 @@ namespace Game.Entities
|
||||
public bool HealthBelowPct(int pct) { return GetHealth() < CountPctFromMaxHealth(pct); }
|
||||
public bool HealthBelowPctDamaged(int pct, uint damage) { return GetHealth() - damage < CountPctFromMaxHealth(pct); }
|
||||
public bool HealthAbovePct(int pct) { return GetHealth() > CountPctFromMaxHealth(pct); }
|
||||
bool HealthAbovePctHealed(int pct, uint heal) { return GetHealth() + heal > CountPctFromMaxHealth(pct); }
|
||||
public bool HealthAbovePctHealed(int pct, uint heal) { return GetHealth() + heal > CountPctFromMaxHealth(pct); }
|
||||
public ulong CountPctFromMaxHealth(int pct) { return MathFunctions.CalculatePct(GetMaxHealth(), pct); }
|
||||
ulong CountPctFromCurHealth(int pct) { return MathFunctions.CalculatePct(GetHealth(), pct); }
|
||||
public ulong CountPctFromCurHealth(int pct) { return MathFunctions.CalculatePct(GetHealth(), pct); }
|
||||
|
||||
public virtual float GetHealthMultiplierForTarget(WorldObject target) { return 1.0f; }
|
||||
public virtual float GetDamageMultiplierForTarget(WorldObject target) { return 1.0f; }
|
||||
|
||||
@@ -509,7 +509,7 @@ namespace Game.Entities
|
||||
public Unit GetDispeller() { return _dispellerUnit; }
|
||||
uint GetDispellerSpellId() { return _dispellerSpell; }
|
||||
public byte GetRemovedCharges() { return _chargesRemoved; }
|
||||
void SetRemovedCharges(byte amount)
|
||||
public void SetRemovedCharges(byte amount)
|
||||
{
|
||||
_chargesRemoved = amount;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Game.Entities
|
||||
{
|
||||
return m_movementInfo.HasMovementFlag(MovementFlag.Walking);
|
||||
}
|
||||
bool IsHovering() { return m_movementInfo.HasMovementFlag(MovementFlag.Hover); }
|
||||
public bool IsHovering() { return m_movementInfo.HasMovementFlag(MovementFlag.Hover); }
|
||||
public bool IsStopped() { return !HasUnitState(UnitState.Moving); }
|
||||
public bool IsMoving() { return m_movementInfo.HasMovementFlag(MovementFlag.MaskMoving); }
|
||||
public bool IsTurning() { return m_movementInfo.HasMovementFlag(MovementFlag.MaskTurning); }
|
||||
|
||||
@@ -1113,7 +1113,7 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
public UnitAI GetAI() { return i_AI; }
|
||||
void SetAI(UnitAI newAI) { i_AI = newAI; }
|
||||
public void SetAI(UnitAI newAI) { i_AI = newAI; }
|
||||
|
||||
public bool IsPossessing()
|
||||
{
|
||||
@@ -2351,7 +2351,7 @@ namespace Game.Entities
|
||||
else
|
||||
return ToCreature().GetCreatureTemplate().CreatureType;
|
||||
}
|
||||
Player GetAffectingPlayer()
|
||||
public Player GetAffectingPlayer()
|
||||
{
|
||||
if (GetCharmerOrOwnerGUID().IsEmpty())
|
||||
return IsTypeId(TypeId.Player) ? ToPlayer() : null;
|
||||
|
||||
Reference in New Issue
Block a user