Commit Graph

154 Commits

Author SHA1 Message Date
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
Shauren
ac1dc758b9 Core/Units: Cleanup hardcoded magic numbers for byte field offsets 2016-12-13 20:58:22 +01:00
Shauren
d2733eb6f1 Merge branch '6.x' of https://github.com/TrinityCore/TrinityCore into legion 2016-06-13 21:00:25 +02:00
Shauren
8396dabdad Core/Misc: Fixed coverity issues
Uninitialized fields: CID 1354593, 1354595, 1354738
Unchecked return value: CID 1354558
Out of bounds access: CID 1352989, 1352993
Null pointer dereference: CID 1296286
2016-06-06 09:16:59 +02:00
Shauren
6b1c85a676 Core/PacketIO: Updated spell packets 2016-06-05 14:08:53 +02:00
Warpten
12f029d442 Core/PacketIO: Implemented new Cast HighGuid type and fix some mistakes with SMSG_MOVE_UPDATE_APPLY_MOVEMENT_FORCE
Core/Updatefields: Health is now stored as an unsigned long int.
2016-06-03 09:27:27 +02:00
myran2
bc1a81747a Core/Pets: Implemented pet specializations (#17058)
* Use prepared statements in Pet::SavePetToDB
* Add support for resetting all of a player's pet specializations
* Send one big spell unlearn/learn packet instead of lots of small ones
* Implemented Adaptation talent
2016-05-26 17:20:01 +02:00
DDuarte
67b977c86a Merge branch 'pets' of https://github.com/myran2/TrinityCore into myran2-pets
# Conflicts:
#	src/server/game/Handlers/PetHandler.cpp
#	src/server/game/Handlers/SpellHandler.cpp
#	src/server/game/Server/Packets/PetPackets.cpp
#	src/server/game/Server/Packets/PetPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/WorldSession.h
2016-03-02 01:38:39 +00:00
Carbenium
46addc21cd Core/PacketIO: Updated and enabled CMSG_REQUEST_PVP_REWARDS 2016-02-02 18:30:34 +01:00
Carbenium
fd162fb604 Core/PacketIO: Add CMSG_REQUEST_PET_INFO packet class for further usage 2016-02-02 18:04:36 +01:00
Carbenium
1f8268c89c Core/PacketIO: Updated and enabled CMSG_PET_SPELL_AUTOCAST 2016-02-02 16:38:36 +01:00
Carbenium
dea718e4ed Core/PacketIO: Updated and enabled CMSG_PET_STOP_ATTACK 2016-02-02 01:56:51 +01:00
Carbenium
0b76381283 Core/PacketIO: Updated and enabled CMSG_PET_ABANDON 2016-02-02 01:18:27 +01:00
Carbenium
6fbfc61de1 Core/PacketIO: Updated and enabled CMSG_DISMISS_CRITTER 2016-02-01 20:14:10 +01: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
jackpoz
4700b24263 Core/Misc: Remove unneeded ToCreature() casts
Remove some ToCreature() casts not needed anymore after 1ee90e1022 changes that moved IsPet(), IsTotem(), IsSummon(), IsGuardian(), IsHunterPet() and IsVehicle() from Creature to Unit

(cherry picked from commit ea4d9c0d9e)

Conflicts:
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/scripts/Spells/spell_pet.cpp
2015-09-24 22:06:05 +02:00