Commit Graph
528 Commits
Author SHA1 Message Date
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
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 2fea2a1e81 Core/GameObject: do not allow consumable chests to restock while partially looted.
(cherry picked from commit cd73664f53db3daad6c7e17edbcd0212ab383c0d)
2021-12-13 00:42:18 +01:00
Wyrserth f136d3cfe0 Core/GameObject: fix some cases where summoned gameobjects of a type different than chest or goober would behave wrongly.
(cherry picked from commit 9f0ac0c24376ec70b8227a8fb0a1e0e686cb3256)
2021-12-13 00:42:18 +01:00
Wyrserth c637260a37 Core/GameObject: implement restock mechanic for non-consumable gameobjects (#23526)
(cherry picked from commit e77c2d55c40bc9d4a15de471de754376f4ec1c49)
2021-12-13 00:42:17 +01:00
Wyrserth 7c7bb95da5 Core/GameObject: restore old behavior for non-consumable chests with restock timer (make them despawn).
(cherry picked from commit 50c5d30d13fe12af2a2028baf845fb6eab329a57)
2021-12-13 00:42:17 +01:00
Wyrserth 836a1bc622 Core/GameObject: don't allow non-consumable goobers to despawn on use (#23469)
Closes #15730.

(cherry picked from commit 2b1e8d135bd3f3a3ddf7f29471cf6116da223175)
2021-12-13 00:42:17 +01:00
Wyrserth 9d865f7536 Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura (#23319)
* Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura.

* Forgot to change this in last-second rename.

* Apply suggested changes, thanks Shauren!

(cherry picked from commit 8bc5451864570c07eff6d427846335044f85a509)
2021-12-09 00:13:59 +01:00
Ovah 09fe78dd59 Core/GameObjects: goober gameobjects may reset only if they have a lock id or a reset time specified (#23298)
* Core/GameObjects: goober gameobjects may reset only if they have a lock id

Tests have shown that Goobers without a lock id (Data0=0) are not allowed to reset their go state such as the teleporters in Ulduar and Icecrown Citadel. The tests has been expanded by checking 4.x goobers as well and the perfect example that confirms that result is the Ancient Bell for Atramedes' intro which also is not suposed to reset after using it.

* Core/GameObjects: allow to reset goobers without a lock id if a reset time is defined

* fixed a typo

(cherry picked from commit a70845c93de0902c4c6fa55ff10293f7e3679ac5)
2021-12-08 21:54:41 +01:00
jackpoz 7fc359559f Core/Misc: Fix static analysis issues reported by Coverity
(cherry picked from commit a0bd68cf465517786d16bcb145ed3fc8bc5b5b98)
2021-12-05 22:44:38 +01:00
Jozef Dúc a13a765610 Core/Object: Range check vol. 2 (#23226)
* Core/Object: Fix all missing parts for #23062

* Update GameObject.cpp

(cherry picked from commit 78070163dc6b9bb34ab2d006e9cc218548e861b7)
2021-12-03 00:21:19 +01:00
Jozef Dúc b717603a9b Core/Object: Range check (#23179)
* Should solve #23062. All credits to @xvwyh

* Remove unused variables

* Remove unused variable

* Cast int32 to uint32

* Remove G3D headers from core header file

* Change door distance

* Update GameObject.cpp

Add newline

* Update GameObject.h

Indentation

(cherry picked from commit 32e1de39a26628dcb64bc21ad415afb2ad938925)
2021-12-02 00:39:20 +01:00
jackpoz 73c6c13ace Core/GameObject: Code cleanup
(cherry picked from commit 16a154c4e87ff1ff89323a8960bf601e6c18589b)
2021-12-02 00:39:20 +01:00
Killyana a18808212e Core/GameObject: Remove summoned gobs properly from the map without effecting other cases
Ref https://github.com/TrinityCore/TrinityCore/commit/0e8e3828f48120629b642d0de1db704fd0bb86cb
Ref #23115

(cherry picked from commit 9db64666dc30b1f8cad904bf8aeea1c9daf41c95)
2021-12-02 00:39:20 +01:00
Killyana 62d3010e56 Core/GameObject: Delete summoned gobs and DestroyForNearbyPlayers gobs spawned with negative spawn time once the gob is deactivated
(cherry picked from commit 0e8e3828f48120629b642d0de1db704fd0bb86cb)
(cherry picked from commit 65afe47580e84a006eb6ce506623d3719ae5bc9b)
(cherry picked from commit 21667f97cbd519dbef1650cd29d53f26443441f3)
2021-12-02 00:39:19 +01:00
jackpoz b02143118f Core/Database: Delete gameobject_addon data when deleting a GameObject from the database
Close #23076

(cherry picked from commit f88a5b12bd7511331ea27975fe26bfc98d92d20d)
2021-11-30 23:05:27 +01:00
jackpoz 43a41caafb Core/Misc: Fix GCC 8 warnings
(cherry picked from commit 1d04a3b216901671eae0104547715a570b1ff3ab)
2021-11-24 23:40:15 +01:00
sirikfoll dc5cab3bf4 Core/GameObject: Properly dismount players on GameObject Use
Closes #23124

(cherry picked from commit dbfc6ce773afad4b5a4db77cbb76e64755d3ef94)
2021-11-24 23:34:48 +01:00
Killyana a99a60bcf3 Core/GameObject: Remove summoned game objects from the map after calling SetSpawnedByDefault(false) (#23120)
Closes #23115

(cherry picked from commit 5f04c829a861da7d5a4f0ac955d6c1fbcd917af9)
2021-11-24 22:27:03 +01:00
Killyana 8d806f8c69 SAI/GameObject: Despawn the linked trap with the gameobject
Closes #23105

(cherry picked from commit 750be73b9963ebcd4b823ec88b20af7cd819529b)
2021-11-24 21:22:50 +01:00
Killyana b0f10b505e Core/GameObject: Set loot state to Not ready when a gob is deactivated (#23072)
(cherry picked from commit 8dec9b97e211d9b9d5153a3f0d19097bae6fdeff)
2021-11-24 20:34:56 +01:00
Jeremy 2a9940e17d Core/GameObject: Implement GameObject::Use case for GAMEOBJECT_TYPE_NEW_FLAG (#27267) 2021-11-20 20:36:56 +01:00
Giacomo Pozzoni d5c41d23e6 Core/Misc: Log more information in asserts (#22783)
* Core/Misc: Log more information in asserts

Add a new function GetDebugInfos() to types that could trigger an ASSERT() to easily include more useful information in crashlogs.
This is an initial commit that requires many more commits to implement the new GetDebugInfos() function in all required types.
If the type doesn't have the function, the global default one is picked which doesn't log anything.

* Core/Misc: Fix dynamic build

Add missing attribute for dynamic build

* Core/Misc: Fix gcc/clang build

* Core/Misc: Rename GetDebugInfos() to GetDebugInfo()

* Core/Misc: Fix FormatAssertionMessage() adding an extra '\0'

* Core/Misc: Add GetDebugInfo support to Unit

* Core/Misc: Add GetDebugInfo support to Creature

* Core/Misc: Add more info to GetDebugInfo for Creature

* Core/Misc: Add GetDebugInfo support to GameObject

* Core/Misc: Add GetDebugInfo support to Player

* Core/Misc: Add more GetDebugInfo info

* Core/Misc: Add GetDebugInfo support to Item

* Core/Misc: Add GetDebugInfo support to Bag

* Core/Misc: Add GetDebugInfo support to Transport

* Core/Misc: Add GetDebugInfo support to TempSummon, Minion, Guardian, Pet

* Core/Misc: Add GetDebugInfo support to Map, InstanceMap

* Core/Misc: Add GetDebugInfo support to Spell

* Core/Misc: Fix build warning

* Core/Misc: Add GetDebugInfo support to Aura

* Core/Misc: Add GetDebugInfo support to UnitAI

(cherry picked from commit 9a924fb9d557434c5a2e4020c80db6e6bfe466ad)
2021-11-16 20:36:58 +01:00
Rochet2 afac2b1742 Add rotation to .gob info (#22723)
* Add rotation to .gob info

- Add rotation (yaw, pitch, roll) to .gob info command
- Replace LANG_SPAWNINFO_DISTANCEFROMPLAYER with LANG_SPAWNINFO_ROTATION
- Fix description of .distance to describe the command arguments (the more you know..)
- Fix .gob info guid targetting nearest gameobject instead of finding with given guid
- Reorder the info data slightly
- Print location and rotation data regardless of object found in world
- Add error messages for when object is not found by guid or entry

(cherry picked from commit 257ae44a20ed40469dd821845de8e27c0af838c7)
2021-11-15 21:49:37 +01:00
jackpoz b6f28a7ebc Core/Packets: Reduce memory footprint of cached queries (#22297)
Ensure only the minimum required memory is used by caching query packets by calling shrink_to_fit()

(cherry picked from commit deabd4ab453ee8cf1f515bdb32bf9cf9de7f0591)
2021-10-22 23:15:27 +02:00
PolarCookie 8c9e5cd3f3 [3.3.5] Core/Loot/Gameobject: Tempspawned Gameobjects after looting (#22124)
* spell spawned chest non-despawn fix

* fix the consumed game objects

(cherry picked from commit 97371533bf4fa0664957b2badf2c945b5b7595c2)
2021-10-22 21:39:28 +02:00
Treeston eb7a8584e2 Core/GameObject: Fix an edge case where GOs might never respawn after being manually despawned. Closes #21792.
(cherry picked from commit 9c5fffb4c51fb53a105b20c97eab19e2ff252788)
2021-10-14 19:40:05 +02:00
Treeston 3418a33a87 Misc: Pass std::chrono types by value everywhere.
(cherry picked from commit 2ef9d301f0869b443122e2ba543af054c5b0e53c)
2021-10-14 19:39:42 +02:00
Maphaze 22298fb172 Core/GameObjects: Fixed DestroyGate battleground hook for vehicles (#22145)
(cherry picked from commit 2ef33158486831aa061050f5cc7d316fee17721d)
2021-10-14 00:11:29 +02:00
Shauren 5274f7af17 Core/PacketIO: Added missing move assignment operator to ByteBuffer
(cherry picked from commit fcb1e3e6424ef86934132e1111052a6798d78bc9)
2021-09-26 01:27:59 +02:00
Meji 0a83f74876 Core/Achievements: Update CriteriaType enum (#26856) 2021-09-08 22:07:01 +02:00
Killyana ffae92edd2 Core/GameObject: Fix linked traps not being despawned properly and remove deprecated code
Closes #20159

(cherry picked from commit 8f0af67bcb56712d4c333f36a1c2030443c10fb7)
2021-09-06 15:26:50 +02:00
ariel- 962f6d7988 Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752

(cherry picked from commit 45c5e1b9d63796d168339a44f63418f220cf2403)
2021-08-28 15:59:11 +02:00
ariel- 67a1a1d29b Core/GameObject: implemented gameobject_overrides table to change faction and flags values on a per-spawn basis
Updates #20957
Closes #20958

(cherry picked from commit 34967e9c32b2c7e871bb93f41609a3b08ad92931)
2021-08-08 21:21:34 +02:00
Treeston 65b8dafb53 Core/GameObject: Force compatibility mode for stupid ridiculous junk legacy hack gameobjects, ref 27e7906.
(cherry picked from commit 9f92896c52dfdaaad3a7eb66a780a7415dc12546)
2021-08-08 21:21:34 +02:00
Treeston de3eb7b298 Core/GameObject: fix stupid ridiculous junk legacy hack code with negative gobj respawn time to work again
(cherry picked from commit 27e7906814f2696863f5ab0488c59ffa347d8cc9)
2021-08-08 21:21:34 +02:00
Treeston 168be492f5 Entities/GO: Add forceRespawnTimer support to DespawnOrUnsummon. Use it in SAI.
(cherry picked from commit 264d4e1d30debcf6feacee3d29982875672a7bbe)
2021-06-20 22:10:08 +02:00
Treeston bccd81e12a Entities/GO: GameObjects now support (delayed) despawning in a reasonable manner. Closes #21406.
(cherry picked from commit f071fa9e931533c28e6b9d8b0e38ed8878ce2b45)
2021-06-20 21:49:11 +02:00
kelno 1206e815cd Core/Creature: improve DB linked_respawn handling (#21172)
* Fixed SetCreatureLinkedRespawn function possible erasing/replacing a GameObject link (instead of a creature one)

(cherry picked from commit 70eb18d0e58ecf0cfcda4f410a183c671fbafe5c)
2021-05-16 21:56:06 +02:00
Matan ShukryandShauren a8fa2a03be Core/Items: Calculating item level + organized iterating over items (#26276)
* Unified iterating player items into a single function

Co-authored-by: Shauren <[email protected]>
2021-04-21 10:02:42 +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 d507a7e3388382960108b24143da48e5f912b4a7)
2021-04-16 15:22:42 +02:00
jackpoz e17e4e6f07 Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
(cherry picked from commit 12701cb0c6c45eb105ad449eb9a56e76d84d691e)

 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
Matan Shukry 1082a6645e Core/Objects: Move personal summon handling from TemporarySummon/GameObject to WorldObject and check it using dedicated guid field 2021-03-28 20:22:05 +02:00
ariel- f199eac72c Core/GameObject: refactor dismounting on use
(cherry picked from commit 98236dfa8846aeea2643deaab5ca86b803e3aee7)
2021-03-15 20:17:31 +01:00
ariel- 0486ff8350 Core/GameObject: implement dismount on use of certain GOs
- The fact of player dismounting was entirely client-sided, with no server code enforcing it.

Closes #19979

(cherry picked from commit 2ce3f3a7b8c6c32c920fe45d27621da390cbc298)
2021-03-15 20:17:31 +01:00
Jeremy 2d84912ce9 Core/GameObjects: Add GameObjectPlaySpellVisual (#26044) 2021-03-14 15:40:42 +01:00
Osleyder Gonzalez Acosta 8ce9b69de3 Core/GameObjects: Allow setting GameObject anim kits in database (#25941)
Necessary to be able to see the new visual effects of the gameobjects such as the portals in the Portals Halls of Orgrimmar and Stormwind.
2021-01-25 23:17:20 +01:00
Matan Shukry e601c6d1f9 Core/Spells: Implemented summoning a personal gameobject effect (#25917) 2021-01-23 16:44:47 +01:00
Shauren 5f3a2d2abf Core/Quests: Fixed questgiver icons
Closes #25702
2020-12-11 22:19:19 +01:00