Commit Graph

1374 Commits

Author SHA1 Message Date
Ovah
cd36606027 Core/Conditions: allow CONDITION_QUEST_COMPLETE to handle spellclick conditions (#22371)
This is a needed change in order to make spellclicks functional that are only available when you have a already completed quest.
2018-09-02 12:36:16 +02:00
Treeston
5cea572a9a Core/Threat: Threat system adjustments:
* Online states are now re-evaluated before victim update instead of continuously. Closes #22226. Tagging #21501.
* Victim update now happens every 1s as opposed to every server tick unless current target goes away.
* Suppressed threat is no longer re-established until the victim gains additional threat (by hitting the target, for instance).
* Assistance threat is now split between non-controlled units threatened by target, as opposed to all units threatened by target.
2018-08-27 19:08:17 +02: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
077bf43ab5 Scripts/Commands: Fix .quest complete to properly work with PvP kill quests. Closes #16321. 2018-08-14 16:09:51 +02:00
Shauren
8411ec7ed6 Core/Players: Fixed saving quest item progress 2018-07-09 18:32:40 +02:00
Ovah
0dcc318e37 Core/Player: fix periodic eating and drinking emotes (#21280)
Closes: #12567
2018-06-22 20:23:46 -03:00
ccrs
982643cd96 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).
2018-06-03 10:06:57 -07:00
jackpoz
5f6af8c6cb Core/Quest: Fix crash caused by disabled quests
Fix crash happening when a disabled quest was added and rewarded (through a GM command). Disabled quests are not validated on startup and they can reference invalid spells.
2018-05-05 19:17:52 +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
Gooyeth
8aad6f828e Core/Battleground: allow Random battleground and arena queues same time. (#21730)
- It also restricts queuing to arenas if it is in queue of dungeon finder
2018-04-15 16:57:57 +02:00
ariel-
a413e7dee9 Core/Player: partial revert of m_items handling as it's cause of a exploit
Closes #21760
2018-04-04 15:42:58 -03:00
ariel-
9cc109fe3e Core/Player: properly clear m_items array when unequipping items from the bag
- Also cleanup weapon damage ap mult when direct destroying a equipped weapon
2018-03-14 11:57:51 -03:00
ariel-
8cf7eda8c1 Core/Entities: cleanup of weapon damage
- ScalingStatDistribution/Value (ie heirlooms): apply bonuses in all cases, some calls used nullptr (like after disarm) and item wasn't regaining them
- AP multiplier wasn't correctly reflected after unequipping a weapon
- Correctly set base damages at unequip

Closes #21610
2018-03-14 03:44:00 -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
Gooyeth
92b8a870bf Core/Player: Do not remove auras from Gamemasters in arenas (#21568) 2018-03-08 15:00:23 +01: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
ariel-
34967e9c32 Core/GameObject: implemented gameobject_overrides table to change faction and flags values on a per-spawn basis
Updates #20957
Closes #20958
2018-02-24 20:57:55 -03:00
ariel-
98d6258efd Core/Entities: kill unused return value from Unit::HandleSpellClick
- AI hook will now receive the result by copy, as modifying it had no effect
- Some renaming: result->spellClickHandled, clickPair is actually clickBounds, the clickPair is the pair <creatureID, SpellClickInfo>
2018-02-24 15:52:09 -03:00
ariel-
ba27711145 Core/Entities: unit states cleanup
- Added new UNIT_STATE_FOCUSING for creature focus system, this will stop creatures adding/clearing the UNIT_STATE_CANNOT_TURN mask (eg UNIT_STATE_STUNNED if stunned while focusing a spell)
- Added UNIT_STATE_CHARMED that gets set/removed on any charm type (UNIT_STATE_POSSESSED is only for possess as it's name suggests)
- The new states are checked against mask to know whenever client needs to regain character control

Closes and fixes #21460
2018-02-20 17:34:12 -03:00
ariel-
e73bfe8df8 Core/Spells: implemented SpellPriority field from SpellEntry to cleanup charged mod proc behaviour
- Only one charged mod will be consumed per SpellMod apply, and it'll be compared against other mod priority
- This is proper way of handling Backdraft/Backlash and Deathchill/Killing Machine

Thanks to killerwife for info
2018-02-12 03:09:22 -03:00
Treeston
d02f481d9a Core/Movement: Creatures' idle movement generator can no longer override player mover control.
Tagging #20310, partial fix.
2018-02-12 01:50:36 +01:00
jackpoz
3576a38f6c Core/Player: Add some asserts
Assert PlayerInfo for race/class pair in a few Player functions
2018-02-11 17:43:12 +01:00
ariel-
8e0af1b93b Core/Player: only call _ApplyWeaponDamage for actual weapons
Closes #21308
2018-01-24 00:05:25 -03:00
ariel-
b8c281f497 Core/Auras: Don't remove shield only dependant auras on disarm
Closes #19782
2018-01-18 16:29:21 -03:00
sirikfoll
ed9e220991 Core/Player: Pass correct Zone ID to HandlePlayerLeaveZone
This will fix some issues with Wintergrasp, like phasing auras getting stuck and missing group invites for the battle, among others
2018-01-17 18:59:20 -02:00
ariel-
f1986c6aaf Core/Entities: implement secondary damage for some weapons and removal of old voodoo
- Fixed correct Retaliation damage spell according to sniffs is 20240
- CalcArmorReducedDamage insisted on dealing a minimum of 1 damage even if damage was 0
- CalculateDamage was zero-phobic too: it defaulted to arbitrary max 5 damage

Closes #19081
2018-01-14 09:23:34 -03:00
ariel-
3b01cccd7e Core/Spell: SpellValueOverrides encapsulation
- No sense to let scripts use SpellValueOverrides, we already have modifiers in CastSpellExtraArgs struct
2018-01-13 20:49:43 -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
ariel-
f50a333418 Core/Misc: kill whitespace 2018-01-12 00:07:29 -03:00
xinef1
23823f5147 Core/Spells: Defined and implemented some new spell attributes (#18950) 2018-01-08 20:31:21 +01: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-
a0dcd9c798 Core/Player: fix issue with SendLoot when using Disarm Trap at maximum range 2018-01-02 01:19:23 -03:00
ariel-
95df8d5028 Core/Player: removed redundant check 2018-01-02 00:29:31 -03:00
ariel-
5b663f1162 Core/Player: implemented facial hair validation 2018-01-01 23:33:04 -03:00
Treeston
eacfa9d89a Core/AI: Kick Gossip functions upstairs, from UnitAI to CreatureAI - they only make sense for Creatures anyway.
Also change a very ugly hack in GetDialogStatus. Ew.
2018-01-01 17:07:58 +01: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
jackpoz
ad56299846 Core/Misc: Fix static analysis issues 2017-12-25 16:34:36 +01:00
jackpoz
12701cb0c6 Core/Misc: Replace time(NULL) with GameTime::GetGameTime() 2017-12-24 22:50:59 +01:00
Golrag
95456ab5d8 Core/Entities: Some changes to LoS z checking & MotionMaster::MoveJumpTo (PR #20970)
- Use Midsection height for LoS checking.
- Changed MotionMaster::MoveJumpTo to use correct z. This change also makes sure the _owner will jump towards the given angle. Instead of jumping to a unintended angle if the first one is not in LoS.
2017-12-14 16:56:30 +01:00
jackpoz
24e82fe83d Core/Misc: Fix static analysis issues
Fix static analysis issues reported by 3rd party tools
2017-12-08 23:27:30 +01:00
jackpoz
925557d1c0 Core/Misc: Fix static analysis issues
Fix various coverity reported issues
2017-12-08 15:14:51 +01:00
jackpoz
a80c95a1c7 Core/Misc: Fix static analysis issues 2017-11-12 14:55:11 +01:00
Nathan Handley
6612ec47f4 Core/Misc: Add functionality to allow low level quests/kills/discoveries to grant experience 2017-11-04 01:25:14 +01:00
Shauren
e947fcedee Core/Taxi: Apply reputation discount to all points in multi-segment paths
(cherry picked from commit 99f5d06149)
2017-10-29 19:13:32 +01:00
Treeston
bf81a7b207 Core/Map: Fix a crash bug when teleporting out of map before being fully added to that map. Closes #20289. 2017-10-26 11:35:21 +02:00