Core/Spells: Fixed value of aura effects for stat mod auras applied by items
Port From (https://github.com/TrinityCore/TrinityCore/commit/123858331211db6fe6745f0886c1499f8e598443)
This commit is contained in:
@@ -83,7 +83,7 @@ namespace Framework.Database
|
|||||||
|
|
||||||
PrepareStatement(CharStatements.SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?");
|
PrepareStatement(CharStatements.SEL_GROUP_MEMBER, "SELECT guid FROM group_member WHERE memberGuid = ?");
|
||||||
PrepareStatement(CharStatements.SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, extendState, resettime, entranceId FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?");
|
PrepareStatement(CharStatements.SEL_CHARACTER_INSTANCE, "SELECT id, permanent, map, difficulty, extendState, resettime, entranceId FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = ?");
|
||||||
PrepareStatement(CharStatements.SEL_CHARACTER_AURAS, "SELECT casterGuid, itemGuid, spell, effectMask, recalculateMask, stackCount, maxDuration, remainTime, remainCharges, castItemLevel FROM character_aura WHERE guid = ?");
|
PrepareStatement(CharStatements.SEL_CHARACTER_AURAS, "SELECT casterGuid, itemGuid, spell, effectMask, recalculateMask, stackCount, maxDuration, remainTime, remainCharges, castItemId, castItemLevel FROM character_aura WHERE guid = ?");
|
||||||
PrepareStatement(CharStatements.SEL_CHARACTER_AURA_EFFECTS, "SELECT casterGuid, itemGuid, spell, effectMask, effectIndex, amount, baseAmount FROM character_aura_effect WHERE guid = ?");
|
PrepareStatement(CharStatements.SEL_CHARACTER_AURA_EFFECTS, "SELECT casterGuid, itemGuid, spell, effectMask, effectIndex, amount, baseAmount FROM character_aura_effect WHERE guid = ?");
|
||||||
PrepareStatement(CharStatements.SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?");
|
PrepareStatement(CharStatements.SEL_CHARACTER_SPELL, "SELECT spell, active, disabled FROM character_spell WHERE guid = ?");
|
||||||
PrepareStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS, "SELECT quest, status, timer FROM character_queststatus WHERE guid = ? AND status <> 0");
|
PrepareStatement(CharStatements.SEL_CHARACTER_QUESTSTATUS, "SELECT quest, status, timer FROM character_queststatus WHERE guid = ? AND status <> 0");
|
||||||
@@ -322,8 +322,8 @@ namespace Framework.Database
|
|||||||
PrepareStatement(CharStatements.DEL_TRANSMOG_OUTFIT, "DELETE FROM character_transmog_outfits WHERE setguid=?");
|
PrepareStatement(CharStatements.DEL_TRANSMOG_OUTFIT, "DELETE FROM character_transmog_outfits WHERE setguid=?");
|
||||||
|
|
||||||
// Auras
|
// Auras
|
||||||
PrepareStatement(CharStatements.INS_AURA, "INSERT INTO character_aura (guid, casterGuid, itemGuid, spell, effectMask, recalculateMask, stackCount, maxDuration, remainTime, remainCharges, castItemLevel) " +
|
PrepareStatement(CharStatements.INS_AURA, "INSERT INTO character_aura (guid, casterGuid, itemGuid, spell, effectMask, recalculateMask, stackCount, maxDuration, remainTime, remainCharges, castItemId, castItemLevel) " +
|
||||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
PrepareStatement(CharStatements.INS_AURA_EFFECT, "INSERT INTO character_aura_effect (guid, casterGuid, itemGuid, spell, effectMask, effectIndex, amount, baseAmount) " +
|
PrepareStatement(CharStatements.INS_AURA_EFFECT, "INSERT INTO character_aura_effect (guid, casterGuid, itemGuid, spell, effectMask, effectIndex, amount, baseAmount) " +
|
||||||
"VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
"VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
|
||||||
|
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ namespace Game.DataStorage
|
|||||||
BarberShopCostBaseGameTable = GameTableReader.Read<GtBarberShopCostBaseRecord>("BarberShopCostBase.txt");
|
BarberShopCostBaseGameTable = GameTableReader.Read<GtBarberShopCostBaseRecord>("BarberShopCostBase.txt");
|
||||||
BaseMPGameTable = GameTableReader.Read<GtBaseMPRecord>("BaseMp.txt");
|
BaseMPGameTable = GameTableReader.Read<GtBaseMPRecord>("BaseMp.txt");
|
||||||
CombatRatingsGameTable = GameTableReader.Read<GtCombatRatingsRecord>("CombatRatings.txt");
|
CombatRatingsGameTable = GameTableReader.Read<GtCombatRatingsRecord>("CombatRatings.txt");
|
||||||
CombatRatingsMultByILvlGameTable = GameTableReader.Read<GtCombatRatingsMultByILvlRecord>("CombatRatingsMultByILvl.txt");
|
CombatRatingsMultByILvlGameTable = GameTableReader.Read<GtGenericMultByILvlRecord>("CombatRatingsMultByILvl.txt");
|
||||||
ItemSocketCostPerLevelGameTable = GameTableReader.Read<GtItemSocketCostPerLevelRecord>("ItemSocketCostPerLevel.txt");
|
ItemSocketCostPerLevelGameTable = GameTableReader.Read<GtItemSocketCostPerLevelRecord>("ItemSocketCostPerLevel.txt");
|
||||||
HpPerStaGameTable = GameTableReader.Read<GtHpPerStaRecord>("HpPerSta.txt");
|
HpPerStaGameTable = GameTableReader.Read<GtHpPerStaRecord>("HpPerSta.txt");
|
||||||
NpcDamageByClassGameTable[0] = GameTableReader.Read<GtNpcDamageByClassRecord>("NpcDamageByClass.txt");
|
NpcDamageByClassGameTable[0] = GameTableReader.Read<GtNpcDamageByClassRecord>("NpcDamageByClass.txt");
|
||||||
@@ -380,6 +380,7 @@ namespace Game.DataStorage
|
|||||||
NpcTotalHpGameTable[6] = GameTableReader.Read<GtNpcTotalHpRecord>("NpcTotalHpExp6.txt");
|
NpcTotalHpGameTable[6] = GameTableReader.Read<GtNpcTotalHpRecord>("NpcTotalHpExp6.txt");
|
||||||
NpcTotalHpGameTable[7] = GameTableReader.Read<GtNpcTotalHpRecord>("NpcTotalHpExp7.txt");
|
NpcTotalHpGameTable[7] = GameTableReader.Read<GtNpcTotalHpRecord>("NpcTotalHpExp7.txt");
|
||||||
SpellScalingGameTable = GameTableReader.Read<GtSpellScalingRecord>("SpellScaling.txt");
|
SpellScalingGameTable = GameTableReader.Read<GtSpellScalingRecord>("SpellScaling.txt");
|
||||||
|
StaminaMultByILvlGameTable = GameTableReader.Read<GtGenericMultByILvlRecord>("StaminaMultByILvl.txt");
|
||||||
XpGameTable = GameTableReader.Read<GtXpRecord>("xp.txt");
|
XpGameTable = GameTableReader.Read<GtXpRecord>("xp.txt");
|
||||||
|
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Initialized {0} DBC GameTables data stores in {1} ms", LoadedFileCount, Time.GetMSTimeDiffToNow(oldMSTime));
|
Log.outInfo(LogFilter.ServerLoading, "Initialized {0} DBC GameTables data stores in {1} ms", LoadedFileCount, Time.GetMSTimeDiffToNow(oldMSTime));
|
||||||
@@ -641,13 +642,14 @@ namespace Game.DataStorage
|
|||||||
public static GameTable<GtBarberShopCostBaseRecord> BarberShopCostBaseGameTable;
|
public static GameTable<GtBarberShopCostBaseRecord> BarberShopCostBaseGameTable;
|
||||||
public static GameTable<GtBaseMPRecord> BaseMPGameTable;
|
public static GameTable<GtBaseMPRecord> BaseMPGameTable;
|
||||||
public static GameTable<GtCombatRatingsRecord> CombatRatingsGameTable;
|
public static GameTable<GtCombatRatingsRecord> CombatRatingsGameTable;
|
||||||
public static GameTable<GtCombatRatingsMultByILvlRecord> CombatRatingsMultByILvlGameTable;
|
public static GameTable<GtGenericMultByILvlRecord> CombatRatingsMultByILvlGameTable;
|
||||||
public static GameTable<GtHpPerStaRecord> HpPerStaGameTable;
|
public static GameTable<GtHpPerStaRecord> HpPerStaGameTable;
|
||||||
public static GameTable<GtItemSocketCostPerLevelRecord> ItemSocketCostPerLevelGameTable;
|
public static GameTable<GtItemSocketCostPerLevelRecord> ItemSocketCostPerLevelGameTable;
|
||||||
public static GameTable<GtNpcDamageByClassRecord>[] NpcDamageByClassGameTable = new GameTable<GtNpcDamageByClassRecord>[(int)Expansion.Max];
|
public static GameTable<GtNpcDamageByClassRecord>[] NpcDamageByClassGameTable = new GameTable<GtNpcDamageByClassRecord>[(int)Expansion.Max];
|
||||||
public static GameTable<GtNpcManaCostScalerRecord> NpcManaCostScalerGameTable;
|
public static GameTable<GtNpcManaCostScalerRecord> NpcManaCostScalerGameTable;
|
||||||
public static GameTable<GtNpcTotalHpRecord>[] NpcTotalHpGameTable = new GameTable<GtNpcTotalHpRecord>[(int)Expansion.Max];
|
public static GameTable<GtNpcTotalHpRecord>[] NpcTotalHpGameTable = new GameTable<GtNpcTotalHpRecord>[(int)Expansion.Max];
|
||||||
public static GameTable<GtSpellScalingRecord> SpellScalingGameTable;
|
public static GameTable<GtSpellScalingRecord> SpellScalingGameTable;
|
||||||
|
public static GameTable<GtGenericMultByILvlRecord> StaminaMultByILvlGameTable;
|
||||||
public static GameTable<GtXpRecord> XpGameTable;
|
public static GameTable<GtXpRecord> XpGameTable;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -747,6 +749,29 @@ namespace Game.DataStorage
|
|||||||
|
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float GetIlvlStatMultiplier(GtGenericMultByILvlRecord row, InventoryType invType)
|
||||||
|
{
|
||||||
|
switch (invType)
|
||||||
|
{
|
||||||
|
case InventoryType.Neck:
|
||||||
|
case InventoryType.Finger:
|
||||||
|
return row.JewelryMultiplier;
|
||||||
|
case InventoryType.Trinket:
|
||||||
|
return row.TrinketMultiplier;
|
||||||
|
case InventoryType.Weapon:
|
||||||
|
case InventoryType.Shield:
|
||||||
|
case InventoryType.Ranged:
|
||||||
|
case InventoryType.Weapon2Hand:
|
||||||
|
case InventoryType.WeaponMainhand:
|
||||||
|
case InventoryType.WeaponOffhand:
|
||||||
|
case InventoryType.Holdable:
|
||||||
|
case InventoryType.RangedRight:
|
||||||
|
return row.WeaponMultiplier;
|
||||||
|
default:
|
||||||
|
return row.ArmorMultiplier;
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace Game.DataStorage
|
|||||||
public float Unused12;
|
public float Unused12;
|
||||||
}
|
}
|
||||||
|
|
||||||
public sealed class GtCombatRatingsMultByILvlRecord
|
public sealed class GtGenericMultByILvlRecord
|
||||||
{
|
{
|
||||||
public float ArmorMultiplier;
|
public float ArmorMultiplier;
|
||||||
public float WeaponMultiplier;
|
public float WeaponMultiplier;
|
||||||
|
|||||||
@@ -487,7 +487,8 @@ namespace Game.Entities
|
|||||||
int maxDuration = auraResult.Read<int>(6);
|
int maxDuration = auraResult.Read<int>(6);
|
||||||
int remainTime = auraResult.Read<int>(7);
|
int remainTime = auraResult.Read<int>(7);
|
||||||
byte remainCharges = auraResult.Read<byte>(8);
|
byte remainCharges = auraResult.Read<byte>(8);
|
||||||
int castItemLevel = auraResult.Read<int>(9);
|
uint castItemId = auraResult.Read<uint>(9);
|
||||||
|
int castItemLevel = auraResult.Read<int>(10);
|
||||||
|
|
||||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(key.SpellId);
|
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(key.SpellId);
|
||||||
if (spellInfo == null)
|
if (spellInfo == null)
|
||||||
@@ -518,7 +519,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
AuraLoadEffectInfo info = effectInfo[key];
|
AuraLoadEffectInfo info = effectInfo[key];
|
||||||
ObjectGuid castId = ObjectGuid.Create(HighGuid.Cast, SpellCastSource.Normal, GetMapId(), spellInfo.Id, GetMap().GenerateLowGuid(HighGuid.Cast));
|
ObjectGuid castId = ObjectGuid.Create(HighGuid.Cast, SpellCastSource.Normal, GetMapId(), spellInfo.Id, GetMap().GenerateLowGuid(HighGuid.Cast));
|
||||||
Aura aura = Aura.TryCreate(spellInfo, castId, key.EffectMask, this, null, info.BaseAmounts, null, casterGuid, itemGuid, castItemLevel);
|
Aura aura = Aura.TryCreate(spellInfo, castId, key.EffectMask, this, null, info.BaseAmounts, null, casterGuid, itemGuid, castItemId, castItemLevel);
|
||||||
if (aura != null)
|
if (aura != null)
|
||||||
{
|
{
|
||||||
if (!aura.CanBeSaved())
|
if (!aura.CanBeSaved())
|
||||||
@@ -1694,6 +1695,7 @@ namespace Game.Entities
|
|||||||
stmt.AddValue(index++, aura.GetMaxDuration());
|
stmt.AddValue(index++, aura.GetMaxDuration());
|
||||||
stmt.AddValue(index++, aura.GetDuration());
|
stmt.AddValue(index++, aura.GetDuration());
|
||||||
stmt.AddValue(index++, aura.GetCharges());
|
stmt.AddValue(index++, aura.GetCharges());
|
||||||
|
stmt.AddValue(index++, aura.GetCastItemId());
|
||||||
stmt.AddValue(index, aura.GetCastItemLevel());
|
stmt.AddValue(index, aura.GetCastItemLevel());
|
||||||
trans.Append(stmt);
|
trans.Append(stmt);
|
||||||
|
|
||||||
|
|||||||
@@ -4002,33 +4002,9 @@ namespace Game.Entities
|
|||||||
|
|
||||||
uint itemLevel = item.GetItemLevel(this);
|
uint itemLevel = item.GetItemLevel(this);
|
||||||
float combatRatingMultiplier = 1.0f;
|
float combatRatingMultiplier = 1.0f;
|
||||||
GtCombatRatingsMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(itemLevel);
|
GtGenericMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(itemLevel);
|
||||||
if (ratingMult != null)
|
if (ratingMult != null)
|
||||||
{
|
combatRatingMultiplier = CliDB.GetIlvlStatMultiplier(ratingMult, proto.GetInventoryType());
|
||||||
switch (proto.GetInventoryType())
|
|
||||||
{
|
|
||||||
case InventoryType.Weapon:
|
|
||||||
case InventoryType.Shield:
|
|
||||||
case InventoryType.Ranged:
|
|
||||||
case InventoryType.Weapon2Hand:
|
|
||||||
case InventoryType.WeaponMainhand:
|
|
||||||
case InventoryType.WeaponOffhand:
|
|
||||||
case InventoryType.Holdable:
|
|
||||||
case InventoryType.RangedRight:
|
|
||||||
combatRatingMultiplier = ratingMult.WeaponMultiplier;
|
|
||||||
break;
|
|
||||||
case InventoryType.Trinket:
|
|
||||||
combatRatingMultiplier = ratingMult.TrinketMultiplier;
|
|
||||||
break;
|
|
||||||
case InventoryType.Neck:
|
|
||||||
case InventoryType.Finger:
|
|
||||||
combatRatingMultiplier = ratingMult.JewelryMultiplier;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
combatRatingMultiplier = ratingMult.ArmorMultiplier;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// req. check at equip, but allow use for extended range if range limit max level, set proper level
|
// req. check at equip, but allow use for extended range if range limit max level, set proper level
|
||||||
for (byte i = 0; i < ItemConst.MaxStats; ++i)
|
for (byte i = 0; i < ItemConst.MaxStats; ++i)
|
||||||
@@ -4066,6 +4042,10 @@ namespace Game.Entities
|
|||||||
//ApplyStatBuffMod(Stats.Spirit, MathFunctions.CalculatePct(val, GetModifierValue(UnitMods.StatSpirit, UnitModifierType.BasePCTExcludeCreate)), apply);
|
//ApplyStatBuffMod(Stats.Spirit, MathFunctions.CalculatePct(val, GetModifierValue(UnitMods.StatSpirit, UnitModifierType.BasePCTExcludeCreate)), apply);
|
||||||
//break;
|
//break;
|
||||||
case ItemModType.Stamina: //modify stamina
|
case ItemModType.Stamina: //modify stamina
|
||||||
|
GtGenericMultByILvlRecord staminaMult = CliDB.StaminaMultByILvlGameTable.GetRow(itemLevel);
|
||||||
|
if (staminaMult != null)
|
||||||
|
val = (int)(val * CliDB.GetIlvlStatMultiplier(staminaMult, proto.GetInventoryType()));
|
||||||
|
|
||||||
HandleStatModifier(UnitMods.StatStamina, UnitModifierType.BaseValue, (float)val, apply);
|
HandleStatModifier(UnitMods.StatStamina, UnitModifierType.BaseValue, (float)val, apply);
|
||||||
ApplyStatBuffMod(Stats.Stamina, MathFunctions.CalculatePct(val, GetModifierValue(UnitMods.StatStamina, UnitModifierType.BasePCTExcludeCreate)), apply);
|
ApplyStatBuffMod(Stats.Stamina, MathFunctions.CalculatePct(val, GetModifierValue(UnitMods.StatStamina, UnitModifierType.BasePCTExcludeCreate)), apply);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -33,16 +33,16 @@ namespace Game.Entities
|
|||||||
|
|
||||||
|
|
||||||
// function uses real base points (typically value - 1)
|
// function uses real base points (typically value - 1)
|
||||||
public int CalculateSpellDamage(Unit target, SpellInfo spellProto, uint effect_index, int? basePoints = null, int itemLevel = -1)
|
public int CalculateSpellDamage(Unit target, SpellInfo spellProto, uint effect_index, int? basePoints = null, uint castItemId = 0, int itemLevel = -1)
|
||||||
{
|
{
|
||||||
SpellEffectInfo effect = spellProto.GetEffect(GetMap().GetDifficultyID(), effect_index);
|
SpellEffectInfo effect = spellProto.GetEffect(GetMap().GetDifficultyID(), effect_index);
|
||||||
return effect != null ? effect.CalcValue(this, basePoints, target) : 0;
|
return effect != null ? effect.CalcValue(this, basePoints, target, castItemId, itemLevel) : 0;
|
||||||
}
|
}
|
||||||
public int CalculateSpellDamage(Unit target, SpellInfo spellProto, uint effect_index, out float variance, int? basePoints = null, int itemLevel = -1)
|
public int CalculateSpellDamage(Unit target, SpellInfo spellProto, uint effect_index, out float variance, int? basePoints = null, uint castItemId = 0, int itemLevel = -1)
|
||||||
{
|
{
|
||||||
SpellEffectInfo effect = spellProto.GetEffect(GetMap().GetDifficultyID(), effect_index);
|
SpellEffectInfo effect = spellProto.GetEffect(GetMap().GetDifficultyID(), effect_index);
|
||||||
variance = 0.0f;
|
variance = 0.0f;
|
||||||
return effect != null ? effect.CalcValue(out variance, this, basePoints, target, itemLevel) : 0;
|
return effect != null ? effect.CalcValue(out variance, this, basePoints, target, castItemId, itemLevel) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int SpellBaseDamageBonusDone(SpellSchoolMask schoolMask)
|
public int SpellBaseDamageBonusDone(SpellSchoolMask schoolMask)
|
||||||
@@ -4142,7 +4142,7 @@ namespace Game.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public Aura _TryStackingOrRefreshingExistingAura(SpellInfo newAura, uint effMask, Unit caster, int[] baseAmount = null, Item castItem = null, ObjectGuid casterGUID = default, bool resetPeriodicTimer = true, ObjectGuid castItemGuid = default, int castItemLevel = -1)
|
public Aura _TryStackingOrRefreshingExistingAura(SpellInfo newAura, uint effMask, Unit caster, int[] baseAmount = null, Item castItem = null, ObjectGuid casterGUID = default, bool resetPeriodicTimer = true, ObjectGuid castItemGuid = default, uint castItemId = 0, int castItemLevel = -1)
|
||||||
{
|
{
|
||||||
Cypher.Assert(!casterGUID.IsEmpty() || caster);
|
Cypher.Assert(!casterGUID.IsEmpty() || caster);
|
||||||
|
|
||||||
@@ -4157,6 +4157,7 @@ namespace Game.Entities
|
|||||||
if (castItem != null)
|
if (castItem != null)
|
||||||
{
|
{
|
||||||
castItemGuid = castItem.GetGUID();
|
castItemGuid = castItem.GetGUID();
|
||||||
|
castItemId = castItem.GetEntry();
|
||||||
Player owner = castItem.GetOwner();
|
Player owner = castItem.GetOwner();
|
||||||
if (owner)
|
if (owner)
|
||||||
castItemLevel = (int)castItem.GetItemLevel(owner);
|
castItemLevel = (int)castItem.GetItemLevel(owner);
|
||||||
@@ -4197,6 +4198,7 @@ namespace Game.Entities
|
|||||||
if (castItemGuid != foundAura.GetCastItemGUID())
|
if (castItemGuid != foundAura.GetCastItemGUID())
|
||||||
{
|
{
|
||||||
foundAura.SetCastItemGUID(castItemGuid);
|
foundAura.SetCastItemGUID(castItemGuid);
|
||||||
|
foundAura.SetCastItemId(castItemId);
|
||||||
foundAura.SetCastItemLevel(castItemLevel);
|
foundAura.SetCastItemLevel(castItemLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -284,12 +284,13 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
const int UPDATE_TARGET_MAP_INTERVAL = 500;
|
const int UPDATE_TARGET_MAP_INTERVAL = 500;
|
||||||
|
|
||||||
public Aura(SpellInfo spellproto, ObjectGuid castId, WorldObject owner, Unit caster, Item castItem, ObjectGuid casterGUID, ObjectGuid castItemGuid, int castItemLevel)
|
public Aura(SpellInfo spellproto, ObjectGuid castId, WorldObject owner, Unit caster, Item castItem, ObjectGuid casterGUID, ObjectGuid castItemGuid, uint castItemId, int castItemLevel)
|
||||||
{
|
{
|
||||||
m_spellInfo = spellproto;
|
m_spellInfo = spellproto;
|
||||||
m_castGuid = castId;
|
m_castGuid = castId;
|
||||||
m_casterGuid = !casterGUID.IsEmpty() ? casterGUID : caster.GetGUID();
|
m_casterGuid = !casterGUID.IsEmpty() ? casterGUID : caster.GetGUID();
|
||||||
m_castItemGuid = castItem != null ? castItem.GetGUID() : castItemGuid;
|
m_castItemGuid = castItem != null ? castItem.GetGUID() : castItemGuid;
|
||||||
|
m_castItemId = castItem != null ? castItem.GetEntry() : castItemId;
|
||||||
m_castItemLevel = castItemLevel;
|
m_castItemLevel = castItemLevel;
|
||||||
m_spellXSpellVisualId = caster ? caster.GetCastSpellXSpellVisualId(spellproto) : spellproto.GetSpellXSpellVisualId();
|
m_spellXSpellVisualId = caster ? caster.GetCastSpellXSpellVisualId(spellproto) : spellproto.GetSpellXSpellVisualId();
|
||||||
m_applyTime = Time.UnixTime;
|
m_applyTime = Time.UnixTime;
|
||||||
@@ -2242,6 +2243,7 @@ namespace Game.Spells
|
|||||||
public ObjectGuid GetCastGUID() { return m_castGuid; }
|
public ObjectGuid GetCastGUID() { return m_castGuid; }
|
||||||
public ObjectGuid GetCasterGUID() { return m_casterGuid; }
|
public ObjectGuid GetCasterGUID() { return m_casterGuid; }
|
||||||
public ObjectGuid GetCastItemGUID() { return m_castItemGuid; }
|
public ObjectGuid GetCastItemGUID() { return m_castItemGuid; }
|
||||||
|
public uint GetCastItemId() { return m_castItemId; }
|
||||||
public int GetCastItemLevel() { return m_castItemLevel; }
|
public int GetCastItemLevel() { return m_castItemLevel; }
|
||||||
public uint GetSpellXSpellVisualId() { return m_spellXSpellVisualId; }
|
public uint GetSpellXSpellVisualId() { return m_spellXSpellVisualId; }
|
||||||
public WorldObject GetOwner() { return m_owner; }
|
public WorldObject GetOwner() { return m_owner; }
|
||||||
@@ -2261,6 +2263,11 @@ namespace Game.Spells
|
|||||||
m_castItemGuid = guid;
|
m_castItemGuid = guid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetCastItemId(uint id)
|
||||||
|
{
|
||||||
|
m_castItemId = id;
|
||||||
|
}
|
||||||
|
|
||||||
public void SetCastItemLevel(int level)
|
public void SetCastItemLevel(int level)
|
||||||
{
|
{
|
||||||
m_castItemLevel = level;
|
m_castItemLevel = level;
|
||||||
@@ -2390,12 +2397,12 @@ namespace Game.Spells
|
|||||||
}
|
}
|
||||||
return (effMask & availableEffectMask);
|
return (effMask & availableEffectMask);
|
||||||
}
|
}
|
||||||
public static Aura TryRefreshStackOrCreate(SpellInfo spellproto, ObjectGuid castId, uint tryEffMask, WorldObject owner, Unit caster, int[] baseAmount = null, Item castItem = null, ObjectGuid casterGUID = default, bool resetPeriodicTimer = true, ObjectGuid castItemGuid = default, int castItemLevel = -1)
|
public static Aura TryRefreshStackOrCreate(SpellInfo spellproto, ObjectGuid castId, uint tryEffMask, WorldObject owner, Unit caster, int[] baseAmount = null, Item castItem = null, ObjectGuid casterGUID = default, bool resetPeriodicTimer = true, ObjectGuid castItemGuid = default, uint castItemId = 0, int castItemLevel = -1)
|
||||||
{
|
{
|
||||||
bool throwway;
|
bool throwway;
|
||||||
return TryRefreshStackOrCreate(spellproto, castId, tryEffMask, owner, caster, out throwway, baseAmount, castItem, casterGUID, resetPeriodicTimer, castItemGuid, castItemLevel);
|
return TryRefreshStackOrCreate(spellproto, castId, tryEffMask, owner, caster, out throwway, baseAmount, castItem, casterGUID, resetPeriodicTimer, castItemGuid, castItemId, castItemLevel);
|
||||||
}
|
}
|
||||||
public static Aura TryRefreshStackOrCreate(SpellInfo spellproto, ObjectGuid castId, uint tryEffMask, WorldObject owner, Unit caster, out bool refresh, int[] baseAmount, Item castItem = null, ObjectGuid casterGUID = default, bool resetPeriodicTimer = true, ObjectGuid castItemGuid = default, int castItemLevel = -1)
|
public static Aura TryRefreshStackOrCreate(SpellInfo spellproto, ObjectGuid castId, uint tryEffMask, WorldObject owner, Unit caster, out bool refresh, int[] baseAmount, Item castItem = null, ObjectGuid casterGUID = default, bool resetPeriodicTimer = true, ObjectGuid castItemGuid = default, uint castItemId = 0, int castItemLevel = -1)
|
||||||
{
|
{
|
||||||
Cypher.Assert(spellproto != null);
|
Cypher.Assert(spellproto != null);
|
||||||
Cypher.Assert(owner != null);
|
Cypher.Assert(owner != null);
|
||||||
@@ -2406,7 +2413,7 @@ namespace Game.Spells
|
|||||||
uint effMask = BuildEffectMaskForOwner(spellproto, tryEffMask, owner);
|
uint effMask = BuildEffectMaskForOwner(spellproto, tryEffMask, owner);
|
||||||
if (effMask == 0)
|
if (effMask == 0)
|
||||||
return null;
|
return null;
|
||||||
Aura foundAura = owner.ToUnit()._TryStackingOrRefreshingExistingAura(spellproto, effMask, caster, baseAmount, castItem, casterGUID, resetPeriodicTimer, castItemGuid, castItemLevel);
|
Aura foundAura = owner.ToUnit()._TryStackingOrRefreshingExistingAura(spellproto, effMask, caster, baseAmount, castItem, casterGUID, resetPeriodicTimer, castItemGuid, castItemId, castItemLevel);
|
||||||
if (foundAura != null)
|
if (foundAura != null)
|
||||||
{
|
{
|
||||||
// we've here aura, which script triggered removal after modding stack amount
|
// we've here aura, which script triggered removal after modding stack amount
|
||||||
@@ -2418,9 +2425,9 @@ namespace Game.Spells
|
|||||||
return foundAura;
|
return foundAura;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return Create(spellproto, castId, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemGuid, castItemLevel);
|
return Create(spellproto, castId, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemGuid, castItemId, castItemLevel);
|
||||||
}
|
}
|
||||||
public static Aura TryCreate(SpellInfo spellproto, ObjectGuid castId, uint tryEffMask, WorldObject owner, Unit caster, int[] baseAmount, Item castItem = null, ObjectGuid casterGUID = default, ObjectGuid castItemGuid = default, int castItemLevel = -1)
|
public static Aura TryCreate(SpellInfo spellproto, ObjectGuid castId, uint tryEffMask, WorldObject owner, Unit caster, int[] baseAmount, Item castItem = null, ObjectGuid casterGUID = default, ObjectGuid castItemGuid = default, uint castItemId = 0, int castItemLevel = -1)
|
||||||
{
|
{
|
||||||
Cypher.Assert(spellproto != null);
|
Cypher.Assert(spellproto != null);
|
||||||
Cypher.Assert(owner != null);
|
Cypher.Assert(owner != null);
|
||||||
@@ -2429,9 +2436,9 @@ namespace Game.Spells
|
|||||||
uint effMask = BuildEffectMaskForOwner(spellproto, tryEffMask, owner);
|
uint effMask = BuildEffectMaskForOwner(spellproto, tryEffMask, owner);
|
||||||
if (effMask == 0)
|
if (effMask == 0)
|
||||||
return null;
|
return null;
|
||||||
return Create(spellproto, castId, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemGuid, castItemLevel);
|
return Create(spellproto, castId, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemGuid, castItemId, castItemLevel);
|
||||||
}
|
}
|
||||||
public static Aura Create(SpellInfo spellproto, ObjectGuid castId, uint effMask, WorldObject owner, Unit caster, int[] baseAmount, Item castItem, ObjectGuid casterGUID, ObjectGuid castItemGuid, int castItemLevel)
|
public static Aura Create(SpellInfo spellproto, ObjectGuid castId, uint effMask, WorldObject owner, Unit caster, int[] baseAmount, Item castItem, ObjectGuid casterGUID, ObjectGuid castItemGuid, uint castItemId, int castItemLevel)
|
||||||
{
|
{
|
||||||
Cypher.Assert(effMask != 0);
|
Cypher.Assert(effMask != 0);
|
||||||
Cypher.Assert(spellproto != null);
|
Cypher.Assert(spellproto != null);
|
||||||
@@ -2461,10 +2468,10 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
case TypeId.Unit:
|
case TypeId.Unit:
|
||||||
case TypeId.Player:
|
case TypeId.Player:
|
||||||
aura = new UnitAura(spellproto, castId, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemGuid, castItemLevel);
|
aura = new UnitAura(spellproto, castId, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemGuid, castItemId, castItemLevel);
|
||||||
break;
|
break;
|
||||||
case TypeId.DynamicObject:
|
case TypeId.DynamicObject:
|
||||||
aura = new DynObjAura(spellproto, castId, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemGuid, castItemLevel);
|
aura = new DynObjAura(spellproto, castId, effMask, owner, caster, baseAmount, castItem, casterGUID, castItemGuid, castItemId, castItemLevel);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Cypher.Assert(false);
|
Cypher.Assert(false);
|
||||||
@@ -2482,6 +2489,7 @@ namespace Game.Spells
|
|||||||
ObjectGuid m_castGuid;
|
ObjectGuid m_castGuid;
|
||||||
ObjectGuid m_casterGuid;
|
ObjectGuid m_casterGuid;
|
||||||
ObjectGuid m_castItemGuid;
|
ObjectGuid m_castItemGuid;
|
||||||
|
uint m_castItemId;
|
||||||
int m_castItemLevel;
|
int m_castItemLevel;
|
||||||
uint m_spellXSpellVisualId;
|
uint m_spellXSpellVisualId;
|
||||||
long m_applyTime;
|
long m_applyTime;
|
||||||
@@ -2518,8 +2526,8 @@ namespace Game.Spells
|
|||||||
|
|
||||||
public class UnitAura : Aura
|
public class UnitAura : Aura
|
||||||
{
|
{
|
||||||
public UnitAura(SpellInfo spellproto, ObjectGuid castId, uint effMask, WorldObject owner, Unit caster, int[] baseAmount, Item castItem, ObjectGuid casterGUID, ObjectGuid castItemGuid, int castItemLevel)
|
public UnitAura(SpellInfo spellproto, ObjectGuid castId, uint effMask, WorldObject owner, Unit caster, int[] baseAmount, Item castItem, ObjectGuid casterGUID, ObjectGuid castItemGuid, uint castItemId, int castItemLevel)
|
||||||
: base(spellproto, castId, owner, caster, castItem, casterGUID, castItemGuid, castItemLevel)
|
: base(spellproto, castId, owner, caster, castItem, casterGUID, castItemGuid, castItemId, castItemLevel)
|
||||||
{
|
{
|
||||||
m_AuraDRGroup = DiminishingGroup.None;
|
m_AuraDRGroup = DiminishingGroup.None;
|
||||||
LoadScripts();
|
LoadScripts();
|
||||||
@@ -2629,8 +2637,8 @@ namespace Game.Spells
|
|||||||
|
|
||||||
public class DynObjAura : Aura
|
public class DynObjAura : Aura
|
||||||
{
|
{
|
||||||
public DynObjAura(SpellInfo spellproto, ObjectGuid castId, uint effMask, WorldObject owner, Unit caster, int[] baseAmount, Item castItem, ObjectGuid casterGUID, ObjectGuid castItemGuid, int castItemLevel)
|
public DynObjAura(SpellInfo spellproto, ObjectGuid castId, uint effMask, WorldObject owner, Unit caster, int[] baseAmount, Item castItem, ObjectGuid casterGUID, ObjectGuid castItemGuid, uint castItemId, int castItemLevel)
|
||||||
: base(spellproto, castId, owner, caster, castItem, casterGUID, castItemGuid, castItemLevel)
|
: base(spellproto, castId, owner, caster, castItem, casterGUID, castItemGuid, castItemId, castItemLevel)
|
||||||
{
|
{
|
||||||
LoadScripts();
|
LoadScripts();
|
||||||
Cypher.Assert(GetDynobjOwner() != null);
|
Cypher.Assert(GetDynobjOwner() != null);
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
public class AuraEffect
|
public class AuraEffect
|
||||||
{
|
{
|
||||||
public AuraEffect(Aura abase, uint effindex, int? baseAmount, Unit caster)
|
public AuraEffect(Aura baseAura, uint effindex, int? baseAmount, Unit caster)
|
||||||
{
|
{
|
||||||
auraBase = abase;
|
auraBase = baseAura;
|
||||||
m_spellInfo = abase.GetSpellInfo();
|
m_spellInfo = baseAura.GetSpellInfo();
|
||||||
_effectInfo = abase.GetSpellEffectInfo(effindex);
|
_effectInfo = baseAura.GetSpellEffectInfo(effindex);
|
||||||
m_baseAmount = baseAmount.HasValue ? baseAmount.Value : _effectInfo.CalcBaseValue(caster, abase.GetAuraType() == AuraObjectType.Unit ? abase.GetOwner().ToUnit() : null, abase.GetCastItemLevel());
|
m_baseAmount = baseAmount.HasValue ? baseAmount.Value : _effectInfo.CalcBaseValue(caster, baseAura.GetAuraType() == AuraObjectType.Unit ? baseAura.GetOwner().ToUnit() : null, baseAura.GetCastItemId(), baseAura.GetCastItemLevel());
|
||||||
m_donePct = 1.0f;
|
m_donePct = 1.0f;
|
||||||
m_effIndex = (byte)effindex;
|
m_effIndex = (byte)effindex;
|
||||||
m_canBeRecalculated = true;
|
m_canBeRecalculated = true;
|
||||||
@@ -76,7 +76,7 @@ namespace Game.Spells
|
|||||||
int amount = 0;
|
int amount = 0;
|
||||||
|
|
||||||
if (!m_spellInfo.HasAttribute(SpellAttr8.MasterySpecialization) || MathFunctions.fuzzyEq(GetSpellEffectInfo().BonusCoefficient, 0.0f))
|
if (!m_spellInfo.HasAttribute(SpellAttr8.MasterySpecialization) || MathFunctions.fuzzyEq(GetSpellEffectInfo().BonusCoefficient, 0.0f))
|
||||||
amount = GetSpellEffectInfo().CalcValue(caster, m_baseAmount, GetBase().GetOwner().ToUnit(), GetBase().GetCastItemLevel());
|
amount = GetSpellEffectInfo().CalcValue(caster, m_baseAmount, GetBase().GetOwner().ToUnit(), GetBase().GetCastItemId(), GetBase().GetCastItemLevel());
|
||||||
else if (caster != null && caster.IsTypeId(TypeId.Player))
|
else if (caster != null && caster.IsTypeId(TypeId.Player))
|
||||||
amount = (int)(caster.ToPlayer().m_activePlayerData.Mastery * GetSpellEffectInfo().BonusCoefficient);
|
amount = (int)(caster.ToPlayer().m_activePlayerData.Mastery * GetSpellEffectInfo().BonusCoefficient);
|
||||||
|
|
||||||
|
|||||||
@@ -2073,12 +2073,12 @@ namespace Game.Spells
|
|||||||
foreach (SpellEffectInfo auraSpellEffect in GetEffects())
|
foreach (SpellEffectInfo auraSpellEffect in GetEffects())
|
||||||
if (auraSpellEffect != null)
|
if (auraSpellEffect != null)
|
||||||
basePoints[auraSpellEffect.EffectIndex] = (m_spellValue.CustomBasePointsMask & (1 << (int)auraSpellEffect.EffectIndex)) != 0 ?
|
basePoints[auraSpellEffect.EffectIndex] = (m_spellValue.CustomBasePointsMask & (1 << (int)auraSpellEffect.EffectIndex)) != 0 ?
|
||||||
m_spellValue.EffectBasePoints[auraSpellEffect.EffectIndex] : auraSpellEffect.CalcBaseValue(m_originalCaster, unit, m_castItemLevel);
|
m_spellValue.EffectBasePoints[auraSpellEffect.EffectIndex] : auraSpellEffect.CalcBaseValue(m_originalCaster, unit, m_castItemEntry, m_castItemLevel);
|
||||||
|
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
bool resetPeriodicTimer = !_triggeredCastFlags.HasAnyFlag(TriggerCastFlags.DontResetPeriodicTimer);
|
bool resetPeriodicTimer = !_triggeredCastFlags.HasAnyFlag(TriggerCastFlags.DontResetPeriodicTimer);
|
||||||
m_spellAura = Aura.TryRefreshStackOrCreate(m_spellInfo, m_castId, (byte)effectMask, unit,
|
m_spellAura = Aura.TryRefreshStackOrCreate(m_spellInfo, m_castId, (byte)effectMask, unit,
|
||||||
m_originalCaster, out refresh, basePoints, m_CastItem, ObjectGuid.Empty, resetPeriodicTimer, ObjectGuid.Empty, m_castItemLevel);
|
m_originalCaster, out refresh, basePoints, m_CastItem, ObjectGuid.Empty, resetPeriodicTimer, ObjectGuid.Empty, m_castItemEntry, m_castItemLevel);
|
||||||
if (m_spellAura != null)
|
if (m_spellAura != null)
|
||||||
{
|
{
|
||||||
// Set aura stack amount to desired value
|
// Set aura stack amount to desired value
|
||||||
@@ -7121,7 +7121,7 @@ namespace Game.Spells
|
|||||||
if ((m_spellValue.CustomBasePointsMask & (1 << (int)i)) != 0)
|
if ((m_spellValue.CustomBasePointsMask & (1 << (int)i)) != 0)
|
||||||
basePoint = m_spellValue.EffectBasePoints[i];
|
basePoint = m_spellValue.EffectBasePoints[i];
|
||||||
|
|
||||||
return m_caster.CalculateSpellDamage(target, m_spellInfo, i, basePoint, m_castItemLevel);
|
return m_caster.CalculateSpellDamage(target, m_spellInfo, i, basePoint, m_castItemEntry, m_castItemLevel);
|
||||||
}
|
}
|
||||||
int CalculateDamage(uint i, Unit target, out float variance)
|
int CalculateDamage(uint i, Unit target, out float variance)
|
||||||
{
|
{
|
||||||
@@ -7129,7 +7129,7 @@ namespace Game.Spells
|
|||||||
if ((m_spellValue.CustomBasePointsMask & (1 << (int)i)) != 0)
|
if ((m_spellValue.CustomBasePointsMask & (1 << (int)i)) != 0)
|
||||||
basePoint = m_spellValue.EffectBasePoints[i];
|
basePoint = m_spellValue.EffectBasePoints[i];
|
||||||
|
|
||||||
return m_caster.CalculateSpellDamage(target, m_spellInfo, i, out variance, basePoint, m_castItemLevel);
|
return m_caster.CalculateSpellDamage(target, m_spellInfo, i, out variance, basePoint, m_castItemEntry, m_castItemLevel);
|
||||||
}
|
}
|
||||||
public SpellState GetState()
|
public SpellState GetState()
|
||||||
{
|
{
|
||||||
@@ -7566,7 +7566,7 @@ namespace Game.Spells
|
|||||||
Cypher.Assert(effects.Length <= SpellConst.MaxEffects);
|
Cypher.Assert(effects.Length <= SpellConst.MaxEffects);
|
||||||
foreach (SpellEffectInfo effect in effects)
|
foreach (SpellEffectInfo effect in effects)
|
||||||
if (effect != null)
|
if (effect != null)
|
||||||
EffectBasePoints[effect.EffectIndex] = effect.CalcBaseValue(caster, null, -1);
|
EffectBasePoints[effect.EffectIndex] = effect.CalcBaseValue(caster, null, 0, -1);
|
||||||
|
|
||||||
CustomBasePointsMask = 0;
|
CustomBasePointsMask = 0;
|
||||||
MaxAffectedTargets = proto.MaxAffectedTargets;
|
MaxAffectedTargets = proto.MaxAffectedTargets;
|
||||||
|
|||||||
@@ -1223,7 +1223,7 @@ namespace Game.Spells
|
|||||||
if (!dynObj.CreateDynamicObject(caster.GetMap().GenerateLowGuid(HighGuid.DynamicObject), caster, m_spellInfo, destTarget, radius, DynamicObjectType.AreaSpell, m_SpellVisual))
|
if (!dynObj.CreateDynamicObject(caster.GetMap().GenerateLowGuid(HighGuid.DynamicObject), caster, m_spellInfo, destTarget, radius, DynamicObjectType.AreaSpell, m_SpellVisual))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Aura aura = Aura.TryCreate(m_spellInfo, m_castId, SpellConst.MaxEffectMask, dynObj, caster, m_spellValue.EffectBasePoints, null, ObjectGuid.Empty, ObjectGuid.Empty, m_castItemLevel);
|
Aura aura = Aura.TryCreate(m_spellInfo, m_castId, SpellConst.MaxEffectMask, dynObj, caster, m_spellValue.EffectBasePoints, null, ObjectGuid.Empty, ObjectGuid.Empty, m_castItemEntry, m_castItemLevel);
|
||||||
if (aura != null)
|
if (aura != null)
|
||||||
{
|
{
|
||||||
m_spellAura = aura;
|
m_spellAura = aura;
|
||||||
|
|||||||
@@ -3905,18 +3905,18 @@ namespace Game.Spells
|
|||||||
return IsAreaAuraEffect() || Effect == SpellEffectName.ApplyAura;
|
return IsAreaAuraEffect() || Effect == SpellEffectName.ApplyAura;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int CalcValue(Unit caster = null, int? bp = null, Unit target = null, int itemLevel = -1)
|
public int CalcValue(Unit caster = null, int? bp = null, Unit target = null, uint castItemId = 0, int itemLevel = -1)
|
||||||
{
|
{
|
||||||
float throwAway;
|
float throwAway;
|
||||||
return CalcValue(out throwAway, caster, bp, target, itemLevel);
|
return CalcValue(out throwAway, caster, bp, target, castItemId, itemLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int CalcValue(out float variance, Unit caster = null, int? bp = null, Unit target = null, int itemLevel = -1)
|
public int CalcValue(out float variance, Unit caster = null, int? bp = null, Unit target = null, uint castItemId = 0, int itemLevel = -1)
|
||||||
{
|
{
|
||||||
variance = 0.0f;
|
variance = 0.0f;
|
||||||
float basePointsPerLevel = RealPointsPerLevel;
|
float basePointsPerLevel = RealPointsPerLevel;
|
||||||
// TODO: this needs to be a float, not rounded
|
// TODO: this needs to be a float, not rounded
|
||||||
int basePoints = CalcBaseValue(caster, target, itemLevel);
|
int basePoints = CalcBaseValue(caster, target, castItemId, itemLevel);
|
||||||
float value = bp.HasValue ? bp.Value : BasePoints;
|
float value = bp.HasValue ? bp.Value : BasePoints;
|
||||||
float comboDamage = PointsPerResource;
|
float comboDamage = PointsPerResource;
|
||||||
|
|
||||||
@@ -3964,7 +3964,7 @@ namespace Game.Spells
|
|||||||
return (int)Math.Round(value);
|
return (int)Math.Round(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int CalcBaseValue(Unit caster, Unit target, int itemLevel)
|
public int CalcBaseValue(Unit caster, Unit target, uint itemId, int itemLevel)
|
||||||
{
|
{
|
||||||
if (Scaling.Coefficient != 0.0f)
|
if (Scaling.Coefficient != 0.0f)
|
||||||
{
|
{
|
||||||
@@ -4011,10 +4011,34 @@ namespace Game.Spells
|
|||||||
|
|
||||||
if (_spellInfo.Scaling._Class == -7)
|
if (_spellInfo.Scaling._Class == -7)
|
||||||
{
|
{
|
||||||
// todo: get inventorytype here
|
GtGenericMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel);
|
||||||
GtCombatRatingsMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel);
|
|
||||||
if (ratingMult != null)
|
if (ratingMult != null)
|
||||||
tempValue *= ratingMult.ArmorMultiplier;
|
{
|
||||||
|
ItemSparseRecord itemSparse = CliDB.ItemSparseStorage.LookupByKey(itemId);
|
||||||
|
if (itemSparse != null)
|
||||||
|
tempValue *= CliDB.GetIlvlStatMultiplier(ratingMult, itemSparse.inventoryType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IsAura(AuraType.ModRating))
|
||||||
|
{
|
||||||
|
GtGenericMultByILvlRecord ratingMult = CliDB.CombatRatingsMultByILvlGameTable.GetRow(effectiveItemLevel);
|
||||||
|
if (ratingMult != null)
|
||||||
|
{
|
||||||
|
ItemSparseRecord itemSparse = CliDB.ItemSparseStorage.LookupByKey(itemId);
|
||||||
|
if (itemSparse != null)
|
||||||
|
tempValue *= CliDB.GetIlvlStatMultiplier(ratingMult, itemSparse.inventoryType);
|
||||||
|
}
|
||||||
|
else if (IsAura(AuraType.ModStat) && MiscValue == (int)Stats.Stamina)
|
||||||
|
{
|
||||||
|
GtGenericMultByILvlRecord staminaMult = CliDB.StaminaMultByILvlGameTable.GetRow(effectiveItemLevel);
|
||||||
|
if (staminaMult != null)
|
||||||
|
{
|
||||||
|
ItemSparseRecord itemSparse = CliDB.ItemSparseStorage.LookupByKey(itemId);
|
||||||
|
if (itemSparse != null)
|
||||||
|
tempValue *= CliDB.GetIlvlStatMultiplier(staminaMult, itemSparse.inventoryType);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4172,6 +4196,7 @@ namespace Game.Spells
|
|||||||
case SpellEffectName.ApplyAreaAuraOwner:
|
case SpellEffectName.ApplyAreaAuraOwner:
|
||||||
case SpellEffectName.ApllyAuraOnPet:
|
case SpellEffectName.ApllyAuraOnPet:
|
||||||
case SpellEffectName.Unk202:
|
case SpellEffectName.Unk202:
|
||||||
|
case SpellEffectName.ApplyAreaAuraPartyNonrandom:
|
||||||
switch (ApplyAuraName)
|
switch (ApplyAuraName)
|
||||||
{
|
{
|
||||||
case AuraType.PeriodicDamage:
|
case AuraType.PeriodicDamage:
|
||||||
|
|||||||
@@ -469,6 +469,7 @@ CREATE TABLE `character_aura` (
|
|||||||
`maxDuration` int(11) NOT NULL DEFAULT '0',
|
`maxDuration` int(11) NOT NULL DEFAULT '0',
|
||||||
`remainTime` int(11) NOT NULL DEFAULT '0',
|
`remainTime` int(11) NOT NULL DEFAULT '0',
|
||||||
`remainCharges` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
`remainCharges` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||||
|
`castItemId` int(10) unsigned NOT NULL DEFAULT '0',
|
||||||
`castItemLevel` int(11) NOT NULL DEFAULT '-1',
|
`castItemLevel` int(11) NOT NULL DEFAULT '-1',
|
||||||
PRIMARY KEY (`guid`,`casterGuid`,`itemGuid`,`spell`,`effectMask`)
|
PRIMARY KEY (`guid`,`casterGuid`,`itemGuid`,`spell`,`effectMask`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System';
|
||||||
@@ -3660,7 +3661,8 @@ INSERT INTO `updates` VALUES
|
|||||||
('2019_10_26_01_characters.sql','59D5860930D02AB77D2AAA704C564957A9143760','RELEASED','2019-10-26 22:04:46',0),
|
('2019_10_26_01_characters.sql','59D5860930D02AB77D2AAA704C564957A9143760','RELEASED','2019-10-26 22:04:46',0),
|
||||||
('2019_11_03_00_characters.sql','DC789597F85B890E9A7901B4443DAD9CAEE2A02A','RELEASED','2019-11-03 14:13:27',0),
|
('2019_11_03_00_characters.sql','DC789597F85B890E9A7901B4443DAD9CAEE2A02A','RELEASED','2019-11-03 14:13:27',0),
|
||||||
('2019_11_12_00_characters.sql','D4C642B4D48DAE9F56329BDE51C258323A132A91','RELEASED','2019-11-12 16:31:29',0),
|
('2019_11_12_00_characters.sql','D4C642B4D48DAE9F56329BDE51C258323A132A91','RELEASED','2019-11-12 16:31:29',0),
|
||||||
('2019_11_22_00_characters.sql','95DFA71DBD75542C098CD86E9C0051C9690902F0','RELEASED','2019-11-20 15:10:12',0);
|
('2019_11_22_00_characters.sql','95DFA71DBD75542C098CD86E9C0051C9690902F0','RELEASED','2019-11-20 15:10:12',0),
|
||||||
|
('2019_11_30_00_characters.sql','D0678E62B651AECA60C2DD6989BF80BD999AD12B','RELEASED','2019-11-29 22:42:01',0);
|
||||||
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE `character_aura` ADD `castItemId` int(10) unsigned NOT NULL DEFAULT '0' AFTER `remainCharges`;
|
||||||
Reference in New Issue
Block a user