Commit Graph

266 Commits

Author SHA1 Message Date
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 6113b9dec2)
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 d507a7e338)
2021-04-16 15:22:42 +02:00
ccrs
82b7f47d53 Core/AI: reorder methods in ScriptedEscortAI
plus ninja rename

(cherry picked from commit 0db5516a1a)
2021-02-25 18:50:55 +01: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
ccrs
138edeb34e Core/AI: add missing checks on AssistPlayerInCombatAgainst
(cherry picked from commit ee5cbf28bc)
2020-08-23 00:49:53 +02:00
ccrs
97585597f0 Core/Movement: waypoint movement (#20121)
Following the work done in #19361 this is the cleanup and improvement of the related logic of waypoint management.

Ref 28050f3 #18020
(taking the good parts and ignoring the incomplete work)

(cherry picked from commit 7fff83d675)
2020-08-23 00:45:46 +02:00
Treeston
129dd7c909 Core/Scripts: dynamic_spawning follow-up, I had forgotten JustRespawned existed.
- Rename JustRespawned to JustAppeared, which better matches its behavior anyway.
- Properly invoke JustAppeared for new (re-)spawns - fixes #20111.
- Fix Thaddius script to work with dynamic_spawning (mostly unrelated to the above) - Feugen/Stalagg should really be a summon group, but I don't have time to fix that right now.
- Fix default value for DynamicEscortNPC to match worldserver.conf.dist.

(cherry picked from commit 184c45cfe0)
2020-08-22 20:10:42 +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 59db2eeea0)
2020-08-22 12:59:57 +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
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +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
803012cc40 Add another helper to ScriptedGossip.h for resolving listId -> action.
(cherry picked from commit 302a039b7c)
2020-06-14 23:49:04 +02:00
ariel-
6fa8b8e1d5 Core/Creature: fix _DespawnAtEvade saving wrong respawn time
Closes #19557

(cherry picked from commit 47d387d6b0)
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
ariel-
93c19c4194 Core/Misc: camelize GetFaction/SetFaction properly
(cherry picked from commit 4c4dca6d69)
2020-04-29 01:36:41 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Riztazz
2caec4f4d2 Revert "[3.3.5][master] Core/Movement: Smooth movement #13467 (#18020)"
This reverts commit 05fb27dae4.

(cherrypicked from a3c6880579)
2019-08-17 20:04:14 +02:00
xinef1
ad008c43b7 Core/Misc: Fix various crashes, also related to multithreading (#19012)
* When iterating groups we have to either do it not in multithreaded context (map updates) or start with checking maps (they are guaranteed to change in single thread update).
* Properly clear ComboPoint references on player remove
* remove some possible references item may have when it is deleted during save.
* Also clear all hostile references when unit is removed from map.

(cherrypicked from 86da1a19bb)
2019-07-21 21:06:54 +02: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 e7024f8a4c)
2018-03-11 16:42:26 +01:00
Riztazz
05fb27dae4 [3.3.5][master] Core/Movement: Smooth movement #13467 (#18020)
Implement smooth movement for all waypoint pathing and escortai

(cherry picked from commit 28050f338d)
2018-02-11 15:53:32 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
SnapperRy
5c7b821e17 Core/Quest: do not set a quest to failed if it's rewarded or has no status at all (not taken).
(cherry picked from commit 97fd0c1b1a)
2017-10-03 17:22:48 +02: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 1ecdea5374)
2017-10-03 17:21:23 +02:00
ariel-
49648b6681 Core/AI: added container independent wrappers for WorldObject::GetxxxInGrid
(cherry picked from commit 271dd0788d)
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
Shauren
f097e341f5 Core/Utilities: Rename RandomResizeList->RandomResize as it is no longer restricted to a list
* Also fix gcc build
2017-03-23 00:11:58 +01:00
Shauren
4557aa8a1b Build fix 2017-03-21 21:48:56 +01:00
Treeston
f02ff3bd6b [3.3.5] Azjol-Nerub rewrite
* Scripts/AzjolNerub: Complete rewrite.
- Gatewatcher:
  - Trash now actually engages properly one by one
  - Fix trash spell casting
  - Add missing quotes
- Hadronox:
  - Everything. Literally.
- Anub'arak:
  - Fix add spawns
  - Fix impale
  - OK this might as well be "fix everything with every boss". Because that's pretty much what happened.
- General hack cleanup

* Update and rename 9999_99_99_99_AZJOLNERUB.sql to 2016_09_25_01_world.sql

* Update and rename 2016_09_25_01_world.sql to 2016_09_25_02_world.sql

* Rename 2016_09_25_02_world.sql to 2016_09_26_02_world.sql

(cherry picked from commit 4b990eb7d7)

# Conflicts:
#	src/server/game/Spells/SpellMgr.cpp
#	src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h
#	src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp

Update boss_hadronox.cpp
(cherry picked from commit 04ec868768)

Update boss_hadronox.cpp

I hate travis, learn from buildbot
(cherry picked from commit aeb20951bb)

I think I got all of them this time

No idea how this one got past travis.
(cherry picked from commit ae163197a7)

Fix nonPCH.
(cherry picked from commit e121d66fbb)

...for real this time (seriously - what happened to test builds before merging, Aok?)
(cherry picked from commit dbe0789eba)

.....hail PCH
(cherry picked from commit 2528194cc1)

and you get a header, and everyone gets a header...
(cherry picked from commit 5e5fe37a7e)
2017-03-04 00:05:55 +01:00
treeston
59d48ce7e4 Core/Movement: Add new SplineChainMovementGenerator that allows accurate replication of sniffed waypoints in static sequences, along with DB facilities that allow loading of waypoints from DB.
(cherry picked from commit 6d00d3f283)

Merge remote-tracking branch 'Treeston/3.3.5-splinechains' into 3.3.5 (PR #17946)
(cherry picked from commit 20f483967f)

Core/Movement: Add a convenience default ctor to SplineChainResumeInfo, and fix PCH build in some configurations (zzz why do we even keep Appveyor and Travis around).
(cherry picked from commit 4fa646c0b2)

PCH build fix. Again.

(( Alright, you made me waste 20 minutes of my life on a full nonPCH rebuild of the core now. ))
(( I hope you're happy. ))
(cherry picked from commit 4a1a460241)
2017-03-01 22:03:35 +01:00
treeston
e941d7e04b Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep.
(cherry picked from commit b3d44d6c36)

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

Build fix.
(cherry picked from commit a9f1151f2c)

Fine, this time I actually built it. Promise.
(cherry picked from commit 0c2c88ed50)
2017-02-26 15:30:15 +01:00
Shauren
bfe4733195 Build fix 2017-02-21 21:05:37 +01:00
Shauren
3fce636c19 Revert "Fix non-PCH build." and fix it the proper way
This reverts commit 438d090c8d.
2017-02-20 17:39:31 +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 ac62d7156f)

Drycoding is bad, mmkay?
(cherry picked from commit ed83a35fbe)
2017-02-19 15:09:02 +01:00
Gacko
438d090c8d Fix non-PCH build.
What else?
2017-02-19 14:36:21 +01:00
treeston
52f400226e Replace a leftover const char* with a std::string const&.
(cherry picked from commit c0de28b045)
2017-02-18 17:54:11 +01:00
treeston
bbbf8df8e5 Entities/Gossip: The Big One™ that gets rid of all uses of The Bad™ and The Ugly™, e.g. gossip preprocessor macros, and replaces them with the new-and-shiny gossip functions.
(cherry picked from commit d55426f5b4)
2017-02-18 17:50:00 +01:00
treeston
f94dc007ae Fix dynamic build.
(cherry picked from commit 54f923fdee)
2017-02-18 17:30:23 +01:00
treeston
a0d48b92d5 Creature/Gossip: offer replacement functions for the existing preprocessor gossip macros
(cherry picked from commit 175db157f7)

You saw nothing (build fix).
(cherry picked from commit 72a7f4b507)

Build fix. Again. Oops.
(cherry picked from commit 61eb70fd82)

....right, I actually went through a full rebuild now just to make sure it works.
(cherry picked from commit 8531f012a2)

Last one. For real. Please. (Build fix #5).
(cherry picked from commit a32536d490)
2017-02-18 17:22:53 +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 4bcc8078d7)
2017-02-18 17:16:10 +01:00
Aokromes
db668cde46 Core/Logs: Fine tunning some logs
(cherry picked from commit b51409a5d3)

# Conflicts:
#	src/server/game/Texts/CreatureTextMgr.cpp
2017-02-11 22:35:00 +01:00
treeston
8d7ab10efa Scripts/SmartAI: Some clean-up work:
- NULL -> nullptr
- Rename "AssistPlayerInCombat(who)" to "AssistPlayerInCombatAgainst(who)" to reflect what the method actually does
- Code style

No functionality was changed.

(cherry picked from commit 152b3ad5b9)

# Conflicts:
#	src/server/game/AI/SmartScripts/SmartAI.cpp
#	src/server/game/AI/SmartScripts/SmartScript.cpp
2017-02-11 22:34:59 +01:00
treeston
d176be59b8 ScriptedAI/Creature: Fix a bug where a std::chrono overload was counting milliseconds instead of seconds.
(cherry picked from commit 4030e4d780)
2017-02-11 22:03:16 +01:00
Gustavo
accaee579e Core/AI Prevent bosses respawn when BossState is set to DONE (#17616)
(cherry picked from commit f826ecb4b2)
2017-02-05 21:09:43 +01:00