diff --git a/Source/Framework/Constants/Spells/SpellConst.cs b/Source/Framework/Constants/Spells/SpellConst.cs index e095ff580..db53350e1 100644 --- a/Source/Framework/Constants/Spells/SpellConst.cs +++ b/Source/Framework/Constants/Spells/SpellConst.cs @@ -1972,7 +1972,7 @@ namespace Framework.Constants DoNotLogAuraRefresh = 0x08, // Do Not Log Aura Refresh (client only) MissileSpeedIsDelayInSec = 0x10, // Missile Speed is Delay (in sec) IgnoreTotemRequirementsForCasting = 0x20, // Ignore Totem Requirements for Casting - Unk6 = 0x40, // 6 + ItemCastGrantsSkillGain = 0x40, // Item Cast Grants Skill Gain Unk7 = 0x80, // 7 AimedShot = 0x100, // 8 NotUsableInArena = 0x200, // 9 Cannot Be Used In Arenas diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 1b83e3e02..61d9816f8 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -2991,6 +2991,14 @@ namespace Game.Spells player.UpdateCriteria(CriteriaType.CastSpell, m_spellInfo.Id); } + // Spells that don't create items can have this attribute - handle here + if (m_CastItem && m_spellInfo.HasAttribute(SpellAttr9.ItemCastGrantsSkillGain)) + { + Player playerCaster1 = m_caster.ToPlayer(); + if (playerCaster1 != null) + playerCaster1.UpdateCraftSkill(m_spellInfo); + } + Item targetItem = m_targets.GetItemTarget(); if (!Convert.ToBoolean(_triggeredCastFlags & TriggerCastFlags.IgnorePowerAndReagentCost)) { diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index b52f73130..90c56004d 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -1015,7 +1015,8 @@ namespace Game.Spells } // we succeeded in creating at least one item, so a levelup is possible - player.UpdateCraftSkill(m_spellInfo); + if (m_CastItem == null) + player.UpdateCraftSkill(m_spellInfo); } } @@ -1046,7 +1047,8 @@ namespace Game.Spells if (m_spellInfo.IsLootCrafting()) { player.AutoStoreLoot(m_spellInfo.Id, LootStorage.Spell, context, false, true); - player.UpdateCraftSkill(m_spellInfo); + if (m_CastItem == null) + player.UpdateCraftSkill(m_spellInfo); } else // If there's no random loot entries for this spell, pick the item associated with this spell { @@ -1990,7 +1992,7 @@ namespace Game.Spells else { // do not increase skill if vellum used - if (!(m_CastItem != null && m_CastItem.GetTemplate().HasFlag(ItemFlags.NoReagentCost))) + if (m_CastItem == null) player.UpdateCraftSkill(m_spellInfo); uint enchant_id = (uint)effectInfo.MiscValue; @@ -3085,7 +3087,8 @@ namespace Game.Spells Player caster = m_caster.ToPlayer(); if (caster != null) { - caster.UpdateCraftSkill(m_spellInfo); + if (m_CastItem == null) + caster.UpdateCraftSkill(m_spellInfo); itemTarget.loot = new Loot(caster.GetMap(), itemTarget.GetGUID(), LootType.Disenchanting, null); itemTarget.loot.FillLoot(itemTarget.GetDisenchantLoot(caster).Id, LootStorage.Disenchant, caster, true); caster.SendLoot(itemTarget.loot);