mirror of
https://github.com/EQEmu/Server.git
synced 2026-02-17 18:02:26 +00:00
[Skills] Make Tracking Skill Configurable (#1784)
Added 1 rule per class that defines tracking distance multiplier for that class Kept the defaults of 12 for ranger, 10 for druid, and 7 for bard Created 1 method for determining class tracking distance multiplier Created 1 method for determining if a class can track, based on multiplier Updated tracking logic to use these methods to determine whether a tracking packet should and can be sent or not.
This commit is contained in:
parent
8c78a19c95
commit
4fbb98a5f7
@ -174,6 +174,22 @@ RULE_INT(Character, ResurrectionSicknessSpellID, 756, "756 is Default Resurrecti
|
||||
RULE_BOOL(Character, EnableBardMelody, true, "Enable Bard /melody by default, to disable change to false for a classic experience.")
|
||||
RULE_BOOL(Character, EnableRangerAutoFire, true, "Enable Ranger /autofire by default, to disable change to false for a classic experience.")
|
||||
RULE_BOOL(Character, EnableTGB, true, "Enable /tgb (Target Group Buff) by default, to disable change to false for a classic experience.")
|
||||
RULE_INT(Character, WarriorTrackingDistanceMultiplier, 0, "If you want warriors to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, ClericTrackingDistanceMultiplier, 0, "If you want clerics to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, PaladinTrackingDistanceMultiplier, 0, "If you want paladins to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, RangerTrackingDistanceMultiplier, 12, "If you want rangers to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, ShadowKnightTrackingDistanceMultiplier, 0, "If you want shadow knights to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, DruidTrackingDistanceMultiplier, 10, "If you want druids to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, MonkTrackingDistanceMultiplier, 0, "If you want monks to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, BardTrackingDistanceMultiplier, 7, "If you want bards to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, RogueTrackingDistanceMultiplier, 0, "If you want rogues to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, ShamanTrackingDistanceMultiplier, 0, "If you want shaman to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, NecromancerTrackingDistanceMultiplier, 0, "If you want necromancers to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, WizardTrackingDistanceMultiplier, 0, "If you want wizards to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, MagicianTrackingDistanceMultiplier, 0, "If you want magicians to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, EnchanterTrackingDistanceMultiplier, 0, "If you want enchanters to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, BeastlordTrackingDistanceMultiplier, 0, "If you want beastlords to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_INT(Character, BerserkerTrackingDistanceMultiplier, 0, "If you want berserkers to be able to track, increase this above 0. 0 disables tracking packets.")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Mercs)
|
||||
|
||||
@ -10869,3 +10869,46 @@ uint16 Client::LearnDisciplines(uint8 min_level, uint8 max_level)
|
||||
|
||||
return learned_disciplines;
|
||||
}
|
||||
|
||||
uint16 Client::GetClassTrackingDistanceMultiplier(uint16 class_) {
|
||||
switch (class_) {
|
||||
case WARRIOR:
|
||||
return RuleI(Character, WarriorTrackingDistanceMultiplier);
|
||||
case CLERIC:
|
||||
return RuleI(Character, ClericTrackingDistanceMultiplier);
|
||||
case PALADIN:
|
||||
return RuleI(Character, PaladinTrackingDistanceMultiplier);
|
||||
case RANGER:
|
||||
return RuleI(Character, RangerTrackingDistanceMultiplier);
|
||||
case SHADOWKNIGHT:
|
||||
return RuleI(Character, ShadowKnightTrackingDistanceMultiplier);
|
||||
case DRUID:
|
||||
return RuleI(Character, DruidTrackingDistanceMultiplier);
|
||||
case MONK:
|
||||
return RuleI(Character, MonkTrackingDistanceMultiplier);
|
||||
case BARD:
|
||||
return RuleI(Character, BardTrackingDistanceMultiplier);
|
||||
case ROGUE:
|
||||
return RuleI(Character, RogueTrackingDistanceMultiplier);
|
||||
case SHAMAN:
|
||||
return RuleI(Character, ShamanTrackingDistanceMultiplier);
|
||||
case NECROMANCER:
|
||||
return RuleI(Character, NecromancerTrackingDistanceMultiplier);
|
||||
case WIZARD:
|
||||
return RuleI(Character, WizardTrackingDistanceMultiplier);
|
||||
case MAGICIAN:
|
||||
return RuleI(Character, MagicianTrackingDistanceMultiplier);
|
||||
case ENCHANTER:
|
||||
return RuleI(Character, EnchanterTrackingDistanceMultiplier);
|
||||
case BEASTLORD:
|
||||
return RuleI(Character, BeastlordTrackingDistanceMultiplier);
|
||||
case BERSERKER:
|
||||
return RuleI(Character, BerserkerTrackingDistanceMultiplier);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool Client::CanThisClassTrack() {
|
||||
return (GetClassTrackingDistanceMultiplier(GetClass()) > 0) ? true : false;
|
||||
}
|
||||
|
||||
@ -810,6 +810,11 @@ public:
|
||||
uint16 ScribeSpells(uint8 min_level, uint8 max_level);
|
||||
uint16 LearnDisciplines(uint8 min_level, uint8 max_level);
|
||||
|
||||
// Configurable Tracking Skill
|
||||
uint16 GetClassTrackingDistanceMultiplier(uint16 class_);
|
||||
|
||||
bool CanThisClassTrack();
|
||||
|
||||
// defer save used when bulk saving
|
||||
void UnscribeSpell(int slot, bool update_client = true, bool defer_save = false);
|
||||
void UnscribeSpellAll(bool update_client = true);
|
||||
|
||||
@ -14064,8 +14064,9 @@ void Client::Handle_OP_TGB(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_Track(const EQApplicationPacket *app)
|
||||
{
|
||||
if (GetClass() != RANGER && GetClass() != DRUID && GetClass() != BARD)
|
||||
if (!CanThisClassTrack()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetSkill(EQ::skills::SkillTracking) == 0)
|
||||
SetSkill(EQ::skills::SkillTracking, 1);
|
||||
@ -14080,10 +14081,9 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_TrackTarget(const EQApplicationPacket *app)
|
||||
{
|
||||
int PlayerClass = GetClass();
|
||||
|
||||
if ((PlayerClass != RANGER) && (PlayerClass != DRUID) && (PlayerClass != BARD))
|
||||
if (!CanThisClassTrack()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (app->size != sizeof(TrackTarget_Struct))
|
||||
{
|
||||
|
||||
@ -3561,12 +3561,8 @@ bool EntityList::MakeTrackPacket(Client *client)
|
||||
uint32 distance = 0;
|
||||
float MobDistance;
|
||||
|
||||
if (client->GetClass() == DRUID)
|
||||
distance = (client->GetSkill(EQ::skills::SkillTracking) * 10);
|
||||
else if (client->GetClass() == RANGER)
|
||||
distance = (client->GetSkill(EQ::skills::SkillTracking) * 12);
|
||||
else if (client->GetClass() == BARD)
|
||||
distance = (client->GetSkill(EQ::skills::SkillTracking) * 7);
|
||||
distance = (client->GetSkill(EQ::skills::SkillTracking) * client->GetClassTrackingDistanceMultiplier(client->GetClass()));
|
||||
|
||||
if (distance <= 0)
|
||||
return false;
|
||||
if (distance < 300)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user