[3.3.5] Combat/Threat rewrite - prep & refactor (#19966)

* Combat/Threat rewrite (PR #19930) prep work. Mostly refactors, and a compatibility layer on ThreatManager/HostileReference that allows scripts to be changed already.

(cherry picked from commit e2a1ccd118d129b96e09ff1a15ed0adb1d4a3897)
This commit is contained in:
Treeston
2020-08-13 22:46:44 +02:00
committed by Shauren
parent 2c99678118
commit 8be23fcbbd
187 changed files with 981 additions and 1133 deletions
@@ -208,11 +208,16 @@ struct TC_GAME_API ScriptedAI : public CreatureAI
//Plays a sound to all nearby players
void DoPlaySoundToSet(WorldObject* source, uint32 soundId);
//Drops all threat to 0%. Does not remove players from the threat list
void DoResetThreat();
float DoGetThreat(Unit* unit);
void DoModifyThreatPercent(Unit* unit, int32 pct);
// Add specified amount of threat directly to victim (ignores redirection effects) - also puts victim in combat and engages them if necessary
void AddThreat(Unit* victim, float amount, Unit* who = nullptr);
// Adds/removes the specified percentage from the specified victim's threat (to who, or me if not specified)
void ModifyThreatByPercent(Unit* victim, int32 pct, Unit* who = nullptr);
// Resets the victim's threat level to who (or me if not specified) to zero
void ResetThreat(Unit* victim, Unit* who = nullptr);
// Resets the specified unit's threat list (me if not specified) - does not delete entries, just sets their threat to zero
void ResetThreatList(Unit* who = nullptr);
// Returns the threat level of victim towards who (or me if not specified)
float GetThreat(Unit const* victim, Unit const* who = nullptr);
void DoTeleportTo(float x, float y, float z, uint32 time = 0);
void DoTeleportTo(float const pos[4]);