233 Commits

Author SHA1 Message Date
Shauren
fbbcc31670 Core/Misc: Simplify LinkedListHead::isEmpty and rename to empty to fit standard container naming 2025-07-11 17:47:14 +02:00
Shauren
0f5d634e38 Scripts: Remove unneccessary DoublePosition from AreaBoundary 2025-02-07 12:47:39 +01: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
Shauren
622eed752b Scripts/Spells: Converted remaining spell scripts to use ValidateSpellEffect 2023-06-03 23:17:28 +02:00
Meji
81ea6f54d9 Core/Creatures: Compute CombatReach and BoundingRadius using DisplayScale (#28863) 2023-03-30 18:54:27 +02:00
Shauren
3df16c12b7 Core/Scripts: Move EvadeReason outside of CreatureAI class 2023-01-19 21:23:06 +01:00
Shauren
46e0056196 Scripts/Instances: Add dungeon encounter data 2022-10-04 00:19:38 +02:00
Shauren
4fd29adc59 Dynamic build fix
(cherry picked from commit 63275e7316)
2022-09-30 20:24:32 +02:00
Shauren
57c56a3ae7 DB/The Sunwell: Migrate linked_respawn to spawn groups
* Also fixed Felmyst not spawning after server reset if Brutallus was killed

Closes #27904

(cherry picked from commit 46560070ae)
2022-09-30 20:23:41 +02:00
Shauren
88060425b5 Scripts/The Sunwell: Move Brutallus and Felmyst to BossAI
(cherry picked from commit 8962d80224)
2022-09-30 20:17:34 +02:00
offl
6fb332d935 Scripts/Spells: Get rid of several DB spell scripts (#28048)
(cherry picked from commit 3808e614d9)
2022-09-05 19:26:59 +02:00
Shauren
b47185cabf Core/Misc: Rename AddXXXFlag updatefield functions to SetXXXFlag 2022-03-27 18:14:47 +02:00
offl
83b4c8cd37 Scripts/Spells: Small cleanup for gen/item spell scripts (#27311)
(cherry picked from commit ef4c878d26)
2022-03-23 00:06:37 +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
ca472c1871 Scripts/SWP: Update M'uru to new register model (#26793)
(cherry picked from commit ec3b571eca)
2022-03-12 14:36:20 +01:00
offl
012444ba80 Scripts/Spells: Add comments with id & name of spells part 4
(cherry picked from commit e7e4786606)
2022-03-10 23:53:31 +01:00
offl
0408693646 Scripts/Spells: Add comments with id & name of spells part 3
(cherry picked from commit 03c727326d)
2022-03-10 23:52:03 +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
offl
ca76786faf Core/Scripts: Move some speed values & UNIT_FLAG_NOT_SELECTABLE to DB
(cherry picked from commit 3cb70ee62a)
2022-03-06 20:01:06 +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
Carbenium
3bba8d50b1 Core/WorldObject: Remove non-std::chrono SummonCreature overload
Remove
TempSummon* SummonCreature(uint32 entry, Position const& pos, TempSummonType despawnType = TEMPSUMMON_MANUAL_DESPAWN, uint32 despawnTime = 0, uint32 vehId = 0, uint32 spellId = 0);

(cherry picked from commit a41f599be7)
2022-01-24 12:39:59 +01:00
Carbenium
eeffb310de Core/EventProcessor: std::chrono-ify CalculateTime
uint64 CalculateTime(uint64 t_offset) has been replaced with Milliseconds CalculateTime(Milliseconds t_offset).
Also add the std::chrono-ified overload void AddEvent(BasicEvent*, Milliseconds, bool)

(cherry picked from commit 92a02a5c87)
2022-01-24 12:00:35 +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
Carbenium
58e1c091a2 Scripts/EasternKingdoms: Use std::chrono overload of Creature::DespawnOrUnsummon
(cherry picked from commit d1a39a2ebf)
2022-01-23 23:53:20 +01:00
Carbenium
e660b870e9 Core/ScriptedAI: std::chrono-ify DoSpawnCreature
(cherry picked from commit f5076112cb)
2022-01-23 23:33:04 +01:00
Peter Keresztes Schmidt
111521d3c9 Scripts/EasternKingdoms: Use std::chrono::duration overloads of EventMap (#25019)
Contributes to #25012

(cherry picked from commit 5ef576d223)
2022-01-23 15:41:30 +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
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
7c97fa4449 Scripts/Misc: Fix build warnings
(cherry picked from commit 37ffdc05b2)
2021-12-19 23:31:30 +01:00
Killyana
71e474e14f DB/Spawns: Remove "Hand of the Deceiver" spawns as summoned by a script
(cherry picked from commit 434cdb1fa0)
2021-12-19 23:27:12 +01:00
ForesterDev
529ca2dd5d Scripts/Defines: cleanup some magic numbers in factions (#23631)
(cherry picked from commit 0c317498a5)
2021-12-17 20:48:31 +01:00
ccrs
4e6c59dca7 Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
        uint8 GetLevelForTarget(WorldObject const* /*target*/)
        void SetLevel(uint8 lvl)
        uint8 GetRace()
        uint32 GetRaceMask()
        uint8 GetClass()
        uint32 GetClassMask()
        uint8 GetGender()

(cherry picked from commit 5c09ff51f7)
2021-12-13 00:42:20 +01:00
ccrs
70fd6e7398 Core/Instances: improve DoRemoveAurasDueToSpellOnPlayers & DoCastSpellOnPlayers handling
(cherry picked from commit 22b3b21ae3)
2021-12-13 00:42:18 +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
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
ccrs
426f9f2f92 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).

(cherry picked from commit 982643cd96)
2021-09-28 00:15:13 +02:00
Treeston
bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2)
2021-09-23 22:21:29 +02:00
Shauren
8a4e1119ac Core/Spells: Unify spell effect access api in both branches 2021-09-04 15:13:15 +02:00
Wyreth
8713a62328 Core/Entities: remove grid-wide visibility from setActive and implement another method for it (#20725)
(cherry picked from commit 56874b44f0)
2021-08-08 21:21:34 +02:00
sirikfoll
e2c72cc02e Scripts/Sunwell Plateau: Fixed and improved spell "Curse of Boundless Agony" target selection (Boss Kalecgos)
(cherry picked from commit 14b6e3bbb3)
2021-06-19 23:33:24 +02:00
ariel-
62c571076e Core/Scripts: added nullptr checks to DamageTaken hooks
Since cb9e72e521 attacker may not be in world when hook is called

(cherry picked from commit 0db5c2df3f)
2021-06-16 12:02:14 +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
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