Commit Graph
5385 Commits
Author SHA1 Message Date
Mikhail Redko c0a1bc8c8d * Core/Misc: Improvement item durability repair logic
* Move item repair cost calculation logic from Player::DurabilityRepair to Item::CalculateDurabilityRepairCost
* Make item repair cost calculation more congruent with client logic (std::round)
* Do not repair items if player does not have enough money to pay for the repair of all items at once
* Withdrawing money from guild bank only once to avoid spam in the guild bank log and reduce number of transactions in the database
2022-06-15 14:24:35 +02:00
Intel ce79689c96 Core/Player: Prevent updating visibility if player is not in world. Closes #13659
(cherry picked from commit 3ec88b7086953685617c2ccd79207a388d20e129)

Closes #27914
2022-05-18 13:52:36 +02:00
Ovahlord edfe82b4a3 Core/Misc: refactored a couple more loops to reduce copies and speeding up things
* silenced a few more msvc suggestions while at it
2022-04-22 22:52:52 +02:00
Ovahlord 2443d48081 Core/Creatures: no longer restore stored orientation values after a spell focus expires since there is no evidence, that this is ever being used on retail 2022-03-29 21:46:16 +02:00
Ovahlord a82fe54bb7 Core/Skills: assign loaded skills that have been marked as forbidden to a proper skill position to avoid interfering with legit skills
closes #332
2022-03-25 11:37:52 +01:00
Ovahlord 5f2b1e45e4 Core/Spells: improve integer to float conversions and checks for spell proc entries 2022-03-10 20:43:12 +01:00
Ovahlord 78896a132f Core/Spells: ported proc flag updates from master branch 2022-02-22 21:19:09 +01:00
Ovahlord 80881f898c build fix 2022-02-21 14:55:09 +01:00
Ovahlord 7bf3379df5 warning fixes 2022-02-21 14:43:50 +01:00
Ovahlord a204e9c61a Core/Units: some minor refactors to reduce the amount of container element copies and improved some array initializations 2022-02-21 14:31:46 +01:00
Ovahlord 6506e71a23 Core/Units: added a helper to check if a limited target aura exists without creating an empty element in the container 2022-02-21 13:44:24 +01:00
Ovahlord d53fb14cbb Core/Creatures: no longer initialize CharmInfo for minions on creation. Unit::SetCharmed takes care of non-guardian initialization
closes #334
2022-02-21 09:42:41 +01:00
xinef1 e5f3de026f Core/Misc: implemented petition manager (#19010)
- Implemented manager for petitions to perform all petition related tasks and synchronize data with database.
- This kills ugly synchronous querys on packet handlers

(cherry picked from commit a4aa95a5a39d75b9e38fe03aac57ceb7d9bba90f)
2022-02-16 04:59:12 +01:00
ariel- cb168a8e7e Core/Unit: fix crash on magic school autoattacks
Closes #19436

(cherry picked from commit 0b50ea072e504ac7d5bf87b08d564955785f7197)
2022-02-16 04:49:24 +01:00
ariel- 5ad31dcf55 Core/Unit: fix SPELL_AURA_MOD_DAMAGE_DONE damage calculation on non-melee schools
for Keader :P

(cherry picked from commit 66ac1509ae925edc8848cdf6c370f8ed52c688ec)
2022-02-16 04:49:24 +01:00
ariel- d441e864c4 Core/Unit: cleanup and minor fixes of miss and resist calculations
- Removed Unit::GetUnitMeleeSkill as it was basically a copy of GetMaxSkillValueForLevel
- Removed static from GetEffectiveResistChance, as this was passed anyways, changed name to CalculateAverageResistReduction, which better reflects what it does
- Fix melee miss chances calculated from attacker maxskill instead of victim maxskill
- Do actual checks if spell can be resisted/missed in MagicSpellHitResult (ie chances > 0)
- Fixed SPELLMOD_RESIST_MISS_CHANCE calculation in MeleeSpellMissChance
- Minor codestyle and cleanup of diminishing returns calcs

(cherry picked from commit e565b34f6d24411e210151d0d03e524f94cdff85)
2022-02-16 04:49:24 +01:00
ariel- 0e8422c30a Core/Misc: fix static analysis issues
CID 1373466
CID 1373481
CID 1373482

(cherry picked from commit e478434146fd479fab955aaa80eb925c15e29809)
2022-02-16 04:49:24 +01:00
Chaouki Dhib 17c4d8f6d9 Core/Spells: fix wrong distance calculations in AoE spells [Needs testing] (#16290)
Core/Spells: Fix wrong distance calculations in AoE spells.
Pull request #16290 by chaodhib.
God bless, finally.

(cherry picked from commit a1f2f30c145f6ad9c4baeffeff32618e71ff537c)
2022-02-16 04:49:24 +01:00
ariel- 4ad1d377fe Core/Entities: virtualize CheckAttackFitToAuraRequirement
- Should've been like this to begin with

(cherry picked from commit 21d95a1d767c95910d4508e0e83f34b4f89f587a)
2022-02-16 04:49:24 +01:00
ariel- 827fcb652a Core/Entities: Fix null-dereference crash
Closes #19191

(cherry picked from commit d61e0f79c40681ce7675e878e0ec0bdc2294527f)
2022-02-16 04:49:24 +01:00
ariel- b8d1bab8de Core/Spells: refactor spell_enchant_proc_data table
- Renamed fields to mimic those in spell_proc
- Added Enchant proc attributes for controlling specific enchant features

Ref #7789

(cherry picked from commit f609e7a08b3b4d2d9642e5ec252e1eedad836f0f)
2022-02-16 04:49:24 +01:00
ariel- 5e57ad6fa8 Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Closes #15734

missing code
(cherry picked from commit eac9c1f0b992fd3622fd7dd864b2acc2781ec778)
2022-02-16 04:49:24 +01:00
xinef1 a627ea354a Properly stop attacking after player leaves ffa area (like Gurubashi Arena) (#18952)
(cherry picked from commit 4eae29d421e1d7a28aaa50d401cbbf09c50bd476)
2022-02-16 04:49:24 +01:00
xinef1 df9738aaa9 Core/Misc: Fixed player corpse looting, added player corpse loot and some more (#19122)
* Fixed corpse looting in wintergrasp
Added corpse loot for wintergrasp quests and To the Looter Go the Spoils (1166) achievement
Don't generate money for loot if no loot mode is available
Simplified few things

(cherry picked from commit 2412886ef69d305df1bd6e6422ca3134c0ab1449)
2022-02-16 04:49:24 +01:00
xinef1 f431459063 Core/Creatures: Various fixes for creatures, regarding combat conditions, despawning, and few others (#18998)
* Made some changes to kiting mechanics, simplified code and made taunt auras prolong combat no matter the distance from the spawn
Unified some creature despawning code, removed some brutal direct calls in scripts
Don't play death anim on forced despawn
Removed some redundant visibility changes on creature despawn
Fixed possible problem with pet initializing template info from difficulty greater than normal
Properly keep UNIT_FLAG_IN_COMBAT on UpdateEntry call
Moved RegenerateMana function to general Regenerate(Power) function
Fixed increased health regeneration from polymorph for pets
Implemented CREATURE_TYPE_FLAG_GHOST_VISIBLE, those creatures will be properly seen when player is dead also
Removed hackfix from Gaeriyan and Franclorn Forgewright, fixed properly
Simplified ForcedRespawnTime code in ForcedDespawn
Do not allow to assist unit while evading or when enemy is evading
Do not allow to attack other units when evading or when the unit is evading
Corrected distance checking code before creature is allowed to evade, should fix some common problems
Properly return summon position for summoned creatures as their respawn position
Properly stop all moving units on gossip hello, no matter their npc flags

(cherry picked from commit e1f14215d86fc9f0cd041f0e87bf0a689c086329)
2022-02-16 04:49:24 +01:00
Ovahlord bea6e6dcea fixed build 2022-02-05 07:22:16 +01:00
Ovahlord f2d651f6a9 Core/Units: no longer normalize melee basic attacks of feral druids 2022-02-05 00:00:55 +01:00
Ovah 135e8833d7 Core/Objects: added a missing member initialization which sometimes resulted in objects being invisible clientside
How did CI not notice that?
2022-02-02 17:33:07 +01:00
Shauren f2b4f2208e Core/Objects: ported master branch handling for properly destroying objects via out of range and destroy object opcode
# Conflicts:
#	src/server/game/Entities/Creature/Creature.cpp
2022-02-02 16:24:42 +01:00
Xinef 62a7c88ef6 Core/Achievements: Optimized resetting achievement criteria by condition and changed the functionality to properly reset all possible criteria with given condition
Closes #18905

(cherry picked from commit 7c7b877c3fc0292f33f54f4e8b514be3bf8514a6)
2022-01-28 22:32:59 +01:00
Xinef dc15ba1193 Core/Achievements: Greatly optimize achievement system by splitting large types by miscvalue
Closes #18633

(cherry picked from commit 9b44ed9cda347bfda1078666b3779d985fc37b2b)
2022-01-28 22:32:59 +01:00
xinef1 9da4acce08 Core/Spells: Remade trajectory target selection (#19048)
* Remade trajectory target selection
* Added possibility to apply conditions to trajectory spells
* Properly recalculate delay time if CMSG_UPDATE_PROJECTILE_POSITION is received

(cherry picked from commit c6060dd0c511ddad3cb1f0423aa9ccf2de7aedec)
2022-01-22 22:29:20 +01:00
Ovahlord ba4df11ab8 Core/Items: handle ITEM_MOD_EXTRA_ARMOR
closes #323
2022-01-21 23:12:16 +01:00
Ovahlord db769f5e52 Core/Units: safeguard Unit::CancelSpellMissiles against triggering an assert in BasicEvent::ScheduleAbort when trying to cancel spell events that already are about to the aborted 2022-01-17 10:59:41 +01:00
Ovahlord 03cbd6fe92 Core/Movement: yoinked the movement direction calculation from master's TARGET_DEST_CASTER_MOVEMENT_DIRECTION implementation
thx Shauren for the headsup
2022-01-16 20:40:19 +01:00
Ovahlord d17ceb70d5 Core/Movement: add a helper to obtain movement direction angles from player movement 2022-01-16 11:31:14 +01:00
Ovahlord 3ff8840fe2 Core/Items: ported several enchantment flag implementations from master branch 2022-01-09 18:15:38 +01:00
Ovahlord 009e1dba37 Core/Spells: coefficient scaling will no longer affect attack power multipliers 2022-01-09 15:09:21 +01:00
Ovahlord e84bb6e6ba Core/Units: no longer send debug hitInfo flags as these have no clientside effect at all
closes #261
2022-01-05 22:35:30 +01:00
Ovahlord 7dc29ee9c1 Core/Spells: skip unnecessary coefficient scaling lookups when no coefficient is provided 2022-01-05 22:32:05 +01:00
Ovahlord 2dc07876ea Core/Spells: implement spellpower and attackpower coefficient scaling 2022-01-05 20:19:06 +01:00
Ovahlord 01d0a0b09c Core/Spells: use the correct getter for school mask 2022-01-05 15:03:42 +01:00
Ovahlord fa378dc870 Core/Spells: Unit::MeleeDamageBonusTaken will now use the SchoolMask of melee attack spells when spellInfo is provided
ref https://github.com/TrinityCore/TrinityCore/issues/27523
2022-01-05 13:11:58 +01:00
Ovahlord 7f62463f36 Core/Movement: no longer blindy rely on ack messages to change movementstatus values as the client can and will sometimes ignore packets such as when receiving movement packets while not being sent out via update object (changing maps via teleport) 2022-01-04 15:04:49 +01:00
Ovahlord 7b3f163ef6 Core/Movement: no longer override a player's movementInfo with the info returned from dismissing controlled vehicles as these do not belong to him. This fixes players getting stuck in a disable gravity state when exiting vehicle seats that have disabled a player's gravity 2022-01-04 12:59:55 +01:00
Ovahlord 91516e155f Core/Units: ported another crashfix from TC 2022-01-04 11:48:42 +01:00
Shauren 8acf90d115 Core/Units: Sync ProcessTerrainStatusUpdate code with master branch 2022-01-01 16:49:48 +01:00
Ovahlord 8202480a93 Core/Units: corrected calculations for dodge, parry and spell hit chances 2021-12-29 19:37:47 +01:00
Ovahlord efc94b46f4 Core/Units: corrected melee miss chance calculation 2021-12-29 19:12:37 +01:00
Giacomo Pozzoni adde43e965 Core/AI: Fix crashes caused by charmed Creatures having null AI for 1 map update tick (#27434)
Implement using ScheduledChangeAI instead of nullptr to signal a required AI change
# Conflicts:
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Entities/Unit/Unit.h
2021-12-27 22:25:11 +01:00