Core/Misc: Misc fixes

This commit is contained in:
hondacrx
2018-03-18 11:44:55 -04:00
parent 6ecc0ae762
commit 761af36d05
8 changed files with 28 additions and 20 deletions
@@ -530,7 +530,7 @@ namespace Game.AI
float MaxPlayerDistance;
uint LastWP;
WaypointPath _path;
WaypointPath _path = new WaypointPath();
Quest m_pQuestForEscort; //generally passed in Start() when regular escort script.
+1 -1
View File
@@ -478,7 +478,7 @@ namespace Game.DataStorage
public uint Id;
public uint SpellID;
public ushort ScalesFromItemLevel;
public byte Class;
public sbyte Class;
public byte MinScalingLevel;
public uint MaxScalingLevel;
}
+1 -1
View File
@@ -2872,7 +2872,7 @@ namespace Game.Entities
return null;
}
public bool HandleSpellClick(Unit clicker, sbyte seatId = 0)
public bool HandleSpellClick(Unit clicker, sbyte seatId = -1)
{
bool result = false;
@@ -326,6 +326,9 @@ namespace Game.Movement
void FormationMove(Creature creature)
{
if (path == null || path.nodes.Empty())
return;
bool transportPath = creature.GetTransport() != null;
WaypointNode waypoint = path.nodes.LookupByIndex((int)currentNode);
+1
View File
@@ -1694,6 +1694,7 @@ namespace Game.Spells
return 0;
// do checks against db data
if (!SpellManager.CanSpellTriggerProcOnEvent(procEntry, eventInfo))
return 0;
-1
View File
@@ -513,7 +513,6 @@ namespace Game.Spells
// normal case
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(triggered_spell_id);
if (spellInfo == null)
{
Log.outError(LogFilter.Spells, "Spell.EffectForceCast of spell {0}: triggering unknown spell id {1}", m_spellInfo.Id, triggered_spell_id);
+13 -13
View File
@@ -3792,7 +3792,6 @@ namespace Game.Spells
int basePoints = bp.HasValue ? bp.Value : BasePoints;
float comboDamage = PointsPerResource;
float value;
// base amount modification based on spell lvl vs caster lvl
if (Scaling.Coefficient != 0.0f)
{
@@ -3811,7 +3810,7 @@ namespace Game.Spells
if (_spellInfo.Scaling.MaxScalingLevel != 0 && _spellInfo.Scaling.MaxScalingLevel < level)
level = _spellInfo.Scaling.MaxScalingLevel;
value = 0.0f;
float tempValue = 0.0f;
if (level > 0)
{
if (_spellInfo.Scaling._Class == 0)
@@ -3820,40 +3819,40 @@ namespace Game.Spells
if (_spellInfo.Scaling.ScalesFromItemLevel == 0)
{
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
{
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)
{
GtCombatRatingsMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel);
if (ratingMult != null)
value *= ratingMult.ArmorMultiplier;
tempValue *= ratingMult.ArmorMultiplier;
}
}
}
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;
if (value != 0.0f && value < 1.0f)
value = 1.0f;
tempValue *= Scaling.Coefficient;
if (tempValue != 0.0f && tempValue < 1.0f)
tempValue = 1.0f;
if (Scaling.Variance != 0f)
{
float delta = Math.Abs(Scaling.Variance * 0.5f);
float valueVariance = RandomHelper.FRand(-delta, delta);
value += value * valueVariance;
tempValue += tempValue * valueVariance;
variance = valueVariance;
}
basePoints = (int)Math.Round(value);
basePoints = (int)Math.Round(tempValue);
if (Scaling.ResourceCoefficient != 0f)
comboDamage = Scaling.ResourceCoefficient * value;
comboDamage = Scaling.ResourceCoefficient * tempValue;
}
else
{
@@ -3889,7 +3888,7 @@ namespace Game.Spells
}
}
value = basePoints;
float value = (float)basePoints;
// random damage
if (caster != null)
@@ -3954,6 +3953,7 @@ namespace Game.Spells
}
}
}
return (int)value;
}