From c81a5e078370e48d8ed6626e7bc6da530ae964ac Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Wed, 3 Aug 2016 23:06:00 -0400 Subject: [PATCH] Limit casting skill ups to casting skills --- common/skills.cpp | 13 +++++++++++++ common/skills.h | 9 +++++---- zone/spells.cpp | 10 ++++++---- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/common/skills.cpp b/common/skills.cpp index 9be28781f..b1cf59c12 100644 --- a/common/skills.cpp +++ b/common/skills.cpp @@ -110,6 +110,19 @@ bool EQEmu::skills::IsBardInstrumentSkill(SkillType skill) } } +bool EQEmu::skills::IsCastingSkill(SkillType skill) +{ + switch (skill) { + case SkillAbjuration: + case SkillAlteration: + case SkillConjuration: + case SkillEvocation: + return true; + default: + return false; + } +} + const std::map& EQEmu::skills::GetSkillTypeMap() { /* VS2013 code diff --git a/common/skills.h b/common/skills.h index cd7603667..19a996729 100644 --- a/common/skills.h +++ b/common/skills.h @@ -161,10 +161,11 @@ namespace EQEmu // server profile does not reflect this yet..so, prefixed with 'PACKET_' #define PACKET_SKILL_ARRAY_SIZE 100 - extern bool IsTradeskill(SkillType skill); - extern bool IsSpecializedSkill(SkillType skill); - extern float GetSkillMeleePushForce(SkillType skill); - extern bool IsBardInstrumentSkill(SkillType skill); + bool IsTradeskill(SkillType skill); + bool IsSpecializedSkill(SkillType skill); + float GetSkillMeleePushForce(SkillType skill); + bool IsBardInstrumentSkill(SkillType skill); + bool IsCastingSkill(SkillType skill); extern const std::map& GetSkillTypeMap(); diff --git a/zone/spells.cpp b/zone/spells.cpp index 60837381e..0eebcb082 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1327,12 +1327,14 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo SetMana(GetMana()); // skills - c->CheckIncreaseSkill(spells[spell_id].skill, nullptr); + if (EQEmu::skills::IsCastingSkill(spells[spell_id].skill)) { + c->CheckIncreaseSkill(spells[spell_id].skill, nullptr); - // increased chance of gaining channel skill if you regained concentration - c->CheckIncreaseSkill(EQEmu::skills::SkillChanneling, nullptr, regain_conc ? 5 : 0); + // increased chance of gaining channel skill if you regained concentration + c->CheckIncreaseSkill(EQEmu::skills::SkillChanneling, nullptr, regain_conc ? 5 : 0); - c->CheckSpecializeIncrease(spell_id); + c->CheckSpecializeIncrease(spell_id); + } } }