Core/Items: Implemented new bonus type (extra ItemEffect)
Port From (https://github.com/TrinityCore/TrinityCore/commit/63fba4751142d7a16d6316e9fb5ad844da088509)
This commit is contained in:
@@ -1052,10 +1052,10 @@ namespace Game
|
||||
if (!item)
|
||||
return;
|
||||
|
||||
if (item.GetTemplate().Effects.Count < 2)
|
||||
if (item.GetBonus().EffectCount < 2)
|
||||
return;
|
||||
|
||||
uint spellToLearn = (uint)item.GetTemplate().Effects[1].SpellID;
|
||||
uint spellToLearn = (uint)item.GetEffect(1).SpellID;
|
||||
|
||||
var entry = Global.SpellMgr.GetBattlePetSpecies(spellToLearn);
|
||||
if (entry != null)
|
||||
|
||||
@@ -90,9 +90,9 @@ namespace Game
|
||||
|
||||
if (user.IsInCombat())
|
||||
{
|
||||
for (int i = 0; i < proto.Effects.Count; ++i)
|
||||
foreach (ItemEffectRecord effect in item.GetEffects())
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo((uint)proto.Effects[i].SpellID);
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo((uint)effect.SpellID);
|
||||
if (spellInfo != null)
|
||||
{
|
||||
if (!spellInfo.CanBeUsedInCombat())
|
||||
|
||||
Reference in New Issue
Block a user