Commit Graph

1063 Commits

Author SHA1 Message Date
Shauren
69e0b9a985 Core/Auras: Update AuraState enum and implement missing new ones 2021-03-16 20:48:42 +01:00
Aokromes
0b3a09b1b4 Misc: Kill trailing white spaces
(cherry picked from commit 5f2c5f2ed3)
2021-02-15 19:13:25 +01:00
jackpoz
852c9e9108 Core/Misc: Fix static analysis issues
(cherry picked from commit a80c95a1c7)
2021-02-06 21:41:51 +01:00
jackpoz
388034498f Core/Misc: Fix static analysis issues
(cherry picked from commit 9b7c73a19d)
2021-02-06 21:41:51 +01:00
Riztazz
dffef65da2 Scripts/Stratholme: spawn Timmy the Cruel if conditions are met (#20750)
* Timmy the cruel
* Rename some variables and use sniffed spawn position
* codestyle
* Use areaboundary instead
* include order
* aokromes request
* remove static
* never cp on tc

(cherry picked from commit c69825d96d)
2021-02-06 21:41:51 +01:00
Killyana
e73bd9763f Creature/Scripts: Add Aggro sound to Cairne Bloodhoo, Sylvanas Windrunner and Thrall
(cherry picked from commit 48ecd81d61)
2021-01-21 22:30:40 +01:00
Treeston
9f2de698c9 some more cleanup (cbd025f follow-up)
(cherry picked from commit 4f5ec886d0)
2021-01-13 22:04:52 +01:00
Treeston
b31816ff79 Scripts/MagistersTerrace: Fix some crashes in Selin Fireheart. His script is still a shitshow, though. Closes #20614.
(cherry picked from commit cbd025f146)
2021-01-13 22:04:52 +01:00
Andrew Letson
bc73b5f8a5 DB/Scripts: Greengill Slave
(cherry picked from commit c8a346a23c)
2021-01-13 22:04:52 +01:00
Wyreth
a3a91dadad Scripts/EasternKingdoms: move Alchemist Arbington and Apothecary Dithers core script to DB
(cherry picked from commit 23329790d2)
2021-01-08 21:12:11 +01:00
Andrew Letson
f79480bf9d DB/Scripts: Yenniku (move npc_yenniku to SAI)
(cherry picked from commit a7f3d5e59f)
2021-01-08 21:12:11 +01:00
sirikfoll
82764a71fc Core/Scripts: Minor fixes in boss Coren Direbrew
Update script register model
Fix number os Mole Machine spell targets
Fix Mole Machine timer
Fix minions summon

(cherry picked from commit 05a101881c)
2020-09-06 21:40:44 +02: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
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 91c0d49c18)
2020-08-23 15:56:21 +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 7fff83d675)
2020-08-23 00:45:46 +02:00
Gustavo
6135ee20a9 Core/Scripts: Rewrite Boss Kalecgos (Sunwell Plateau) (#19897)
* Core/Scripts: Rewrite Boss Kalecgos (Sunwell Plateau)

Scripted all spells
Corrected behavior of Spectral Blast and Curse of Boundless Agony
Removed wrong wipe behavior
Fix problem where bosses would be stuck with banish
Added Boundaries
Corrected texts
Removed old hacks
Other minor fixes

(cherry picked from commit e9cd7af2df)
2020-08-22 21:13:01 +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 184c45cfe0)
2020-08-22 20:10:42 +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 74af880217)
2020-08-18 18:53:13 +02:00
Nyeriah
5b8d3ede7d Scripts/Karazhan: Fix Attumen and Midnight not moving towards each other on phase transition after latest changes
(cherry picked from commit 746fce30d9)
2020-08-18 18:53:13 +02:00
treeston
2c88d9f162 Some more refactoring prep for combat/threat (#19930).
(cherry picked from commit 2739a5c5f5)
2020-08-18 18:53:13 +02:00
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Treeston
8be23fcbbd [3.3.5] Combat/Threat rewrite - prep & refactor (#19966)
* Combat/Threat rewrite (PR #19930) prep work. Mostly refactors, and a compatibility layer on ThreatManager/HostileReference that allows scripts to be changed already.

(cherry picked from commit e2a1ccd118)
2020-08-13 22:46:44 +02:00
Artamedes
e85bd8fd39 Scripts/Stockades: Cleanup the scripts (#23524)
* Scripts/Stockades: Cleanup the scripts

Scripts looked ugly before, now they are less ugly
Move Mortimer Moloch and Warden Thelwater to use TaskScheduler rather than EventMap
Use new script registers
Cleanup some other code

Co-authored-by: Carbenium <carbenium@outlook.com>
2020-08-10 20:50:25 +02:00
Treeston
f7a7d02a7f 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.

(cherry picked from commit 1660bb7d27)
2020-07-16 21:47:28 +02:00
ariel-
5903a10a83 Core/AI: segregate GameObject ReportUse from normal Use (lock open/normal click)
Closes #19819

(cherry picked from commit 2335b9de1a)
2020-07-16 21:47:28 +02:00
TecDian
1aaf09b199 Core/Scripts: simplify speech for DK races quests
(cherry picked from commit 3f34c2f5eb)
2020-07-16 21:47:27 +02:00
sirikfoll
1d99860757 Core/Scripts: Updated Sunwell Plateau instance model
(cherry picked from commit 2984def452)
2020-07-16 21:47:27 +02:00
ForesterDev
c34b83a467 Core/Defines: define faction templates and replace magic numbers from scripts
(cherry picked from commit abea8bf4cb)
2020-06-14 23:49:03 +02:00
TecDian
4015c02a42 Scripts/Events: Add missing line for "Love is in the air" boss fight (#19521)
(cherry picked from commit 4b8644d6e6)
2020-06-14 22:48:17 +02:00
ccrs
55576d20d8 Core/Creature: drop method SetPosition
eeeevil, use UpdatePosition. It was there just for old scripts compatibility.

(cherry picked from commit 17579f8d91)
2020-06-14 20:04:17 +02:00
Shauren
c7306439e7 Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower 2020-06-12 01:29:18 +02:00
Shauren
d1572327d2 Core/Misc: build fixes
Merges #24550
2020-05-03 14:53:18 +02:00
ariel-
e27d7049c3 Core/Misc: build fixes
(cherry picked from commit aa0b7dd152)
2020-05-03 03:06:37 +02:00
ariel-
6604849716 Core/Scripts: unified scripted gossip/quest api
- Changed self-accessor on GameObjectAI to "me", like UnitAI
- Moved all related functions to AI, now Unit and GameObject have the same function names with identical behaviour
- Remove "OnUpdate" from CreatureScript/GameObjectScript, was never used and we already have AI Update method
- Quest methods no longer return a bool, the return value was used to call the AI version if the ScriptMgr one returned false
- Implemented GameObjectAI::Destroyed hook (was never called), implemented Damaged method
- Rename OnStateChanged to OnLootStateChanged to reflect when it's really called, and created a new hook OnStateChanged that only gets called on GOState change
- Since the functions are now only getting called from AI, made GetAI methods full virtual. (CanSpawn method is anyways going to be used on creatures with AI)

(cherry picked from commit f913f3bb89)
2020-05-03 03:04:32 +02:00
ariel-
93c19c4194 Core/Misc: camelize GetFaction/SetFaction properly
(cherry picked from commit 4c4dca6d69)
2020-04-29 01:36:41 +02:00
ccrs
104e745edf Core/Misc: cleanup SetInFront uses
Set in front modifies only the serverside orientation, use with care.
Also check for current focus to prevent things like incorrect damage on casting creatures (ie dragon breath direction change in your face because of some taunt missclick)

(cherry picked from commit 229444b74a)
2020-04-28 17:51:25 +02:00
ccrs
2d4549023a Core/Unit: 2170541a51 followup
use true as default value since pretty much all the script calls will expect that

(cherry picked from commit c7a57e2a09)
2020-04-28 17:42:26 +02:00
tkrokli
b259614778 Scripts: minimize duplicated enum names in header files (#19377)
* Scripts: Minimize duplicated enum names in header files

This reduces the number of cache resets with the Zapcc compiler

- Standard followed is instance/raid TLA + DataTypes/CreaturesIds/etc
- Partial cherry-pick of master commit 7eb4512eee
- Removed unused defines in sunken_temple.h (the core scripts using these have been moved to SAI)

(cherry picked from commit f6f36be004)
2020-04-24 17:18:51 +02:00
Chaouki Dhib
5d076cfe29 Core/Spells: fix wrong distance calculations in AoE spells [Needs testing] (#16290)
Core/Spells: Fix wrong distance calculations in AoE spells.
Pull request #16290 by chaodhib.
God bless, finally.

(cherry picked from commit a1f2f30c14)
2020-04-24 17:18:49 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
3ac790287a Core/DataStores: Updated db2 structures to 8.2.5 2019-10-27 00:12:45 +02:00
Shauren
3b004b2cfd Nopch fix2 2019-08-18 11:16:43 +02:00
Gustavo
1b85f62b96 Core/Scripts: implement boss Apothecary Hummel ("Love is in the Air" event boss) (#19076)
Closes #5114

(cherrypicked from 8c6fa411e8)
2019-08-17 20:04:14 +02:00
xinef1
4f65dc5e20 Core/Misc: Various crash fixes (#19059)
* Replaced some FindPlayer calls with GetPlayer
Fixed some more crashes

* Correction

(cherrypicked from 14dfc377b4)
2019-07-21 21:06:54 +02:00
xinef1
fe63cd3dbb Core/Creatures: Various fixes for creatures, regarding combat conditions, despawning, and few others (#18998)
* Made some changes to kiting mechanics, simplified code and made taunt auras prolong combat no matter the distance from the spawn
Unified some creature despawning code, removed some brutal direct calls in scripts
Don't play death anim on forced despawn
Removed some redundant visibility changes on creature despawn
Fixed possible problem with pet initializing template info from difficulty greater than normal
Properly keep UNIT_FLAG_IN_COMBAT on UpdateEntry call
Moved RegenerateMana function to general Regenerate(Power) function
Fixed increased health regeneration from polymorph for pets
Implemented CREATURE_TYPE_FLAG_GHOST_VISIBLE, those creatures will be properly seen when player is dead also
Removed hackfix from Gaeriyan and Franclorn Forgewright, fixed properly
Simplified ForcedRespawnTime code in ForcedDespawn
Do not allow to assist unit while evading or when enemy is evading
Do not allow to attack other units when evading or when the unit is evading
Corrected distance checking code before creature is allowed to evade, should fix some common problems
Properly return summon position for summoned creatures as their respawn position
Properly stop all moving units on gossip hello, no matter their npc flags

(cherrypicked from e1f14215d8)
2019-07-21 21:06:54 +02:00
xinef1
ad008c43b7 Core/Misc: Fix various crashes, also related to multithreading (#19012)
* When iterating groups we have to either do it not in multithreaded context (map updates) or start with checking maps (they are guaranteed to change in single thread update).
* Properly clear ComboPoint references on player remove
* remove some possible references item may have when it is deleted during save.
* Also clear all hostile references when unit is removed from map.

(cherrypicked from 86da1a19bb)
2019-07-21 21:06:54 +02:00
Shauren
1ce8bf22fc Nopch fix 2019-06-15 19:04:21 +02:00
Gustavo
7fbae7530d Core/Scripts Rework boss Terestian Illhoof (Karazhan) (#19057)
(cherrypicked from 87f2cb04ca)
2019-06-15 18:41:09 +02:00
Gustavo
c53df2adb0 Core/Scripts Update boss Maiden of Virtue (#19058)
(cherrypicked from d06391d062)
2019-06-15 18:41:09 +02:00
Gustavo
384f2d636c Core/Scripts: boss The Curator (Karazhan) rework (#19040)
Closes #16099
(cherrypicked from 169e150628)
2019-06-15 18:41:09 +02:00