50 Commits

Author SHA1 Message Date
Shauren
f58a5fe674 Core/BattlePets: Fix using moved-from variable when adding new pet 2025-08-19 18:05:21 +02:00
Shauren
c215363e86 Core/BattlePets: Refactor BattlePetMgr::SendUpdates to use std::span argument 2025-08-19 18:02:42 +02:00
Shauren
00223f3bee Core/Misc: Add a bunch of examples for 67418a1aee 2025-02-23 12:10:33 +01:00
Shauren
d778d5ec7c Core/Misc: Include cleanup - remove MapUtils.h from Containers.h 2024-12-31 18:12:36 +01:00
Shauren
c4b710446d Core/Realms: Realmlist refactors
* Removed global realm variable from World and use RealmList everywhere
* Match auth build key with client version
* Restored allowedSecurityLevel checks for realmlist packet building
* Restored updating population field, mysteriously removed 15 years ago in f20b25d1c9
2024-08-18 18:59:58 +02:00
Shauren
88fea990ff Core/Players: Use PlayerData::VirtualPlayerRealm instead of global GetVirtualRealmAddress() where possible 2024-08-18 10:58:34 +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
Meji
a1f673d1ca Core/BattlePets: Move BattlePet stuff from SpellMgr to BattlePetMgr (#27986) 2022-06-09 13:58:54 +02:00
Meji
966430dc44 Core/BattlePets: Implemented CMSG_BATTLE_PET_UPDATE_NOTIFY (#27724) 2022-02-13 19:18:18 +01:00
Treeston
54fc62db52 Core/Misc: Convert leftover DatabaseTransactions-by-reference (pass them by value!)
(cherry picked from commit 6b8f3d0f94)
2022-02-05 19:56:31 +01:00
Shauren
596bf2b772 Core/Misc: Replace boost::optional with std::optional part 2 2022-01-23 20:31:52 +01:00
Meji
ddc71206de Core/Spells: Implemented spell effect 225 (SPELL_EFFECT_GRANT_BATTLEPET_LEVEL) (#27506) 2022-01-07 22:14:07 +01:00
Meji
9354b4ac8e Core/Spells: Implemented battle pet experience related spell effects and auras (#27488)
* Spell effect 286 (SPELL_EFFECT_GRANT_BATTLEPET_EXPERIENCE)
* Aura type 420 (SPELL_AURA_MOD_BATTLE_PET_XP_PCT)
2021-12-30 20:38:29 +01:00
Meji
924182f692 Core/BattlePets: Misc fixes (#27446)
* Added script for "Summon Battle Pet" spell (118301).
* Set the saved display of the battle pet when summoning it.
* If a summon has SummonPropertiesFlags::SummonFromBattlePetJournal it will remove NpcFlag UNIT_NPC_FLAG_WILD_BATTLE_PET (Wild battle pets).
* When a creature is summoned with SummonTitle::Companion, it will check to see if it has SummonPropertiesFlags::SummonFromBattlePetJournal before updating the battle pet's update fields. (If you have a summoned battle pet and summon a creature with that SummonTitle, it will incorrectly update the battle pet's update fields with the summoned battle pet's data).
* Implemented SummonPropertiesFlags::UseCreatureLevel. If a summon has this flag, it will use the owner's level (If the summon doesn't have SummonProperties it will always use the selected level).
2021-12-25 15:27:58 +01:00
Meji
c4fee8c5cf Core/Spells: Implemented spell effect 204 (SPELL_EFFECT_CHANGE_BATTLEPET_QUALITY) (#27425) 2021-12-19 13:27:27 +01:00
Shauren
e8b3dda4a0 Core/BattlePets: Wrap battle pet related code in a separate namespace 2021-12-17 14:23:43 +01:00
Meji
446997cdf2 Core/BattlePets: Misc fixes
* The battle pet's experience and level will now be reflected in the player's UpdateFields
* Despawn summoned battle pet when it is caged
2021-12-17 14:23:43 +01:00
Meji
0a8f79ad5a Core/BattlePets: Improvements when enabling battle pets (#27367) 2021-12-10 20:17:21 +01:00
Meji
93c668ac50 Core/BattlePets: Implemented BattlePetSpeciesFlags::NotAccountWide (#27303)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-11-25 20:55:12 +01:00
Shauren
e9e69ed978 Core/BattlePets: Set Allow = false; in SMSG_QUERY_BATTLE_PET_NAME_RESPONSE when name is empty 2021-11-20 20:22:53 +01:00
Meji
8614690e27 Core/BattlePets: Implemented battle pet name query packet (#27294)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-11-20 19:06:14 +01:00
Meji
895367e69f Core/BattlePets: Journal lock improvements (#27178)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-11-19 15:37:21 +01:00
Meji
12cc779ab0 Core/BattlePets: BattlePetError enum class (#27286) 2021-11-19 14:01:22 +01:00
Meji
7c15ec00c7 Core/BattlePets: Fixes when adding pets (#27076)
* Add pet when learning it for the first time (summon spell not known).
* Removed code that adds battle pet if its summon spell is known (Learn cageable pet -> Cage pet -> Log out -> Log in -> Pet is added).
* When uncaging check that the species has a summon spell before trying to learn it.
2021-10-17 00:11:48 +02:00
Shauren
047117fe9f Core/BattlePets: Fix field index in BattlePetMgr::LoadFromDB 2021-10-16 12:21:04 +02:00
Meji
11cc5c0d3b Core/BattlePets: Misc fixes (#27057)
* Rename WorldPackets::BattlePet::BattlePet::CollarID to WorldPackets::BattlePet::BattlePet::DisplayID
* Use the DisplayID field to store the model of the battle pet. If the species has BattlePetSpeciesFlags::RandomDisplay, nothing is stored. Otherwise a random model is chosen from those available
* Stored DisplayID in ITEM_MODIFIER_BATTLE_PET_DISPLAY_ID when caging the battle pet (previously the CreatureID was being stored)
* Modified SendPlaySpellVisual function to allow sending Target and TargetPosition at the same time
* Added SpellVisual when uncaging
2021-10-16 12:15:03 +02:00
Meji
82b3a409db Core/BattlePets: Store declined names (#27025) 2021-10-16 00:48:54 +02:00
Meji
0cfd14d2a0 Core/BattlePets: Misc fixes (#26990)
* Define BattlePetBreedQuality enum class.
* Check the quality of the battle pet species in battle_pet_quality table to avoid invalid values.
* Set CurrentBattlePetBreedQuality and WildBattlePetLevel update fields with the data of the summoned battle pet.
* Added function to calculate the WildBattlePetLevel of wild battle pets according to their spawn zone.
2021-10-03 21:20:45 +02:00
Meji
de4eaa0de9 Core/BattlePets: Misc fixes (#26964)
* Define BattlePetSpeciesFlags enum class.
* Define BattlePetDbFlags enum class.
* Added check to prevent the pet from being caged if its species has flag BattlePetSpeciesFlags::NotTradable.
* Added check to prevent the pet from being caged if it's in battle pet slots.
* Added check to prevent the pet from being caged if its health is below maximum health.
* Only add pet if the species has flag BattlePetSpeciesFlags::WellKnown.
* Added function to check flag BattlePetSpeciesFlags::LegacyAccountUnique to avoid learning copies of unique pets.
* Implemented CMSG_BATTLE_PET_CLEAR_FANFARE.
2021-09-29 22:26:25 +02:00
Meji
0a83f74876 Core/Achievements: Update CriteriaType enum (#26856) 2021-09-08 22:07:01 +02:00
Shauren
d0be92ec0a Core/Achievements: Defined all modifier tree types and implemented many of them 2021-06-07 15:37:34 +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
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
Shauren
7512ffb058 Core/Entities: Update updatefields to 8.0.1.27980 2018-10-10 22:11:41 +02:00
Shauren
007b5a68c5 Core/DataStores: Fixed db2 structures after 7.3.5 2018-03-12 23:11:49 +01:00
Shauren
d9639e8d1f Nopch fix 2 2018-01-02 15:03:12 +01:00
Shauren
379eadcff6 Nopch fix 2018-01-02 14:08:35 +01:00
Shauren
ea6de0b565 Core/BattlePets: Misc fixes
* Fixed caged pet item chat message
* BattlePetMgr optimizations: removed copying data all over the place
* Fixed gaining two pets when learned from item for the first time
* Fixed dismiss button
2018-01-02 14:04:09 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01: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
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren
c75fcbe20b Core/Achievements: AchievementMgr refactoring
* Extracted base CriteriaHandler class that deals with criteria only and will be reused for future scenario implementation
* Fixed players earning guild achievements
2016-05-07 01:16:29 +02:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Carbenium
c0c4ed7135 Misc: Fix some warnings reported by GCC 4.9 2015-11-28 01:02:13 +01:00
StormBytePP
056d7f8e5d Core/Build: Fix nonPCH compile 2015-09-10 16:44:19 +02:00
horn
e8b1faa156 Core/BattlePets: Basics for Battle Pets 2015-09-09 14:52:32 +02:00