Merge pull request #662 from noudess/master

Rule to dictate if you can teach yourself lang.
This commit is contained in:
Michael Cook (mackal) 2017-09-24 18:07:41 -04:00 committed by GitHub
commit f8a4f2e6bd
2 changed files with 9 additions and 3 deletions

View File

@ -186,6 +186,7 @@ RULE_INT(Skills, MaxTrainSpecializations, 50) // Max level a GM trainer will tra
RULE_INT(Skills, SwimmingStartValue, 100)
RULE_BOOL(Skills, TrainSenseHeading, false)
RULE_INT(Skills, SenseHeadingStartValue, 200)
RULE_BOOL(Skills, SelfLanguageLearning, true)
RULE_CATEGORY_END()
RULE_CATEGORY(Pets)

View File

@ -1225,11 +1225,16 @@ void Client::ChannelMessageSend(const char* from, const char* to, uint8 chan_num
strcpy(&cm->message[0], buffer);
QueuePacket(&app);
bool senderCanTrainSelf = RuleB(Client, SelfLanguageLearning);
bool weAreNotSender = strcmp(this->GetCleanName(), cm->sender);
if (senderCanTrainSelf || weAreNotSender) {
if ((chan_num == 2) && (ListenerSkill < 100)) { // group message in unmastered language, check for skill up
if (m_pp.languages[language] <= lang_skill)
CheckLanguageSkillIncrease(language, lang_skill);
}
}
}
void Client::Message(uint32 type, const char* message, ...) {
if (GetFilter(FilterSpellDamage) == FilterHide && type == MT_NonMelee)