Commit Graph

211 Commits

Author SHA1 Message Date
Benjamin Jackson
11a4dc5ece fix(Core/Creature): Use minimum template level instead of current level for leash timer. (#22250) 2025-06-05 15:50:36 -03:00
Benjamin Jackson
2a93e7d410 chore(Core/Unit): Correct typo of Controlled. (#22260) 2025-06-03 08:56:44 +02:00
Benjamin Jackson
e6a29d96c8 fix(Core/Creature): Use home position for leash distance check for creatures with no movement. (#22245) 2025-05-30 10:35:28 -03:00
Benjamin Jackson
93ac73a4d1 fix(Core/Creature): Leashing improvements. (#22129)
Co-authored-by: killerwife <killerwife@users.noreply.github.com>
Co-authored-by: 天鹭 <18535853+PkllonG@users.noreply.github.com>
2025-05-23 18:22:56 +02:00
Benjamin Jackson
5686f1e87a fix(Core/Creature): Implement respond to call for help faction flag. (#21959) 2025-04-30 02:19:58 +01:00
天鹿
c78217baa2 fix(Core/Creature): Correctly get flag from cinfo in IsDungeonBoss & IsImmuneToKnockback (#21456) 2025-02-15 18:10:48 +01:00
Andrew
062f9c4341 fix(Core/Map): Dynamic respawns: preserve original respawn timer and skip rares (#21440) 2025-02-14 11:30:59 +01:00
Takenbacon
edcfaeb845 refactor(Core/World): Create WorldSessionMgr to split session logic out of World (#21400) 2025-02-13 07:04:38 +01:00
Andrew
16fa25b7a9 feat(Core/Maps): Implement dynamic respawn rates (#21417)
Co-authored-by: r00ty-tc <r00ty-tc@users.noreply.github.com>
Co-authored-by: Jelle Meeus <sogladev@gmail.com>
Co-authored-by Treeston

This is a partial cherry-pick of: 59db2eeea0
2025-02-12 15:06:42 -03:00
Andrew
7e29e023e8 fix(Core/Creature): Allow temp summons to respawn when despawning on … (#21363) 2025-02-10 08:46:31 +01:00
Andrew
79cbb00075 feat(Core/Creature): Implement HasFlagsExtra() helper to creature (#21362) 2025-02-08 14:07:04 -03:00
Kitzunu
17412174be feat(Core/SAI): implement SMART_ACTION_DISABLE_REWARD (#21105) 2025-02-01 22:49:41 +01:00
Grimdhex
edf2959a26 feat(Core/Creatures): implement a sparring system (#19824) 2025-01-26 09:40:37 +01:00
Kitzunu
ed008a8780 refactor(Core/Spells): Add helpers for HasAuraType (#20802) 2024-12-01 08:50:59 -03:00
Riley S.
e9137d4d4d fix(Core/Spells): Resolve invalid spell casts on dead players when the cast is valid. (#20712)
* Initial fix for #20509

* small revert

* Two way visibility between ghosts.

* clean up temporary changes.

* clean up debug code.

* small typo

* revert .gitignore

* fix codestyle

* Add missing flag, resolve issue where cast was failing while alive.

* Update SpellInfo.cpp

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

---------

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
2024-11-30 20:18:32 +01:00
Jelle Meeus
4b03e97a63 fix(Core/Creature): Set RespawnTime before AI Reset (#20684)
fix(Core/Creature): Set RespawnTIme before AI Reset
2024-11-22 12:23:21 -03:00
Francesco Borzì
2ce2c8cf3a refactor(src/server/game/*): remove unused imports (big part 3) (#20315) 2024-10-27 13:10:28 +01:00
Jelle Meeus
01b86ec7a6 fix(Core/Unit): update death state before handling RemoveAllAurasOnDeath() (#20124)
fix setDeathState

[PATCH] Don't allow units to enter combat upon death
91ebea4a77.patch
Co-authored-by: trickerer <onlysuffering@gmail.com>
2024-10-04 11:01:36 -03:00
Jelle Meeus
6e4a9bbb14 fix(Core/Unit): fix Dual Wield for more creatures, CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK, creature disarm damage (#20015)
* enable CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK

* sql set CREATURE_FLAG_EXTRA_USE_OFFHAND

* use new HasOffHandWeaponForAttack instead of haveOffhandWeapon

no longer requires m_CanDualwield set to use Offhand attack
requires non-disarmed weapon in Offhand OR creature_flag_extra enabled

Co-authored-by: Ovah <dreadkiller@gmx.de>
Co-authored-by: Warlockbugs <warlockbugs@outlook.com>

* Make shapeshift forms which dont override attack speed use weapon damage

Co-authored-by: killerwife <killerwife@gmail.com>

* SetEquipmentSlots turning off damage update when using template default

Co-authored-by: killerwife <killerwife@gmail.com>

* Setup DualWield & Damage On Equipment Updates, implement Set and GetVirtualItem

Co-authored-by: Yatzii <47720837+Yatzii93@users.noreply.github.com>

* creature disarm damage

set disarm to reduce minmax damage by 50% instead of setting to 0

Co-authored-by: Warlockbugs <warlockbugs@outlook.com>

---------

Co-authored-by: Ovah <dreadkiller@gmx.de>
Co-authored-by: Warlockbugs <warlockbugs@outlook.com>
Co-authored-by: killerwife <killerwife@gmail.com>
Co-authored-by: Yatzii <47720837+Yatzii93@users.noreply.github.com>
2024-09-25 16:53:39 +02:00
Kitzunu
386aea03ee chore(Core/Misc): Some cleanup (#19970)
* remove weird blanks

* update if

* ) ) to ))

* missed some ) )

* now switch

* .
2024-09-21 19:34:31 +02:00
Benjamin Jackson
00e35a201e fix(Core/AI): Reduce movement leash extension interval. (#19923)
* Init.

* Use GetGameTime() instead of system call.

Co-Authored-By: Anton Popovichenko <walkline.ua@gmail.com>

* Update leash timer if rooted.

* Remove unnecessary checks, add extension for fanning.

More parity with VMaNGOS implementation.

---------

Co-authored-by: Anton Popovichenko <walkline.ua@gmail.com>
2024-09-11 03:25:32 -03:00
天鹿
9dae87595d fix(Core/Creature): Creature Scale. (#19722)
Update Creature.cpp
2024-09-05 11:56:17 -03:00
Benjamin Jackson
bf18b9bdfb fix(Core/AI): Improve creature leashing behavior. (#19751)
* Init.

https: //github.com/vmangos/core/commit/7d2f1e2923734ea1b983eeaa0208cfd158d4af02
Co-Authored-By: ratkosrb <35845488+ratkosrb@users.noreply.github.com>

* Hackfix for pets.

* Whoops.

* Correct evade uses.

* Conflict.

* Actually fix grace timer.

* Add visibility distance check.

Creatures should always fail combat checks in the open world if they're outside of visibility distance, might not be the case for worldbosses.

---------

Co-authored-by: ratkosrb <35845488+ratkosrb@users.noreply.github.com>
2024-09-03 21:08:56 +02: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
Walter Pagani
3b45e90e41 fix(Scripts/ICC): NPC Muradin Dialogues (#18931)
Co-authored-by: Meji <alvaro.megias@outlook.com>
Co-authored-by: 天鹿 <18535853+PkllonG@users.noreply.github.com>
2024-08-31 17:34:56 -03:00
Grimdhex
2f85097413 docs(Core): improve several functions documentation (#19677)
* initial release

* fix reviews

* fix some typo and add new documetations for MotionMaster

* new update and fix the cli-codestyle

* fix typo

* fix reviews
2024-08-28 08:17:24 -03:00
Benjamin Jackson
5ffbfdd5d6 fix(Core/Creature): Fix grace period for can attack check. (#19763)
Init.
2024-08-28 08:13:06 -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
d6d49a9e45 refactor(Core/ObjectMgr): Implement display probabilities. (#19068)
* Init.

Cherry-picked from TC commits 9d210476e5 and c488fb219a

Co-Authored-By: Traesh <9392905+traesh@users.noreply.github.com>
Co-Authored-By: Shauren <shauren.trinity@gmail.com>

* Add brute data.

Needs validation against what existed before, i.e. Classic change prevention.

* Add validation info for brute data.

* Remove incomplete data queries.

* Requested changes.

* Whitespace.

* Requested change.

Table name.

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

* Requested change.

Table name.

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

* Resolve the funny merge conflicts.

I wonder why git blame doesn't work on a file with 20k lines in it that's odd huh champ.

* Remove unused parameter.

* Remove uses of unused parameter.

* Use unused parameter.

Hopefully?

* I will cry.

* Sobbing endlessly.

* Remove comment.

* Adjust table structure query.

Remove length parameters and allow null for build value.

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

* Adjust column datatype and add check constraint.

---------

Co-authored-by: Traesh <9392905+traesh@users.noreply.github.com>
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
2024-06-16 18:12:16 +02:00
Andrew
6df652a8dd fix(Core/Creature): Prevent combat movement disabled creatures from r… (#18428)
* fix(Core/Creature): Prevent combat movement disabled creatures from repositioning if target moves within model boundary

* fixbuild

* Apply suggestions from code review
2024-02-27 10:11:39 -03:00
Nathan Handley
df33a57b78 feat(Core/Unit): New helper IsClass and script hook OnPlayerIsClass (#18243)
* Class Comparison Logic Encapsulation - Parity

* Add Context to IsClass

* Add Unit IsClass script hook

* Replace additional getClass with IsClass

* Update CanUseItem to replace getClass with IsClass

* Add separate context for pet vs ability

* Change Create to Init since not all referenced contexts are creation

* Align spacing in ClassContext

* Drop context on LFGManager max power

* Update IsClass context that wraps around Missle Barrage

* Rename context for swapping weapons

* Be more specific than CLASS_CONTEXT_TALENT

* Remove duplicate context

* Moved IsClass Hook to Player

* Removed unused parameter in virtual base function

* Added maybe_unused to IsClass virtual in order to compile

To match the override signature, the virtual base needs to include the parameter in question, so using [maybe_unused] to signal to the compiler to allow it

* Remove extra blank line

* Add ABILITY_REACTIVE context

* Add context for PET_CHARM

* Remove explicit nullopt check per review

* Code Readability - Change if to if else in pet

Due to the return pattern, this doesn't change functionality in any way

* Add OnPlayer to disambiguate

---------

Co-authored-by: NathanHandley <nathanhandley@protonmail.com>
2024-02-10 12:25:00 -03:00
sudlud
e447351b0f fix(Core/Creature): Remove automated z spawn correction (#18200)
* fix(Core/Creature): Remove automated z spawn correction

* comment out unused parameter

* remove gridLoad parameter from Creature::LoadCreatureFromDB()
2024-01-21 07:33:00 -03:00
sudlud
96d8d1d89a fix(Core/Creature): Reduce z offset for automated spawn correction (#18153)
- this is necessary to correctly spawn creatures within small defines
- 0.42f is as good as 1.0f to detect and correct reasonable z errors
in DB spawn data
2024-01-11 11:15:41 -03:00
Andrew
be4d90404b feat(Core/Spells): Implement SPELL_ATTR0_CU_BYPASS_MECHANIC_IMMUNITY (#18056) 2023-12-25 03:58:29 -03:00
Winfidonarleyan
eb1ecc38a5 feat(Core/Scripting): move all script objects to separated files (#17860)
* feat(Core/Scripts): move all script objects to separated files

* Apply 5bfeabde81

* try gcc build

* again
2023-12-02 21:13:20 +01:00
KJack
b7f7a7c731 fix(Core/Creature): Make Respawn() respect conditions and linked respawns (#17597) 2023-11-26 08:48:58 -03:00
Andrew
e3a7613f56 fix(Core/Creature): Move DespawnOnEvade() respawn handling to map level (#17806) 2023-11-20 12:18:48 -03:00
Andrew
bf40479db6 fix(Scripts/SSC): Fix being able to damage Leo's minions if you are n… (#17786)
* fix(Scripts/SSC): Fix being able to damage Leo's minions if you are not the target player

* implement helper

* Update Creature.cpp

* Update Creature.h
2023-11-19 12:38:47 +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
Kitzunu
f757e93da5 refactor(Core/Misc): Make DeathState enum class (#17607) 2023-10-28 10:54:03 +02: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
Kitzunu
2255f492b5 fix(Core/Creature): Update movement in UpdateEntry() (#17291)
* fix(Core/Creature): Update movement in UpdateEntry()

* Update Creature.cpp

* Update Creature.cpp

* hover

* just replace with updatemovememntflags

* Update Creature.cpp

* Update Creature.cpp

---------

Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com>
2023-10-08 10:49:17 -03:00
Kitzunu
b1395b9450 refactor(Core/Creature): Calculate BaseArmor as float (#17448) 2023-10-08 08:56:16 -03:00
KJack
a23d5ee50d feat(Core/Scripting): Implement OnBeforeCreatureSelectLevel() hook (#17391)
* Add `OnBeforeCreatureSelectLevel()` hook
- allows modules to alter the level of a creature just before it is set

* Fix missing class name.

* Hook should catch even if the level isn't being changed.

* Trim whitespace.

* Revert "Trim whitespace."

This reverts commit 76768d85c0b9878828b71a008e709c1df7ddadc5.

* Fix whitespace
2023-10-01 02:25:06 -03:00
Skjalf
7de2405604 fix(Scripts/Karazhan): Several Aran fixes (#17394)
- Fix drinking being interrupted by dots
- Fix first super timer
- Fix missing Arcane Explosion emote
- Fix supers being locked by spell interrupt
- Correct drinking to 10% mana down from 20%
2023-09-30 22:13:49 -03:00
AG
2779833768 feat(Core/Grids): Implement visibility notifier (#15919)
* Cherry-picked from TrinityCore (unable to find author)
2023-09-28 22:28:28 +02:00
Skjalf
ae99ce586a fix(Scripts/Karazhan): Fix Aran combat movement behavior (#17359)
* fix(Scripts/Karazhan): Fix Aran combat movement behavior

* Update SmartScript.cpp
2023-09-26 18:27:23 -03:00
Francesco Borzì
5d01b700fd refactor(Core): remove unused imports (#17094) 2023-08-28 13:39:43 +02:00
Gultask
d525949316 fix(Core/Creature): Re-Add IGNORE_ASSISTANCE_CALL flag (#16387)
init
2023-05-28 13:49:17 -03:00
Gultask
b86cf11499 fix(Core/Creature): Adjust IGNORE ASSISTANCE CALL flag to prevent assistance on initial aggro only (#16046)
init
2023-04-20 18:16:31 -03:00