diff options
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 1 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 21 | 
2 files changed, 10 insertions, 12 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4e57c538c4d..1369d915773 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5072,6 +5072,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)          hadPet = false;      } +    // TODO: Better to fail Hunter's "Revive Pet" at cast instead of here when casting ends      Pet* pet = player->GetPet(); // Attempt to get current pet      if (!pet || pet->IsAlive())          return; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 1b8f50b5eab..eb45e8f49f5 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1337,23 +1337,20 @@ public:              return false;          } -        std::string tNameLink = handler->GetNameLink(target); +        bool targetHasSkill = target->GetSkillValue(skill); -        if (!target->GetSkillValue(skill)) -        { -            handler->PSendSysMessage(LANG_SET_SKILL_ERROR, tNameLink.c_str(), skill, skillLine->name[handler->GetSessionDbcLocale()]); -            handler->SetSentErrorMessage(true); -            return false; -        } - -        uint16 max = maxPureSkill ? atol (maxPureSkill) : target->GetPureMaxSkillValue(skill); +        // If our target does not yet have the skill they are trying to add to them, the chosen level also becomes +        // the max level of the new profession. +        uint16 max = maxPureSkill ? atol (maxPureSkill) : targetHasSkill ? target->GetPureMaxSkillValue(skill) : uint16(level);          if (level <= 0 || level > max || max <= 0)              return false; -        target->SetSkill(skill, target->GetSkillStep(skill), level, max); -        handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], tNameLink.c_str(), level, max); - +        // If the player has the skill, we get the current skill step. If they don't have the skill, we +        // add the skill to the player's book with step 1 (which is the first rank, in most cases something +        // like 'Apprentice <skill>'. +        target->SetSkill(skill, targetHasSkill ? target->GetSkillStep(skill) : 1, level, max); +        handler->PSendSysMessage(LANG_SET_SKILL, skill, skillLine->name[handler->GetSessionDbcLocale()], handler->GetNameLink(target).c_str(), level, max);          return true;      }  | 
