Commit Graph

804 Commits

Author SHA1 Message Date
jackpoz
e3a9a9bfb2 Core/Scripts: Rename recent GameObject spell overloads to fix GCC warnings
Rename recent GameObject spell overloads (they used to accept only Unit as parameters) to fix GCC warnings about partial function override.
2019-04-27 23:48:39 +02:00
Jozef Dúc
32e1de39a2 Core/Object: Range check (#23179)
* Should solve #23062. All credits to @xvwyh

* Remove unused variables

* Remove unused variable

* Cast int32 to uint32

* Remove G3D headers from core header file

* Change door distance

* Update GameObject.cpp

Add newline

* Update GameObject.h

Indentation
2019-04-24 20:39:01 +02:00
Jeremy
9fcbd8f15d Core/Movement: Fix some undermap issues with random movement/fear/blink (#22937)
* Core/Movement:
- Only move to point if there is a path that is not a shortcut (which will make the unit move through terrain)
- Added new function to check if there is a vmap floor without search distance
- Units that can fly, are underground but far above the vmap floor will stay underground (bronze drakes in tanaris)
- Don't remove PATHFIND_SHORTCUT from path type in some cases

* Core/Object: Ignore UpdateAllowedPositionZ for flying units.

- This will make flying units go through mountains instead of going to the top and back to the bottom to reach you.

* Core/Object: Revert some changes and let MovePositionToFirstCollision deal with a position without ground

* Missing groundZ change for objects on transport

* use CanFly instead of IsFlying
2019-04-07 20:15:40 +02:00
Gustavo
50f122de77 Core/Misc: Warning fixes (/W4) (#23149)
* Core/Misc: Warning fixes (/W4)
2019-04-03 23:36:26 -03:00
jackpoz
1d04a3b216 Core/Misc: Fix GCC 8 warnings 2019-03-31 17:34:28 +02:00
PolarCookie
ec3cb05d7f Core/Spell: SpellAura Redux (#22794)
* typo and correction

* spell aura no longer shared between targets

_spellAura isolated

* SPELL_AURA_CONTROL_VEHICLE is not strictly single target spell

Steam Tank Control and Wyrmrest Commander

units can reseat themselves again

* Rename 9999_99_99_99_world.sql to 2019_03_08_00_world.sql
2019-03-08 08:34:16 +01:00
jackpoz
72052aa9a5 Core/Spells: Adjust range checks to GameObject targets 2019-03-03 21:42:07 +01:00
jackpoz
270a144083 Core/Spells: Adjust range checks to GameObject targets 2019-03-03 21:24:39 +01:00
jackpoz
76cc94f325 Core/Spells: Add range checks to GameObject targets
Close #23062
Patch by robinsch
2019-02-23 18:34:31 +01:00
Treeston
fcfcb0eb6f Happy New Year, folks. It's 2019! 2019-01-01 15:45:25 +01:00
Shauren
3b5014fdae Core/Spells: Fixed ErrorCube spell missiles 2018-12-31 21:41:25 +01:00
Shauren
b09390e575 Core/Spells: Corrected haste affecting GCDs to match 3.3.5 client logic 2018-12-16 18:52:45 +01:00
Giacomo Pozzoni
9a924fb9d5 Core/Misc: Log more information in asserts (#22783)
* Core/Misc: Log more information in asserts

Add a new function GetDebugInfos() to types that could trigger an ASSERT() to easily include more useful information in crashlogs.
This is an initial commit that requires many more commits to implement the new GetDebugInfos() function in all required types.
If the type doesn't have the function, the global default one is picked which doesn't log anything.

* Core/Misc: Fix dynamic build

Add missing attribute for dynamic build

* Core/Misc: Fix gcc/clang build

* Core/Misc: Rename GetDebugInfos() to GetDebugInfo()

* Core/Misc: Fix FormatAssertionMessage() adding an extra '\0'

* Core/Misc: Add GetDebugInfo support to Unit

* Core/Misc: Add GetDebugInfo support to Creature

* Core/Misc: Add more info to GetDebugInfo for Creature

* Core/Misc: Add GetDebugInfo support to GameObject

* Core/Misc: Add GetDebugInfo support to Player

* Core/Misc: Add more GetDebugInfo info

* Core/Misc: Add GetDebugInfo support to Item

* Core/Misc: Add GetDebugInfo support to Bag

* Core/Misc: Add GetDebugInfo support to Transport

* Core/Misc: Add GetDebugInfo support to TempSummon, Minion, Guardian, Pet

* Core/Misc: Add GetDebugInfo support to Map, InstanceMap

* Core/Misc: Add GetDebugInfo support to Spell

* Core/Misc: Fix build warning

* Core/Misc: Add GetDebugInfo support to Aura

* Core/Misc: Add GetDebugInfo support to UnitAI
2018-12-14 22:01:16 +01:00
Shauren
be47254a4f Core/Auras: Fixed saving auras with same spell id but different item source 2018-11-09 20:51:20 +01:00
PolarCookie
a0999744ef Core/Spells: fix issues with delayed spells and auras (#22382)
* Core/Spells: fix issues with delayed spells and auras

* Make Travis Happy
2018-11-04 12:38:14 +01:00
Shauren
bbdf62d6e8 Core/Spells: Warning fix 2018-10-27 12:14:54 +02:00
Treeston
5b99ce2f83 Core/Spell: Fixed an issue with Premeditation removing itself 2018-10-22 19:50:40 +02:00
Treeston
003cc56d70 Core/Player: Clean up duel related code. Fix a check for abusive client behavior, sanitize pointer usage, code style. Closes #22374. 2018-09-17 12:40:42 +02:00
PolarCookie
759c16f2be Chain heal won't bounce on 100% target now (#22136) 2018-08-26 14:24:56 -03:00
Treeston
d4ef2529e9 Core/Unit: Store charmer and charmed pointers on Unit directly, no more map lookups for Unit::GetCharmer and Unit::GetCharmed 2018-08-25 00:44:33 +02:00
Treeston
042f5515e4 Core/AI: Clean up charm AI handling, we now have two unique_ptr instead of a crapton of booleans 2018-08-23 16:34:42 +02:00
Treeston
081eab3cf5 Core/Unit: UNIT_FLAG renames
[UNIT_FLAG_PLAYER_CONTROLLED -> UNIT_FLAG_POSSESSED]
[UNIT_FLAG_PVP_ATTACKABLE -> UNIT_FLAG_PLAYER_CONTROLLED]
Signed off by: Shauren, Warlockbugs.
2018-05-02 19:09:37 +02:00
Treeston
2a84562dc8 Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
- Chase to angle is now functional. Pets use this to chase behind the target. Closes #19925.
- Chase to arbitrary range interval works. Not used anywhere, but you can technically make hunter-like mobs.
- Pets now follow the hunter cleanly and without stutter stepping. Also fix some other things. Closes #8924.
2018-04-06 18:09:55 +02:00
ariel-
07e42f7d41 Core/Spells: always initialize hitinfo aura
Ref 437c5c7b9d
2018-03-19 00:45:02 -03:00
ariel-
437c5c7b9d Core/Spells: fix delayed hit aura crash
Closes #21664
2018-03-18 15:36:37 -03:00
ariel-
2828869844 Core/Spells: fix issues with delayed spells and auras
- Was losing info of delayed targets due to remove_if move-assigning targets, it needs to be saved into delayed target vector before returning from lambda
- Delayed auras applying on many targets are now handled gracefully

Closes #21609
Closes #21612
2018-03-13 13:46:25 -03:00
ariel-
b978b673a9 Core/Spell: clear buffer from spell go before broadcasting it again without predictedpower flag 2018-03-12 19:34:37 -03:00
ariel-
abb602f7c1 Core/Spells: only apply aura effects when needed. Fixes #21602 2018-03-12 19:04:00 -03:00
ariel-
ac97655063 Core/Spells: Fix some issues with channeled spells and aura duration mods
Closes #21584
2018-03-12 02:31:17 -03:00
ariel-
f7869ad38b Core/Spell: fix LoS checks for GameObject spells
Closes #21580
2018-03-10 20:25:50 -03:00
ariel-
7f947646f9 Core/Spell: fix SendSpellMiss requiring caster Unit 2018-03-10 19:51:36 -03:00
ariel-
d6b9f148a7 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
2018-03-10 19:40:19 -03:00
ariel-
0c2a6dee07 Core/Spell: fix spell visual for other players
- Ported SMSG_SPELL_GO and SMSG_SPELL_START to new packet system
2018-03-10 03:55:14 -03:00
ariel-
bd3530dd1f Core/Spells: move m_preCastSpell logic to scripts
- Bad name because it was actaully executed after effects
2018-03-10 00:55:24 -03:00
ariel-
45c5e1b9d6 Core/Spells: rework part 5: GameObject casting
Closes #21330
Closes #18885
Ref #18752
2018-03-09 14:41:28 -03:00
ariel-
080d2c6cd4 Core/Spells: rework part 4: iterate over effects first
Ref #18395

Implement far spell queue processing
Closes #7395
2018-03-09 14:41:28 -03:00
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