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 92a02a5c8750913f596d7e3b58bf8439cb770c28)
2022-01-24 12:00:35 +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
Shauren
b4952db464
Core/Units: Named unit flags linked to CreatureDifficulty flags
2022-01-22 13:21:15 +01:00
jackpoz
ff778a7581
Core/Creature: Add null check for charmed creatures
...
(cherry picked from commit b4adaa838c2e44f4008152cc955410d25ff4d8b0)
2022-01-22 00:50:40 +01:00
Giacomo Pozzoni
07863a7a68
Core/Creature: Allow to disable HP regen in Raids even if the target is unreachable ( #24646 )
...
(cherry picked from commit 247564a7ab7dc6f640bb8f4fd32c30ffdc9076d2)
2022-01-06 16:12:51 +01:00
Shauren
679e9910e0
Core/Auras: Prevent getting negative scale with auras
...
Closes #24040
(cherry picked from commit 50576fa1f5044ca81baf633d84174cef2346acc5)
2022-01-01 22:49:58 +01:00
Ovahlord
f4f56c105f
Core/Vehicles: update the power display of vehicles before being added to world to avoid building unnecessary update_object packets right after spawning them
...
(cherry picked from commit 1610337e67ed3f2fc8bc2ab7b3e3f2bd1b7b1033)
2022-01-01 21:47:30 +01:00
Giacomo Pozzoni
6ec933f281
Core/Logs: Log full guid instead of just low guid
...
(cherry picked from commit 468ecb7252ea4eabd37e11b9ddbbb96ffd26bd7e)
2021-12-31 21:56:40 +01:00
Eridium
924116f046
Core/Movement: Formation Rewrite ( #24379 )
...
* Core/Movement: Formation Rewrite
* Add a missing include
* fixed another warning
* meh
Co-authored-by: Ovahlord <[email protected] >
Co-authored-by: Ovah <[email protected] >
(cherry picked from commit 0e2342c1698d9e2dc8a8c9d559f232cbb83707cb)
2021-12-31 19:28:14 +01:00
Sorikoff
1e93210999
[WIP] Core/AI: Pets musn't attack civilian NPC in aggressive mode ( #24121 )
...
* Core/AI: Pets musn't attack civilian NPC in aggressive mode
* Move decision to ignore civilians to PetAI, keeping the check in GridNotifiers
Co-authored-by: Giacomo Pozzoni <[email protected] >
(cherry picked from commit 5f20715e2f38a6eb721f443df9e13c84ecb11fbb)
2021-12-21 23:06:20 +01:00
ratkosrb
72093e98e1
Core/Creature: Use proper name for wander distance. ( #24133 )
...
* Use proper name for wander distance.
* Rename db field.
* Fix query.
* Remove underscore from chat command.
* Rename the handler too.
* Update chat command description.
* Fix remaining issues.
* Rename 2020_99_99_99_world_335.sql to 2020_02_16_01_world.sql
Co-authored-by: Giacomo Pozzoni <[email protected] >
(cherry picked from commit 6176ce92ea01fd33b11c2e7f8e9ebb509e80c944)
# Conflicts:
# sql/updates/world/master/2020_02_16_01_world.sql
# src/server/database/Database/Implementation/WorldDatabase.cpp
# src/server/game/Entities/Creature/Creature.cpp
# src/server/game/Globals/ObjectMgr.cpp
# src/server/game/Globals/ObjectMgr.h
# src/server/scripts/Commands/cs_npc.cpp
2021-12-21 19:50:12 +01:00
Treeston
94a79bac7a
Core/Misc: Some refactoring, #23603 prep: ( #23676 )
...
- Split SpawnMetadata off from SpawnData
- No longer allocate Creature/Gameobject objects in ObjectGridLoader just to check their typeid and delete them afterwards
Co-authored-by: Giacomo Pozzoni <[email protected] >
(cherry picked from commit 9304e496cbf6ab6c028671fb8526c732ae5d799f)
2021-12-21 15:16:26 +01:00
ForesterDev
9124fd1f1f
Core/Items: implement some helper methods for easier readability ( #24113 )
...
(cherry picked from commit 573ddf4d22564d022e30807c5ba2c6eb1a2c8b2e)
2021-12-21 00:46:13 +01:00
Killyana
a7cf209428
Core/Creature: Clear creature focus after an evade
...
(cherry picked from commit a32aeceb0da5d691eb655e80eb9ea7b32fc44839)
2021-12-19 17:44:00 +01:00
Giacomo Pozzoni
d095d4afe9
Fix fleeing speed to 66% run speed ( #24025 )
...
* Core/Movement: Fix fleeing speed to 66% run speed
Fix fleeing speed to 66% run speed until the creature starts returning home
* Fix build
* Don't check speed type
* Don't apply speed reduction twice
* Fix no-pch (1st try)
* Make sure every spell focus is interrupted when seeking assistance
(cherry picked from commit 4ccf01de3947f50629c20192da3f99cb8c693b35)
2021-12-19 17:39:25 +01:00
jackpoz
18d1f0c964
Core/Creature: Fix another pet assert
...
Fix an assert triggered when dismissing a Warlock pet while it's casting a spell
(cherry picked from commit 4074cb0f01d106c69546c3cb944d6fcf92ade456)
2021-12-18 21:32:51 +01:00
Shauren
8f3904f8fd
Core/Map: Kill zoneId from RespawnInfo, all it did was significantly slow down startup to make one gm command faster
...
(cherry picked from commit 3a4216fd979eb2a7667b0861a770e9af4f242eab)
2021-12-18 20:57:38 +01:00
Treeston
97bf9278a8
Entities/Creature: Fix an edge case assertion failure with pets dying in specific situations while casting spells.
...
(cherry picked from commit 6590a0bfcefe7b8e5f87c82ba5ab4df2c72be418)
2021-12-18 20:31:57 +01:00
Treeston
4b588694ca
Core/Creature: Fix an issue that sometimes prevented spellcast focus targets from being reacquired.
...
(cherry picked from commit fcce90508d899641494d7c281a0e08e411a0d5ab)
2021-12-18 20:29:05 +01:00
ccrs
31bf529667
Core/Creature: 4a219ed codestyle followup, for real this time
...
(cherry picked from commit 30f4aabf64897f11f212ea67a3192206fe97f7b0)
2021-12-18 15:39:58 +01:00
Treeston
51fbda4223
Core/Pooling: Quest pooling rewrite: (PR#23627)
...
- Split quest pooling from PoolMgr (into QuestPoolMgr)
- Proper saving/restoring on server restart
- No more hacking into sObjectMgr to insert/remove available quests
(cherry picked from commit a5e73e41c0e813e674bb0a644e0052052435494e)
2021-12-18 15:28:45 +01:00
Treeston
a90073dadd
no idea what happened there (4a219ed follow-up)
...
(cherry picked from commit b159921099e3d10fbe282d9496b9ffb56f28f16d)
2021-12-18 11:37:33 +01:00
Treeston
14c38a1c52
Core/Unit: Spell focusing now no longer nonsensical. HasSpellFocus always const. Error logs for various stuff.
...
(cherry picked from commit 4a219eda07c353139608065f7d0a016094ee4ce0)
2021-12-18 11:36:50 +01:00
ccrs
44e9572a77
Core/Creature: add a const spell-focus-check method and remove a nasty const_cast from IsMovementPreventedByCasting()
...
closes #23670
maybe #22857 ?
(cherry picked from commit 8e88f4501d8e3b537e96fa56ad7dd25a61dff968)
2021-12-18 00:35:14 +01:00
ccrs
4db13853f7
Core/Unit: rename more things
...
Workaround prework till actual facing system rework arrives
(cherry picked from commit 3a4021be50d37c1c967db1ee73defa509264d5bc)
2021-12-18 00:34:15 +01:00
ccrs
a58881d6da
Core/Unit: rename more methods
...
Workaround prework till actual facing system rework arrives
(cherry picked from commit 85ad0befc51879627f865c86a6b415ca12401fe3)
2021-12-18 00:29:38 +01:00
ccrs
be4ed9152c
Core/Unit: rename IsFocusing method
...
Workaround prework till actual facing system rework arrives
(cherry picked from commit ec9f15a5fff7830bf2aebc517654784a6d54bb74)
2021-12-18 00:25:14 +01:00
Treeston
3db58c4d96
Core/SmartAI: SmartAI creatures no longer process health-based hooks after death.
...
(cherry picked from commit 1faa54fe8b2690507e4177a9a7373c0b24855291)
2021-12-18 00:03:55 +01:00
Treeston
8c3eb07889
Scripts/FollowerAI: Some cleanup:
...
- FollowerAI properly resumes follow after evading.
- Removed duplicated getters from CreatureAI (IsEscorted vs IsEscortNPC), they were used to do the same thing
- FollowerAI properly assists in combat.
- FollowerAI properly despawns if quest is abandoned.
- FollowerAI now supports dynamic respawning for escort NPCs.
(cherry picked from commit 3d4bebd8d9210fbb84f8fc75742e248071192b09)
2021-12-17 23:05:55 +01:00
Treeston
917d9b7621
Scripts/ICC: Prevent Professor Putricide from displaying weird behavior during the Rotface/Festergut encounters as a result of his boss boundary
...
(cherry picked from commit 7fa990edc6cbae05e8b68da58313fd675ac5fa81)
2021-12-17 22:46:06 +01:00
Treeston
6b1ca0ca12
Core/Combat: Properly unset engagement flag on death.
...
(cherry picked from commit 9c603ea87f09c47d52f093ccc73ee75c15eff6f5)
2021-12-17 22:45:55 +01:00
Treeston
c13d83796f
Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged. Fixes #17981 and #23602 for real this time.
...
(cherry picked from commit 0e7c66cb4c7ff7d44e232d0b50703a48605ffd24)
2021-12-17 00:23:33 +01:00
Wyrserth
537b425377
Core/Creature: don't set guardian stats in Creature::UpdateEntry(), because stat calculation from guardians is already done in Guardian::InitStatsForLevel.
...
Closes #281 .
Signed-off-by: Wyrserth <[email protected] >
(cherry picked from commit 5f5d2028df70e82d5cd70837953acd059f2ac7fb)
2021-12-16 21:57:19 +01:00
Treeston
eee950cdd7
Core/Misc: Various dynspawn cleanup and refactors split off from pooling rewrite:
...
- Map::RemoveRespawnTime(SpawnObjectType, LowType, doRespawn) split into Map::Respawn and Map::RemoveRespawnTime, without the extra boolean
- Map::RemoveRespawnTime(RespawnInfo*) merged into Map::DeleteRespawnInfo(RespawnInfo*) and is now private
- Map::DeleteRespawnInfo(void) renamed to Map::UnloadAllRespawnInfos to properly describe what it does
- Map::ProcessRespawns now actually saves the delayed respawn time to DB if the respawn was delayed
- Map::AddRespawnInfo now takes const reference, and returns success as a boolean
- Map::AddRespawnInfo no longer offers an unused "replace" parameter
- Map::DeleteRespawnInfo no longer offers a variety of unused private overloads
- Map::SaveRespawnTime no longer offers a tantalizing writeDB parameter. Parameter is now called "startup" to properly describe what it does.
- Map::SaveRespawnInfoDB now takes RespawnInfo reference instead of all the various fields. Still public because compatibility mode. QQ.
- Map::GetWorldObjectBySpawnId sanitized
- Map::GetXRespawnTime methods sanitized to all go through Map::GetRespawnTime
(cherry picked from commit d60082ae866d77a12a9e6d09dfce27fc1cb5df90)
2021-12-16 01:33:09 +01:00
Treeston
d5e58cef69
Core/Spawns: Exterminate CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY with extreme prejudice. (It didn't work anyway.)
...
(cherry picked from commit 26440857c1a74031ea0a0234ca0b0fcb09b6bcb0)
2021-12-16 01:18:15 +01:00
Treeston
2532de6acb
Entities/Unit: Nuke Map::ForceRespawn from orbit, with the following implications:
...
- .npc respawn no longer causes stupid things to happen (Fixes #23014 )
- ::DeleteFromDB methods on Creature and GameObject rewritten to be as sensible as such a colossally stupid method can ever be. They're static now.
- .npc delete and .gobj delete ported to new argument handling, and rewritten as per above. They can no longer crash the server when used in instances, too. Yay for that.
- Adjusted various dusty cobwebbed hacks around the core (why does waypoint visualization use permanent spawns *shudder*) to still work too.
(cherry picked from commit 84b7b2e08ea55575cbe62d795383d4a5341ffd4d)
2021-12-14 22:42:22 +01:00
Treeston
2225cb1201
Entities/Creature: Some asserts are now LOG_ERRORs that block spawning. Fix a group spawning bug exposed by the CoS merge. Improve some command output.
...
(cherry picked from commit ded18a2690063991d5440df7d3e5d526b884ec16)
2021-12-14 22:24:24 +01:00
Shauren
d249a2a98a
Warning fixes
2021-12-14 22:15:04 +01:00
Ovahlord
3fc20584bc
Core/Creature: Reworked creature aggro radius calculation ( #20615 )
...
* Core/Creatures: rewrote creature aggro radius calculation
* Formulas are taken from WoW Wiki
(cherry picked from commit 980047763a685217e712f58b8713d48523d90ccb)
2021-12-14 21:09:11 +01:00
ForesterDev
104ec7a81a
Core/Unit: Implement more helper methods ( #23555 )
...
(cherry picked from commit c44fb37f74347e3b6d399c941716971503af4cf8)
2021-12-14 20:42:32 +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 5c09ff51f7015b775def8d5cc1f678eaef37200f)
2021-12-13 00:42:20 +01:00
Wyrserth
62f5d9b46b
Core/SAI: do not pass old creatureData to UpdateEntry() and keep current health when changing a NPC's entry. ( #23493 )
...
(cherry picked from commit 8967cc96df4c1c5c7465e9fd1fa66400f3e992b3)
2021-12-13 00:42:17 +01:00
Treeston
f29644efd5
some more cleanup, a5f8c0d follow-up
...
(cherry picked from commit 00728cef1565a78b39541fbaea5923dcfc243743)
2021-12-12 00:33:36 +01:00
Treeston
e3411b4740
Core/Creature: Attach out-of-combat health regen to the Engaged system, not the Combat flag. Closes #21571 .
...
(cherry picked from commit a5f8c0d30ca8793a0d1f97a16ab0e0a9f066dab4)
2021-12-12 00:33:23 +01:00
Treeston
35e55f1089
Core/Entities: Kick engagement logic upstairs to Unit (from ThreatManager), since all Units with AI need it (not just those with threat list). Fixes #17981 .
...
(cherry picked from commit dbe3bbefe734f8824e8f07c302e256f0d446b974)
2021-12-12 00:31:15 +01:00
Wyrserth
3278f87789
Core/Loot: fix some other cases where a creature should not be able to set focus. ( #23415 )
...
(cherry picked from commit d50be8e020c235617cae6d85e214794c164a73c9)
2021-12-11 14:12:54 +01:00
Wyrserth
264373bb65
Core/Creature: prevent dead creatures from setting a focus target, so they won't turn when hit by certain spells. ( #23367 )
...
(cherry picked from commit 0a24a6571b7065d66afe52fc7b0b00f6366272bf)
2021-12-11 13:06:44 +01:00
Aokromes
1d22ade73f
Core/Creature: equipment_id field on creature table is not working correctly, if it's set to 0 the npc still spawn with the equipement. ( #23273 )
...
By Malcrom
Closes #16416
(cherry picked from commit 61ba477c7733e2d69f1bc287f2bff853cbc67d16)
2021-12-05 18:20:36 +01:00
ccrs
c22431936e
Core/Creature: couple refactors/renaming
...
(cherry picked from commit 69c15f5ae769612c89346c6a308655d0987caae7)
2021-12-02 23:45:14 +01:00
Ovah
d5daa2ad49
Core/Objects: use the actual collision height of players and creatures to get more accurate liquid status results ( #23070 )
...
(cherry picked from commit b9e9ccf93c63c3b27d7a6f9eced0beb4e14af40e)
2021-11-26 22:24:07 +01:00