Commit Graph

212 Commits

Author SHA1 Message Date
Treeston
e4e6e2209c Core/AI: EscortAI init logic moved from JustAppeared to InitializeAI. There are no escort NPCs using compatibility mode anymore, so this is equivalent.
As a result, inheriting scripts calling Start in on-create hooks (like JustSummoned) will now work properly again.

Tagging #20310.
2018-02-12 03:25:05 +01:00
Treeston
3bb33e3108 Core/Map: New Map::ForceRespawn to override objections and force a respawn (equivalent to force = true). Use this to fix various GM commands.
Scripts/Valithria: Fix an issue that could get the encounter stuck in an unloaded state.
2018-01-07 19:53:39 +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
6113b9dec2 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. 2017-12-31 03:23:42 +01:00
Treeston
d507a7e338 [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
2017-12-30 20:28:41 +01:00
ccrs
0db5516a1a Core/AI: reorder methods in ScriptedEscortAI
plus ninja rename
2017-12-11 21:00:04 +01:00
ccrs
ee5cbf28bc Core/AI: add missing checks on AssistPlayerInCombatAgainst 2017-08-12 18:19:18 +02:00
ccrs
7fff83d675 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)
2017-08-12 01:40:25 +02:00
Treeston
184c45cfe0 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.
2017-08-06 16:07:30 +02:00
Aokromes
41721642f7 NoPCH Build fix 2017-07-31 22:56:21 +02:00
r00ty-tc
59db2eeea0 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.
2017-07-31 21:21:04 +02: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
Shauren
d6201e5dbb Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50
(cherry picked from commit 9299e9bde0)
2017-06-19 13:16:13 -03:00
Shauren
abac1b34bc Core/Utilities: Rename RandomResizeList->RandomResize as it is no longer restricted to a list
* Also fix gcc build

(cherry picked from commit f097e341f5)
2017-06-03 02:27:48 -03:00
treeston
302a039b7c Add another helper to ScriptedGossip.h for resolving listId -> action. 2017-05-30 21:50:49 +02:00
ariel-
47d387d6b0 Core/Creature: fix _DespawnAtEvade saving wrong respawn time
Closes #19557
2017-05-27 02:21:06 -03:00
ariel-
4c4dca6d69 Core/Misc: camelize GetFaction/SetFaction properly 2017-04-28 18:37:38 -03:00
xinef1
86da1a19bb 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.
2017-02-04 22:37:16 +01:00
ariel-
2c20b368bc Core/EscortAI: fix invalid iterator dereference 2017-01-24 23:38:21 -03:00
Rushor
a3c6880579 Revert "[3.3.5][master] Core/Movement: Smooth movement #13467 (#18020)" (#18888)
This reverts commit 28050f338d.

Conflicts:
	src/server/game/AI/SmartScripts/SmartAI.cpp
	src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
2017-01-20 14:16:47 +01:00
ccrs
a58505eaf8 cb634e6fba followup
updates #18401
2017-01-06 23:39:16 +01:00
tkrokli
6a51a88767 Update Copyright notice for 2017
Happy new year!
2017-01-02 19:52:45 +01:00
Keader
e7024f8a4c Core/AI: Added new method for search friendly targets with certain entry and hp pct below a value (#18310) 2016-11-27 23:28:06 +01:00
Riztazz
28050f338d [3.3.5][master] Core/Movement: Smooth movement #13467 (#18020)
Implement smooth movement for all waypoint pathing and escortai
2016-11-24 23:31:10 +00:00
SnapperRy
97fd0c1b1a Core/Quest: do not set a quest to failed if it's rewarded or has no status at all (not taken). 2016-10-15 19:08:21 +02:00
treeston
1ecdea5374 Fix _DespawnAtEvade for other creatures to actually respawn said other creatures.
Also fix add aggro for Hadronox.
Fixes and closes #18012.
2016-10-15 18:18:56 +02:00
ariel-
271dd0788d Core/AI: added container independent wrappers for WorldObject::GetxxxInGrid 2016-10-13 22:44:59 -03:00
Treeston
4b990eb7d7 [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
2016-09-26 12:49:32 +02:00
treeston
6d00d3f283 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. 2016-09-20 00:37:36 +02:00
treeston
b3d44d6c36 Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep. 2016-09-09 16:21:27 +02:00
treeston
ac62d7156f 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.
2016-09-03 17:21:22 +02:00
treeston
c0de28b045 Replace a leftover const char* with a std::string const&. 2016-08-31 01:02:54 +02:00
treeston
d55426f5b4 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. 2016-08-31 00:59:04 +02:00
treeston
54f923fdee Fix dynamic build. 2016-08-31 00:11:57 +02:00
treeston
a32536d490 Last one. For real. Please. (Build fix #5). 2016-08-28 20:13:39 +02:00
treeston
8531f012a2 ....right, I actually went through a full rebuild now just to make sure it works. 2016-08-28 20:08:55 +02:00
treeston
61eb70fd82 Build fix. Again. Oops. 2016-08-28 20:05:04 +02:00
treeston
72a7f4b507 You saw nothing (build fix). 2016-08-28 19:52:53 +02:00
treeston
175db157f7 Creature/Gossip: offer replacement functions for the existing preprocessor gossip macros 2016-08-28 19:43:30 +02:00
treeston
4bcc8078d7 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. 2016-08-25 23:04:21 +02:00
Aokromes
b51409a5d3 Core/Logs: Fine tunning some logs 2016-08-05 21:22:12 +02:00
treeston
152b3ad5b9 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.
2016-08-05 12:41:56 +02:00
treeston
4030e4d780 ScriptedAI/Creature: Fix a bug where a std::chrono overload was counting milliseconds instead of seconds. 2016-08-04 15:32:24 +02:00
Gustavo
f826ecb4b2 Core/AI Prevent bosses respawn when BossState is set to DONE (#17616) 2016-07-18 12:35:11 +02:00
treeston
0547926f17 Entities/Creature: Add some more std::chrono overloads 2016-07-08 17:02:34 +02:00
ForesterDev
fb0881398a Core: updated creature type flags enum (#17128)
Core/Misc: Update CreatureTypeFlags enum according to TrinityCoreWiki
2016-05-26 10:56:50 +02:00
treeston
6040e30fa3 Allow BossAI::_DespawnAtEvade to work on creatures other than the boss itself (optional argument). 2016-05-13 22:24:01 +02:00