Commit Graph

1002 Commits

Author SHA1 Message Date
Meji
7c15ec00c7 Core/BattlePets: Fixes when adding pets (#27076)
* Add pet when learning it for the first time (summon spell not known).
* Removed code that adds battle pet if its summon spell is known (Learn cageable pet -> Cage pet -> Log out -> Log in -> Pet is added).
* When uncaging check that the species has a summon spell before trying to learn it.
2021-10-17 00:11:48 +02:00
Shauren
6b69338990 Core/Items: Refactored learning spells from items to check for ITEM_SPELLTRIGGER_LEARN_SPELL_ID instead of hardcoded spell ids 2021-10-16 13:22:42 +02:00
Meji
11cc5c0d3b Core/BattlePets: Misc fixes (#27057)
* Rename WorldPackets::BattlePet::BattlePet::CollarID to WorldPackets::BattlePet::BattlePet::DisplayID
* Use the DisplayID field to store the model of the battle pet. If the species has BattlePetSpeciesFlags::RandomDisplay, nothing is stored. Otherwise a random model is chosen from those available
* Stored DisplayID in ITEM_MODIFIER_BATTLE_PET_DISPLAY_ID when caging the battle pet (previously the CreatureID was being stored)
* Modified SendPlaySpellVisual function to allow sending Target and TargetPosition at the same time
* Added SpellVisual when uncaging
2021-10-16 12:15:03 +02:00
ModoX
68c2fc8ff5 Core/Characters: Made homebind location a WorldLocation (this implicitly adds orientation) (#27055) 2021-10-16 01:17:47 +02:00
Shauren
990e4d8657 Core/Spells: Fixed Righteous Defense crash caused by modifying target list inside effect handler
* Already handled in a script

Closes #22158

(cherry picked from commit 2351d02930)
2021-10-15 00:16:43 +02:00
ModoX
94aca04c3b Core/Player: Added SendPlayerBound method 2021-10-13 19:33:19 +02:00
Shauren
49eb3cf8fe Core/Spells: Implemented SPELL_EFFECT_TELEPORT_WITH_SPELL_VISUAL_KIT_LOADING_SCREEN 2021-10-13 11:49:30 +02:00
ModoX
1673b6e2ff Core/Spells: Implemented SPELL_EFFECT_CANCEL_CONVERSATION (#27037) 2021-10-11 14:50:04 +02:00
Shauren
d7302ffd14 Core/Scenes: Implemented spell created SceneObjects 2021-10-11 12:59:19 +02:00
Shauren
3fe9b0a296 Core/Conversations: Replace _participants with generic personal object implementation 2021-10-09 13:30:47 +02:00
ModoX
00dd4629bd Core/Scenes: Defined more flags and implemented FadeToBlackscreenOnCancel (#26975) 2021-10-05 22:36:22 +02:00
Meji
0cfd14d2a0 Core/BattlePets: Misc fixes (#26990)
* Define BattlePetBreedQuality enum class.
* Check the quality of the battle pet species in battle_pet_quality table to avoid invalid values.
* Set CurrentBattlePetBreedQuality and WildBattlePetLevel update fields with the data of the summoned battle pet.
* Added function to calculate the WildBattlePetLevel of wild battle pets according to their spawn zone.
2021-10-03 21:20:45 +02:00
Shauren
cbf1f2883a Core/Spells: Reduce number of CastSpell overloads to 1 2021-10-03 19:58:03 +02:00
Shauren
555b2d40ec Core/Spells: Send OriginalCastId in SMSG_SPELL_START and SMSG_SPELL_GO for triggered spells in 'game' project 2021-10-03 16:36:39 +02:00
Shauren
3af9be830d Core/Spells: Removed CastSpellExtraArgs constructors accepting ObjectGuid, they would become ambiguous with future changes 2021-10-03 14:58:35 +02:00
Meji
de4eaa0de9 Core/BattlePets: Misc fixes (#26964)
* Define BattlePetSpeciesFlags enum class.
* Define BattlePetDbFlags enum class.
* Added check to prevent the pet from being caged if its species has flag BattlePetSpeciesFlags::NotTradable.
* Added check to prevent the pet from being caged if it's in battle pet slots.
* Added check to prevent the pet from being caged if its health is below maximum health.
* Only add pet if the species has flag BattlePetSpeciesFlags::WellKnown.
* Added function to check flag BattlePetSpeciesFlags::LegacyAccountUnique to avoid learning copies of unique pets.
* Implemented CMSG_BATTLE_PET_CLEAR_FANFARE.
2021-09-29 22:26:25 +02:00
ccrs
426f9f2f92 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).

(cherry picked from commit 982643cd96)
2021-09-28 00:15:13 +02:00
Keader
69663cc94f Core/Spells: Fix UNIT_CREATED_BY_SPELL in SPELL_EFFECT_SUMMON (#21756)
(cherry picked from commit 309738dc3e)
2021-09-23 23:50:13 +02:00
Treeston
bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2)
2021-09-23 22:21:29 +02:00
ariel-
a2ea26816e Core/Spell: fix target checks
- Aura will be applied at last moment possible (after damage) to prevent regressions on #18395
- Partial revert of 9b38a6352c as it wasnt handling correctly checks without spells

Closes #21578
Closes #21579
Closes #21581

(cherry picked from commit d6b9f148a7)
2021-09-05 22:43:48 +02:00
ariel-
c07b9188df Core/Spells: register and apply individual aura effects on hit handler
- Remove area aura processing from spell system, they're fully handled by aura owner update now

Closes #21577

(cherry picked from commit 4ca9d6469d)
2021-09-05 15:19:55 +02:00
Shauren
8a4e1119ac Core/Spells: Unify spell effect access api in both branches 2021-09-04 15:13:15 +02:00
Shauren
6031b95ea7 Core/Spells: Remove outdated damage calculations from Spell::EffectSchoolDMG and Spell::EffectWeaponDmg 2021-08-30 21:21:51 +02:00
Shauren
aebf308368 Core/Spells: Fixed Spell::EffectWeaponDmg for spells with multiple damage effects
Closes #26717
2021-08-28 19:53:53 +02:00
Shauren
3dd75a49b1 Core/Spells: Removed SpellEffIndex effIndex argument from spell effect handlers, it was commented out in almost every handler 2021-08-28 19:51:29 +02:00
Shauren
bc2c76a5b8 Core/Spells: Refactor building SMSG_SPELL_EXECUTE_LOG to not create 192 empty vectors on every spell cast 2021-08-28 18:30:45 +02:00
ariel-
962f6d7988 Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752

(cherry picked from commit 45c5e1b9d6)
2021-08-28 15:59:11 +02:00
ariel-
65dca120d3 Core/Spells: rework part 4: iterate over effects first
Ref #18395

Implement far spell queue processing
Closes #7395

(cherry picked from commit 080d2c6cd4)
2021-08-28 15:59:11 +02:00
ariel-
f3548d45d0 Core/Spells: rework part 3: spells only handle at most one UnitAura and one DynObjAura during its lifetime
Closes #15088

(cherry picked from commit e8d5aa56cc)
2021-08-28 15:59:11 +02:00
Jeremy
69edf282fa Partial: Core/Entities: Reduce the probability of units dropping under the map (#21322)
Reduce the probabilty of going under the map

(cherry picked from commit 9e0faace9a)

Revert "Core/Entities: Reduce the probability of units dropping under the map (#21322)"

(cherry picked from commit 2dadbda24a)
2021-08-08 21:21:34 +02:00
Shauren
fcead0b4ea Core/Spells: Use caster as chat source in Spell::EffectSendChatMessage 2021-08-08 18:15:00 +02:00
Shauren
ce1046a8fd Core/DataStores: 9.1.0 db2 structures 2021-08-08 00:18:10 +02:00
ariel-
15810eb579 Core/Unit: kill unused parameter from SpellxxxBonusTaken
(cherry picked from commit c7095375c3)
2021-06-20 01:09:20 +02:00
ariel-
3485cb38ed Core/Spells: remove 'Vanish Purge' hack, the spell is present on DB and is copy of one in vanilla DBC
Thanks to killerwife for the heads-up

(cherry picked from commit 303efcf0e4)
2021-06-19 23:33:25 +02:00
ariel-
f9b14ca795 Core/Spells: fix logic error causing near teleports to drop combat for players
Closes #21362

(cherry picked from commit 65709e1c30)
2021-06-19 23:33:24 +02:00
ariel-
d34292534c Core/Spells: fix SPELLMOD_DAMAGE application order for melee spells
Closes #20597

(cherry picked from commit 2d2c43f4b9)
2021-06-19 23:33:23 +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 3b01cccd7e)
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 cb9e72e521)
2021-06-13 00:59:13 +02:00
xinef1
1912999b9e Core/Spells: Defined and implemented some new spell attributes (#18950)
(cherry picked from commit 23823f5147)
2021-05-16 21:56:07 +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 532ab1c7f8)
2021-05-16 21:56:01 +02:00
Shauren
1a7779a6e6 Core/Spells: Expose number of targets selected for each spell effect to scripts to allow implementing spells that do something depending on number of targets hit 2021-05-13 00:38:09 +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
4e00cb7c15 Core/Spells: Fix feed pet effect after wrong merge conflict resolution 2021-04-22 22:57:00 +02:00
Matan Shukry
60df74933f Core/Spells: Removed extra health from feed pet (#26305) 2021-04-22 22:02:19 +02:00
Matan Shukry
a8fa2a03be Core/Items: Calculating item level + organized iterating over items (#26276)
* Unified iterating player items into a single function

Co-authored-by: Shauren <shauren.trinity@gmail.com>
2021-04-21 10:02:42 +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 d507a7e338)
2021-04-16 15:22:42 +02:00
Treeston
76b2d37259 Core/Spell: Remove some leftover hack code from ::EffectSanctuary pertaining to vanish. None of this code did anything anymore.
(cherry picked from commit 3a536260f8)
2021-04-15 05:53:27 +02:00
Shauren
2398c1e23c Core/Spells: Implemented SUMMON_PROP_FLAG_PERSONAL_GROUP_SPAWN 2021-03-28 20:22:05 +02:00
Shauren
46a81ea1f4 Core/Spells: Add missing privateObjectOwner support to Spell::SummonGuardian 2021-03-28 20:22:05 +02:00