Commit Graph

108 Commits

Author SHA1 Message Date
jackpoz
69809d1203 Core/AI: Fix remaining charming issue
Make creatures evade when a charming expires and they cannot attack the charmer (i.e. charmer with .gm on)
2020-03-02 20:43:52 +01:00
Giacomo Pozzoni
817ae5bca6 Core/AI: Allow creatures to evade (#24221)
* Core/AI: Allow creatures to evade

Revert changes that didn't allow creatures to evade anymore no matter how hard a script would try

* PArtially revert 163f44c1b0
2020-03-02 20:17:47 +01:00
Aokromes
ed93932537 New year
Say bye bye to every year changing dates
2020-01-02 06:25:50 +01:00
ccrs
7ffe018571 Scripts/ICC: little bit of cleanup in Valithria after the "recent" changes 2020-01-02 01:06:38 +01:00
Killyana
a32aeceb0d Core/Creature: Clear creature focus after an evade 2020-01-01 17:19:37 +01:00
Killyana
cb11ad97fb Creature/AI: Reset CoolDowns on evade
Closes  #24008
2019-12-29 14:05:03 +01:00
Artamedes
0b3a9e2a2b 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
2019-09-05 08:37:44 +02:00
Treeston
4a219eda07 Core/Unit: Spell focusing now no longer nonsensical. HasSpellFocus always const. Error logs for various stuff. 2019-08-04 01:26:20 +02:00
ccrs
ec9f15a5ff Core/Unit: rename IsFocusing method
Workaround prework till actual facing system rework arrives
2019-08-03 17:45:06 +02:00
Treeston
9c603ea87f Core/Combat: Properly unset engagement flag on death. 2019-07-31 13:17:32 +02:00
Treeston
163f44c1b0 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. 2019-07-29 00:14:10 +02:00
Treeston
49b04c0fdd Core/AI: No longer override chase movement with follow movement if the creature engages before JustAppeared has had a chance to fire. 2019-07-21 03:59:43 +02:00
Treeston
0e7c66cb4c 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. 2019-07-21 01:50:52 +02:00
Treeston
f6f1c48aa5 Entities/Player: Clean up client control handling behavior around possession. Mind Control should no longer cause various weirdness. Closes #23539. 2019-07-02 11:58:12 +02:00
ccrs
626a24822b Misc: some corrections after recent merges 2019-06-29 16:01:58 +02:00
Treeston
63383da36e fix comment, 3cdf274 follow-up 2019-06-26 01:06:01 +02:00
Treeston
3cdf27494f Core/AI: Actually accurately reproduce the logic from before 849943 that determines what summons start following on appearance. Third time's the charm?
Closes #23513.
2019-06-26 01:04:27 +02:00
Shauren
c0b25c9a83 Core/Creatures: Fixed crash in CreatureAI::JustAppeared caused by scripted summons without SummonProperties
Closes #23507
2019-06-24 18:47:04 +02:00
ccrs
ebd438883e Core/AI: minimize further undesired behaviours (e3e4b97 followup)
Those Category checks come from checking all Spell::SummonGuardian uses
2019-06-24 12:49:15 +02:00
Treeston
1158f267df 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. 2019-06-23 23:31:51 +02:00
Treeston
8499434340 Core/AI: Remove EnterEvadeMode calls from Guardian/Summon spell handlers. Add follow logic to CreatureAI::JustAppeared. Closes #23270. 2019-06-23 17:18:42 +02:00
Treeston
c06330acf2 Revert "Core/AI: Fix Guardians not following the owner after finishing combat (#23466)"
This reverts commit c234604e82.
2019-06-22 22:21:09 +02:00
Giacomo Pozzoni
c234604e82 Core/AI: Fix Guardians not following the owner after finishing combat (#23466)
CreatureAI::UpdateVictim() was not triggering EnterEvadeMode() after the Creature ended combat because IsEngaged() would return false.
These changes save the value of IsEngaged() to be used next tick to check if the Creature was in combat, is not anymore now and needs to evade (or select another enemy).
EnterEvadeMode() sets the stored previous value to false to ensure the Creature will not try to evade while already evading.
2019-06-22 20:03:49 +02:00
ccrs
fdb71ce19e Core/AI: logs, codestyle & cosmetics standarization 2019-05-15 19:23:28 +02:00
ccrs
179c7da1fc Core/AI: variable naming standarization
plus minimum codestyle changes
2019-05-15 01:33:55 +02:00
jackpoz
6dae4a747d Core/Vehicles: Fix accessories disappearing on reset 2019-05-05 17:20:10 +02:00
Treeston
fcfcb0eb6f Happy New Year, folks. It's 2019! 2019-01-01 15:45:25 +01:00
Treeston
50f70a3faf indent + header fix 2018-08-23 17:44:14 +02:00
Treeston
b4cdf556f1 missing base class forward, 042f551 follow-up 2018-08-23 16:42:55 +02:00
Treeston
042f5515e4 Core/AI: Clean up charm AI handling, we now have two unique_ptr instead of a crapton of booleans 2018-08-23 16:34:42 +02:00
Treeston
c00a2efb21 Core/AI: Remove unnecessary parameter from DoZoneInCombat after eb1972f 2018-08-22 21:51:16 +02:00
Treeston
eb1972f21d Core/AI: Some cleanup to DoZoneInCombat and Malygos' AI that I found while working out #22226. 2018-08-20 19:04:21 +02:00
ccrs
982643cd96 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).
2018-06-03 10:06:57 -07:00
Treeston
4692e10ca2 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good. 2018-04-01 13:52:36 +02:00
Treeston
df639d85e4 Core/CreatureAI: CheckBoundary -> IsInBoundary, better reflects what it does. Also moved to public so spellscript can use it. 2018-03-08 18:41:46 +01:00
Treeston
c69584a967 Game/AI: Remove some unused old logic. 2018-01-29 01:57:31 +01:00
Treeston
9f9507e6a1 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
2018-01-04 04:46:41 +01:00
Treeston
532ab1c7f8 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.
2018-01-03 20:04:19 +01:00
tkrokli
f6b6f57a6d Update copyright note for 2018
Best wishes for the new year.
2018-01-01 01:55:29 +01:00
treeston
74af880217 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;
2017-07-09 02:07:29 +02:00
Treeston
e2a1ccd118 [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.
2017-07-01 20:18:02 +02:00
ariel-
85a7d5ce9a Core: ported headers cleanup from master branch 2017-06-19 23:20:06 -03:00
Treeston
1660bb7d27 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.
2017-06-07 02:33:47 +02:00
ccrs
c7a57e2a09 Core/Unit: 2170541a51 followup
use true as default value since pretty much all the script calls will expect that
2017-04-27 14:55:06 +02:00
ccrs
5fc366d03b Core/CreatureAI: b6b0353bff followup 2017-04-27 14:00:57 +02:00
ariel-
6892404b27 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
2017-04-26 04:20:38 -03:00
ariel-
b6b0353bff Core/AI: prevent launching a new MoveChase if victim didn't change
Thanks ccrs for feedback :P
2017-04-23 21:48:05 -03:00
ariel-
2f99fa09c9 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
2017-03-28 01:52:49 -03:00
xinef1
3c81a9a6d4 Properly clear focused target on evade (#18992)
Closes #18095
2017-01-27 19:42:50 -03:00
tkrokli
6a51a88767 Update Copyright notice for 2017
Happy new year!
2017-01-02 19:52:45 +01:00