Commit Graph

768 Commits

Author SHA1 Message Date
ariel-
e8d5aa56cc Core/Spells: rework part 3: spells only handle at most one UnitAura and one DynObjAura during its lifetime
Closes #15088
2018-03-09 14:41:28 -03:00
ariel-
9b38a6352c 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

Closes #8844
2018-03-09 14:41:28 -03:00
ariel-
efeae33495 Core/Spells: rework part 1: Improved positive detection logic 2018-03-09 14:41:28 -03:00
ariel-
6e0b9a7916 Core/Creatures: port power type updates from master branch
Core/Misc: Added helper function Unit::SetFullPower
Cherry-picked from 8199eef81c

Core/Creatures: Updated power type handling (#20981)
Cherry-picked from 16a7a414ab
2018-03-07 03:34:45 -03:00
Treeston
e79c595b69 Core/VMap: Add outdoor state to Map::GetFullTerrainStatusForPosition. Add WorldObject::IsOutdoors, basic member access.
Ref #21479.
2018-02-26 17:40:40 +01:00
jackpoz
e482d9f303 Core/Spells: Revert SPELL_ATTR2_IGNORE_ITEM_CHECK to unknown
Revert SPELL_ATTR2_IGNORE_ITEM_CHECK to unknown, too many spells unrelated to items have this attribute and the current handling was causing exploits with "Mote of Water" and other elements.
Fix #19547
2018-02-18 12:20:25 +01:00
Cannix
7e71b4535a Core/Spells: Execute item casts immediately instead (#21396) 2018-02-17 16:46:26 +01:00
Jeremy
9e0faace9a Core/Entities: Reduce the probability of units dropping under the map (#21322)
Reduce the probabilty of going under the map
2018-02-16 20:59:19 +01:00
ariel-
29f7258dc8 Core/Spells: prevent creatures to focus channeled spells without SPELL_ATTR1_CHANNEL_TRACK_TARGET
- Creatures stuck here wouldn't try attacking because of this
- Remove one workaround in halion script, now it's unneeded

Ref #11311
2018-02-15 17:50:15 -03:00
ariel-
93cbe815cb Core/Spells: fixed server being too overzealous with autoshot
- Interrupting it when casting another spell and switching targets

Ref #21390
2018-02-14 23:10:41 -03:00
ariel-
546a605bd0 Core/Spells: implement SPELLVALUE_CRIT_CHANCE and SPELL_ATTR4_INHERIT_CRIT_FROM_AURA
Closes #18813
2018-02-12 00:21:26 -03:00
ariel-
e979a58d17 Core/Spells: remove duplicated LowerPlayerDamageReq call on reflected spells
- It is already called at Unit::DealDamage
2018-02-04 22:07:10 -03:00
ariel-
9fc732eb97 Core/Spells: kill unused parameter from Spell constructor
Added in 1f2292af79
2018-02-04 20:15:38 -03:00
ariel-
b1072faa50 Core/Spell: killed deprecated code which randomly changed powercost for missed spells
Added in 80d3cd43f6

Closes #5954
2018-01-24 13:07:01 -03:00
ariel-
c099174ff7 Core/Misc: fix some /W4 warnings and some reported by GCC 6.3 2018-01-22 23:55:33 -03:00
ariel-
22b24d8dae Core/Unit: fixed crash
Closes #21231
2018-01-13 21:36:06 -03:00
ariel-
cb9e72e521 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
2018-01-13 06:45:21 -03:00
xinef1
23823f5147 Core/Spells: Defined and implemented some new spell attributes (#18950) 2018-01-08 20:31:21 +01:00
ariel-
e245113660 Core/Spells: fix casting NO_TARGET event spells
Closes #19978
2018-01-03 22:49:13 -03:00
Treeston
532ab1c7f8 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.
2018-01-03 20:04:19 +01:00
ariel-
5e284d4b38 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
2018-01-01 17:18:00 -03:00
tkrokli
f6b6f57a6d Update copyright note for 2018
Best wishes for the new year.
2018-01-01 01:55:29 +01:00
Treeston
d507a7e338 [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
2017-12-30 20:28:41 +01:00
Jeremy
e42903ec16 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
2017-12-29 22:32:07 +01:00
ariel-
5e2c5a52cd Core/Spell: implement SPELL_FAILED_AURA_BOUNCED on DR spells
Closes #13695
2017-12-21 02:25:04 -03:00
Shauren
6122006b0c Core/Spells: Changed channel triggered spells to inherit positive/negative status from main spells
Closes #18259
Closes #21041
2017-12-13 21:46:42 +01:00
joschiwald
842a65ac15 Core/Spells: Spells with TARGET_SELECT_CATEGORY_NEARBY requires a valid target (#20954) 2017-12-10 11:16:43 +01:00
Ovah
51bcd1a918 Core/Spells: Gathering no longer fails after patch 3.1.0 (#21039)
* Core/Skills: gathering items with orange skill level will no longer fail as it has been removed with patch 3.1.0

Closes #21038
2017-12-09 22:58:22 +01:00
Chaouki Dhib
9dbef4b6bb Core/Spells: Core/Spells: Improve teleport destination for a certain class of spells (Killing Spree, Shadowstep, ...) (#20434)
Close # 8758
2017-10-12 22:06:27 +02:00
Gustavo
e9cd7af2df Core/Scripts: Rewrite Boss Kalecgos (Sunwell Plateau) (#19897)
* Core/Scripts: Rewrite Boss Kalecgos (Sunwell Plateau)

Scripted all spells
Corrected behavior of Spectral Blast and Curse of Boundless Agony
Removed wrong wipe behavior
Fix problem where bosses would be stuck with banish
Added Boundaries
Corrected texts
Removed old hacks
Other minor fixes
2017-08-08 22:36:40 -03:00
jackpoz
9cf4dd7345 Core/Misc: Fix static analysis issues 2017-07-16 18:20:29 +02:00
treeston
5d3c69bf44 Creatures now release spell focus on projectile launch (for spells that have a projectile portion) as opposed to projectile impact.
This should make some very slow projectiles (f.ex. Professor Putricide's Malleable Goo) a lot smoother.
2017-07-03 00:17:31 +02:00
Treeston
e2a1ccd118 [3.3.5] Combat/Threat rewrite - prep & refactor (#19966)
* Combat/Threat rewrite (PR #19930) prep work. Mostly refactors, and a compatibility layer on ThreatManager/HostileReference that allows scripts to be changed already.
2017-07-01 20:18:02 +02:00
Treeston
489478b74d Core/Entities: Extend combo point system to all Units and fix numerous quirks with rogue CP and vehicles (Malygos P3) (#19914)
- Implement Wolverine Bite (fixes #752)
- General combo point system cleanup
2017-06-24 22:41:16 -03:00
ariel-
85a7d5ce9a Core: ported headers cleanup from master branch 2017-06-19 23:20:06 -03:00
ariel-
fd07c4985e Core: fix warning 2017-06-19 13:38:01 -03:00
Shauren
d6201e5dbb Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50
(cherry picked from commit 9299e9bde0)
2017-06-19 13:16:13 -03:00
treeston
d57307f63d So, I came in trying to fix gameobject LoS. So I restructured some stuff.
Then it turned out that gameobject LoS is already fixed. So all this does, really, is restructure some stuff.
And remove the hack from Sapphiron because I could.
2017-06-10 15:08:35 +02:00
Treeston
f6c849729b [3.3.5] Get zone/area IDs from vmap data in the liquid update (#19840)
* Add new method Map::getFullVMapDataForPosition to get area info and liquid info in a single vmap lookup
* Use this lookup in Map:: relocation methods to update m_areaId and m_zoneId fields on WorldObject
* Adjust GetZoneId/GetAreaId on WorldObject to always return these cached fields
* Clean up liquid state handling on Unit and Player
* Hand floor's Z coord up through GetFullTerrainStatusForPosition, use it to update a new field in WorldObject, and use that to feed a new GetFloorZ call on WorldObject.

Closes #16489
2017-06-08 00:25:06 +02:00
Treeston
1660bb7d27 Pet/Guardian AI hook re-organizing (#19824)
* Pet/Guardian AI hook re-organizing:
- Adjust OwnerAttacked/OwnerAttackedBy hooks on CreatureAI to fire for all owned units, not just player pets. This should allow guardians to more reliably recognize valid targets.
- Kill off the AttackedBy hook. While it was defined in CreatureAI.h as virtual, it was only ever invoked for player pets in specific situations. This makes it classic developer bait.
  - Adjust PetAI to use DamageTaken instead of AttackedBy.
  - Adjust behavior of AttackStart on PetAI to compensate.
2017-06-07 02:33:47 +02:00
treeston
b983ec11bd Re-check target evade state on projectile impact and adjust accordingly. This fixes the incorrect message ("Absorb" instead of "Evade"), and also removes the root cause of the original evade follow bug (that was prevented in 1945874). 2017-06-06 19:24:14 +02:00
Shauren
abac1b34bc Core/Utilities: Rename RandomResizeList->RandomResize as it is no longer restricted to a list
* Also fix gcc build

(cherry picked from commit f097e341f5)
2017-06-03 02:27:48 -03:00
ariel-
63e502a67d Core/Spell: in case of immunity, check all effects to choose correct procFlags, as none has technically hit 2017-05-28 18:19:15 -03:00
treeston
1c528c30f8 Quickfix a bug introduced by 2f19d97 which prevented GTAoE from being cast. 2017-05-27 21:05:26 +02:00
ariel-
2f19d97d21 Core/Spell: abort channeling if no valid targets are found after searching
Closes #17624
2017-05-27 01:40:14 -03:00
Chaouki Dhib
2ff76e828f Core/Spells: Change the radius of PBAoEs following the feedback received on (#16290) 2017-05-14 21:40:11 +02:00
ccrs
df96e053a5 Core/Spell: move creature focus
bellow the possible interruptions
2017-04-27 14:16:40 +02:00
ariel-
1f4439ece4 Core/Spell: don't make creature change orientation to 0 if channeling self 2017-04-23 21:48:06 -03:00
ariel-
88c12b45d0 Core/Spell: fix creature focus with channeled spells
- Remove one not needed ReleaseFocus, this is done at finish already
2017-04-22 04:00:49 -03:00
ariel-
8b52cf902b Core/Spell: register spell mod owner properly on spell cast
- This fixes pets and totems getting mods from owner
2017-04-15 15:58:56 -03:00