[Feature] Faction Association (#2408)

* Add faction logging category

Probably should use this for more things

* Add FactionAssociation struct

This is simply just a struct that contains an array of faction ids and
multiplier. This can hold a maximum of 10 entries (Seru hit is 8, so 2
extra) this can be raised if need be.

* Add database changes and other data point changes

This is all the database changes and loading changes

Included is an optional SQL that will be used as a starting point, there
is likely errors or typos, but we will fix those as they are discovered.

* Add Client::RewardFaction function

This just takes the faction ID and the magnitude of the primary faction
hit and calculates the rest.

The minimum change will be either 1 or -1. We stop processing after we
see an ID of 0 and assume there will be no later entries.

The primary faction ID will always receive a hit even if there is no
faction association entries

* Add users of RewardFaction to NPC death, tasks, and QuestRewards

This will only use the new system if the magnitude is set, otherwise we
will just use the old system still

* Add quest system calls and lua QuestReward support

* Add #factionassociation command

This just calls RewardFaction, mostly useful for debugging
This commit is contained in:
Michael Cook (mackal)
2022-09-03 10:57:55 -04:00
committed by GitHub
parent efe1879115
commit 2b4e555eae
41 changed files with 1363 additions and 25 deletions
+2 -1
View File
@@ -217,7 +217,8 @@ struct TaskInformation {
int reward_id{};
int cash_reward{}; // Expressed in copper
int experience_reward{};
int faction_reward{}; // just a npc_faction_id
int faction_reward{}; // npc_faction_id if amount == 0, otherwise primary faction ID
int faction_amount{}; // faction hit value
TaskMethodType reward_method;
int reward_points;
AltCurrencyType reward_point_type;