194 Commits

Author SHA1 Message Date
Shauren
05eb63c8a2 Scripts/Misc: Update ScriptPCH content to include most commonly headers 2025-05-11 23:34:45 +02:00
Shauren
605e5f94c0 Core/Creatures: Moved autoattack handling from scripts to game 2024-01-08 22:23:12 +01:00
ModoX
0e2f041728 Core/InstanceScript: Refactored door types to reflect its behavior (#29406) 2023-11-06 00:11:42 +01:00
Shauren
2e7e49b749 Scripts/Spells: Removed unneccessary PrepareSpellScript and PrepareAuraScript uses 2023-07-24 10:48:50 +02:00
Teleqraph
88ff97c1f9 Core/Units: Added helper functions to modify UNIT_FLAG_UNINTERACTIBLE (#29159)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2023-07-20 19:09:27 +02:00
ModoX
356c98579b Core/SAI: Drop waypoints table and move existing rows to waypoint_data table (#28834) 2023-04-08 01:33:05 +02:00
Shauren
46e0056196 Scripts/Instances: Add dungeon encounter data 2022-10-04 00:19:38 +02:00
lee
6d805a653b Scripts/Misc: Load gossip options from DB (#27892)
(cherry picked from commit 5a20861565)
2022-06-10 16:13:23 +02:00
Shauren
b47185cabf Core/Misc: Rename AddXXXFlag updatefield functions to SetXXXFlag 2022-03-27 18:14:47 +02:00
offl
979ce40c25 Scripts/Spells: Few fixes to spells with GameObjectActions (#27587)
(cherry picked from commit dca7e51250)
2022-03-25 00:23:41 +01:00
offl
c4906ce60b Core/Misc: Rename UNIT_FLAG_NOT_SELECTABLE to UNIT_FLAG_UNINTERACTIBLE (#26913)
(cherry picked from commit c4741a131a)
2022-03-15 23:03:26 +01:00
Giacomo Pozzoni
71c2f0af46 Core/AI: Add DamageEffectType and SpellInfo parameters to UnitAI::DamageTaken (#26787)
* Core/AI: Add DamageEffectType and SpellInfo parameters to UnitAI::DamageTaken

* Update scripts

(cherry picked from commit 0800ab20a8)
2022-03-12 14:45:04 +01:00
offl
f2777596a0 Scripts/Spells: Add comments with id & name of spells part 1
(cherry picked from commit 80a4b7f1e2)
2022-03-10 22:41:12 +01:00
Shauren
439b027d48 Core/Misc: Cleanup unused includes 2022-02-13 15:07:00 +01:00
Maks Szokalski
bc04acb726 Add "On" to some gossip methods in AI (#25415)
* Add "On" to some methods

* Update npc_innkeeper.cpp

* Update zone_borean_tundra.cpp

(cherry picked from commit 41188eb535)
2022-02-05 22:18:19 +01:00
Shauren
0a1acb9c05 Scripts/Spells: Replace RegisterAuraScript with RegisterSpellScript and remove it
(cherry picked from commit 7d4fbf706a)
2022-02-04 00:27:10 +01:00
Giacomo Pozzoni
61bf51874d Core/Misc: Fix static analysis issues (#25178)
(cherry picked from commit 7cf122fc2a)
2022-01-24 20:21:25 +01:00
Carbenium
b3f2ff97ff Core/CreatureAI: std::chrono-ify DoSummon* methods
(cherry picked from commit 1245833cdd)
2022-01-24 13:11:13 +01: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 1131229ee9)
2022-01-24 11:55:32 +01:00
Peter Keresztes Schmidt
44ea32ace4 Build: Enable -Wimplicit-fallthrough on clang (#25056)
* Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs

Related: #25006

* Misc: Add some missing breaks (no-ops) to satisfy clang

Related: #25006
Closes #25055

* Build: Enable -Wimplicit-fallthrough on clang

Closes #25006
2022-01-23 22:16:15 +01:00
Peter Keresztes Schmidt
8e7c368220 Scripts/Magisters Terrace: Use std::chrono::duration overloads of EventMap (#25038)
Contributes to #25012

(cherry picked from commit 88314660b6)
2022-01-23 16:00:43 +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 418c3b1fd5)
2022-01-06 21:53:27 +01:00
ForesterDev
3171cd3fa9 Core/AI: refactor SpellHit and SpellHitTarget. (#24691)
* Core/AI: refactor SpellHit and SpellHitTarget.

- now caster/target is WorldObject instead of Unit
- remove SpellHitByGameObject / SpellHitTargetGameObject (handled by SpellHit / SpellHitTarget)
- rename parameters in scripts according parent methods

* Restore logic in Algalon script

* Changed check for REMORSELESS_WINTER hit to avoid dublicate call, because it has TARGET_UNIT_CASTER for effects 0/1 and TARGET_GAMEOBJECT_SRC_AREA for effect 2

* Fix build after merge

(cherry picked from commit e3b232fe0e)
2022-01-06 20:46:25 +01:00
Jeremy
15b9183635 Core/ZoneScript: Add "invoker" param to ProcessEvent (#24758) 2021-12-27 13:55:59 +01:00
Shauren
5d02739b98 Scripts: Fix rbac permission for skipping default boss sequencing check
(cherry picked from commit e660c8bc19)
2021-12-20 21:40:47 +01:00
Giacomo Pozzoni
5f545f5402 3.3.5 gameobject summoner (#23289)
* Scripts/Misc: Change IsSummonedBy(Unit*) to IsSummonedBy(WorldObject*)

* Scripts/Misc: Fix build

* Core/TempSummons: Rename GetSummoner() to GetSummonerUnit()

* Core/TempSummons: Add support to TempSummons::GetSummoner() to return GameObject too

* Fix build

* Core/TempSummons: Allow GameObject to be owner of TempSummon

* Core/TempSummons: Add support to SAI for GameObject owner of TempSummon

* Scripts/Misc: Fix no-pch build

* Core/TempSummons: Implement PR comments

(cherry picked from commit 797fba98e9)
2021-12-07 00:02:03 +01:00
Ovah
2dda5fb477 Scripts/MGT: Kael'thas intro can now be skipped when not killing the trash pack in his room
Scripts/MGT: Kael'thas will now despawn at evade

Cherry picked from
f6e9ff5ca4
ed8c1830f5

(cherry picked from commit c10c8c6bba)
2021-11-23 23:17:08 +01:00
Shauren
c14cf5a892 Core/Misc: Added lambda support to EventProcessor
Closes #22909

(cherry picked from commit 813f693768)
2021-11-23 23:01:47 +01:00
Keader
084491669e Scripts/Magister Terrace: Fixed a enum mistake
(cherry picked from commit 33b0654f8e)
2021-11-23 00:40:07 +01:00
Keader
cfd0e18b81 Core/Misc: Fixed shaman elementals and magister terrace first boss access
(cherry picked from commit 6545cd33b9)
2021-11-23 00:39:59 +01:00
Ovah
3027458338 Scripts/Magister Terrace: Update InstanceScript and more fixes
Cherrypicked of https://github.com/Ovahlord/TrinityCore/commits/4.3.4

(cherry picked from commit 1b346485e4)
2021-11-23 00:39:13 +01:00
Ovah
3847d7b277 Scripts/Magister Terrace: Felblood Kaelthas rewrite
Cherrypick of ae440400aa

(cherry picked from commit 00958c9178)
2021-11-23 00:21:42 +01:00
DanVS
28cb2af1c5 Core/Scripts: Unify Chrono Literals (#22420)
* Unify Chrono Literals

* Retire IN_MILLISECONDS

* Build fix

* Build fix (sequel)

* Retire urand()

* Edge cases

* Build

* Whitespaces

* More edge cases

* Additional cases

(cherry picked from commit 5b0f4009df)
2021-11-09 00:26:59 +01:00
Meji
5c287929b2 Core/Gossip: Update GossipOptionIcon enum (#26906) 2021-10-03 16:24:07 +02:00
Keader
9b7f3bff9f Core/Scripts: Fixed tabs issues introduced in 5bef3e426a
(cherry picked from commit 31ad6358fb)
2021-06-19 23:33:24 +02:00
Keader
ad5b0fa9cd Core/Scripts: Fixed possible crashs related with JustDied
(cherry picked from commit 5bef3e426a)
2021-06-19 23:33:24 +02:00
sirikfoll
9573987775 Scripts/Magisters Terrace: Removed not allowed ENSURE_AI call from constructor
Closes #20727

(cherry picked from commit cfaa4e6caf)
2021-06-19 23:33:24 +02:00
ariel-
fccf1a8c62 Core/Auras: removed caster dependency from core
- Decoupled Unit logic: split of spell critical chance into done (caster bonuses) and taken (target bonuses), this allows to precalculate caster bonuses on aura apply and then check victim's auras on damage/healing calc
- Made static a bunch of methods (they no longer have this pointer because they are now called from periodic handlers which may or may not have an active caster in world)
- Simplified all AuraEffect bonuses into AuraEffect::_amount, no more duplicated code
- Critical chance and whether or not caster is player owned unit (for resilience calcs) is now saved one level upper, on Aura itself (it's impossible as of 3.3.5 to have different effects with different critical chances)
- Minor cleanup of SPELL_DAMAGE_CLASS_NONE and Arcane Potency (#18813) crit handling

Closes #19876

(cherry picked from commit cb9e72e521)
2021-06-13 00:59:13 +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 532ab1c7f8)
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 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
Shauren
69e0b9a985 Core/Auras: Update AuraState enum and implement missing new ones 2021-03-16 20:48:42 +01:00
Aokromes
0b3a09b1b4 Misc: Kill trailing white spaces
(cherry picked from commit 5f2c5f2ed3)
2021-02-15 19:13:25 +01:00
jackpoz
852c9e9108 Core/Misc: Fix static analysis issues
(cherry picked from commit a80c95a1c7)
2021-02-06 21:41:51 +01:00
jackpoz
388034498f Core/Misc: Fix static analysis issues
(cherry picked from commit 9b7c73a19d)
2021-02-06 21:41:51 +01:00
Treeston
9f2de698c9 some more cleanup (cbd025f follow-up)
(cherry picked from commit 4f5ec886d0)
2021-01-13 22:04:52 +01:00
Treeston
b31816ff79 Scripts/MagistersTerrace: Fix some crashes in Selin Fireheart. His script is still a shitshow, though. Closes #20614.
(cherry picked from commit cbd025f146)
2021-01-13 22:04:52 +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
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