mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 18:52:22 +00:00
Use rules to configure faction thresholds
Default to legacy values. Updated "accurate" values are available in optional database script
This commit is contained in:
+10
-12
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "faction.h"
|
||||
#include "races.h"
|
||||
#include "rulesys.h"
|
||||
|
||||
const char *FactionValueToString(FACTION_VALUE fv)
|
||||
{
|
||||
@@ -59,34 +60,31 @@ FACTION_VALUE CalculateFaction(FactionMods* fm, int32 tmpCharacter_value)
|
||||
if (fm) {
|
||||
character_value += fm->base + fm->class_mod + fm->race_mod + fm->deity_mod;
|
||||
}
|
||||
if (character_value >= 1100) {
|
||||
if (character_value >= RuleI(Faction, AllyFactionMinimum)) {
|
||||
return FACTION_ALLY;
|
||||
}
|
||||
if (character_value >= 750 && character_value <= 1099) {
|
||||
if (character_value >= RuleI(Faction, WarmlyFactionMinimum)) {
|
||||
return FACTION_WARMLY;
|
||||
}
|
||||
if (character_value >= 500 && character_value <= 749) {
|
||||
if (character_value >= RuleI(Faction, KindlyFactionMinimum)) {
|
||||
return FACTION_KINDLY;
|
||||
}
|
||||
if (character_value >= 100 && character_value <= 499) {
|
||||
if (character_value >= RuleI(Faction, AmiablyFactionMinimum)) {
|
||||
return FACTION_AMIABLE;
|
||||
}
|
||||
if (character_value >= 0 && character_value <= 99) {
|
||||
if (character_value >= RuleI(Faction, IndifferentlyFactionMinimum)) {
|
||||
return FACTION_INDIFFERENT;
|
||||
}
|
||||
if (character_value >= -100 && character_value <= -1) {
|
||||
if (character_value >= RuleI(Faction, ApprehensivelyFactionMinimum)) {
|
||||
return FACTION_APPREHENSIVE;
|
||||
}
|
||||
if (character_value >= -500 && character_value <= -101) {
|
||||
if (character_value >= RuleI(Faction, DubiouslyFactionMinimum)) {
|
||||
return FACTION_DUBIOUS;
|
||||
}
|
||||
if (character_value >= -750 && character_value <= -501) {
|
||||
if (character_value >= RuleI(Faction, ThreateninglyFactionMinimum)) {
|
||||
return FACTION_THREATENLY;
|
||||
}
|
||||
if (character_value <= -751) {
|
||||
return FACTION_SCOWLS;
|
||||
}
|
||||
return FACTION_INDIFFERENT;
|
||||
return FACTION_SCOWLS;
|
||||
}
|
||||
|
||||
// this function should check if some races have more than one race define
|
||||
|
||||
@@ -758,6 +758,17 @@ RULE_BOOL(Bugs, UseOldReportingMethod, true) // Forces the use of the old bug re
|
||||
RULE_BOOL(Bugs, DumpTargetEntity, false) // Dumps the target entity, if one is provided
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(Faction)
|
||||
RULE_INT(Faction, AllyFactionMinimum, 1101)
|
||||
RULE_INT(Faction, WarmlyFactionMinimum, 701)
|
||||
RULE_INT(Faction, KindlyFactionMinimum, 401)
|
||||
RULE_INT(Faction, AmiablyFactionMinimum, 101)
|
||||
RULE_INT(Faction, IndifferentlyFactionMinimum, 0)
|
||||
RULE_INT(Faction, ApprehensivelyFactionMinimum, -100)
|
||||
RULE_INT(Faction, DubiouslyFactionMinimum, -700)
|
||||
RULE_INT(Faction, ThreateninglyFactionMinimum, -999)
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
#undef RULE_CATEGORY
|
||||
#undef RULE_INT
|
||||
#undef RULE_REAL
|
||||
|
||||
Reference in New Issue
Block a user