diff --git a/changelog.txt b/changelog.txt index e27e7f44a..f2fe06150 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,10 +1,12 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 02/23/2015 == -Noudess: Allow for a rule to set starting swimming value. -If the rule does not exist, it uses the old hard coded overrides. I moved -the swimming override to char create instead of setting it every time a char -enters a zone. +Noudess: Allow for a rule to set starting swimming && SenseHeading value. +I moved the swimming override to char create instead of setting it +every time a char enters a zone. + +Also added rules to not ignore, but rather forrce sense heading packets to be +used to train it instead of maxing it out like before. == 02/21/2015 == Noudess: Starting erudites that were supposed to start in paineel were landing in erudin on Titanium. Fixed to be paineel. diff --git a/common/ruletypes.h b/common/ruletypes.h index 7be048385..7894c5ebd 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -134,6 +134,8 @@ RULE_BOOL ( Skills, UseLimitTradeskillSearchSkillDiff, true ) RULE_INT ( Skills, MaxTradeskillSearchSkillDiff, 50 ) RULE_INT ( Skills, MaxTrainSpecializations, 50 ) // Max level a GM trainer will train casting specializations RULE_INT ( Skills, SwimmingStartValue, 100 ) +RULE_BOOL ( Skills, TrainSenseHeading, false ) +RULE_INT ( Skills, SenseHeadingStartValue, 200 ) RULE_CATEGORY_END() RULE_CATEGORY( Pets ) diff --git a/world/client.cpp b/world/client.cpp index 2fbb6ffb9..1cf88d481 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1429,13 +1429,9 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) SetRaceStartingSkills(&pp); SetClassStartingSkills(&pp); SetClassLanguages(&pp); - pp.skills[SkillSenseHeading] = 200; - // Allow server to force swimming training from a configured level - std::string value; - bool userule; - userule=RuleManager::Instance()->GetRule("Skills:SwimmingStartValue", value); - pp.skills[SkillSwimming] = (userule) ? atoi(value.c_str()) : 100; + pp.skills[SkillSwimming] = RuleI(Skills, SwimmingStartValue); + pp.skills[SkillSenseHeading] = RuleI(Skills, SenseHeadingStartValue); // strcpy(pp.servername, WorldConfig::get()->ShortName.c_str()); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index bd856fc45..29abadb61 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -332,7 +332,13 @@ void MapOpcodes() ConnectedOpcodes[OP_Save] = &Client::Handle_OP_Save; ConnectedOpcodes[OP_SaveOnZoneReq] = &Client::Handle_OP_SaveOnZoneReq; ConnectedOpcodes[OP_SelectTribute] = &Client::Handle_OP_SelectTribute; - ConnectedOpcodes[OP_SenseHeading] = &Client::Handle_OP_Ignore; + + // Use or Ignore sense heading based on rule. + bool train=RuleB(Skills, TrainSenseHeading); + + ConnectedOpcodes[OP_SenseHeading] = + (train) ? &Client::Handle_OP_SenseHeading : &Client::Handle_OP_Ignore; + ConnectedOpcodes[OP_SenseTraps] = &Client::Handle_OP_SenseTraps; ConnectedOpcodes[OP_SetGuildMOTD] = &Client::Handle_OP_SetGuildMOTD; ConnectedOpcodes[OP_SetRunMode] = &Client::Handle_OP_SetRunMode; @@ -11648,6 +11654,27 @@ void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) return; } +void Client::Handle_OP_SenseHeading(const EQApplicationPacket *app) +{ + if (!HasSkill(SkillSenseHeading)) + return; + + int chancemod=0; + + // The client seems to limit sense heading packets based on skill + // level. So if we're really low, we don't hit this routine very often. + // I think it's the GUI deciding when to skill you up. + // So, I'm adding a mod here which is larger at lower levels so + // very low levels get a much better chance to skill up when the GUI + // eventually sends a message. + if (GetLevel() <= 8) + chancemod += (9-level) * 10; + + CheckIncreaseSkill(SkillSenseHeading, nullptr, chancemod); + + return; +} + void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) { if (!HasSkill(SkillSenseTraps))