Commit Graph

887 Commits

Author SHA1 Message Date
Aokromes
0fbcdca05e Core/Collision: Replaced phasemask with proper phases in GameObject c…
…ollision calculation
2017-05-06 01:55:17 +02:00
ccrs
748df97208 Core/Spell: move creature focus
bellow the possible interruptions
2017-04-28 12:57:16 +02:00
ariel-
c697a9de2e Core/Spell: don't make creature change orientation to 0 if channeling self 2017-04-25 13:31:11 +02:00
Aokromes
ae8dccad31 Core/Spell: fix creature focus with channeled spells
- Remove one not needed ReleaseFocus, this is done at finish already
2017-04-25 13:27:02 +02:00
Aokromes
adae2fec26 Ensure that all actions are compared to fixed point in time (ie. world update start) 2017-04-14 15:02:49 +02:00
xinef1
cddcf9f11e Core/Spells: Fixed some enchantments checks and fixed serious logic flaw in create item effect check (#19123) 2017-03-13 10:10:26 +01:00
xinef1
62111a8c4a Core/SmartAI: Various fixes and extensions for smart scripts: (#18673)
- Possible crashes fixed
- Memory leak fixed
- Implemented checking of vehicle conditions
- Extended eventphasemask to 12 bits (sql required to change DB field type)
- SMART_EVENT_GOSSIP_HELLO - added possibility to detect for gameobject reportUse call
- Renamed action SMART_ACTION_SET_FLY to SMART_ACTION_SET_DISABLE_GRAVITY (to reflect actual functionality)
- Added targetsLimit to action SMART_ACTION_CAST and SMART_ACTION_INVOKER_CAST to limit max amount of targets (selected randomly)
- Action SMART_ACTION_TALK corrected to always work as intended
- Properly call GroupEventHappens in action SMART_ACTION_CALL_GROUPEVENTHAPPENS if invoker was charmed or owned by the player
- Properly utilize followAngle in action SMART_ACTION_FOLLOW (db orientation should be in degrees), but keep backward compatibility
- Added action SMART_ACTION_SET_CAN_FLY (119) 0/1
- Added action SMART_ACTION_REMOVE_AURAS_BY_TYPE (120) AuraType, can be used to exit vehicle for example
- Added action SMART_ACTION_SET_SIGHT_DIST (121) sightDist
- Added action SMART_ACTION_FLEE (122) fleeTime
- Added action SMART_ACTION_ADD_THREAT (123) +threat, -threat
- Added action SMART_ACTION_LOAD_EQUIPMENT (124) equipmentId
- Added action SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT (125) minId, maxId
- Added action SMART_ACTION_REMOVE_ALL_GAMEOBJECTS (126), removes all owned gameobjects
- Added action SMART_ACTION_STOP_MOTION (127), stopMoving, movementExpired
- Extended target SMART_TARGET_HOSTILE_SECOND_AGGRO with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_LAST_AGGRO with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_RANDOM with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_RANDOM_NOT_TOP with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_THREAT_LIST with maxdist
- Extended target SMART_TARGET_OWNER_OR_SUMMONER to be able to get charmer/owner of current owner
- Added new target SMART_TARGET_FARTHEST with maxDist, playerOnly, isInLos restrictions
- Added SpellHit hook to GameObjectAI and extended SmartGameObjectAI to call SMART_EVENT_SPELLHIT when gameobject is hit by spell
- Call GameObjectAI Reset hook on gameobject respawn (for ex. to reset one time events in smart scripts)
- Fixed some logic errors in code
- SmartAI Escorts properly despawn escortee if no players are in range
- Disable Evading while charming creature with SmartAI
- Don't call SMART_EVENT_RESPAWN for dead units before they actually respawn
- Don't call SMART_EVENT_RESPAWN for not spawned gameobjects
- Properly call SMART_EVENT_RESPAWN for gameobject respawn
- Allow action SMART_ACTION_SET_IN_COMBAT_WITH_ZONE to utilize targetlist
- Allow action SMART_ACTION_CALL_FOR_HELP to utilize targetList
- Allow action SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL to utilize targetList
- Allow action SMART_ACTION_SET_VISIBILITY to utilize targetList
- Allow action SMART_ACTION_SET_ACTIVE to utilize targetList
- Allow action SMART_ACTION_ATTACK_START to select random attack target instead of first on the list
- Allow gameobjects to summon gameobjects with action SMART_ACTION_SUMMON_GO
- Properly store action invokers for action SMART_ACTION_WP_START, if no player invokers are found, distance despawn check won't be used
- Allow action SMART_ACTION_WP_RESUME to compensate for the state the unit actually is in (eg. combat)
- Allow action SMART_ACTION_MOVE_TO_POS to select random of the avaiable targets, not only the first one.
- Allow action SMART_ACTION_MOVE_TO_POS to utilize x, y, z parameters as an offset to calculated coordinates
- Action SMART_ACTION_RESPAWN_TARGET should never modify respawntime of already spawned gameobjects, use dedicated function
- Properly delete ontime events created by SMART_ACTION_CREATE_TIMED_EVENT
- If action could not be started because conditions were not satisfied, do not recalculate the waittime to action repeattime, use smaller value to recheck more frequently
- Allow target SMART_TARGET_CLOSEST_PLAYER to be used by gameobjects
- Allow target SMART_TARGET_OWNER_OR_SUMMONER to be used by gameobjects
- Fixed SMART_EVENT_COUNTER_SET to be only called for the id that was incremented
- Changed the way counters work
- Protect PhaseInc from surpassing maximum phase
- Added loading checks for missing NON_REPEATABLE flag if no repeatmin, repeatmax is set
- Added spell validation for SMART_ACTION_CROSS_CAST
2017-02-19 09:10:29 +01:00
Aokromes
0f9c7106ce Core/Spells: Added very little tolerance level to completed casts to …
…ensure that spell cast at target standing at the max possible range is finished properly even if target moves a little
2017-02-01 15:23:16 +01:00
HelloKitty
927a73a7ef Core/Vmaps: Stop M2s from occluding for spellcast LoS
Closes #18528
2017-01-21 14:45:30 +01:00
Aokromes
b7432bc39a Compile fix try 2017-01-18 15:09:57 +01:00
ariel-
0c97c46361 Core/Spell: perform charmer check against player controlling unit. Fixes spellcasts while charmed 2017-01-18 14:19:11 +01:00
ariel-
f2ffa22ac7 Core/Spell: fix typo
Closes #18248
2017-01-18 14:18:53 +01:00
joschiwald
44fbd2d400 Ups... 2017-01-09 08:04:25 +01:00
joschiwald
a3ed1c303b Core/Spells: Fix wrong totem placement
- Addition to 37b2f590b6
2017-01-09 08:04:11 +01:00
Aokromes
719a317a67 Update copyright note for 2017 2017-01-02 07:26:38 +01:00
xinef1
2f43df388d Core/Spell: Fixed bug where spell could fail to hit a target properly even if all conditions were met (#18596) 2017-01-01 13:29:19 +01:00
ariel-
eb3a90a4e8 Core/Spell: implemented dispel reflection
Closes #18323
2016-12-16 19:24:01 +01:00
ariel-
bb8068febb Core/Spells: fix a pretty edge case of creatures being put in combat by evaded spells
Closes #18369
2016-12-06 11:07:15 +01:00
ariel-
009adc4324 Revert "Core/Spell: add EquipedItemClass/EquippedItemSubClass check to passive spell casts"
This reverts commit f188ff1ce4.

Was breaking Titan's Grip.
Spells are loaded before items, and they CAST the spell on the player.
When items are then loaded, Player::ApplyItemDependentAuras only has AddAura on it. Titan's Grip is an effect, no auras involved.

In turn reverting this commit will now allow Two-handed weapon specialization and similar from spells load. Which is the lesser of two evils.
2016-11-27 03:11:27 +01:00
ariel-
f348c015c0 Core/Spell: add EquipedItemClass/EquippedItemSubClass check to passive spell casts
- Was adding auras on login that didn't satisfy requirements (like Two-Handed Weapon Specialization)
2016-11-27 03:09:47 +01:00
Aokromes
d9e8c7a285 Core/Spell: Missing change, partialy revert change 2016-11-19 06:59:05 +01:00
Aokromes
dbd4fc3eca Core/Spell: Compile fix try 2016-11-19 06:35:33 +01:00
Aokromes
b1d4f802ef Core/Spell: move attribute helpers to spellInfo
- Renamed CheckEffectExecuteData to AssertEffectExecuteData and made const, better reflects its purpose
- Added missing attribute check to IsNextMeleeSwingSpell
- Reworked SPELL_ATTR4_CAST_ONLY_IN_OUTLAND attr check (researched behavior)
2016-11-19 06:23:06 +01:00
Aokromes
e4dd97765e Core/Spell: revamp of immunities system
- Spell attributes research
- Container optimization
- Do not skip damage immunity checks on SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY present
- Added additonal arguments support to SendCastResult / CheckCast, spells can now send proper error messages
- Loads spell immune masks/states/effects at startup.
- This cached info is used whenever a spell cast requires immunities to be known beforehand (to see if an aura could be applied for example)
2016-11-19 06:10:14 +01:00
ariel-
ad927acae4 Core/Spell: do not fail triggered Charge effects in case a root is present.
Fixes Master's call when pet is rooted
2016-11-15 05:47:59 +01:00
ariel-
66fb271921 Core/Spell: use SpellEntry to select implicit targets in case RadiusEntry wasn't set for the current effect.
Closes #15388
2016-11-15 05:46:42 +01:00
ariel-
7d04331322 Core/Spell: do positivity spell checks only against actually hitted effects instead of the whole spell
Closes #18097
2016-10-24 14:03:08 +02:00
ariel-
162eaad0ee Core/Spell: clear auras of channeled spells if channeling is cancelled due to invalid targets (dead or w/e)
Closes #14859
Closes #15186
2016-10-24 13:59:54 +02:00
Aokromes
2057e6de4a Core/Items: Defined all item flags
(cherry picked from commit ef29f32)
2016-10-24 13:01:00 +02:00
Aokromes
686a9eeef9 Core/Spells: add Target Processing (SMSG_SPELLLOGEXECUTE) to LAUNCH_T…
…ARGET phase.

Move EffectInterruptCast to LAUNCH_TARGET Phase.
2016-10-21 08:23:40 +02:00
Aokromes
57d0a5d16d Revert "Core/Spells: Implementation of QAston proc system"
This reverts commit a70e4e26b3.
2016-10-21 07:27:04 +02:00
Aokromes
a70e4e26b3 Core/Spells: Implementation of QAston proc system
- Move checks from Unit::IsTriggeredAtSpellProcEvent (old system) to Aura::IsProcTriggeredOnEvent (new system)
- Templatize SpellModOp param of Player::ApplySpellMod, also killed charge counter from SpellModifier and Player system for handling charges... no point in having 3 different systems doing the same thing
- Automatically add default entries to spellProcMap, based on spellinfo (else auras won't proc without an entry) Based on old Unit::ProcDamageAndSpellFor
- Old Unit::ProcDamageAndSpellFor renamed to Unit::ProcSkillsAndReactives and made private, will no longer handle auras.
- Start making use of HealInfo::AbsorbHeal in unit calculations, add effective healing info to HealInfo struct
- Changes in spell reflection system, emulates old behaviour, delaying aura drop
- Removed old charge count hacks in SpellMgr::LoadSpellInfoCorrections
- Removed bogus error log when procChance is 0: Some auras have initial 0 procChance but modified by SPELLMOD_CHANCE_OF_SUCCESS
- Fixed TriggerAurasProcOnEvent logic that tried to trigger twice from actor.
- Allow non damaging spells with DamageClass Melee or Ranged to proc character enchants. Ref issue #17034:

  * http://web.archive.org/web/20110309092008/http://elitistjerks.com/f47/t49865-paladin_retribution_pve/
  * When an auto-attack lands (does not dodge/parry/miss) that can proc a seal the of the following things happen independently of each other (see 2 roll system).

  * 1) A "hidden strike" which uses melee combat mechanics occurs. If it lands it refreshes/stacks SoV DoT. Only white swings can trigger a refresh or stack. (This hidden strike mechanic can also proc things like berserking..)
  * 2) A weapon damage based proc will occur if you used a special (CS/DS/judge) or if you have a 5 stack (from auto attacks). This attack can not be avoided.

  * Holy Vengeance is the "hidden strike" it has an apply aura effect and damage class melee.
- Fixed Blood Tap interaction with Death Runes (btw, don't know what was going on with those MiscValueB, spell 45529 doesn't have any MiscValueB in SPELL_EFFECT_ACTIVATE_RUNE)
- Ported some AuraEffect checks from old Unit.cpp function. added new AuraScript hook to check procs of an specific effect
- Allow only AuraEffects that passed the check to proc, this won't block whole aura from proccing (and lose charges) if at least one of the effects procs, though
- Changes in spell mod system (for SPELLMOD_CASTING_TIME). fixes #17558.
- Added an exception for SPELLMOD_CRITICAL_CHANCE too, fixes #15193
2016-10-05 13:19:51 +02:00
Aokromes
bcfe5b4f4f Core/Spells: fixed SPELL_ATTR5_USABLE_WHILE_STUNNED 2016-10-03 14:56:48 +02:00
ariel-
b18477f80f Core/Spells: Implemented SPELL_ATTR6_NOT_RESET_SWING_IF_INSTANT.
Closes #1765
2016-10-03 14:42:53 +02:00
joschiwald
4ed2cd9500 Core/Spells: use spellinfo helper methods
(cherry picked from commit 12a52595ed)
2016-10-03 14:42:37 +02:00
ariel-
9cf523634d Core/Spell: do not cast interrupt effect if the spell did not hit 2016-09-14 14:32:16 +02:00
ariel-
f4957850e1 Core/Spell: no need to bloat existing parameter lists. (f81754a306 follow up) 2016-09-02 10:47:41 +02:00
ariel-
8e96d7fc8e Core/Spells: register SPELLMOD_CRITICAL_CHANCE in casting spell modifiers. 2016-09-01 15:19:49 +02:00
ariel-
fe32fffa56 Core/Spells: Remove spellmods from SpellMod owner instead of caster (needed so pet casts properly remove aura charges) 2016-09-01 15:19:29 +02:00
ariel-
87bcba9a1f Core/Spells: fix Bullheaded immunities
Closes #421
2016-09-01 15:19:11 +02:00
Shauren
a3d4957150 Typo fix 2016-08-22 20:54:59 +02:00
mik1893
cea753e4e6 Core/Spells: Fixed spells like Shadowform, Tricks of the Trade, Misdirection getting stuck in unusable state clientside if they failed earlier because of GCD
Closes #657
Closes #12913
Closes #17376
2016-08-21 13:16:52 +02:00
Treeston
a29913187b Core/Spells: Fix orientation- and targeting-related issues if the creature isn't currently engaged in combat. (#17120)
Also disable spell focus system for vehicle control auras.

Closes #16572
Closes #17016
2016-08-21 13:16:30 +02:00
Chaouki Dhib
c152bbe17d Core/Spells: Fixed extended spell range while moving Closes #17818 (#17824)
Cherry pick of 10e0f4ff8f
Closes https://github.com/TrinityCore/TrinityCore/issues/17818
2016-08-20 06:23:00 +02:00
Aokromes
375b7a61c4 Core/Units: Fixed melee range check
* Split Spell::CheckRange() into 2 methods since that method had more than one responsibility.
* Moved melee range logic into its own function
* Moved melee range logic method GetMeleeRange from Spell to Unit class. Unit::IsWithinMeleeRange() and Spell::GetMinMaxRange() both use that method.
2016-08-16 12:25:53 +02:00
ariel-
87f25be0aa Core/Spells: build fixes 2016-08-01 03:54:30 -03:00
ariel-
79b3fa5862 Core/Auras: Implemented SPELL_AURA_MOD_SPELL_COOLDOWN_BY_HASTE, SPELL_AURA_MOD_GLOBAL_COOLDOWN_BY_HASTE, SPELL_AURA_MOD_COOLDOWN_BY_HASTE_REGEN and SPELL_AURA_MOD_GLOBAL_COOLDOWN_BY_HASTE_REGEN
(cherry picked from commit 6c71c8694f)

Conflicts:
	src/server/game/Spells/Auras/SpellAuraDefines.h
	src/server/game/Spells/Auras/SpellAuraEffects.cpp
	src/server/game/Spells/SpellHistory.cpp
2016-08-01 03:54:29 -03:00
ariel-
0c51829cc4 Core/Auras: Implemented aura 321 SPELL_AURA_MOD_NO_ACTIONS
(cherry picked from commit 55d5cd37df)
2016-08-01 03:54:28 -03:00
ariel-
f5e2b7db3a Core/Spells: Fix merge error in e34e3f379f causing instant spells to be wrongly Delayed
Closes #74
2016-07-23 17:59:46 -03:00
Aokromes
67bb661def Core/Mmaps: Charge ignoring z position of target (#17516)
* Core/Mmaps: Charge ignoring z position of target

By cemak closes #15011
2016-07-20 18:43:45 +02:00