24 Commits

Author SHA1 Message Date
Shauren
5de252ae84 Core/Misc: Move large functions out of header files 2025-07-13 13:40:31 +02:00
Shauren
d778d5ec7c Core/Misc: Include cleanup - remove MapUtils.h from Containers.h 2024-12-31 18:12:36 +01:00
Shauren
1369b87084 Core/Creatures: Implemented CREATURE_STATIC_FLAG_2_IGNORE_SANCTUARY (ignore SPELL_EFFECT_SANCTUARY, used by Vanish) 2024-03-04 00:05:35 +01:00
Shauren
d8a4668c77 Core/Misc: Add missing Containers.h include where neccessary 2023-01-06 16:44:11 +01:00
Shauren
9bfc29f4af Core/Combat: Allow PvE combat references to become suppressed, just like PvP ones
(cherry picked from commit e8dfd8c25c)
2022-09-05 22:23:02 +02:00
Alan Deutscher
ff99952dfb Core/Spells: Delay combat flagging for spell targets until spell missile lands
(cherry picked from commit b59706c8b6)
2022-09-05 22:23:02 +02:00
Shauren
b47185cabf Core/Misc: Rename AddXXXFlag updatefield functions to SetXXXFlag 2022-03-27 18:14:47 +02:00
Lucas Nascimento
4ed918fcb3 Core/Combat: Fixed combat after remove charm (#27248)
https://github.com/TrinityCore/TrinityCore/pull/27038#issuecomment-958784361
(cherry picked from commit 0cc0b3f926)
2022-03-21 22:02:34 +01:00
Gildor
b6615a45eb Core/Combat: Allow refresh pvp combat when assisting a unit that is in pvp combat (#26773)
(cherry picked from commit 372c84392b)
2022-03-12 01:16:36 +01:00
offl
53d19b09f4 Core/Creature: rename CREATURE_FLAG_EXTRA_IGNORE_COMBAT into CREATURE_FLAG_EXTRA_CANNOT_ENTER_COMBAT (#26762)
Co-authored-by: offl <offl@users.noreply.github.com>
(cherry picked from commit 06b554c36e)
2022-03-11 21:20:04 +01:00
Ovah
2819951dce Core/Units: add new functionality for units to block or enable combat interactions (#25168)
* Core/Units: add new functionality for units to block or enable combat entirely via helper to reflect what CREATURE_DIFFICULTYFLAGS_IGNORE_COMBAT and client AI functions imply

* yeah...

* Nuke Creature::IsCombatDisallowed helper as its unused by now

* no combat extra flag may now be changed on transforms if the transformed entry does not have the flag

(cherry picked from commit 764f22fc91)
2022-01-26 18:41:41 +01:00
Giacomo Pozzoni
1dfcb7086e Core/Combat: Disable triggers entering combat (#25086)
* Core/Combat: Disable triggers entering combat

* Move check to database flags_extra flag in creature_template with value 0x00002000

* Fix Rotface puddle stalker too

* Rename 9999_99_99_99_world.sql to 2020_07_22_00_world.sql

(cherry picked from commit 6440c3bcac)
2022-01-23 22:35:00 +01:00
ccrs
d7571e5d1f Scripts/ICC: little bit of cleanup in Valithria after the "recent" changes
(cherry picked from commit 7ffe018571)
2021-12-19 18:05:23 +01:00
Treeston
4c754de7a8 != and == are not the same thing.
(cherry picked from commit 51cf1c7136)
2021-12-17 00:29:31 +01:00
Treeston
c13d83796f Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged. Fixes #17981 and #23602 for real this time.
(cherry picked from commit 0e7c66cb4c)
2021-12-17 00:23:33 +01:00
Treeston
513b35ea2f Entities/Unit: Properly unset engaged flag for creates that cannot have a threat list on combat exit. Fixes #23518.
(cherry picked from commit f44539b642)
2021-12-14 00:07:37 +01:00
Treeston
35e55f1089 Core/Entities: Kick engagement logic upstairs to Unit (from ThreatManager), since all Units with AI need it (not just those with threat list). Fixes #17981.
(cherry picked from commit dbe3bbefe7)
2021-12-12 00:31:15 +01:00
Treeston
e4e8c1c59c Core/AI: Clean up charm AI handling, we now have two unique_ptr instead of a crapton of booleans
(cherry picked from commit 042f5515e4)
2021-10-22 23:47:51 +02:00
Treeston
f1ac141f25 Core/Unit: UNIT_FLAG renames
[UNIT_FLAG_PLAYER_CONTROLLED -> UNIT_FLAG_POSSESSED]
[UNIT_FLAG_PVP_ATTACKABLE -> UNIT_FLAG_PLAYER_CONTROLLED]
Signed off by: Shauren, Warlockbugs.

(cherry picked from commit 081eab3cf5)
2021-09-26 16:07:09 +02:00
Treeston
f982f3019a Core/Combat: Unify combat permitted checks between CvC and PvC - only require "not friendly" in all cases. Fixes Yogg-Saron encounter. Closes #21380.
Also some bonus cleanup to Yogg's script to make transition cleaner.

(cherry picked from commit 4da9321d2b)
2021-06-21 00:07:24 +02:00
Treeston
56fcd8ba1d Core/Threat: Fix a potential crash that would occur in specific edge cases of AI being a bit naughty.
(cherry picked from commit 1847555c8c)
2021-06-15 23:22:50 +02:00
Treeston
dce39aedc2 Core/Combat: Some more sanity check asserts to try and track down #21187.
Also, some anti-annoyance treatment for dot tele.

(cherry picked from commit fdacf12739)
2021-05-16 21:56:05 +02:00
Treeston
2a7bb9b404 Core/Combat: some more detailed assertions to possibly shed light on #21187.
(cherry picked from commit 5a9fddaa5a)
2021-05-16 21:56:05 +02:00
Treeston
34c7810fe5 Core: Combat/threat system rewrite (PR #19930)
- 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)
2021-05-16 21:56:01 +02:00