Commit Graph
161 Commits
Author SHA1 Message Date
Shauren d8a4668c77 Core/Misc: Add missing Containers.h include where neccessary 2023-01-06 16:44:11 +01:00
Shauren 133334a902 Core/Loot: Implemented personal loot and tag sharing for non-boss loot 2022-10-17 23:11:46 +02:00
Shauren 5f1a4cf904 Core/Loot: Set loot dungeon encounter id before generating 2022-10-05 20:04:15 +02:00
Shauren 5a516fb654 Core/Loot: Send DungeonEncounter id in SMSG_ITEM_PUSH_RESULT 2022-10-04 00:19:38 +02:00
Carbenium 310f996b1d Core/WorldObject: Partially std::chrono-ify SummonCreature overloads
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0);
to
TempSummon* SummonCreature(uint32 entry, float x, float y, float z, float o = 0, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime = 0s);

(cherry picked from commit 1131229ee9c43704b11187f0b11c327db92018b6)
2022-01-24 11:55:32 +01:00
Carbenium b8a3ab880f Core/Misc: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit c39eb9b5041950ce3af89f82848bd3e1f3a6e0af)
2022-01-23 23:56:25 +01:00
Carbenium e660b870e9 Core/ScriptedAI: std::chrono-ify DoSpawnCreature
(cherry picked from commit f5076112cb25bff877a450a14fe20172e9044081)
2022-01-23 23:33:04 +01:00
Carbenium da438c73e2 Core/BossAI: Remove _DespawnAtEvade(uint32, Creature*) overload
Use _DespawnAtEvade(Seconds,  Creature*) instead

(cherry picked from commit 27229c10cd6813e69ea6db69384312b1854b2b57)
2022-01-23 23:28:47 +01:00
Peter Keresztes Schmidt c4098897a8 game/AI: Convert SelectAggroTarget to enum class (#24818)
* game/AI: Convert SelectAggroTarget to enum class

* game/AI: Rename SelectAggroTarget to SelectTargetMethod

(cherry picked from commit 418c3b1fd50664aad035bd975a65281e82ba2dea)
2022-01-06 21:53:27 +01:00
Ujp8LfXBJ6wCPR ee5384a15d Modernize codebase with Clang-Tidy range based loops (#24165)
Manual expansion of auto types into "typed types"

(cherry picked from commit a933ba60151f478c7bae23dddbba315a448ffe3e)
2021-12-22 16:42:54 +01:00
Shauren 5d02739b98 Scripts: Fix rbac permission for skipping default boss sequencing check
(cherry picked from commit e660c8bc19198d9e2e912c5243498469f75b0ee6)
2021-12-20 21:40:47 +01:00
Shauren 68a25f5e9b Core/Scripts: Add missing implementation for samePhase argument of ScriptedAI::ForceCombatStopForCreatureEntry 2021-12-19 18:12:12 +01:00
ccrs d967d03151 Core/AI: add another helper for "ScriptedAI::ForceCombatStop"
(cherry picked from commit 3842ab2781e4ca518d98d4f50566e42eeced18bf)
2021-12-19 01:05:59 +01:00
ccrs 50c90728b2 Core/AI: 06443e3 followup
(cherry picked from commit bb9af06cd4ff80f078fcb6ae4871c74a1a174bcc)
2021-12-18 23:13:20 +01:00
ccrs d3ddb3726a Core/AI: 06443e3 followup
cause its not "that" horrible

(cherry picked from commit a71c5f4c7f35b074397abfcc9b925e80720f8c75)
2021-12-18 23:03:00 +01:00
jackpoz 7d78ddcbd5 Core/AI: Add new method to force creatures around to stop combat
(cherry picked from commit 06443e38e761ed8ac7ce803c39bbbc7263983479)
2021-12-18 22:46:24 +01:00
ccrs 844f969ed7 Core/AI: logs, codestyle & cosmetics standarization
(cherry picked from commit fdb71ce19e02b44323fbb9dfa5f07dae2a35f8ba)
2021-12-05 16:48:58 +01:00
ccrs dd11603150 Core/AI: variable naming standarization
plus minimum codestyle changes

(cherry picked from commit 179c7da1fc264b1444aa50632317e16dca02f78b)
2021-12-05 16:17:02 +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 042f5515e4f3e52b0d2e23d9b9e147041849ce12)
2021-10-22 23:47:51 +02:00
Treeston 5d48e8db7d Core/AI: Remove unnecessary parameter from DoZoneInCombat after eb1972f
(cherry picked from commit c00a2efb21356eb4105cb7db9112c708762d9191)
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 994121e671 Core/CreatureAI: CheckBoundary -> IsInBoundary, better reflects what it does. Also moved to public so spellscript can use it.
(cherry picked from commit df639d85e4e82add71432ea0a4cba91f238a30ba)
2021-08-23 23:28:48 +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 532ab1c7f8653d1a2e48aa1f1f8a9ba1041d4bb7)
2021-05-16 21:56:01 +02:00
Treeston bce43de7f3 Core/AI: Some more refactoring prep for #19930. CreatureAI::EnterCombat is now called CreatureAI::JustEngagedWith. There's also two new methods on UnitAI, though they're never invoked right now.
(cherry picked from commit 6113b9dec2e0081c36c36c2974a28ed0693bc601)
2021-04-16 20:22:13 +02:00
Treeston 9b141207d1 [3.3.5] CastSpell unclusterfucking (that's a word now) (#21123)
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 d507a7e3388382960108b24143da48e5f912b4a7)
2021-04-16 15:22:42 +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
r00ty-tc 03b125e6d1 Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object
 - Toggleable spawn groups (with C++/SAI/command options to use them)
 - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone.
 - Backward compatibility mode (set via group and for summons)
   to support creatures/gos that currently don't work well with this
   (this should be removed once the exceptions are fixed)

Fixes and closes #2858
Tags #8661 as fixable.
Fixes and closes #13787
Fixes #15222.

(cherry picked from commit 59db2eeea0a35028779fd76372ae06cc98c8086f)
2020-08-22 12:59:57 +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 e2a1ccd118d129b96e09ff1a15ed0adb1d4a3897)
2020-08-13 22:46:44 +02:00
ariel- 6fa8b8e1d5 Core/Creature: fix _DespawnAtEvade saving wrong respawn time
Closes #19557

(cherry picked from commit 47d387d6b0d123334e4721c55426c1d236297112)
2020-06-14 23:49:04 +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
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
Shauren 738f37d3cf Core/Maps: Replaced spawnmask with difficulty list 2018-09-15 17:55:26 +02:00
Keader e65ddccd1b Core/AI: Added new method for search friendly targets with certain entry and hp pct below a value (#18310)
(cherry picked from commit e7024f8a4c514eb4d8466383f8b5367ad7bab630)
2018-03-11 16:42:26 +01:00
vincent-michael 7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
treeston 10e8b61f90 Fix _DespawnAtEvade for other creatures to actually respawn said other creatures.
Also fix add aggro for Hadronox.
Fixes and closes #18012.

(cherry picked from commit 1ecdea5374f331f0c71e543e713592baa21e6e99)
2017-10-03 17:21:23 +02:00
ariel- 49648b6681 Core/AI: added container independent wrappers for WorldObject::GetxxxInGrid
(cherry picked from commit 271dd0788d1c01adbb741c1d9b3686f80978ddbc)
2017-09-06 13:36:05 +02: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 f2039981e0 Core/Game: Include cleanup, part 3 2017-05-20 00:09:37 +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
Shauren 9299e9bde0 Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50 2017-05-13 19:37:33 +02:00
treeston e941d7e04b Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep.
(cherry picked from commit b3d44d6c366c7e4f12a6ce30ee5cf6b9bff68a06)

Game/Scripting: Follow-up to b3d44d6. Fix script selection for creatures on difficulty > 0.
(cherry picked from commit 91c2b3162d350ab1a09053574ad67f45f089175b)

Build fix.
(cherry picked from commit a9f1151f2ca56394e315d0b07741c240ef59c2ff)

Fine, this time I actually built it. Promise.
(cherry picked from commit 0c2c88ed5025d9b51b6cbdf0603ceaf1ea54c80a)
2017-02-26 15:30:15 +01:00
treeston dd0df772df Scripts/Events: Globally fix all ExecuteEvent loops to check UNIT_STATE_CASTING after each iteration, instead of just checking it once initially.
Fixes and closes #17892.

(cherry picked from commit ac62d7156f93bf86f57dbad1f24f14031322fd5a)

Drycoding is bad, mmkay?
(cherry picked from commit ed83a35fbeeb7f9005fe4792225fb50700791c6f)
2017-02-19 15:09:02 +01:00
treeston 5c01d14056 Entities/Creature: Add arg2 to DespawnOrUnsummon to allow overriding respawn time. This matches changes that will be merged as part of dynamic spawning, allowing scripts to transition early.
(cherry picked from commit 4bcc8078d734ccf166533e504db703ded6968339)
2017-02-18 17:16:10 +01:00
Gustavo accaee579e Core/AI Prevent bosses respawn when BossState is set to DONE (#17616)
(cherry picked from commit f826ecb4b2e8cc1fa54419947dff041a580d9c03)
2017-02-05 21:09:43 +01:00
treeston 86aa3997e4 Allow BossAI::_DespawnAtEvade to work on creatures other than the boss itself (optional argument).
(cherry picked from commit 6040e30fa381efdfc466d635bc6fe150d878e5ed)
2017-01-08 17:31:42 +01:00
treeston 416afdfec5 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.

(cherry picked from commit b7f2c87d37ad20e9fd39c6f0523f6b5edb9d4a66)

Too many damn stars in that damn argument list.
(cherry picked from commit afbda0476700f272c734ecb5b31474dbf66477f7)
2017-01-08 03:01:51 +01:00
treeston 489027703e 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.

(cherry picked from commit 7b1560fccba77ecbdfecd7b33af740aea41b7087)
2017-01-07 21:33:28 +01:00