Commit Graph

91 Commits

Author SHA1 Message Date
Ovahlord
1ab7a9328f Core/Combat: reduce differences between 4.x and 335 2020-07-22 21:37:02 +02:00
Treeston
1d02149384 Core/Combat: Properly unset engagement flag on death.
# Conflicts:
#	src/server/game/AI/CoreAI/GuardAI.cpp
#	src/server/game/Entities/Creature/Creature.cpp
2020-07-22 19:16:35 +02:00
Treeston
58eab458e2 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.
# Conflicts:
#	src/common/Utilities/FuzzyFind.h
2020-07-22 19:15:39 +02:00
Treeston
c7c4f267c4 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. 2020-07-22 19:14:52 +02:00
Treeston
db3282e65a 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.
# Conflicts:
#	src/server/game/AI/CreatureAI.cpp
#	src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
#	src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp
#	src/server/scripts/Kalimdor/zone_desolace.cpp
#	src/server/scripts/Northrend/zone_borean_tundra.cpp
2020-07-22 18:38:35 +02:00
Treeston
607069de36 Core/AI: Remove unnecessary parameter from DoZoneInCombat after eb1972f 2020-07-22 17:38:11 +02:00
Treeston
1d16b98d52 Core/AI: Some cleanup to DoZoneInCombat and Malygos' AI that I found while working out #22226.
# Conflicts:
#	src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
2020-07-22 17:37:49 +02:00
Treeston
0b64a60d5c Game/AI: Remove some unused old logic.
# Conflicts:
#	src/server/game/AI/CreatureAI.cpp
2020-07-22 17:17:18 +02:00
Treeston
4fd7d9aa00 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

# Conflicts:
#	sql/old/4.3.4/world/23_2017_11_15/2018_01_04_00_world.sql
#	src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
2020-07-22 16:50:54 +02:00
Treeston
942c3a77da 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.
2020-07-22 16:49:37 +02:00
treeston
a09db6b4ba 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;

# Conflicts:
#	src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Spells/SpellEffects.cpp
#	src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/boss_tomb_of_seven.cpp
#	src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
#	src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp
#	src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp
#	src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
#	src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
#	src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
#	src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp
#	src/server/scripts/Kalimdor/WailingCaverns/wailing_caverns.cpp
#	src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp
#	src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp
#	src/server/scripts/Kalimdor/zone_tanaris.cpp
#	src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp
#	src/server/scripts/Northrend/Naxxramas/boss_thaddius.cpp
#	src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
#	src/server/scripts/Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
2020-07-22 14:35:53 +02:00
Treeston
ec04d3b2cd [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.
2020-07-22 13:43:23 +02:00
Ovah
b09d6e2330 Core/Movement: reimplement follow movement (#124) 2020-06-26 21:22:21 +02:00
Shauren
cb6ce1302b Core/Misc: Defined new summon properties titles 2020-04-07 18:33:13 +02:00
Ovahlord
0cf82dc50b Core/Movement: added a missing change that was causing companions to not allign to their follow target's speed 2020-03-27 19:10:19 +01:00
Ovahlord
c9961e6a94 Core/Movement: rewrite follow movement 2020-03-27 18:59:16 +01:00
Ovahlord
2a9fc25269 Core/Misc: fixed more no pch errors 2020-03-11 13:42:42 +01:00
Ovahlord
fe5044aac3 Core/AI: summons that are considered as "guides" will no longer follow players on spawn 2020-01-31 07:59:44 +01:00
Ovahlord
eaa635ab32 Core/Movement: backported cleanup for determining follow movement on appearing instead of calling evade modes right away 2020-01-31 07:34:11 +01:00
Aokromes
d6d3f06f06 New year 2020-01-04 18:32:38 +01:00
funjoker
6c56916b29 Misc: Update copyright information
Happy new year
2020-01-01 18:47:28 +01:00
Ovahlord
62d90aa8d9 Core/Misc: removed tabs from last cherrypicks
* it's awesome to not have a proper code editor at hand
2019-12-30 21:48:15 +01:00
Killyana
3b24c65364 Core/AI: reset spell cooldowns uppon entering evade mode 2019-12-30 18:57:39 +01:00
Ovahlord
4ba820d5dc Core/Spells:
* fixed releasing spell focus when a creature enters evade mode while focusing a target
* allow the focus handling to accept self cast spells
* fixed an issue that was prevent channeled spells without a cast time being rejected for focusing
* channeled spells will now always have a focus target
* target less casts will now trigger focusing as well
2019-08-11 13:57:55 +02:00
Ovahlord
148291729f Core/Spells: ported focusing rework and fixed an additional issue that was causing channeled spells getting interrupted when being cast within the focus delay release time 2019-08-10 23:43:15 +02:00
Ovahlord
a13dc7013d Core/Vehicles: Fix accessories disappearing on reset (ported commit: 6dae4a747d) 2019-05-12 01:28:09 +02:00
ariel-
5ff847159c Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources 2018-03-28 04:41:59 -03:00
Aokromes
4bd0525edd Update copyright note for 2018 2018-01-01 01:06:19 +01:00
Aokromes
0bb27ecd4b 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:50:14 +02:00
ccrs
a17849bcfe Core/Unit: 2170541a51 followup
use true as default value since pretty much all the script calls will expect that
2017-04-28 12:57:38 +02:00
ccrs
8b62b4ff03 Core/CreatureAI: b6b0353bff followup 2017-04-28 12:57:06 +02:00
ariel-
e53e8b8437 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 13:08:01 +02:00
ariel-
2e27a1f64e Core/AI: prevent launching a new MoveChase if victim didn't change
Thanks ccrs for feedback :P
2017-04-25 13:30:44 +02:00
Aokromes
e24178406d Core/AI: Remove incorrect call
By Malcrom
2017-04-01 21:05:09 +02:00
ariel-
d3151fed8c 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-04-01 07:06:35 +02:00
xinef1
accc1f32d3 Properly clear focused target on evade (#18992)
Closes #18095
2017-02-01 01:25:51 +01:00
Aokromes
719a317a67 Update copyright note for 2017 2017-01-02 07:26:38 +01:00
treeston
8a402b9f6b Core/Unit: Standardize SetFacingTo and SetFacingToObject behavior while moving. Both now fail while moving unless arg2 bool is true 2016-09-20 20:28:45 +02:00
Aokromes
340b0227bf Core/Logs: Fine tunning some logs 2016-08-07 21:28:07 +02:00
treeston
dbd1d58f9d Creature/CreatureAI:
- Default range for DoZoneInCombat: 50.0f -> 250.0f.
- Add optional second arg to SummonList::DoZoneInCombat to specify range.
- Also a bunch of random NULL -> nullptr cleanup.
2016-07-20 10:39:10 +02:00
Aokromes
6e68a60e6d Core/Unit: Do not remove auras from Pets and Guardians after evading 2016-07-19 16:21:41 +02:00
Aokromes
a71da1c603 Entities/Unit: Finally fix no-path evasion.
- When a creature cannot find a path to its victim, it begins evading all attacks and regenerating health.
- If this persists for 5 seconds, it evades back to spawn position with new EvadeReason value EVADE_REASON_NO_PATH.
- Also some SmartAI cleanup (why oh why does it have so much duplicated code) and getting rid of #defines in favor of type-checked compile-time constants.
2016-07-19 13:33:04 +02:00
Aokromes
41c3193c6b Core: Remove whitespaces 2016-05-16 22:52:36 +02:00
treeston
5671f50933 CreatureAI: Adjust AI behavior when a charm ends. OnCharmed will be invoked on the creature's base (non-charmed) AI, allowing the AI to react to the creature no longer being charmed. 2016-05-12 09:16:31 +02:00
treeston
8e6fb3b1c5 Core/AI: Fully move react state check from CreatureUnitRelocationWorker to CreatureAI::MoveInLineOfSight. This means that AI for passive/defensive creatures can now once again use MoveInLineOfSight (and fixes that weird thing where triggers decided it would be funny to attack players). 2016-02-11 18:36:01 +01:00
treeston
19ed18c881 AI/BossAI: Make creature never chase targets that are out of bounds
- Add missing const attribute on CheckBoundary arg.
- Prevent AI from attacking a target that is out of bounds. This prevents exploids such as killing Gluth/Deathbringer from out of bounds.
2016-02-09 22:46:57 +01:00
treeston
233297c5c8 Merge branch '3.3.5-spellfacing' into 3.3.5-base (PR #15641) 2016-01-13 18:38:54 +01:00
treeston
f481ae1048 Core/Spells: Creature spellcast facing rework:
- Fixes creatures turning just before a spellcast finishes and smacking players with supposedly-unavoidable damage. Fixes and closes #15393, #10803, and probably others.
- Fixes visual effects not lining up with the correct target for spells that have their visual aligned with the caster's orientation (examples: Anub'rekhan Impale, Ingvar's Smash/Dark Smash, etc.). Fixes and closes #2947 and probably a bunch of others, including the aforementioned #15393 and #10803.
- Creatures' displayed target now properly matches the unit they are targeting with spells for a split second (blizzlike). This is necessary to get proper client-side orientation.
2016-01-13 18:35:44 +01:00
treeston
2da458c56d Scripts/Instances: Complete rewrite of the boundary system.
- Migrate boundary logic to Maps/AreaBoundary instead of having it sit in InstanceScript (to possibly allow use for other purposes).
- Implement the first five boundary types in Maps/AreaBoundary.cpp.
- Add boundary checks to Creature's update logic
- Add boundary data for all Northrend raids
- Add boundary initialization structures and methods to InstanceScript
- Modify EnterEvadeMode signature. It now passes a value from the EvadeReason enum as parameter to allow special casing depending on evade reason
- Remove previous (weird) boundary code that had them linked to GO spawns
2016-01-12 22:24:23 +01:00
Rushor
923a368ac7 Update copyright note for 2016 2016-01-01 12:02:33 +01:00