Commit Graph

169 Commits

Author SHA1 Message Date
Shauren
ad4f4bfab7 Core/Misc: Minor game include cleanup 2022-02-13 00:49:10 +01:00
Shauren
950db60435 Core/Pets: Updated pet summoning for latest client version (5 Call Pet spells and stable size 200) 2022-02-02 00:08:37 +01:00
Shauren
ca92686b44 Core/Pets: Pet management refactoring (#25191)
* Core/Pets: Pet management refactoring

* Preload basic pet data on character login with async query
* Load additional pet data (declined names/auras/spells/cooldowns) using async query after we are sure pet loading will succeed
* Remove all select queries related to pet stable/unstable
* Remove all silent pet deletions except explicit UI-triggered abandons
* Fixed displaying stable master content when current pet is not summoned
* Allow to stable/swap unsummoned current pet

Closes #3610
Closes #21266

(cherry picked from commit 5c1fc5e387)
2022-01-31 00:17:21 +01:00
Peter Keresztes Schmidt
ad340466d0 Misc: Use [[fallthrough]] attribute instead of comment to mark intentional fallthroughs (#25054)
Related: #25006
(cherry picked from commit 85b5b842ca)
2022-01-23 22:02:03 +01:00
Shauren
596bf2b772 Core/Misc: Replace boost::optional with std::optional part 2 2022-01-23 20:31:52 +01:00
Giacomo Pozzoni
a9e325f6b7 Core/Logs: Log full guid instead of just low guid, part 2
(cherry picked from commit 3def52c1c4)
2022-01-01 00:51:54 +01:00
Giacomo Pozzoni
6ec933f281 Core/Logs: Log full guid instead of just low guid
(cherry picked from commit 468ecb7252)
2021-12-31 21:56:40 +01:00
NoName
25e68fc5c2 Core/PacketIO: Handle CMSG_REQUEST_PET_INFO for more cases (#24364)
+ vehicle
+ charm
+ possession

from 87c6cc19e5

(cherry picked from commit fbcd244b2f)
2021-12-31 21:56:33 +01:00
NoName
37178ff311 Core/Spells: SPELL_AURA_48 implementation (#24054)
by xvwyh

(cherry picked from commit b3b7f0761d)
2021-12-20 22:30:41 +01:00
Artamedes
00ba5df52b Core/Handlers: Handle CMSG_REQUEST_PET_INFO - this fixes when you /reload and the pet bar disappears (#23762)
(cherry picked from commit 6ebe1afeec)
2021-12-18 21:35:41 +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 4074cb0f01)
2021-12-18 21:32:51 +01:00
Treeston
14c38a1c52 Core/Unit: Spell focusing now no longer nonsensical. HasSpellFocus always const. Error logs for various stuff.
(cherry picked from commit 4a219eda07)
2021-12-18 11:36:50 +01:00
ccrs
be4ed9152c Core/Unit: rename IsFocusing method
Workaround prework till actual facing system rework arrives

(cherry picked from commit ec9f15a5ff)
2021-12-18 00:25:14 +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
ccrs
4765668718 Core/Handlers: apply some movement related corrections
Unit::StopMoving() is evil, and so is MotionMaster::Clear()

the first can really mess up existing movement generators
the second can interrupt "controlled" movements... can do it literally mid-air

(cherry picked from commit c826ec0a3c)
2021-12-05 23:00:39 +01:00
ccrs
a41cac45f4 Core/Handlers: random PetHandler cosmetics & codestyle
(cherry picked from commit 48208b8dde)
2021-12-05 23:00:15 +01:00
ccrs
c511fa2803 Core/Misc: remove incorrect ClearUnitState calls related to movement
these unit states should never be removed outside motionmaster's handlings

(cherry picked from commit 79b90f9d3a)
2021-12-05 18:37:12 +01:00
Gustavo
6aaf9aaf3b Core/Misc: Warning fixes (/W4) (#23149)
* Core/Misc: Warning fixes (/W4)

(cherry picked from commit 50f122de77)
2021-11-26 11:18:15 +01:00
DanVS
0585032c90 Core/Entities: Handle partial state change for pets (#22014)
* handle partial state change

* range-based for loop

* fixes

* readability

* break

(cherry picked from commit ae22fd6d74)
2021-11-15 22:10:18 +01:00
Treeston
a5989dcee9 Core/Unit: Store charmer and charmed pointers on Unit directly, no more map lookups for Unit::GetCharmer and Unit::GetCharmed
(cherry picked from commit d4ef2529e9)
2021-10-23 00:11:44 +02: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
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
Shauren
8a4e1119ac Core/Spells: Unify spell effect access api in both branches 2021-09-04 15:13:15 +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
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
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
Shauren
f759809d9d Core/PacketIO: Use new time utilities in packets instead of plain time_t/uint32 2021-04-06 19:10:28 +02: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
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
f7a7d02a7f Pet/Guardian AI hook re-organizing (#19824)
* Pet/Guardian AI hook re-organizing:
- Adjust OwnerAttacked/OwnerAttackedBy hooks on CreatureAI to fire for all owned units, not just player pets. This should allow guardians to more reliably recognize valid targets.
- Kill off the AttackedBy hook. While it was defined in CreatureAI.h as virtual, it was only ever invoked for player pets in specific situations. This makes it classic developer bait.
  - Adjust PetAI to use DamageTaken instead of AttackedBy.
  - Adjust behavior of AttackStart on PetAI to compensate.

(cherry picked from commit 1660bb7d27)
2020-07-16 21:47:28 +02:00
Shauren
c7306439e7 Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower 2020-06-12 01:29:18 +02:00
Shauren
4d69cc1c56 Core/Misc: GCC build and warning fixes 2020-05-21 22:15:58 +02:00
ccrs
104e745edf Core/Misc: cleanup SetInFront uses
Set in front modifies only the serverside orientation, use with care.
Also check for current focus to prevent things like incorrect damage on casting creatures (ie dragon breath direction change in your face because of some taunt missclick)

(cherry picked from commit 229444b74a)
2020-04-28 17:51:25 +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
d1cbd8a837 Core/Pets: Fixed flashing pet attack button (#18906)
(cherrypicked from 0fa38d0ae0)
2019-06-15 18:41:09 +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
xinef1
0a2876c091 Core/Pets: Fixed exploit where warlock can abandon its pet to generate new name (#18606)
(cherry-picked from 8ce5712552)
2018-12-09 14:18:42 +01:00
Brecky
06520a322b Delete double include #include "PetPackets.h" 2018-03-01 08:19:52 +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
Shauren
a12a34b1dc Core/Game: Include cleanup - removed G3D classes from packets
* Use our own Position class instead, with the coords written to packets being part of type
2017-05-16 22:16:21 +02:00
Aokromes
0ff577853e Core/Logs: Fine tune more logs
And move others to more logical appenders
(cherry picked from commit b65d26b5b4)

# Conflicts:
#	src/server/game/Handlers/PetHandler.cpp
2017-02-11 22:42:34 +01:00
Aokromes
a5f21b4c62 Core/Misc: Coding standard (#17521)
(cherry picked from commit a832865ce2)

# Conflicts:
#	src/server/game/Handlers/PetHandler.cpp
#	src/server/game/Spells/Spell.cpp
2017-02-05 00:00:38 +01:00
joschiwald
0f432edc4b Fixed build
Closes #18816
2017-01-13 18:54:15 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00