Commit Graph
706 Commits
Author SHA1 Message Date
Shauren 388c504047 Core/Spells: Named and implemented most of SpellAttr8 2023-10-23 18:07:05 +02:00
Shauren 3c0cf32b43 Core/Spells: Named and implemented most of SpellAttr7 2023-10-21 20:32:32 +02:00
Shauren 77c017555b Core/Auras: Registering a new owned aura will now search existing owned auras instead of applied auras to check for unstackable one 2023-10-18 21:43:46 +02:00
Ovahlord 5c13baf230 Core/Misc: removed unused includes and removed unit include from vehicle.h 2023-10-10 03:01:05 +02:00
Ovahlord faa78b9e07 Core/Units: moved spell cast request includes out of unit class and use unique_ptr instead of optionals 2023-10-09 22:07:13 +02:00
funjoker df32b341a5 DB/Creatures: Port master model system
Fixes incorrect displayid for creatures, due to probability
2023-09-15 23:52:51 +02:00
Ovahlord 770f9e11db Core/Movement: sync spline code with master branch 2023-08-19 15:04:34 +02:00
Shauren 9480f79c2a Core/Scripts: Added damage and healing calculation hook to spell and aura scripts allowing to override base damage amount, flat value mod and percent value mod separately 2023-08-03 21:32:20 +02:00
Traesh ee8e20d81f Core/Units: Allow autoattack if channelling with SPELL_ATTR5_ALLOW_ACTIONS_DURING_CHANNEL 2023-07-16 15:30:34 +02:00
Ovahlord 5f808b5247 Core/Entities: modernized several pointers and arrays in Player, Unit and Creature classes 2023-07-08 17:55:25 +02:00
Ovahlord aaff7e2ced Core/Units: fixed more deprecation warnings 2023-07-07 22:54:01 +02:00
Ovahlord e12c3597f4 Core/Unit: fixed more deprecation warnings 2023-07-07 22:29:52 +02:00
Ovahlord 40ec92758c Core/Packets: converted SMSG_EMOTE to packet class 2023-06-05 13:24:02 +02:00
Ovahlord 9455b09518 Core/Packets: converted SMSG_PET_ACTION_SOUND to packet class and renamed its related method to Unit::SendPetActionSound 2022-12-11 20:12:35 +01:00
Ovahlord 92c9661804 Core/Packets: converted SMSG_PET_ACTION_FEEDBACK to packet class and added spellId argument to Unit::SendPetActionFeedback 2022-12-11 20:03:57 +01:00
Shauren c3b52fd29f Core/Auras: Improve aura interactions with immunities on spell effect level
* Effects that target is immune to will be suppressed instead of completely removed
2022-09-30 12:49:31 +02:00
Shauren c78371f321 ore/Spells: Autorepeat casting fixes
* Fixed cast bars of ranged spells not disappearing when canceled while autoshooting
* Replaced hacky 500ms delay on non auto shot autorepeat spells with native spell cast time (wands have 500ms cast time)
* Update cooldowns before attempting to cast autorepeat spells (for cases when cooldown ends on the same server tick as cast attempt)
2022-09-30 11:08:20 +02:00
Shauren 75906f3d06 Core/Auras: Added support for SPELL_ATTR5_LIMIT_N limit to other number than just 1 2022-09-30 01:57:52 +02:00
Shauren a7dc339a6a SHA-1: 8d16a79dea4c0100d36e13b068c42499a3a48154
* Core/Spells: Rename SpellAttr4 to use official attribute names

* Corrected implementation of SPELL_ATTR4_CLASS_TRIGGER_ONLY_ON_TARGET
* Implemented SPELL_ATTR4_NO_HELPFUL_THREAT
* Implemented SPELL_ATTR4_NO_PARTIAL_IMMUNITY
* Implemented SPELL_ATTR4_ALLOW_PROC_WHILE_SITTING
* Implemented SPELL_ATTR4_USE_FACING_FROM_SPELL
* Implemented SPELL_ATTR4_BOUNCY_CHAIN_MISSILES
* Implemented SPELL_ATTR4_AURA_NEVER_BOUNCES
* Implemented SPELL_ATTR4_AURA_BOUNCE_FAILS_SPELL
* Implemented SPELL_ATTR4_AURA_IS_BUFF
* Implemented SPELL_ATTR5_MELEE_CHAIN_TARGETING

* Implemented SpellEffectAttributes::ChainFromInitialTarget
2022-09-30 01:16:39 +02:00
Ovahlord ef3632109d Core/Spells: ported SpellModOp definitions from master branch 2022-09-17 11:56:54 +02:00
Ovahlord a7ba9502d7 Core/Units: a587f99c30 followup 2022-09-13 16:30:15 +02:00
Ovahlord a587f99c30 Core/Units: correct block chance and damage calculation of melee spells
*MeleeSpellHitResult already returns a valid block roll result so we don't need a 2nd roll in CalculateSpellDamageTaken
2022-09-13 16:14:42 +02:00
Shauren ea4bc6c02a Core/Spells: Rename SpellAttr2 to use official attribute names
* Corrected implementation of SPELL_ATTR1_ALLOW_WHILE_STEALTHED
* Implemented SPELL_ATTR2_RETAIN_ITEM_CAST
* Implemented SPELL_ATTR2_ALLOW_WHILE_INVISIBLE
* Implemented SPELL_ATTR0_PROC_FAILURE_BURNS_CHARGE
* Implemented SPELL_ATTR2_PROC_COOLDOWN_ON_FAILURE
* Implemented SPELL_ATTR2_NO_TARGET_PER_SECOND_COSTS
* Implemented SPELL_ATTR2_DO_NOT_REPORT_SPELL_FAILURE
* Implemented SPELL_ATTR1_REQUIRE_ALL_TARGETS
* Implemented SPELL_ATTR2_CHAIN_FROM_CASTER
* Implemented SPELL_ATTR2_NO_ACTIVE_PETS
* Implemented SPELL_ATTR2_ENCHANT_OWN_ITEM_ONLY
2022-09-13 14:36:32 +02:00
Ovahlord e3e4b2cf16 Core/Spells: dropped old dot clipping implementation and restored TC period and duration calculations in preparation of re-implementing it 2022-09-12 09:15:35 +02:00
Shauren ca7d36873f Core/Spells: Rename SpellAttr1 to use official attribute names
* Implemented SPELL_ATTR1_NO_SKILL_INCREASE, SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT, SPELL_ATTR1_DISPEL_ALL_STACKS
2022-09-12 09:15:31 +02:00
Shauren 96c4a1b1f9 Core/Spells: Fixed unapplying rockbiter weapon 2022-09-12 09:15:21 +02:00
Shauren adfeaa7666 Core/PacketIO: Fixed SMSG_SPELLNONMELEEDAMAGELOG structure 2022-09-12 09:15:20 +02:00
ariel- 3a3e70f2b6 Core/Spells: all bleed effects should ignore armor 2022-09-12 09:15:19 +02:00
ariel- b3c8d78fa2 Core/Spell: fix SendSpellMiss requiring caster Unit 2022-09-12 09:15:16 +02:00
ariel- 1fe5563431 Core/Spells: Fix periodic rolling adding bonuses twice
Calculation is now done in CalculateAmount
2022-09-12 09:15:15 +02:00
ariel- b6fac86b71 Core/Spells: rework part 5: GameObject casting 2022-09-12 09:15:14 +02:00
ariel- 3fbbea61bd Core/Spells: rework part 3: spells only handle at most one UnitAura and one DynObjAura during its lifetime
# Conflicts:
#	src/server/game/Spells/Auras/SpellAuras.h
2022-09-12 09:15:13 +02:00
ariel- 98a988a77a Core/Spells: rework part 2: Split up target selection logic
Target check only determines what kind of entities we can target, spell positivity determines if that entity is valid for attack/assist
2022-09-12 09:15:13 +02:00
ariel- 3bfa32d15b Core/Unit: kill unused parameter from SpellxxxBonusTaken 2022-09-12 09:15:11 +02:00
ariel- 6024b7b4fb Core/Unit: corrected calculation for SPELL_AURA_MOD_DAMAGE_TAKEN/SPELL_AURA_MOD_HEALING auras
- Spell bonus calculation and penalty was done twice, but it's simply flat +SP, which should be taken into account before other bonuses
- Fixed missing code from SpellDamageBonusDone/SpellHealingBonusDone and killed multiplication by stack amount twice for default coefficient spells (already multiplied on level penalty)
2022-09-12 09:15:11 +02:00
ariel- c81f48197d Core/Spells: calculate crit chance only for spells that do damage/healing 2022-09-12 09:15:10 +02:00
Ovahlord 30e219bfa1 Core/Entities: don't allow client control if player is still affected by any lose of control state 2022-09-12 09:15:08 +02:00
ariel- 29fddba8fd Core/Entities: Port some refactors from f1986c6aafdf2457902a7a4cc7acc903cbbdc7bb 2022-09-12 09:15:06 +02:00
ariel- 6fc5bfcd08 Core/Unit: fixed crash 2022-09-12 09:15:05 +02:00
ariel- 1d3fbff332 Core/Auras: removed caster dependency from core
- Decoupled Unit logic: split of spell critical chance into done (caster bonuses) and taken (target bonuses), this allows to precalculate caster bonuses on aura apply and then check victim's auras on damage/healing calc
- Made static a bunch of methods (they no longer have this pointer because they are now called from periodic handlers which may or may not have an active caster in world)
- Simplified all AuraEffect bonuses into AuraEffect::_amount, no more duplicated code
- Critical chance and whether or not caster is player owned unit (for resilience calcs) is now saved one level upper, on Aura itself (it's impossible as of 3.3.5 to have different effects with different critical chances)
- Minor cleanup of SPELL_DAMAGE_CLASS_NONE and Arcane Potency (#18813) crit handling
2022-09-12 09:15:04 +02: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
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- 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
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
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
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
Ovahlord a8301ba5f6 Core/Units: fixed a crash when creatures are having their attack speed increased via aura 2021-11-28 15:11:23 +01:00