Commit Graph
2058 Commits
Author SHA1 Message Date
ariel- 29bfa32fc3 Core/Entities: don't allow client control if player is still affected by any lose of control state
(cherry picked from commit e315e41d36061fc88dfa09bfa0da1fbc0c00826f)
2021-06-16 20:38:56 +02:00
ariel- df585571f1 Core/Unit: fixed Global cooldown cancelation on spell interrupt
Thanks to Nyeriah for the heads up

(cherry picked from commit 514c847881a9fff504e90f1186a1209c0b8a3674)
2021-06-16 19:43:20 +02:00
Treeston 14bda72751 Core/Unit: Remove a superfluous threat state update in SetPhaseMask.
(cherry picked from commit 2c86c78f04f7cb95c201592b8d3002525eb6a46f)
2021-06-16 14:37:58 +02:00
ariel- 85ffcd9826 Core/Scripts: fix wrong uses of SetHitDamage hook.
This hook modifies damage AFTER it has been reduced by target auras/armor/resistances etc, it's useful if you want to scale damage by a factor, but not to add flat bonuses.
We're fixing those by moving calculation to Launch phase, where target taken bonuses haven't been used yet.

- Bronjahm: Magic's Bane
- BPC: Shadow Prison
- Oculus: Shock Lance
- Ymiron: Dark Slash (extra fix, it was wrongly damaging half of total health, it's supposed to be half of CURRENT health!)
- DK: Raise Ally Thrash spell (also extra fix: corrected formula)
- Warrior: Bloodthirst (shouldn't matter much as it's damage class none and those don't get bonuses by default)
- Warrior: Concussion Blow
- Warlock: extra fix for Haunt, healing part shouldn't scale with spell power

Closes #9560

(cherry picked from commit 9f5d1e2b10013e5fecf35fdd5af70921c96d07d1)
2021-06-16 14:26:09 +02:00
ariel- d0fa8c72a3 Core/Unit: check remaining instead of full duration for Bounced by DR auras
(cherry picked from commit ccf0807be0974dfb8080cb2fc6ea616cc96f062c)
2021-06-15 23:42:10 +02:00
ariel- bf4330bfb5 Core/Unit: fix mess-up with CalcArmorReducedDamage parameter order
(cherry picked from commit 01537e1dfbd042b3608d5ac895009182026def00)
2021-06-15 23:08:27 +02:00
ariel- 431a326e69 Core/Entities: Port some refactors from f1986c6aafdf2457902a7a4cc7acc903cbbdc7bb 2021-06-15 00:48:02 +02:00
ariel- 6ab410b926 Core/Unit: allow miss chance to exceed 60% cap with certain auras
(cherry picked from commit 688e96fb4ffcdeb55b58d13285e3cebfbc617614)
2021-06-14 18:52:48 +02:00
ariel- 770367a514 Core/Unit: fix Sanctified Wrath (again)
- Actually only rank 1 was affected because of 50% reduction on rank 2

(cherry picked from commit 0e9b1635e0a2351342e8ed0ae4a1495479e09ffc)
2021-06-14 18:50:10 +02:00
ariel- 84a29d8077 Core/Unit: fixed crash
Closes #21231

(cherry picked from commit 22b24d8dae23d4a4b4314f46b65b8e453816eef7)
2021-06-14 01:19:38 +02:00
ariel- bec829df0a Core/Unit: simplified and arranged spell bonus calculation
- Remove duplicated SPELLMOD_BONUS_MULTIPLIER handling (both on done and taken)
- Handle properly bonus data, don't apply bonus by default, only player spells should take into account spell power
- Moved Earthliving Weapon coefficient to DB
- Refactored Avenging Wrath handling

Closes #13287
Closes #21230

(cherry picked from commit d570e2af3e7bcb625d8941397d55972d49319a8f)
2021-06-14 01:17:43 +02:00
ariel- 5fbddef85f Core/Spell: SpellValueOverrides encapsulation
- No sense to let scripts use SpellValueOverrides, we already have modifiers in CastSpellExtraArgs struct

(cherry picked from commit 3b01cccd7eafaff9f3b8236a544e4fa46818926c)
2021-06-14 00:19:50 +02:00
ariel- fccf1a8c62 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

Closes #19876

(cherry picked from commit cb9e72e521d3cc415dd15bf6912c87f89e41b92a)
2021-06-13 00:59:13 +02:00
Shauren f6b919fafe Core/Reputation: Named all reputation flags 2021-06-05 23:00:06 +02:00
Shauren 9542d221cb Core/Units: Add std::function overloads to GetAura/GetAuraApplication 2021-06-04 21:20:55 +02:00
Shauren 6ecfe58cae Core/Maps & Extractors: Move copypasted map file headers into a single shared file and replace #defines with enums 2021-05-29 21:21:37 +02:00
Treeston ac8ff49274 Core/Unit: Abide UNIT_FLAG2_DISABLE_TURN on creatures. Add that flag to Kologarn (from sniff). Hi sirikfoll.
(cherry picked from commit d9c772303cc17d98581cc52bb51116f640e23c08)
2021-05-17 00:36:06 +02:00
xinef1 1912999b9e Core/Spells: Defined and implemented some new spell attributes (#18950)
(cherry picked from commit 23823f5147e808928e1d8cd31b6cdf31753ef14d)
2021-05-16 21:56:07 +02:00
Shauren c79e5528e1 Core/Units: Remove Unit::EnergizeBySpell overload taking spellId argument 2021-05-16 21:56:06 +02:00
Treeston dce39aedc2 Core/Combat: Some more sanity check asserts to try and track down #21187.
Also, some anti-annoyance treatment for dot tele.

(cherry picked from commit fdacf127395965b426185f05a7b1351138775e89)
2021-05-16 21:56:05 +02:00
Treeston 34c7810fe5 Core: Combat/threat system rewrite (PR #19930)
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.

(cherry picked from commit 532ab1c7f8653d1a2e48aa1f1f8a9ba1041d4bb7)
2021-05-16 21:56:01 +02:00
Shauren 331c7ec7c2 Scripts/Spells: Remove manual damage adjustment from Arcane Barrage for scaling with arcane charges and use spell cast for mana energize 2021-05-15 17:44:31 +02:00
Matan Shukry be8cbab4b3 Scripts/Spells: Fixed arcane barrage + explosion 2021-05-15 17:44:31 +02:00
Shauren b511fac643 Core/Spells: Send actual power gain amount in spell energize log 2021-05-15 02:15:09 +02:00
Ovahlord a0a4d23fed Core/Units: No longer send PowerUpdate packets when gaining power via energize spell effects 2021-05-13 00:43:11 +02:00
Shauren 1cf5f6e82e Core/PacketIO: Fixed combat log packets not being sent to self 2021-05-05 22:10:55 +02:00
Shauren fb66575d38 Core/Grids: Move packet sending functionality out of MessageDistDeliverer and into separate, customizable class and unify LocalizedPacketDo, LocalizedPacketListDo as generic localizable action 2021-05-01 20:16:10 +02:00
Shauren 3a37a2e0d7 Core/Grids: Allow customizing packets sent with MessageDistDeliverer and MessageDistDelivererToHostile depending on receiver
* Switch combat log sending to that implementation
2021-04-30 00:08:07 +02:00
Shauren 8e6821648b Core/Spells: Only interrupt spells with interrupt flag Combat when spell also has SPELL_ATTR0_CANT_USED_IN_COMBAT attribute 2021-04-29 18:51:56 +02:00
ariel- b426e64c39 Core/Entities: fix crash
- m_currentSpells and spell would be different in case cancelation of a channeled spell would remove the aura, and aura scripted to cast another channeled spell on remove
- In the above situation, we would lose reference of currentSpell and remove reference from wrong one, this was fixed by clearing the pointer before spell cancelation.

Closes #20172

(cherry picked from commit 5e284d4b3826cd345193298688c1d2bc5b3c8f72)
2021-04-27 23:56:35 +02:00
Shauren 854a55daab Core/PacketIO: Implemented SMSG_SPELL_ABSORB_LOG 2021-04-18 00:12:46 +02:00
Matan Shukry 530631e0a7 Core/Auras: Implemented SPELL_AURA_SCHOOL_ABSORB_OVERKILL (#26269) 2021-04-17 22:42:34 +02:00
Treeston bce43de7f3 Core/AI: Some more refactoring prep for #19930. CreatureAI::EnterCombat is now called CreatureAI::JustEngagedWith. There's also two new methods on UnitAI, though they're never invoked right now.
(cherry picked from commit 6113b9dec2e0081c36c36c2974a28ed0693bc601)
2021-04-16 20:22:13 +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
Jeremy 446fc391f0 Core/Entities: Fix some weird movement due to los issues (#21125)
* Core/Entities: Fix some weird movement due to los issues
- Made LoS check use collisionHeight instead of midsection. Value was too low.
- Gnomes will now have a breath bar more quickly than for example a tauren.
- Changes have been made to checking for ground z as well, some tweeking might be needed but removed most of the scattered +2.0f/+0.5f/we
* Add 0.05f to isInAir check in Creature::UpdateMovementFlags

(cherry picked from commit e42903ec16f4849b71bc8736e3151a1e11d3cd25)
2021-04-15 05:53:27 +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
ariel- bebc20b4de Core/Spell: implement SPELL_FAILED_AURA_BOUNCED on DR spells
Closes #13695

(cherry picked from commit 5e2c5a52cd8a4ce12e189034df66b42d0d0b2c01)
2021-04-15 05:53:27 +02:00
Léo Gautheron a58dcd1d9c Core/Unit: make neutral guards attack players involved in PvP
Fix https://github.com/TrinityCore/TrinityCore/issues/17635

(cherry picked from commit e96cf0b2426068947864a36eaece2a9312c0e48e)
2021-04-15 05:53:27 +02:00
Matan Shukry b92e20f6c8 Script/Spells: shaman spell fixes (#26192)
* Flametongue Weapon
* Tremor Totem
* Healing Stream Totem
* Liquid Magma Totem
* Healing Rain
2021-04-11 19:23:19 +02:00
Shauren f2202869f7 Core/PacketIO: Updated packet structures to 9.0.5 2021-04-09 20:57:47 +02:00
Robingad f8255b1541 Core/Script: Implement CalcCritChance hooks for spell and aura scripts (#26116)
(cherry picked from commit AshamaneProject/AshamaneCore@4e0a3f4343)
2021-03-25 21:28:22 +01:00
Shauren 07a47947e2 Core/Spells: Defined and implemented new spell interrupt flags 2021-03-24 23:36:53 +01:00
Matan Shukry 2420f4e7a1 Core/Scripts: Implemented new aura script hook OnEnterLeaveCombat 2021-03-23 00:46:47 +01:00
Shauren 88f4d30445 Core/Units: Corrected values of UnitData::Resistances (should be total value) 2021-03-21 22:19:43 +01:00
Shauren 9b5a46ca2b Core/Auras: Defined and implemented many new interrupt flags 2021-03-21 12:05:32 +01:00
Shauren 6db27c58b9 Core/Spells: Updated spell shapeshift form flags enum 2021-03-19 23:48:33 +01:00
Shauren 69e0b9a985 Core/Auras: Update AuraState enum and implement missing new ones 2021-03-16 20:48:42 +01:00
Shauren 6585666e6e Core/Spells: Define all spell modifier types and implement ProcCooldown mod and PeriodicHealingAndDamage for melee periodic damage 2021-03-15 21:03:06 +01:00
ariel- f20a904b74 Core/Spells: allow auras to proc from partial blocks
Closes #21065

(cherry picked from commit 3722a96f4f938a4870f85f2abb1d19be63bf000b)
2021-03-15 20:17:31 +01:00
ariel- 5f9e0d92d5 Core/Auras: periodics refactor part 1:
- Don't skip ticks if diff is greater than amplitude
- Fixed spells without ampltude in DBC

(cherry picked from commit 5d91beb1dbc795382a12ec05f6e72c76b195b141)
2021-03-15 20:17:31 +01:00