Core/Misc: Misc fixes
This commit is contained in:
@@ -1193,12 +1193,17 @@ namespace Framework.Constants
|
|||||||
IgnoreCasterAurastate = 0x800, //! Will Ignore Caster Aura States Including Combat Requirements And Death State
|
IgnoreCasterAurastate = 0x800, //! Will Ignore Caster Aura States Including Combat Requirements And Death State
|
||||||
DisallowProcEvents = 0x1000, //! Disallows proc events from triggered spell (default)
|
DisallowProcEvents = 0x1000, //! Disallows proc events from triggered spell (default)
|
||||||
IgnoreCasterMountedOrOnVehicle = 0x2000, //! Will Ignore Mounted/On Vehicle Restrictions
|
IgnoreCasterMountedOrOnVehicle = 0x2000, //! Will Ignore Mounted/On Vehicle Restrictions
|
||||||
|
// reuse = 0x00004000,
|
||||||
|
// reuse = 0x00008000,
|
||||||
IgnoreCasterAuras = 0x10000, //! Will Ignore Caster Aura Restrictions Or Requirements
|
IgnoreCasterAuras = 0x10000, //! Will Ignore Caster Aura Restrictions Or Requirements
|
||||||
DontResetPeriodicTimer = 0x20000, //! Will allow periodic aura timers to keep ticking (instead of resetting)
|
DontResetPeriodicTimer = 0x20000, //! Will allow periodic aura timers to keep ticking (instead of resetting)
|
||||||
DontReportCastError = 0x40000, //! Will Return SpellFailedDontReport In Checkcast Functions
|
DontReportCastError = 0x40000, //! Will Return SpellFailedDontReport In Checkcast Functions
|
||||||
IgnoreEquippedItemRequirement = 0x80000,
|
FullMask = 0x0007FFFF, //! Used when doing CastSpell with triggered == true
|
||||||
IgnoreTargetCheck = 0x100000,
|
|
||||||
FullMask = 0xffffffff
|
// debug flags (used with .cast triggered commands)
|
||||||
|
IgnoreEquippedItemRequirement = 0x80000, //! Will ignore equipped item requirements
|
||||||
|
IgnoreTargetCheck = 0x100000, //! Will ignore most target checks (mostly DBC target checks)
|
||||||
|
FullDebugMask = 0xFFFFFFFF
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SpellSchoolMask
|
public enum SpellSchoolMask
|
||||||
|
|||||||
@@ -530,7 +530,7 @@ namespace Game.AI
|
|||||||
float MaxPlayerDistance;
|
float MaxPlayerDistance;
|
||||||
uint LastWP;
|
uint LastWP;
|
||||||
|
|
||||||
WaypointPath _path;
|
WaypointPath _path = new WaypointPath();
|
||||||
|
|
||||||
Quest m_pQuestForEscort; //generally passed in Start() when regular escort script.
|
Quest m_pQuestForEscort; //generally passed in Start() when regular escort script.
|
||||||
|
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ namespace Game.DataStorage
|
|||||||
public uint Id;
|
public uint Id;
|
||||||
public uint SpellID;
|
public uint SpellID;
|
||||||
public ushort ScalesFromItemLevel;
|
public ushort ScalesFromItemLevel;
|
||||||
public byte Class;
|
public sbyte Class;
|
||||||
public byte MinScalingLevel;
|
public byte MinScalingLevel;
|
||||||
public uint MaxScalingLevel;
|
public uint MaxScalingLevel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2872,7 +2872,7 @@ namespace Game.Entities
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool HandleSpellClick(Unit clicker, sbyte seatId = 0)
|
public bool HandleSpellClick(Unit clicker, sbyte seatId = -1)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
||||||
|
|||||||
@@ -326,6 +326,9 @@ namespace Game.Movement
|
|||||||
|
|
||||||
void FormationMove(Creature creature)
|
void FormationMove(Creature creature)
|
||||||
{
|
{
|
||||||
|
if (path == null || path.nodes.Empty())
|
||||||
|
return;
|
||||||
|
|
||||||
bool transportPath = creature.GetTransport() != null;
|
bool transportPath = creature.GetTransport() != null;
|
||||||
|
|
||||||
WaypointNode waypoint = path.nodes.LookupByIndex((int)currentNode);
|
WaypointNode waypoint = path.nodes.LookupByIndex((int)currentNode);
|
||||||
|
|||||||
@@ -1694,6 +1694,7 @@ namespace Game.Spells
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// do checks against db data
|
// do checks against db data
|
||||||
|
|
||||||
if (!SpellManager.CanSpellTriggerProcOnEvent(procEntry, eventInfo))
|
if (!SpellManager.CanSpellTriggerProcOnEvent(procEntry, eventInfo))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|||||||
@@ -513,7 +513,6 @@ namespace Game.Spells
|
|||||||
|
|
||||||
// normal case
|
// normal case
|
||||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(triggered_spell_id);
|
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(triggered_spell_id);
|
||||||
|
|
||||||
if (spellInfo == null)
|
if (spellInfo == null)
|
||||||
{
|
{
|
||||||
Log.outError(LogFilter.Spells, "Spell.EffectForceCast of spell {0}: triggering unknown spell id {1}", m_spellInfo.Id, triggered_spell_id);
|
Log.outError(LogFilter.Spells, "Spell.EffectForceCast of spell {0}: triggering unknown spell id {1}", m_spellInfo.Id, triggered_spell_id);
|
||||||
|
|||||||
@@ -3792,7 +3792,6 @@ namespace Game.Spells
|
|||||||
int basePoints = bp.HasValue ? bp.Value : BasePoints;
|
int basePoints = bp.HasValue ? bp.Value : BasePoints;
|
||||||
float comboDamage = PointsPerResource;
|
float comboDamage = PointsPerResource;
|
||||||
|
|
||||||
float value;
|
|
||||||
// base amount modification based on spell lvl vs caster lvl
|
// base amount modification based on spell lvl vs caster lvl
|
||||||
if (Scaling.Coefficient != 0.0f)
|
if (Scaling.Coefficient != 0.0f)
|
||||||
{
|
{
|
||||||
@@ -3811,7 +3810,7 @@ namespace Game.Spells
|
|||||||
if (_spellInfo.Scaling.MaxScalingLevel != 0 && _spellInfo.Scaling.MaxScalingLevel < level)
|
if (_spellInfo.Scaling.MaxScalingLevel != 0 && _spellInfo.Scaling.MaxScalingLevel < level)
|
||||||
level = _spellInfo.Scaling.MaxScalingLevel;
|
level = _spellInfo.Scaling.MaxScalingLevel;
|
||||||
|
|
||||||
value = 0.0f;
|
float tempValue = 0.0f;
|
||||||
if (level > 0)
|
if (level > 0)
|
||||||
{
|
{
|
||||||
if (_spellInfo.Scaling._Class == 0)
|
if (_spellInfo.Scaling._Class == 0)
|
||||||
@@ -3820,40 +3819,40 @@ namespace Game.Spells
|
|||||||
if (_spellInfo.Scaling.ScalesFromItemLevel == 0)
|
if (_spellInfo.Scaling.ScalesFromItemLevel == 0)
|
||||||
{
|
{
|
||||||
if (!_spellInfo.HasAttribute(SpellAttr11.ScalesWithItemLevel))
|
if (!_spellInfo.HasAttribute(SpellAttr11.ScalesWithItemLevel))
|
||||||
value = CliDB.GetSpellScalingColumnForClass(CliDB.SpellScalingGameTable.GetRow(level), _spellInfo.Scaling._Class);
|
tempValue = CliDB.GetSpellScalingColumnForClass(CliDB.SpellScalingGameTable.GetRow(level), _spellInfo.Scaling._Class);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uint effectiveItemLevel = (uint)(itemLevel != -1 ? itemLevel : 1);
|
uint effectiveItemLevel = (uint)(itemLevel != -1 ? itemLevel : 1);
|
||||||
value = ItemEnchantment.GetRandomPropertyPoints(effectiveItemLevel, ItemQuality.Rare, InventoryType.Chest, 0);
|
tempValue = ItemEnchantment.GetRandomPropertyPoints(effectiveItemLevel, ItemQuality.Rare, InventoryType.Chest, 0);
|
||||||
if (IsAura() && ApplyAuraName == AuraType.ModRating)
|
if (IsAura() && ApplyAuraName == AuraType.ModRating)
|
||||||
{
|
{
|
||||||
GtCombatRatingsMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel);
|
GtCombatRatingsMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel);
|
||||||
if (ratingMult != null)
|
if (ratingMult != null)
|
||||||
value *= ratingMult.ArmorMultiplier;
|
tempValue *= ratingMult.ArmorMultiplier;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
value = ItemEnchantment.GetRandomPropertyPoints(_spellInfo.Scaling.ScalesFromItemLevel, ItemQuality.Rare, InventoryType.Chest, 0);
|
tempValue = ItemEnchantment.GetRandomPropertyPoints(_spellInfo.Scaling.ScalesFromItemLevel, ItemQuality.Rare, InventoryType.Chest, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
value *= Scaling.Coefficient;
|
tempValue *= Scaling.Coefficient;
|
||||||
if (value != 0.0f && value < 1.0f)
|
if (tempValue != 0.0f && tempValue < 1.0f)
|
||||||
value = 1.0f;
|
tempValue = 1.0f;
|
||||||
|
|
||||||
if (Scaling.Variance != 0f)
|
if (Scaling.Variance != 0f)
|
||||||
{
|
{
|
||||||
float delta = Math.Abs(Scaling.Variance * 0.5f);
|
float delta = Math.Abs(Scaling.Variance * 0.5f);
|
||||||
float valueVariance = RandomHelper.FRand(-delta, delta);
|
float valueVariance = RandomHelper.FRand(-delta, delta);
|
||||||
value += value * valueVariance;
|
tempValue += tempValue * valueVariance;
|
||||||
|
|
||||||
variance = valueVariance;
|
variance = valueVariance;
|
||||||
}
|
}
|
||||||
|
|
||||||
basePoints = (int)Math.Round(value);
|
basePoints = (int)Math.Round(tempValue);
|
||||||
|
|
||||||
if (Scaling.ResourceCoefficient != 0f)
|
if (Scaling.ResourceCoefficient != 0f)
|
||||||
comboDamage = Scaling.ResourceCoefficient * value;
|
comboDamage = Scaling.ResourceCoefficient * tempValue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3889,7 +3888,7 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
value = basePoints;
|
float value = (float)basePoints;
|
||||||
|
|
||||||
// random damage
|
// random damage
|
||||||
if (caster != null)
|
if (caster != null)
|
||||||
@@ -3954,6 +3953,7 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (int)value;
|
return (int)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user