Commit Graph

824 Commits

Author SHA1 Message Date
Killyana
a32aeceb0d Core/Creature: Clear creature focus after an evade 2020-01-01 17:19:37 +01:00
Giacomo Pozzoni
88a14251e2 Core/MMaps: Fix charge underwater/falling (#24010)
* Core/MMaps: Fix charge underwater

Fix charge sometimes returning "no path available" when swimming/underwater.
Fix charge selecting a destination point 4 yards above swimming/underwater targets

* Allow falling units to charge targets that are below (lower Z coordinate)

* Disable "raycast" pathfinding as it's not blizzlike.

This might show some strange paths when charging with a target in front.
It also fixes some falling undermap issues.

This Reverts 272009ebee

* Remove Z offset when charging a target as it never made sense
2019-12-30 15:58:39 +01:00
ForesterDev
448facc5e7 Core/Spells: Fixed warlock's Banish cancel if target was already banished (#23697)
* Core/Spells: Add SpellMissInfo argument to BeforeHit hooks and call them also when the spell doesn't hit. (#17613)

(cherry picked from commit 8ff5b35be1)

# Conflicts:
#	src/server/game/Spells/Spell.cpp
#	src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
#	src/server/scripts/Spells/spell_warlock.cpp

* Core/Spells: Fixed warlock's Banish cancel if target was already banished (#17614)

(cherry picked from commit 4587b5d880)

# Conflicts:
#	src/server/scripts/Spells/spell_warlock.cpp
2019-08-23 19:24:56 +02:00
Treeston
4a219eda07 Core/Unit: Spell focusing now no longer nonsensical. HasSpellFocus always const. Error logs for various stuff. 2019-08-04 01:26:20 +02:00
ccrs
85ad0befc5 Core/Unit: rename more methods
Workaround prework till actual facing system rework arrives
2019-08-03 17:53:22 +02:00
ccrs
ec9f15a5ff Core/Unit: rename IsFocusing method
Workaround prework till actual facing system rework arrives
2019-08-03 17:45:06 +02:00
jackpoz
9b292f4369 Core/Spells: Fix infinite loop
Fix an infinite loop caused by a mix of item 25498 and liquid damage
2019-07-28 17:13:48 +02:00
Treeston
c4c739fea5 remove unnecessary check, 37f6982 follow-up 2019-07-21 15:49:42 +02:00
Treeston
37f69825c4 Core/Spells: Spell pushback now only affects players (as it should) 2019-07-15 17:21:40 +02:00
ccrs
d1dc0e2dc1 Scripts/DK: correctly handle Blood Tap 2019-07-13 17:57:07 +02:00
ccrs
401777d024 Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
        uint8 GetLevelForTarget(WorldObject const* /*target*/)
        void SetLevel(uint8 lvl)
        uint8 GetRace()
        uint32 GetRaceMask()
        uint8 GetClass()
        uint32 GetClassMask()
        uint8 GetGender()
2019-07-01 21:36:32 +02:00
Wyrserth
5dc2dfd60c Core/Spell: fix some issues with taunt spells (#23425) 2019-06-27 22:08:39 +02:00
Wyrserth
7a71127da9 Core/SAI: allow creatures to handle gameobject spellhit SAI events. (#23492) 2019-06-26 18:08:19 +02:00
Treeston
632a300dd2 Core/Misc: Rename Unit::AttackedTarget to Unit::AtTargetAttacked to match naming scheme for these notifiers 2019-06-23 00:32:59 +02:00
Wyrserth
218055280a Core/Spells: don't allow spells with SPELL_EFFECT_CREATE_ITEM_2 to be cast if there isn't enough space in inventory (#23404)
* Core/Spells: don't allow spells with SPELL_EFFECT_CREATE_ITEM_2 to be cast if there isn't enough space in inventory,

* Move GetFreeInventorySpace() to a better place, thanks ccrs!
2019-06-15 15:11:49 +02:00
Wyrserth
8bc5451864 Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura (#23319)
* Core/Misc: don't allow players to use/activate/loot non-allowed gameobjects while under the effect of a damage immunity aura.

* Forgot to change this in last-second rename.

* Apply suggested changes, thanks Shauren!
2019-05-30 20:07:46 +02:00
Giacomo Pozzoni
797fba98e9 3.3.5 gameobject summoner (#23289)
* Scripts/Misc: Change IsSummonedBy(Unit*) to IsSummonedBy(WorldObject*)

* Scripts/Misc: Fix build

* Core/TempSummons: Rename GetSummoner() to GetSummonerUnit()

* Core/TempSummons: Add support to TempSummons::GetSummoner() to return GameObject too

* Fix build

* Core/TempSummons: Allow GameObject to be owner of TempSummon

* Core/TempSummons: Add support to SAI for GameObject owner of TempSummon

* Scripts/Misc: Fix no-pch build

* Core/TempSummons: Implement PR comments
2019-05-23 21:08:29 +02:00
brotalnia
49d0a5bbb6 Core/Spells: Return CheckCast result from CastSpell (#23236)
* Return CheckCast result from CastSpell

* Return cast result from UnitAI methods too.
2019-05-10 18:58:26 +02:00
jackpoz
4130384f2e Core/Misc: Log Spell/Aura name in Spell/Auras asserts 2019-05-06 20:20:10 +02:00
Jozef Dúc
78070163dc Core/Object: Range check vol. 2 (#23226)
* Core/Object: Fix all missing parts for #23062

* Update GameObject.cpp
2019-05-02 21:53:12 +02:00
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