[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
+1
View File
@@ -132,6 +132,7 @@ public:
int GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 race, uint32 class_, uint32 deity, uint32 faction, Lua_NPC npc);
void SetFactionLevel(uint32 char_id, uint32 npc_id, int char_class, int char_race, int char_deity);
void SetFactionLevel2(uint32 char_id, int faction_id, int char_class, int char_race, int char_deity, int value, int temp);
void RewardFaction(int id, int amount);
int GetRawItemAC();
uint32 AccountID();
const char *AccountName();