* Add pet when learning it for the first time (summon spell not known).
* Removed code that adds battle pet if its summon spell is known (Learn cageable pet -> Cage pet -> Log out -> Log in -> Pet is added).
* When uncaging check that the species has a summon spell before trying to learn it.
* Rename WorldPackets::BattlePet::BattlePet::CollarID to WorldPackets::BattlePet::BattlePet::DisplayID
* Use the DisplayID field to store the model of the battle pet. If the species has BattlePetSpeciesFlags::RandomDisplay, nothing is stored. Otherwise a random model is chosen from those available
* Stored DisplayID in ITEM_MODIFIER_BATTLE_PET_DISPLAY_ID when caging the battle pet (previously the CreatureID was being stored)
* Modified SendPlaySpellVisual function to allow sending Target and TargetPosition at the same time
* Added SpellVisual when uncaging
* Define BattlePetBreedQuality enum class.
* Check the quality of the battle pet species in battle_pet_quality table to avoid invalid values.
* Set CurrentBattlePetBreedQuality and WildBattlePetLevel update fields with the data of the summoned battle pet.
* Added function to calculate the WildBattlePetLevel of wild battle pets according to their spawn zone.
* Define BattlePetSpeciesFlags enum class.
* Define BattlePetDbFlags enum class.
* Added check to prevent the pet from being caged if its species has flag BattlePetSpeciesFlags::NotTradable.
* Added check to prevent the pet from being caged if it's in battle pet slots.
* Added check to prevent the pet from being caged if its health is below maximum health.
* Only add pet if the species has flag BattlePetSpeciesFlags::WellKnown.
* Added function to check flag BattlePetSpeciesFlags::LegacyAccountUnique to avoid learning copies of unique pets.
* Implemented CMSG_BATTLE_PET_CLEAR_FANFARE.
- Aura will be applied at last moment possible (after damage) to prevent regressions on #18395
- Partial revert of 9b38a6352c as it wasnt handling correctly checks without spells
Closes#21578Closes#21579Closes#21581
(cherry picked from commit d6b9f148a7)
Reduce the probabilty of going under the map
(cherry picked from commit 9e0faace9a)
Revert "Core/Entities: Reduce the probability of units dropping under the map (#21322)"
(cherry picked from commit 2dadbda24a)
- Decoupled Unit logic: split of spell critical chance into done (caster bonuses) and taken (target bonuses), this allows to precalculate caster bonuses on aura apply and then check victim's auras on damage/healing calc
- Made static a bunch of methods (they no longer have this pointer because they are now called from periodic handlers which may or may not have an active caster in world)
- Simplified all AuraEffect bonuses into AuraEffect::_amount, no more duplicated code
- Critical chance and whether or not caster is player owned unit (for resilience calcs) is now saved one level upper, on Aura itself (it's impossible as of 3.3.5 to have different effects with different critical chances)
- Minor cleanup of SPELL_DAMAGE_CLASS_NONE and Arcane Potency (#18813) crit handling
Closes#19876
(cherry picked from commit cb9e72e521)
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
- They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
- ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
- ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes#16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.
Closes#7951 and #19998.
(cherry picked from commit 532ab1c7f8)
Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation.
- CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments
- This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one
- It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object.
- A gajillion refactors to make everything behave the way it always has
(cherry picked from commit d507a7e338)