Commit Graph

107 Commits

Author SHA1 Message Date
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
Killyana
a7cf209428 Core/Creature: Clear creature focus after an evade
(cherry picked from commit a32aeceb0d)
2021-12-19 17:44:00 +01:00
Killyana
a09d5d4854 Creature/AI: Reset CoolDowns on evade
Closes  #24008

(cherry picked from commit cb11ad97fb)
2021-12-19 15:46:40 +01:00
Artamedes
913f0903a3 Scripts/Outland: Fix npc_ancestral_wolf not starting waypoint (#23763)
* Scripts/Outlands: Fix npc_ancestral_wolf not starting waypoint, and also add a way to not follow owner automatically in CreatureAI::JustAppeared() for tempsummons

* fix nopch

(cherry picked from commit 0b3a9e2a2b)
2021-12-18 21:37:02 +01:00
Treeston
14c38a1c52 Core/Unit: Spell focusing now no longer nonsensical. HasSpellFocus always const. Error logs for various stuff.
(cherry picked from commit 4a219eda07)
2021-12-18 11:36:50 +01:00
ccrs
be4ed9152c Core/Unit: rename IsFocusing method
Workaround prework till actual facing system rework arrives

(cherry picked from commit ec9f15a5ff)
2021-12-18 00:25:14 +01:00
Treeston
6b1ca0ca12 Core/Combat: Properly unset engagement flag on death.
(cherry picked from commit 9c603ea87f)
2021-12-17 22:45:55 +01:00
Treeston
3269c42789 Core/AI: No longer do strange things when told to enter evade mode while there's no need to do so, typically by terrible legacy code.
(cherry picked from commit 163f44c1b0)
2021-12-17 21:50:47 +01:00
Treeston
a4c2c0fb1d Core/AI: No longer override chase movement with follow movement if the creature engages before JustAppeared has had a chance to fire.
(cherry picked from commit 49b04c0fdd)
2021-12-17 00:25:59 +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
bba4696de7 Entities/Player: Clean up client control handling behavior around possession. Mind Control should no longer cause various weirdness. Closes #23539.
(cherry picked from commit f6f1c48aa5)
2021-12-13 23:44:13 +01:00
ccrs
cadbf42ea4 Misc: some corrections after recent merges
(cherry picked from commit 626a24822b)
2021-12-13 00:42:18 +01:00
Treeston
c9d52c9547 Core/AI: Actually accurately reproduce the logic from before 8499434 that determines what summons start following on appearance. Third time's the charm?
Closes #23513.

(cherry picked from commit 3cdf27494f)
(cherry picked from commit 63383da36e)
2021-12-13 00:42:16 +01:00
Shauren
1c00109756 Core/Creatures: Fixed crash in CreatureAI::JustAppeared caused by scripted summons without SummonProperties
Closes #23507

(cherry picked from commit c0b25c9a83)
2021-12-12 02:20:42 +01:00
ccrs
d7e544e816 Core/AI: minimize further undesired behaviours (e3e4b97 followup)
Those Category checks come from checking all Spell::SummonGuardian uses

(cherry picked from commit ebd438883e)
2021-12-12 02:15:00 +01:00
Treeston
38d7c1530a Combat/Threat: Split ThreatManager::NotifyDisengaged off from ThreatManager::ClearAllThreat. NotifyDisengaged signifies intent to clear the engagement flag, and should only be called from AI. Fixes #23490.
(cherry picked from commit 1158f267df)
2021-12-12 02:09:15 +01:00
Treeston
9f7d3ebd6a Core/AI: Remove EnterEvadeMode calls from Guardian/Summon spell handlers. Add follow logic to CreatureAI::JustAppeared. Closes #23270.
(cherry picked from commit 8499434340)
2021-12-12 01:27:04 +01:00
ccrs
844f969ed7 Core/AI: logs, codestyle & cosmetics standarization
(cherry picked from commit fdb71ce19e)
2021-12-05 16:48:58 +01:00
ccrs
dd11603150 Core/AI: variable naming standarization
plus minimum codestyle changes

(cherry picked from commit 179c7da1fc)
2021-12-05 16:17:02 +01:00
jackpoz
a855e6221d Core/Vehicles: Fix accessories disappearing on reset
(cherry picked from commit 6dae4a747d)
2021-12-03 22:02:13 +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
5d48e8db7d Core/AI: Remove unnecessary parameter from DoZoneInCombat after eb1972f
(cherry picked from commit c00a2efb21)
2021-10-22 13:29:34 +02:00
Seyden
8f097e4425 Core/Scripts: Implement script name reloading
* Authored by Seyden
* Co-authored by Naios
* We thank Shauren for your helpful feedback
2021-10-22 12:52:37 +02:00
Treeston
6a5edf0472 Core/AI: Some cleanup to DoZoneInCombat and Malygos' AI that I found while working out #22226.
(cherry picked from commit eb1972f21d)
2021-10-22 00:48:20 +02:00
ccrs
426f9f2f92 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).

(cherry picked from commit 982643cd96)
2021-09-28 00:15:13 +02:00
Treeston
bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2)
2021-09-23 22:21:29 +02:00
Treeston
994121e671 Core/CreatureAI: CheckBoundary -> IsInBoundary, better reflects what it does. Also moved to public so spellscript can use it.
(cherry picked from commit df639d85e4)
2021-08-23 23:28:48 +02:00
Treeston
75a3b2f122 Game/AI: Remove some unused old logic.
(cherry picked from commit c69584a967)
2021-06-19 01:35:40 +02:00
Shauren
b9d63c2009 Core/Scripts: Remove deprecated overload of QuestReward without LootItemType argument 2021-05-16 21:56:06 +02:00
Treeston
5aee452943 Core/Misc: A variety of clean-up changes, mostly following up on 532ab1c to fix legacy bugs exposed by it:
- Triggers can no longer have a threat list (this may expose some ugliness in old legacy scripts)
- Threat entries are forced to OFFLINE if the AI refuses to attack the target
- Clean up passive creature evade behavior to be more consistent
- Fix a months old issue in spawn group management that would cause "Inactive" to incorrectly show in .list respawns for system groups outside of map 0
- Valithria script cleanups, remove old hacks and make it work with the new system. Closes #21174.
- Some strings cleanup

(cherry picked from commit 9f9507e6a1)
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
Treeston
0aed5a35ef Core/AI: Kick Gossip functions upstairs, from UnitAI to CreatureAI - they only make sense for Creatures anyway.
Also change a very ugly hack in GetDialogStatus. Ew.

(cherry picked from commit eacfa9d89a)
2021-04-27 23:49:36 +02:00
Shauren
b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
treeston
2dfafa69eb Hi, I'm Treeston, and welcome to Combat PR Prep Refactors.
Today, we're moving UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC to higher-level abstraction so combat manager can react to it.
New methods on Unit:
- void SetImmuneTo<All/PC/NPC>(apply, keepCombat = false);
- bool IsImmuneTo<All/PC/NPC>() const;

(cherry picked from commit 74af880217)
2020-08-18 18:53:13 +02:00
Treeston
8be23fcbbd [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 e2a1ccd118)
2020-08-13 22:46:44 +02:00
Treeston
f7a7d02a7f Pet/Guardian AI hook re-organizing (#19824)
* Pet/Guardian AI hook re-organizing:
- Adjust OwnerAttacked/OwnerAttackedBy hooks on CreatureAI to fire for all owned units, not just player pets. This should allow guardians to more reliably recognize valid targets.
- Kill off the AttackedBy hook. While it was defined in CreatureAI.h as virtual, it was only ever invoked for player pets in specific situations. This makes it classic developer bait.
  - Adjust PetAI to use DamageTaken instead of AttackedBy.
  - Adjust behavior of AttackStart on PetAI to compensate.

(cherry picked from commit 1660bb7d27)
2020-07-16 21:47:28 +02:00
Shauren
c7306439e7 Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower 2020-06-12 01:29:18 +02:00
ccrs
2d4549023a Core/Unit: 2170541a51 followup
use true as default value since pretty much all the script calls will expect that

(cherry picked from commit c7a57e2a09)
2020-04-28 17:42:26 +02:00
ccrs
5d411e0b21 Core/CreatureAI: b6b0353bff followup
(cherry picked from commit 5fc366d03b)
2020-04-28 14:55:44 +02:00
ariel-
f3a49059ac Core/AI: some tweaks on boundary functionality:
- Moved SetBoundary to public scope to allow for greater flexibility (ie set from external script)
- Extended to allow checking inverted boundaries

(cherry picked from commit 6892404b27)
2020-04-28 14:07:43 +02:00
ariel-
9c53ee0fe8 Core/AI: prevent launching a new MoveChase if victim didn't change
Thanks ccrs for feedback :P

(cherry picked from commit b6b0353bff)
2020-04-27 18:29:39 +02:00
ariel-
3f79c9f696 Core/AI: AreaBoundary refactor
- Added an auxiliary function IsInBounds to base CreatureAI
- Changed container to vector. Set had no sense because we're storing new pointers, they have different addresses even if the boundary is the same

(cherry picked from commit 2f99fa09c9)
2020-04-24 17:18:51 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
455959c606 Core/PacketIO: Rewrite updatefield handling 2019-06-08 17:06:57 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
xinef1
d8f701e1ac Properly clear focused target on evade (#18992)
Closes #18095

(cherry-picked from 3c81a9a6d4)
2018-12-09 14:18:42 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
b453e12423 Core/Game: Include cleanup part 5
* ObjectMgr.h
* Player.h
* Unit.h
* G3D should no longer propagate everywhere from Spline/MotionMaster
2017-06-04 01:00:45 +02:00
Shauren
a0a158b5b8 Core/Scripts: Include cleanup 2017-05-28 16:34:44 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00