Commit Graph
678 Commits
Author SHA1 Message Date
ariel- c77925da4a Core/Entities: killed Creature::SetInCombatWithZone and replaced with AI version
Closes #12108 (again)

(cherry picked from commit 7c9722a4ae08b5f283f6a085a411e37604a7da9f)
2021-06-16 21:03:06 +02:00
Kittnz cd3425f6a6 Scripts/Outland: Fix logical error in Hellfire event in Honor Hold
(cherry picked from commit 8f64612cb12d2ceabf610a436e7b514acdc1b181)
2021-06-16 14:32:07 +02:00
ariel- 85ffcd9826 Core/Scripts: fix wrong uses of SetHitDamage hook.
This hook modifies damage AFTER it has been reduced by target auras/armor/resistances etc, it's useful if you want to scale damage by a factor, but not to add flat bonuses.
We're fixing those by moving calculation to Launch phase, where target taken bonuses haven't been used yet.

- Bronjahm: Magic's Bane
- BPC: Shadow Prison
- Oculus: Shock Lance
- Ymiron: Dark Slash (extra fix, it was wrongly damaging half of total health, it's supposed to be half of CURRENT health!)
- DK: Raise Ally Thrash spell (also extra fix: corrected formula)
- Warrior: Bloodthirst (shouldn't matter much as it's damage class none and those don't get bonuses by default)
- Warrior: Concussion Blow
- Warlock: extra fix for Haunt, healing part shouldn't scale with spell power

Closes #9560

(cherry picked from commit 9f5d1e2b10013e5fecf35fdd5af70921c96d07d1)
2021-06-16 14:26:09 +02:00
ariel- 62c571076e Core/Scripts: added nullptr checks to DamageTaken hooks
Since cb9e72e521d3cc415dd15bf6912c87f89e41b92a attacker may not be in world when hook is called

(cherry picked from commit 0db5c2df3fe56f42293865e87ec781cd4d41598b)
2021-06-16 12:02:14 +02:00
ariel- 5fbddef85f Core/Spell: SpellValueOverrides encapsulation
- No sense to let scripts use SpellValueOverrides, we already have modifiers in CastSpellExtraArgs struct

(cherry picked from commit 3b01cccd7eafaff9f3b8236a544e4fa46818926c)
2021-06-14 00:19:50 +02:00
ariel- fccf1a8c62 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

(cherry picked from commit cb9e72e521d3cc415dd15bf6912c87f89e41b92a)
2021-06-13 00:59:13 +02:00
Kittnz 299746f9f6 Scripts/Outland: Implement Hellfire event in Honor Hold (#21110)
* Script/Outland: Implement Hellfire event in Honor Hold

This is hourly, event is only 60 seconds long.

(cherry picked from commit acc73d469319a2b22804e55c0603e82615f5c8c2)
2021-05-29 21:27:11 +02:00
ariel- 9bf5a03bc4 Core/Scripts: fix Millhouse Manastorm resetting dialogs after Skyriss encounter
Closes #21159

(cherry picked from commit fd7fff80c9ce9954c58fa3fa35eadcdfe5648e3d)
2021-05-06 07:06:27 +02:00
ariel- 82fa6ede59 Core/Scripts: cast "Trial of the Naaru: Tenacity" credit spell when criteria is achieved
Closes #21155

(cherry picked from commit 036a05458eb90f137326885651dec05b303116f9)
2021-05-06 07:06:27 +02:00
ariel- f77bd1e7c9 Core/Scripts: fixed npc immunity flags during Harbinger Skyriss encounter
- Added missing _Reset
- Properly register Skyriss summons in SummonList

Closes #21154

Who ordered up an extra large can of whoop-ass?

(cherry picked from commit f8b148c3346e6d5017bf3b044cc36bce32c0cf45)
2021-05-06 07:06:27 +02:00
Treeston bce43de7f3 Core/AI: Some more refactoring prep for #19930. CreatureAI::EnterCombat is now called CreatureAI::JustEngagedWith. There's also two new methods on UnitAI, though they're never invoked right now.
(cherry picked from commit 6113b9dec2e0081c36c36c2974a28ed0693bc601)
2021-04-16 20:22:13 +02:00
Treeston 9b141207d1 [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

(cherry picked from commit d507a7e3388382960108b24143da48e5f912b4a7)
2021-04-16 15:22:42 +02:00
Keader a7883380ce Core/AI: Making guid const& in SetGUID method (#21128)
(cherry picked from commit 465b43fabef1727432ddda27f04b882b29fd2c7f)
2021-04-15 05:53:27 +02:00
jackpoz 8244d60859 Core/Misc: Fix static analysis issues
(cherry picked from commit ad56299846a92c2cda84ebcc2d37d9aa6e3e8024)
2021-04-15 05:53:27 +02:00
Shauren 69e0b9a985 Core/Auras: Update AuraState enum and implement missing new ones 2021-03-16 20:48:42 +01:00
ariel- 1891edb455 Core/Scripts: nopch fix
(cherry picked from commit 7fb70e74f2bde19b0eb488a673c8ea650b3b72b1)
2021-03-15 20:17:31 +01:00
ariel- 6042126916 Core/Scripts: travis fixes
(cherry picked from commit ea0224e3bd8a4b081725c1eae5c597f8c7d74d7f)
2021-03-15 20:17:31 +01:00
ariel- 44c8ccadd7 Core/Auras: periodics refactor part 5: ported periodic trigger spell auras to scripts
(cherry picked from commit a36e804ae4639be40be17282e6c79fad9a769517)
2021-03-15 20:17:31 +01:00
ariel- 5f9e0d92d5 Core/Auras: periodics refactor part 1:
- Don't skip ticks if diff is greater than amplitude
- Fixed spells without ampltude in DBC

(cherry picked from commit 5d91beb1dbc795382a12ec05f6e72c76b195b141)
2021-03-15 20:17:31 +01:00
Shauren efdca47aff Core/Auras: Remove m_effIndex member of AuraEffect and always take it from SpellEffectInfo 2021-03-11 10:32:03 +01:00
Aokromes 0b3a09b1b4 Misc: Kill trailing white spaces
(cherry picked from commit 5f2c5f2ed376bc2ab9107a4a8da7df04f8aef85a)
2021-02-15 19:13:25 +01:00
Andrew Letson a36ddf47a9 DB/Scripts: Terokkar Forest SAI migration
(cherry picked from commit 4d338b1d4d6ddf449e52c38f6cb9cdeb9cbf32fe)
2021-02-15 19:13:25 +01:00
Matan Shukry 7159de62b6 Scripts/Spells: Remove const from AuraEffect argument for AuraEffectProcFn 2021-02-13 14:08:16 +01:00
Keader ce8b3a1308 Core/Scripts: Fixed Charge behavior on Illidan encounter
"If any raid member is farther away than 25 yards from *both* Blades, one of the Flames charges that player and enrages"

(cherry picked from commit cb3627ca62712d4fba1c05cf4d9b12b82f317cc2)
2021-02-06 21:41:51 +01:00
jackpoz 388034498f Core/Misc: Fix static analysis issues
(cherry picked from commit 9b7c73a19df66849ec829fc5a94875aa9593934d)
2021-02-06 21:41:51 +01:00
jackpoz a68ab3241a Core/Misc: Fix static analysis issues
(cherry picked from commit 7e73f5f1edd8c99c3639e2a342cf044f6192fb6a)
2021-02-06 21:41:51 +01:00
Keader 0a68d46798 Core/Scripts: Updated Black Temple to new Creature/Spell/Aura/GOB model
Fixed some codestyle issues.
Removed ENSUREAI

(cherry picked from commit 78f4f54f81e092c9c7b99af445fb6ec85e00e6b0)
2021-02-06 21:41:51 +01:00
Andrew Letson b6f1ab5526 DB/Creature: Coosh'coosh to SAI
(cherry picked from commit 7822f058b0ee997d4c114b60ec9ea5ddc2cc2874)
2021-01-29 19:23:53 +01:00
tkrokli 0d32a1ef0f Scripts: tabs2spaces cleanup after commit cc89428
Thanks to Wyreth for reporting the overlooked tabs.

(cherry picked from commit bbd339370ed2eea5f12e79a977fd9e0e93543101)
2021-01-21 22:30:40 +01:00
Malleus 8eaf992f3e Script/Quests: Fix some missing NPC spells and quest credit
(cherry picked from commit cc894288b77299e9e73f322869f16c2791435104)
2021-01-21 22:30:40 +01:00
Keader 8a6fdb7a21 Scripts/BlackTemple: Updates on Illidan encounter
- Fixed issues related with Parasitic Shadowfiend
- Updated script to new model
- Fixed loop of Parasitic Shadowfiend Summon
- Added a new spell (SPELL_REMOVE_PARASITIC_SHADOWFIEND)
- Fixed illidari elite attacking players
- SPELL_PARASITIC_SHADOWFIEND now is a negative aura

(cherry picked from commit 90f07bd948546595a04d7633eaa95a463f0ce6f9)
2021-01-21 22:30:40 +01:00
Keader c41c6d5f61 Core/Illidan: Parasitic Shadowfiend can target tanker
(cherry picked from commit b4d632e57d72b1049c3a89a11b29192b27ebea9f)
2021-01-13 22:04:52 +01:00
Wyreth 3c898d9e01 Scripts/Quest: Captain Tyralius improvements (#20419)
Update: #12352
(cherry picked from commit 398e67cbca3960603cc498e8b0e40bd6a7625d6e)
2021-01-13 22:04:52 +01:00
Andrew Letson 3fcc31005f DB/Scripts: Migrate Raliq the Drunk and Sal'salabim to SAI
(cherry picked from commit 7db70bf40b1595f58a08536a36f74f18e8405758)
2021-01-08 21:12:11 +01:00
Andrew Letson f2a4cf99e6 Scripts/Outland: Migrate Shattrath City NPCs to SAI (#20596)
- Zephyr and Flask Vendors to SAI
- Update gossip menu options to proper values
  (thx Killyana for digging into this)

(cherry picked from commit 5558bd27c6a7ae3aa13773eee7d048e31f676738)
2021-01-08 21:12:11 +01:00
Andrew Letson 011d4d0b97 Scripts/Outland: migrate Elder Kuruti to SAI
* Migrate Elder Kuruti to SAI

(cherry picked from commit ac63614016291c11a278c890ee79743b173106a3)
2020-12-31 23:23:50 +01:00
Shauren b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
Treeston fe938b99f8 Core/Scripts: Implemented OnlyOnceAreaTriggerScript (#20288)
(cherry picked from commit 971ed856a49dc56ea33d9a0779b1386eea5cd3ca)
2020-08-29 00:41:22 +02:00
Treeston 06a1271a50 Core/Misc: random refactors
(cherry picked from commit 37dff2b7a1850f9f751c472e277277305a660229)
2020-08-23 17:47:41 +02:00
ccrs 9a5e2b80b3 Core/Creature: regenerate health
There are three possible scenarios regarding regenerating health
- db lock and curhealth set to > 0
- db lock and curhealth set to 0
- dynamic lock (set in scripts and such) overriding db lock

(cherry picked from commit 91c0d49c188977c3d797f5749b1204612ce50195)
2020-08-23 15:56:21 +02:00
Treeston 88a61fa9d6 Scripts/Auchindoun: Fix a super edge case crash bug with GM far teleports during Blackheart's charm phase. Follow-up to d80d7c6.
(cherry picked from commit 165bc028893a1971d4c75b146e3cd3ce92f13982)
2020-08-23 14:47:29 +02:00
ccrs 97585597f0 Core/Movement: waypoint movement (#20121)
Following the work done in #19361 this is the cleanup and improvement of the related logic of waypoint management.

Ref 28050f3 #18020
(taking the good parts and ignoring the incomplete work)

(cherry picked from commit 7fff83d67526efff63867d41b9e036a19a9287b3)
2020-08-23 00:45:46 +02:00
Treeston 129dd7c909 Core/Scripts: dynamic_spawning follow-up, I had forgotten JustRespawned existed.
- Rename JustRespawned to JustAppeared, which better matches its behavior anyway.
- Properly invoke JustAppeared for new (re-)spawns - fixes #20111.
- Fix Thaddius script to work with dynamic_spawning (mostly unrelated to the above) - Feugen/Stalagg should really be a summon group, but I don't have time to fix that right now.
- Fix default value for DynamicEscortNPC to match worldserver.conf.dist.

(cherry picked from commit 184c45cfe0fbe4f3e4fb701f0f99994df98bdc8a)
2020-08-22 20:10:42 +02:00
Treeston e51960ea45 Core/PlayerAI: Some adjustments:
- Add a 2 second delay before the AI begins using spells. This should provide opportunity for counterplay before that rogue activates cloak and goes on an unstoppable rampage among your healers. (Sorry, guys.)
- Stopped the AI from attacking invalid targets under some conditions. It should now properly leash back and follow the charmer if we try to select an invalid target.
- Stopped the AI from constantly re-creating the follow movement generator (and thus spamming movesplines).

(cherry picked from commit 331e463de83e4ea13935773f992b32733272d263)
2020-08-20 00:11:18 +02:00
Treeston 2c92e09230 Scripts/Auchindoun: Last one, hopefully. Remove reliance on large grid searchers by integrating with instance script.
(cherry picked from commit d80d7c6685b8a52d5ff7c2a3fade728b91c17eb4)
2020-08-20 00:08:04 +02:00
Treeston 6599dab1e1 Scripts/Auchindoun: Blackheart the Inciter fully fixed now. I had way too much fun with this one.
Two points of note:
1) Spawning 5 invisible triggers with 5 distinct factions which then MC one target each? Biggest. Hack. Ever. Best part? It's blizzlike.
2) For over ten years, I thought it was spelled "Auchinodoun". It's not. It's spelled "Auchindoun". TIL.

(cherry picked from commit 04dc47e7e28a26cf027a5bb5c1a3ebf685861325)
2020-08-19 23:50:31 +02:00
Treeston 8a1739d15e Scripts/Auchindoun: Replace the Blackheart the Inciter hack-filled script with a slightly less hack-filled script that actually mostly works. This should at least make the boss encounter possible to complete. No claims to correctness, of course.
(cherry picked from commit a38141fd6c3a5cc40732af82edd22605e3f67a71)
2020-08-19 23:47:25 +02:00
treeston 2dfafa69eb Hi, I'm Treeston, and welcome to Combat PR Prep Refactors.
Today, we're moving UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC to higher-level abstraction so combat manager can react to it.
New methods on Unit:
- void SetImmuneTo<All/PC/NPC>(apply, keepCombat = false);
- bool IsImmuneTo<All/PC/NPC>() const;

(cherry picked from commit 74af880217fc567c9949d7557408718af889402f)
2020-08-18 18:53:13 +02:00
treeston 2c88d9f162 Some more refactoring prep for combat/threat (#19930).
(cherry picked from commit 2739a5c5f5d5a359eee4eef1a6486ddcaf24faaf)
2020-08-18 18:53:13 +02:00
Shauren 1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00