Commit Graph

120 Commits

Author SHA1 Message Date
sudlud
c72ac105e4 fix(Core/Gameobject): prevent getting empty fishing loot (#21216) 2025-01-19 21:34:02 +01:00
Grimdhex
a4e2b1d743 feat(Core/WorldObjects): implement Heartbeat timers (#20872) 2024-12-13 08:50:45 +01:00
Benjamin Jackson
1edac37ac3 refactor(Core): Make more use of helpers. (#19835)
* Init.

* Reword.

* Update codestyle script.

Co-Authored-By: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Add gameobject type ID check, reorder checks.

* Add helper/codestyle check for unit type.

* `IsUnit()` -> `IsCreature()`

* Add `IsUnit()` method.

* Use type mask.

https: //github.com/TrinityCore/TrinityCore/commit/cc71da35b5dc74abf71f8691161525a23d870bb5
Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-Authored-By: Ovahlord <18347559+Ovahlord@users.noreply.github.com>

* Replace instances of `isType` with `IsUnit`.

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-authored-by: Ovahlord <18347559+Ovahlord@users.noreply.github.com>
2024-09-03 14:41:31 -03:00
Jelle Meeus
0504c7f9de fix(Core/GameObject): fixup allow use of Mage portal if caster is offline and still in group (#19853)
* fix portals

* fixup! fix portals

* fixup! fixup! fix portals
2024-09-02 14:00:15 -03:00
Jelle Meeus
5d4c85143c fix(Core/GameObject): Allow use of Mage portal if caster is offline and still in group (#19797)
search group of user for ownerGUID
2024-09-01 20:56:05 -03:00
Grimdhex
643362d697 refactor(Core/Object): adds consistency in the use of type object check (#19671) 2024-08-25 09:57:37 -03:00
Benjamin Jackson
67010623a0 fix(Core): Adjustments to summoning ritual object handling. (#19600)
* Init.

* Allow self-summoning.

* Revert unintended change.

Self-summoning still works fine without this being removed, I see no harm in putting it back.
2024-08-13 12:12:05 -03:00
Saqra1
ed824de7b8 fix(Core): Ritual animations (#19602)
Channel the same spell as the original caster when clicking on a ritual
portal, but ignore the effects of the spell.

Co-authored-by: killerwife <killerwife@gmail.com>
2024-08-13 11:54:17 -03:00
Benjamin Jackson
3b2b8406a8 fix(Core/Entities): Only add use to spell caster objects if cast succeeds. (#19601)
Init.
2024-08-12 08:46:20 -03:00
Francesco Borzì
54fadbda67 refactor(src/server/game/Entities): remove unused imports (#19507) 2024-07-28 16:39:39 -03:00
Kitzunu
793f87fd61 fix(Core/GameObject): Use correct spell at meeting stone (#19311)
* fix(Core/GameObject): Use correct spell at meeting stone

* cleanup
2024-07-09 19:39:58 -03:00
Kitzunu
3c50b1a135 fix(Core/Player): Vertical Message distance (#19302)
* cherry-pick commit (297541e9c9)

* Get rid of unused param

* Merge SendMessageToSetInRange_OwnTeam into SendMessageToSetInRange

Co-authored-by: Badgersson <83663557+dekz120@users.noreply.github.com>
2024-07-06 10:05:34 -03:00
sudlud
0a376bdc76 fix(Core/GameObject): load guid based scripts correctly (#18811)
- m_goData must be assigned before Create() is beeing called
- otherwise GetScriptId() can't load the correct scriptiD
  in Create()
- all in all this is now more in line with how it's beeing
  done in Creature.cpp
2024-04-26 20:56:46 -03:00
Anton Popovichenko
1f640c9872 feat(Core/Optimization): Optimize build of units update object by leveraging cache (#18637)
* feat(Core/Optimization): Optimize build of units update object by leveraging cache.

* Remove whitespaces.

* Add alternative hooks to handle transmog and other similar things.

* Fix build on some compilers.

* Fix codestyle

* Fix build again.

* Take into account updateType.
2024-04-05 08:03:11 +02:00
Anton Popovichenko
73340b94e3 feat(Core/Compression): Move packets compression from map to network thread (#18602)
* feat(Code/Compression): Move packets compression from map to network thread.

* Code style fix

* Remove unicode letter
2024-03-28 08:57:29 -03:00
Andrew
a11434b24f refactor(Core/GameObject): Move the GameObject state save handling to… (#18080)
* refactor(Core/GameObject): Move the GameObject state save handling to instance level

* Update GameObject.h

* remove leftover

* small improvements
2024-01-01 01:51:33 -03:00
Tristan 'Natrist' Cormier
4c94f62144 chore(Core/Account): move AccountMgr::IsGMAccount() to class WorldSession (#17845) 2023-11-28 21:44:48 +01:00
Kitzunu
bbadc32bea Revert Visibility Notifier changes (#17682)
* Revert "fix(Core/Grid): Implement missing GridUnload setting (#17569)"

This reverts commit 79b39f9655.

* Revert "fix(Core/Grid): Address bugs and performance issues introduced by visibility notifier implementation (#17480)"

This reverts commit 60e27511c5.

* Revert "fix(Core): GridCleanUpDelay Log (#17436)"

This reverts commit 90b16ca065.

* Revert "feat(Core/Grids): Implement visibility notifier (#15919)"

This reverts commit 2779833768.
2023-11-12 00:48:49 +01:00
AG
60e27511c5 fix(Core/Grid): Address bugs and performance issues introduced by visibility notifier implementation (#17480)
* Bug fixes

- Corrected std::chrono from seconds to milliseconds
- Got rid of leftover code that caused objects to not show up on time

* Removed logic to set gameobject as active

- More alignement with TC.
- Reduces CPU usage drastically

* Revert back to using time_t instead of std chrono

* Invoke SetNoCreate() method to reduce CPU usage drastically

* Remove setActive from static and motion transports

* Fix performance issues

* Added SetFarVisible to WG and some dungeon scripts

- Also removed setActive(true) from creatures in Wintergrasp. As for gameobjects they are set to active upon being damaged/destroyed and removed from active on rebuild (reset)

* Removed comments related to VISIBILITY_COMPENSATION

* Fix log

* Deleted unused files + corrected a check

* Added missing header

* Removed unused parameter

* Removed another unsued parameter

* Changed vector to set for i_visibleNow

- Changed vector to set for i_visibleNow in VisibleNotifer
- Adjusted HaveAtClient to accept Object*
- Adjusted SendUpdateToPlayer to send createobject packet only if not known to client
2023-10-23 05:37:11 -03:00
KJack
c25d0b38e8 feat(Core/GameObject): Implement OnGameObjectModifyHealth() hook (#17374) 2023-09-28 22:39:57 +02:00
Skjalf
71de2e5c26 fix(Core/GameObject): Also send EventInform() calls for GAMEOBJECT_TY… (#17283)
fix(Core/GameObject): Also send EventInform() calls for GAMEOBJECT_TYPE_CAMERA

- This allows object and zone AI to process events called by camera objects as well (previously only possible through event_scripts)

(cherry-picked from commit 6904073c9c)
2023-09-17 10:18:13 -03:00
Gultask
0ddf00c7be fix(Core/Gameobject): Fix lootable chests related to quests but not having quest loot (#15197)
Authored-by: Shauren <shauren.trinity@gmail.com>
2023-03-01 17:36:56 -03:00
Kitzunu
f039836a2f chore(Core/Misc): Change all TODO to doxygen comment (#14966) 2023-02-12 10:05:34 -03:00
Skjalf
dba8c49bce chore(Core/Object): Rename GetGOData() to GetGameObjectData() (#14875) 2023-02-05 08:35:52 -03:00
Benjamin Jackson
c8bbea9e1b fix(Core/GameObject): Make fishing bobber finish a channeled spell rather than interrupt in all cases. (#14422) 2023-01-28 11:00:07 +01:00
Kitzunu
4870b14b1f refactor(Core/Object): getLevel() -> GetLevel() (#14122)
* refactor(Core/Object): getLevel() -> GetLevel()

* fix build and sneak some doxygen in

* codeSTLE

* codestyle
2022-12-31 17:39:23 +01:00
UltraNix
d32daab969 fix(Core/GameObject): Implement restock mechanic for non-consumable gameob… (#13950)
Core/GameObject: Implement restock mechanic for non-consumable gameobjects.

Don't allow non-consumable goobers/chests to despawn on use.
Source: TrinityCore.
Fixes #13909
2022-12-06 12:44:44 -03:00
UltraNix
984a389d37 fix(Core): Crashfix. (#13113)
Fixes #13111
2022-09-25 10:40:37 -03:00
DavuKnight
d8598c764e feat(core): OnFfaPvpStateUpdate Event (#13023)
* Event for Notification when the Player enters into or Leaves Ffa

* Bug and Formatting Fixes
2022-09-21 08:33:28 -04:00
ZhengPeiRu21
25f88caa42 fix(Core): Correct Post 3.1 Fishing Skill Leveling (#12996) 2022-09-18 22:09:47 -03:00
ZhengPeiRu21
f01459553f feat(Core): Hide Quest Sparkle Config Option (#13005) 2022-09-13 21:40:27 -03:00
Maelthyr
d0d1671745 feat(Core/Debug): GetDebugInfo implementation (#12705)
Cherry-pick: 9a924fb9d5

Co-authored-by: jackpoz <giacomopoz@gmail.com>

Co-authored-by: jackpoz <giacomopoz@gmail.com>
2022-08-15 09:43:41 -03:00
Skjalf
e476533e6e chore(Core/GameObject): Clear an error that often doesn't mean anything (#12689)
* chore(Core/GameObject): Clear an error that often doesn't mean anything

* drop it to debug
2022-08-09 12:57:49 -03:00
IntelligentQuantum
cc52712ac1 refactor(Core/AI): factory functions cleanup (#11779) 2022-07-15 16:11:49 +02:00
UltraNix
12a07ff91f fix(Core/Spells): Fixed LoS problems with hunter traps. (#12348)
* fix(Core/Spells): Fixed LoS problems with hunter traps.

Fixes #12332

* missing
2022-07-10 14:18:36 -04:00
UltraNix
f6ede1a503 fix(DB/ZulGurub): Hoodoo Piles should not melee atack their targets. (#12269)
Will of Hakkar is casted on pile looter.
Fixes #12186
2022-07-09 10:12:16 -04:00
Skjalf
32ba21d029 feat(Core/Scripting): Implement OnAllowedForPlayerLootCheck() hook (#12316)
* feat(Core/Scripting): Implement OnAllowedForPlayerLootCheck() hook

* reverse logic
2022-07-09 00:10:04 -03:00
Maelthyr
d928d8d96a refactor(Core/Unit): PC&NPC Immunity (#11986)
* initial

* refactor(Core/Unit): PC & NPC Immunities

Cherry-pick TC: 74af880217

Co-authored-by: Treeston <treeston.nmoc@gmail.com>

* fix builds error

Cherry-pick TC: 74af880217

Co-authored-by: Treeston <treeston.nmoc@gmail.com>

* Fix nef combat, and replace SetFlag by SetUnitFlag

* fix combat with jedoga

Co-authored-by: Treeston <treeston.nmoc@gmail.com>
2022-06-18 08:16:45 -04:00
UltraNix
f28c678c14 fix(Core/Spells): Hunter traps should not be activated by targets not… (#11971)
fix(Core/Spells): Hunter traps should not be activated by targets not in LoS.

Fixes #11432
2022-06-06 09:03:24 -03:00
Hanabi
a6a2ca8ef7 feat(Core/GameObjects): Instance gameobject save data implementation (#11113)
* fix(Core): Save gameobject state on instances

Currently, azerothcore doesn't save gameobject states on instances.
Whenever there's a re-start or crash, the instance's gameobjects and
their states aren't saved, producing un-wanted behaviours and blocking instances at times.

Implemented CRUD for new table `instance_saved_data` that holds the states of gameobjects.

- When worldserver launches and gameobjects are loaded, this will check
  if this object's state exists on the DB and sets the previous state.
- On instance deletion (reset) these states are also removed based on
  the instance ID.
- Whenever a gameobject state changes inside a dungeon or raid, we save
  on the database the set state.

* Select query to synchronous and used FindMap()

* loading gameobject states on create

* reseting instance saved data

* missing reset methods and on create state

* database structure

* Update src/server/game/Entities/GameObject/GameObject.cpp

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Update src/server/game/Entities/GameObject/GameObject.cpp

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Update src/server/game/Entities/GameObject/GameObject.cpp

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Update src/server/game/Entities/GameObject/GameObject.cpp

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Update src/server/game/Entities/Player/PlayerMisc.cpp

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Update src/server/game/Groups/Group.cpp

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* codestyle

* table changes

* table style

* codestyle

* table changes for columns

* data sanitization

* todo:

- Finish loading db data into the containers
- Using containers to find data
- How to get data from ObjectMGR inside Gameobject?

* loading on start up and db changes

* Removing unused data structure

* Uninitialised integer

* Whitespace

* clean-up and hooks to save states on memory

* Codestyle MySQL deprecated backticks

* i dont understand codefactor

* build

* Update data/sql/updates/pending_db_world/rev_1643395587559675400.sql

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* Update src/server/game/Globals/ObjectMgr.h

Co-authored-by: Kargatum <dowlandtop@yandex.com>

* review changes

* unecessary removal

* pushback instead of emplace

* wrong database update

* Update ObjectMgr.cpp

* missing check

* removing entry from the PR

* missing removals

* last delete

* build

* aha! Found the culprit for the sudden assert errors

* type safety, save only important gameobjects

* static cast to unsigned short

* Update data/sql/updates/pending_db_characters/rev_1643629468629316100.sql

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

* type changes

* queries fix

* fix build

* enabling which gameobjects to save on the database

* deadmines iron clad door

* Adjustment to gameobject onj create state and instances:

- Gnomeregan doors and Grubbis boss state
- Deadmines missing doors
- Stratholme gameobjects state saved

* forgot emi blastfuse change to despawn

* Leaving group logic

* codestyle

* fixing merge issues

* prevent bad behaviour

* brain meltdown

* Update data/sql/updates/pending_db_characters/rev_1643629468629316100.sql

* Update data/sql/updates/pending_db_world/rev_1649359139539727000.sql

Co-authored-by: Claudiodfc <54484196+claudiodfc@users.noreply.github.com>
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
Co-authored-by: Kargatum <dowlandtop@yandex.com>
Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com>
2022-05-24 10:33:45 -03:00
Tralenor
6cf82e3bd6 feat(Core/DB): Add Hooks On creature/game object save to db (#11246)
* implement OnCreatureSaveToDB and OnGameObjectSaveToDB Hooks

* fix Whitespaces in ScriptMgr.h

Co-authored-by: Timothée Moos <t1997.m@gmx.net>
2022-05-06 00:42:49 -03:00
Kitzunu
b41967a067 feat(Core/GameObject): Gob flag helpers (#11287) 2022-04-05 13:52:58 +02:00
Kitzunu
856aed6fc6 feat(Core/Unit): New helpers for UnitFlag and UnitFlag2 (#11227) 2022-03-30 07:59:42 -03:00
acidmanifesto
77f13636b7 fix (core) Script Names not loaded with manual add (#11102)
This fixes Script names not being loaded with npcs and gameobjects when manually added with the .npc\gameobject add cmd that would lead the user to restart the server to load up the npc\gameobject with the script that was manually added
2022-03-22 09:49:06 -04:00
UltraNix
68891ccd74 fix(Core/Loot): Fixed some chests inside dungeons not being bound only to participants. (#10995) 2022-03-18 18:33:04 -03:00
UltraNix
982be6de00 fix(Core/GameObjects): move activation code of traps to GO_ACTIVATED (#10537)
- Original author: @Gacko
2022-02-19 22:26:26 +01:00
Kitzunu
cf65cd6baf refactor(Core/Misc): sqrt/log/exp() to std::sqrt/log/exp() (#9792) 2022-02-09 11:59:30 +01:00
Kargatum
de13bf426e feat(Core/DBLayer): replace char const* to std::string_view (#10211)
* feat(Core/DBLayer): replace `char const*` to `std::string_view`

* CString

* 1

* chore(Core/Misc): code cleanup

* cl

* db fix

* fmt style sql

* to fmt

* py

* del old

* 1

* 2

* 3

* 1

* 1
2022-02-05 00:37:11 +01:00
Kargatum
5969df4e30 refactor(Core/Logging): switch to fmt style for LOG_ (#10366)
* feat(Core/Common): add support fmt style for ASSERT and ABORT

* correct CheckCompactArrayMaskOverflow

* 1

* Update src/server/game/Spells/Spell.cpp

* rework logging

* add fmt replace logs

* logging

* FMT_LOG_

* settings

* fix startup

* 1

* 2

* 3

* 4

* 5

* fmt::print

* to fmt
2022-01-27 16:44:41 +01:00
Kargatum
8b7df23f06 feat(Core/Time): Implement saparated manager for game time (#8630) 2022-01-24 17:55:00 +07:00