Commit Graph

928 Commits

Author SHA1 Message Date
Ovalord
e88789555f Core/Spells: implement CAST_FLAG_HEAL_PREDICTION 2017-11-15 22:41:22 +01:00
Aokromes
2cc4fef9d5 Fix warning 2017-10-17 01:19:52 +02:00
Ovalord
34b3617184 Core/Spells: merged commits 86275a397a ae070a1b64 and
be7486fddb
2017-10-17 01:06:15 +02:00
Aokromes
1b850ff3f3 Core/Misc: Build fix 2017-07-16 19:31:10 +02:00
Aokromes
8b6261c809 Core/Misc: Fix static analysis issues 2017-07-16 19:05:26 +02:00
Aokromes
1a5c0f5c3b Core/Grids: Ported cmangos/mangos-wotlk@ea99457
(cherry picked from commit 9299e9b)
2017-06-19 20:20:26 +02:00
Aokromes
9057cae219 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-11 19:02:07 +02:00
Aokromes
f8d9d954d1 Get zone/area IDs from vmap data in the liquid update
* 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.
2017-06-09 13:20:37 +02:00
Aokromes
ac3dbcb880 Core/Utilities: Rename RandomResizeList->RandomResize as it is no longer restricted to a list 2017-06-07 09:53:04 +02:00
Aokromes
0bb27ecd4b 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:50:14 +02:00
treeston
24c89fba76 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:32:18 +02:00
ariel-
e778c4c628 Core/Spell: in case of immunity, check all effects to choose correct procFlags, as none has technically hit 2017-05-30 09:21:03 +02:00
Ryan
a289acff81 Core/Spells: Fix SPELL_AURA_FIXATE 2017-05-28 20:14:31 +01:00
Ryan
1442984686 Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into 4.3.4 2017-05-28 19:10:00 +01:00
treeston
e361682377 Quickfix a bug introduced by 2f19d97 which prevented GTAoE from being cast. 2017-05-28 03:18:35 +02:00
ariel-
8082b3165e Core/Spell: abort channeling if no valid targets are found after searching
Closes #17624
2017-05-28 03:11:57 +02:00
Ryan
20726edec2 Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into 4.3.4 2017-05-19 23:49:46 +01:00
Aokromes
0fbcdca05e Core/Collision: Replaced phasemask with proper phases in GameObject c…
…ollision calculation
2017-05-06 01:55:17 +02:00
roc13x
02e174d7e9 Cleanup 2017-05-05 00:10:25 +01:00
roc13x
c2fd775e5d Add missing changes
Core compiles now
2017-05-04 05:24:21 +01:00
ariel-
07a182f1d3 Core/Spell: register spell mod owner properly on spell cast
- This fixes pets and totems getting mods from owner
2017-05-04 05:04:19 +01:00
ariel-
091100f795 Core/Spell: check aura positivity per effect on spell hit
- Fixes applying DR to positive effects, and changing duration of whole aura

Closes #19447
2017-05-04 05:01:17 +01:00
xinef1
ae4b91bcf6 Fixed setting and unsetting of m_spellModTakingSpell 2017-05-04 04:32:26 +01:00
roc13x
557f714a10 Fix spell dst execution time 2017-05-04 04:26:51 +01:00
Gerhood
0e1cc63055 Core/Spells: implement Mad/Crazy Alchemist's potions 2017-05-04 04:17:24 +01:00
ariel-
1f6fa54465 Core/Spell: build fix 2017-05-04 04:14:12 +01:00
ariel-
3ccdf57f4a Core/Spell: unified handling of SPELL_ATTR5_USABLE_WHILE_* attributes
Allowed mechanic mask is calculated on startup and auras checked against those mechanics
Closes #18798
2017-05-04 04:13:49 +01:00
ariel-
921efdc1fa Core/Spell: consider spells with no targets for the purpose of finish procs
Closes #18799
2017-05-04 04:10:22 +01:00
ariel-
69625f32fe Core/Spell: kill old charge restoring system. Mods are fully handled by proc system now.
- Fixes an edge case of spell failing due to out of range and re-adding charges to an existing aura.
2017-05-04 04:00:58 +01:00
ariel-
0814834492 Core/Spell: reverted stun aura handling
Partial revert of 50a3ce5703

Closes #18487
Closes #18490
Closes #18497
2017-05-04 03:47:21 +01:00
ariel-
be418d3671 Core/Spell: fix for hitmask being ignored in finish phase procs 2017-05-04 03:45:37 +01:00
ariel-
6e62130e96 Core/Spell: improved immunity logic for dispels 2017-05-04 03:26:54 +01:00
ariel-
307b736768 Core/Spell: Undefined SPELL_ATTR7_USABLE_IN_STUN_FEAR_CONFUSION attr for now 2017-05-04 03:18:14 +01:00
ariel-
c62077237d Core/Spell: restore old proc system behaviour on auras self proc. 2017-05-04 02:21:58 +01:00
ariel-
b7b69b88ba Core/Unit: damage immune improvements 2017-05-04 01:48:16 +01:00
ariel-
746cb97dce Core/Unit: don't use damage immunity to calculate hit result for the whole spell. Should be used only for damage 2017-05-04 01:45:58 +01:00
ariel-
b14b00da5c Core/ScriptMgr: use vector instead of list to contain Spell and Aura scripts and hooks 2017-05-04 01:41:35 +01:00
ariel-
c9101f6707 Core/Spells: workaround stealth interaction with Death and Decay and GameObject casts 2017-05-04 01:16:00 +01:00
ariel-
21ac6296be Core/Spells: moved handling of SPELL_ATTR0_CU_DONT_BREAK_STEALTH inside proc system.
Fixes additional issues with spells that shouldn't be breaking stealth and had this attribute
2017-05-04 01:01:24 +01:00
roc13x
d30237fb1e Core/Globals: compute aura diminishing return info at startup and cache it 2017-05-04 00:57:24 +01:00
ariel-
a7a024d1d6 Core/Auras: reset periodic aura timers by default. Except when aura comes from triggered spell 2017-05-03 23:51:47 +01:00
ariel-
51f26dfe51 Core/Spells: Implementation of QAston proc system 2017-05-03 20:08:08 +01: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