More updates to scripts (still wont build)
This commit is contained in:
@@ -847,7 +847,7 @@ namespace Game.Chat
|
||||
public uint GetNumPlayers() { return (uint)_playersStore.Count; }
|
||||
|
||||
public ChannelFlags GetFlags() { return _channelFlags; }
|
||||
bool HasFlag(ChannelFlags flag) { return _channelFlags.HasAnyFlag(flag); }
|
||||
public bool HasFlag(ChannelFlags flag) { return _channelFlags.HasAnyFlag(flag); }
|
||||
|
||||
public AreaTableRecord GetZoneEntry() { return _zoneEntry; }
|
||||
|
||||
|
||||
@@ -3126,6 +3126,7 @@ namespace Game.Entities
|
||||
|
||||
public virtual uint GetFaction() { return 0; }
|
||||
public virtual void SetFaction(uint faction) { }
|
||||
public virtual void SetFaction(FactionTemplates faction) { }
|
||||
|
||||
//Position
|
||||
|
||||
|
||||
@@ -6669,7 +6669,7 @@ namespace Game.Entities
|
||||
|
||||
uint level = GetLevel();
|
||||
|
||||
ScriptMgr.OnGivePlayerXP(this, xp, victim);
|
||||
ScriptMgr.OnGivePlayerXP(this, ref xp, victim);
|
||||
|
||||
// XP to money conversion processed in Player.RewardQuest
|
||||
if (IsMaxLevel())
|
||||
|
||||
@@ -2263,6 +2263,7 @@ namespace Game.Entities
|
||||
|
||||
public override uint GetFaction() { return m_unitData.FactionTemplate; }
|
||||
public override void SetFaction(uint faction) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.FactionTemplate), faction); }
|
||||
public override void SetFaction(FactionTemplates faction) { SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.FactionTemplate), (uint)faction); }
|
||||
|
||||
public void RestoreFaction()
|
||||
{
|
||||
|
||||
@@ -1620,7 +1620,7 @@ namespace Game.Groups
|
||||
return m_guid.GetCounter();
|
||||
}
|
||||
|
||||
string GetLeaderName()
|
||||
public string GetLeaderName()
|
||||
{
|
||||
return m_leaderName;
|
||||
}
|
||||
|
||||
@@ -2793,7 +2793,7 @@ namespace Game.Maps
|
||||
bool _reverse;
|
||||
}
|
||||
|
||||
public class UnitAuraCheck<T> : ICheck<T> where T : WorldObject
|
||||
public class UnitAuraCheck : ICheck<WorldObject>
|
||||
{
|
||||
public UnitAuraCheck(bool present, uint spellId, ObjectGuid casterGUID = default)
|
||||
{
|
||||
@@ -2802,12 +2802,12 @@ namespace Game.Maps
|
||||
_casterGUID = casterGUID;
|
||||
}
|
||||
|
||||
public bool Invoke(T obj)
|
||||
public bool Invoke(WorldObject obj)
|
||||
{
|
||||
return obj.ToUnit() != null && obj.ToUnit().HasAura(_spellId, _casterGUID) == _present;
|
||||
}
|
||||
|
||||
public static implicit operator Predicate<T>(UnitAuraCheck<T> unit)
|
||||
public static implicit operator Predicate<WorldObject>(UnitAuraCheck unit)
|
||||
{
|
||||
return unit.Invoke;
|
||||
}
|
||||
|
||||
@@ -619,7 +619,7 @@ namespace Game.Scripting
|
||||
public virtual void OnMoneyChanged(Player player, long amount) { }
|
||||
|
||||
// Called when a player gains XP (before anything is given)
|
||||
public virtual void OnGiveXP(Player player, uint amount, Unit victim) { }
|
||||
public virtual uint OnGiveXP(Player player, uint amount, Unit victim) { return 0; }
|
||||
|
||||
// Called when a player's reputation changes (before it is actually changed)
|
||||
public virtual void OnReputationChange(Player player, uint factionId, int standing, bool incremental) { }
|
||||
|
||||
@@ -801,9 +801,11 @@ namespace Game.Scripting
|
||||
{
|
||||
ForEach<PlayerScript>(p => p.OnMoneyChanged(player, amount));
|
||||
}
|
||||
public void OnGivePlayerXP(Player player, uint amount, Unit victim)
|
||||
public void OnGivePlayerXP(Player player, ref uint amount, Unit victim)
|
||||
{
|
||||
ForEach<PlayerScript>(p => p.OnGiveXP(player, amount, victim));
|
||||
uint tempAmount = amount;
|
||||
ForEach<PlayerScript>(p => tempAmount = p.OnGiveXP(player, tempAmount, victim));
|
||||
amount = tempAmount;
|
||||
}
|
||||
public void OnPlayerReputationChange(Player player, uint factionID, int standing, bool incremental)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user