181 Commits

Author SHA1 Message Date
Meji
c575b397c5 Core/GameEvents: Added holiday/event world state field (#31284)
Closes #30622
2025-09-23 15:48:58 +02:00
Shauren
3b8f64831a Core/Events: Replace remaining packed time calculations with WowTime class 2025-09-08 00:23:01 +02:00
Shauren
5de252ae84 Core/Misc: Move large functions out of header files 2025-07-13 13:40:31 +02:00
Shauren
7cafeb46b3 Core/Creatures: Don't require creature.modelid to be one of linked creature_template models 2023-11-26 00:20:13 +01:00
Jeremy
0ede6c1556 Core/Battlegrounds: Rework queues (#29200)
* No more copies of Battleground classes
* FreesSlotQueues now have as key the MapId instead of queue id
* Random queues can now popup already busy specific battelgrounds (queues are NOT merged)
* Removed Holiday handling, this should already be handled in BattlegroundMgr::IsBGWeekend
2023-08-26 14:03:42 +02:00
Meji
81ea6f54d9 Core/Creatures: Compute CombatReach and BoundingRadius using DisplayScale (#28863) 2023-03-30 18:54:27 +02:00
Shauren
d791afae1d Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) 2023-01-08 21:16:53 +01:00
Shauren
fbe0b8efeb Core/Maps: Removed MapInstanced - no longer neccessary for grid data reference counting (moved to TerrainInfo) 2022-07-24 18:56:40 +02:00
Shauren
020166649d Core/WorldStates: Migrate battleground HolidayWorldState to new system 2022-07-11 16:15:07 +02:00
Shauren
49ad0d2d49 Core/Quests: Reset seasonal quests based on saved completion time and intended holiday start time 2022-07-03 23:44:48 +02:00
Shauren
306022054b Revert "Core/Event: prevent seasonal quests from resetting at server restart (#17455)"
This reverts commit 6a8ca9b0bf.
2022-07-03 22:22:45 +02:00
Shauren
94d829c84f Core/Pools: Implemented pooling for instances 2022-06-11 14:04:56 +02:00
Shauren
6ca0f99ccf Core/GameEventMgr: Spawn creatures and gameobjects in all active instances when event starts 2022-06-09 23:03:42 +02:00
Shauren
4eba978670 Core/Misc: Rename SetXXXFlags updatefield functions to ReplaceAllXXXFlags 2022-03-26 18:59:44 +01:00
Treeston
9f97fdd31a Core/Common: Tokenizer -> Trinity::Tokenize (PR: #25327)
(cherry picked from commit 534a2388b7)
2022-02-04 00:27:14 +01:00
Ovahlord
7a5529eb58 Core/Events: refactored battleground holiday assignments.
Instead of going with shitty bitmasks we now accept plain battleground ids
 instead

(cherry picked from commit 8a82403400)
2022-01-21 22:09:06 +01:00
jackpoz
7eff81f9db Core/Pools: Fix crash on startup
(cherry picked from commit 9cde3ffd14)
2022-01-01 14:34:20 +01:00
Matan Shukry
8fabe5a3aa Core/Phasing: Implemented db spawns in personal phases (#26345)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-12-28 13:24:10 +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 <giacomopoz@gmail.com>
(cherry picked from commit 9304e496cb)
2021-12-21 15:16:26 +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 a5e73e41c0)
2021-12-18 15:28:45 +01:00
jackpoz
dad86f5bce Core/GameEvent: Fix OnGameEvent() hook not being called on Creature/GameObject spawned by the event itself
Hook broken since it was added in 1b2c413933

(cherry picked from commit d9ae19d974)
2021-12-17 22:48:01 +01:00
Giacomo Pozzoni
4e7727d575 3.3.5 game event respawn (#23391)
* Core/GameEvent: Remove respawn times of Creature and GameObjects when starting/stopping an event

* Add checks for pool

* Remove the check for pools

(cherry picked from commit 678f3dd687)
2021-12-11 13:06:13 +01:00
r00ty-tc
4c996bdf8b Core/GameEventMgr: Log error if loading GO/Creature into event that is part of pool - Only warn, still load the GO/Creature - These should be added to game_event_pool by pool ID instead
(cherry picked from commit 8bb88657f8)
2021-11-26 22:06:18 +01:00
Treeston
e4e8c1c59c Core/AI: Clean up charm AI handling, we now have two unique_ptr instead of a crapton of booleans
(cherry picked from commit 042f5515e4)
2021-10-22 23:47:51 +02:00
ariel-
5714e89ccf Core/Events: update holiday code and remove misleading log (event date is the one from game_event)
- add siign to DBC struct member CalendarFilterType as it was being used as such
- kill localtime usage as it's deprecated

Closes #18542

(cherry picked from commit 5b4287e683)
2021-06-22 13:19:03 +02:00
jackpoz
e17e4e6f07 Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
(cherry picked from commit 12701cb0c6)

 Conflicts:
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
	src/server/game/Battlefield/Battlefield.cpp
	src/server/game/Battlefield/Zones/BattlefieldWG.cpp
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Calendar/CalendarMgr.h
	src/server/game/DungeonFinding/LFGQueue.cpp
	src/server/game/Entities/Corpse/Corpse.cpp
	src/server/game/Entities/Creature/Creature.cpp
	src/server/game/Entities/Item/Item.cpp
	src/server/game/Entities/Pet/Pet.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Grids/ObjectGridLoader.cpp
	src/server/game/Guilds/Guild.cpp
	src/server/game/Handlers/AuctionHouseHandler.cpp
	src/server/game/Handlers/BattlefieldHandler.cpp
	src/server/game/Handlers/CalendarHandler.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Handlers/ChatHandler.cpp
	src/server/game/Handlers/LFGHandler.cpp
	src/server/game/Handlers/MailHandler.cpp
	src/server/game/Handlers/MiscHandler.cpp
	src/server/game/Handlers/MovementHandler.cpp
	src/server/game/Handlers/PetHandler.cpp
	src/server/game/Handlers/QueryHandler.cpp
	src/server/game/Handlers/TicketHandler.cpp
	src/server/game/Instances/InstanceSaveMgr.cpp
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Spells/Auras/SpellAuras.cpp
	src/server/game/Tickets/TicketMgr.cpp
	src/server/game/Tickets/TicketMgr.h
	src/server/game/World/World.cpp
	src/server/scripts/Commands/cs_gobject.cpp
	src/server/scripts/Commands/cs_instance.cpp
	src/server/scripts/Commands/cs_list.cpp
	src/server/scripts/Northrend/zone_wintergrasp.cpp
	src/server/scripts/Spells/spell_item.cpp
2021-04-15 05:53:27 +02:00
ariel-
f97e4ad1f4 Core/Globals: validate creature_template mingold and maxgold fields
(cherry picked from commit 5798fda0a0)
2021-04-15 05:53:27 +02:00
Shauren
d29dd1eeb5 Core/Misc: Change all unix time columns in character database to bigint (signed) 2021-04-05 23:47:05 +02:00
ariel-
88ae43fa51 Core/Misc: minor typo and codestyle fixes
- Replace NULL uses in new code with nullptr
- Fix wrong (accumulated) load time log when loading calendar invites
- Make Creature::CanRegenerateHealth const as its just a getter
- Mark OnlyOnceAreaTriggerScript::OnTrigger as final in case someone wants to override that (you are supposed to use protected _OnTrigger hook)

(cherry picked from commit 78a1c687a2)
2021-03-15 20:17:31 +01:00
jackpoz
a01d397c3d Core/Misc: Fix static analysis issues
Fix static analysis issues reported by 3rd party tools

(cherry picked from commit 24e82fe83d)
2021-02-25 18:50:55 +01:00
jackpoz
668a3ad643 Core/Misc: Fix static analysis issues
Fix coverity id 1382860

(cherry picked from commit 19e99478a7)
2021-02-25 18:50:55 +01:00
Aokromes
93552510ab Core/Logs: Fix more logs
the others have exit,so they continue to be error because they are critical

(cherry picked from commit b68484cfb0)
2021-01-21 22:30:40 +01:00
Gerhood
4024df122a Calendar/GameEvents: Store + send holiday data (#20117)
Close: #16845
(cherry picked from commit 951fa46fe9)
2021-01-21 22:30:40 +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
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
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Shauren
4c173e4b7b Core/Maps: Use FindMap instead of CreateBaseMap in places where the intent was to check for a existing map (and a loaded grid on that map) 2020-07-18 00:57:16 +02:00
ariel-
6604849716 Core/Scripts: unified scripted gossip/quest api
- Changed self-accessor on GameObjectAI to "me", like UnitAI
- Moved all related functions to AI, now Unit and GameObject have the same function names with identical behaviour
- Remove "OnUpdate" from CreatureScript/GameObjectScript, was never used and we already have AI Update method
- Quest methods no longer return a bool, the return value was used to call the AI version if the ScriptMgr one returned false
- Implemented GameObjectAI::Destroyed hook (was never called), implemented Damaged method
- Rename OnStateChanged to OnLootStateChanged to reflect when it's really called, and created a new hook OnStateChanged that only gets called on GOState change
- Since the functions are now only getting called from AI, made GetAI methods full virtual. (CanSpawn method is anyways going to be used on creatures with AI)

(cherry picked from commit f913f3bb89)
2020-05-03 03:04:32 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
f6e2b8cdc1 Core/DBLayer: Prevent committing transactions started on a different database 2019-07-27 10:52:33 +02:00
Shauren
e8e89f58fb Core/DBLayer: Prevent using prepared statements on wrong database 2019-07-27 01:00:37 +02:00
xinef1
b485f3e673 Few small optimizations here and there (#18684)
Changes list:
- Added CharacterGuidByNameContainer which contains name -> guid unordered map (updated along CharacterInfo)
- Extended CharacterInfo structure with GuildId
- Extended CharacterInfo structure with ArenaTeamId[3], for all possible teams (2v2, 3v3, 5v5)
- Removed CHAR_SEL_GUID_BY_NAME and CHAR_SEL_CHAR_GUID_BY_NAME synchronous queries, name -> guid can be now retrieved in World::GetCharacterGuidByName
- Removed CHAR_SEL_GUID_RACE_ACC_BY_NAME synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_CHAR_LEVEL synchronous query, level can be retrieved by guid
- Changed CHAR_SEL_CHARACTER_ACTIONS_SPEC to asynchronous query, action bars are now loaded asynchronously
- Removed CHAR_SEL_CHARACTER_NAME_CLASS synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_PLAYER_ARENA_TEAMS and CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID synchronous queries, arena teams are now stored in CharacterInfo
- Replaced synchronous db calls with CharacterInfo lookups
- Removed ObjectMgr::GetPlayerGUIDByName, as it used db query
- Replaced some unnecessary UpdateObjectVisibility() calls because they were either duplicated (called few lines above in other function) or it is enough to call DestroyForNearbyPlayers because object is being removed or should be invisible and DestroyForNearbyPlayers is faster
- Corrected typo in Player::DestroyForPlayer, only items in slots 0 to EQUIPMENT_SLOT_END are sent to other players
- Renamed Player::GetGuildIdFromDB to Player::GetGuildIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetArenaTeamIdFromDB to Player::GetArenaTeamIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetLevelFromDB to Player::GetLevelFromCharacterInfo and changed the function to use CharacterInfo structure
- Removed GameEventMgr::_questToEventLinks and associated functions, eventId is now stored in Quest class under _eventIdForQuest variable
- Changed some functions checking quest status to use other functions for quest status check instead of duplicating code
- Removed callback from add friend, because we can get the guid from appropriate storage, no need to make db query
- Removed callback from add ignore, because we can get the guid from appropriate storage, no need to make db query
- Added callback to unwrap wrapped items asynchronously
- Removed synchronous select in tutorials to check if we have any entries in db, if any entry exists in db, m_TutorialsChanged variable will have TUTORIALS_FLAG_LOADED_FROM_DB flag added and it is no longer necessary to query database

(cherrypicked from b955456008)
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
joschiwald
6226189a16 Core/Entities: Created factory methods to create new areatriggers, creatures and gameobjects 2018-01-27 23:02:46 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Roc13x
a6d1b34472 Core/Creature: Refactor and improve vendor items (#20328)
* Implement item bonuses in vendors.
* Implement the PlayerConditionID and IgnoreFiltering DB columns.
* Fix loading referenced vendor items
* Allow adding bonuses in .npc add item command
2017-10-09 21:03:25 +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
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
SnapperRy
6a8ca9b0bf Core/Event: prevent seasonal quests from resetting at server restart (#17455)
Closes #16015.
Closes #16413.
(cherry picked from commit fb6d4dd98f)
2017-02-18 14:47:00 +01:00