127 Commits

Author SHA1 Message Date
Shauren
605e5f94c0 Core/Creatures: Moved autoattack handling from scripts to game 2024-01-08 22:23:12 +01:00
Shauren
ae26431a81 Scripts/Gnomeregan: Added dungeon encounter ids 2023-09-17 22:06:02 +02:00
Shauren
03d6dd8539 Scripts/Uldaman: Added dungeon encounter ids 2023-09-17 22:01:07 +02:00
Teleqraph
88ff97c1f9 Core/Units: Added helper functions to modify UNIT_FLAG_UNINTERACTIBLE (#29159)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
2023-07-20 19:09:27 +02:00
Shauren
76be303351 Core/Scripts: Save instance data in JSON format 2022-10-04 00:19:38 +02:00
Shauren
b47185cabf Core/Misc: Rename AddXXXFlag updatefield functions to SetXXXFlag 2022-03-27 18:14:47 +02:00
Shauren
4eba978670 Core/Misc: Rename SetXXXFlags updatefield functions to ReplaceAllXXXFlags 2022-03-26 18:59:44 +01:00
Gildor
2cfcecaf26 Scripts/Uldaman: Fix Ironaya crash (#27189)
* Scripts/Uldaman: Fix Ironaya crash
* little code cleanup

* oops

(cherry picked from commit cb4e12bdf0)
2022-03-20 23:47:58 +01:00
offl
c4906ce60b Core/Misc: Rename UNIT_FLAG_NOT_SELECTABLE to UNIT_FLAG_UNINTERACTIBLE (#26913)
(cherry picked from commit c4741a131a)
2022-03-15 23:03:26 +01:00
Shauren
439b027d48 Core/Misc: Cleanup unused includes 2022-02-13 15:07:00 +01:00
Maks Szokalski
bc04acb726 Add "On" to some gossip methods in AI (#25415)
* Add "On" to some methods

* Update npc_innkeeper.cpp

* Update zone_borean_tundra.cpp

(cherry picked from commit 41188eb535)
2022-02-05 22:18:19 +01:00
offl
5662d71708 DB/Instance: Convert some Uldaman scripts to DB
Closes #24744

(cherry picked from commit a117450ce9)
2022-01-06 21:36:29 +01:00
ForesterDev
3171cd3fa9 Core/AI: refactor SpellHit and SpellHitTarget. (#24691)
* Core/AI: refactor SpellHit and SpellHitTarget.

- now caster/target is WorldObject instead of Unit
- remove SpellHitByGameObject / SpellHitTargetGameObject (handled by SpellHit / SpellHitTarget)
- rename parameters in scripts according parent methods

* Restore logic in Algalon script

* Changed check for REMORSELESS_WINTER hit to avoid dublicate call, because it has TARGET_UNIT_CASTER for effects 0/1 and TARGET_GAMEOBJECT_SRC_AREA for effect 2

* Fix build after merge

(cherry picked from commit e3b232fe0e)
2022-01-06 20:46:25 +01:00
Jeremy
15b9183635 Core/ZoneScript: Add "invoker" param to ProcessEvent (#24758) 2021-12-27 13:55:59 +01:00
ForesterDev
529ca2dd5d Scripts/Defines: cleanup some magic numbers in factions (#23631)
(cherry picked from commit 0c317498a5)
2021-12-17 20:48:31 +01:00
Shauren
f2456ff319 Scripts/Areatriggers: Fixed all areatrigger scripts triggering both on enter and exit instead of only on enter 2021-11-10 00:01:50 +01:00
Wilcalaf
e9833447ed Archaedas should properly start now when clicking on the altar. (#21401)
(cherry picked from commit 0c1aaac219)
2021-06-20 00:30:33 +02:00
Keader
ad5b0fa9cd Core/Scripts: Fixed possible crashs related with JustDied
(cherry picked from commit 5bef3e426a)
2021-06-19 23:33:24 +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 6113b9dec2)
2021-04-16 20:22:13 +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
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
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
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
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
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01: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
Shauren
455959c606 Core/PacketIO: Rewrite updatefield handling 2019-06-08 17:06:57 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
9ffabae6bf Scripts/Misc: Use InstanceMap* in InstanceScript instead of Map* 2018-06-16 17:24:10 +02:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Aokromes
90badf9d7e Misc: More cleanup 2017-11-25 02:50:29 +01:00
joschiwald
0fcf6043b7 Core/Misc: Changed some SpellMgr::GetSpellInfo calls 2017-09-24 23:15:56 +02:00
Shauren
b453e12423 Core/Game: Include cleanup part 5
* ObjectMgr.h
* Player.h
* Unit.h
* G3D should no longer propagate everywhere from Spline/MotionMaster
2017-06-04 01:00:45 +02:00
Shauren
a0a158b5b8 Core/Scripts: Include cleanup 2017-05-28 16:34:44 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00
Alan Deutscher
cd811271d9 Scripts: UNIT_FLAG_REMOVE_CLIENT_CONTROL no longer used as a method for preventing a unit from moving
UNIT_FLAG_REMOVE_CLIENT_CONTROL (formerly UNIT_FLAG_DISABLE_MOVE) is a client-only feature that should not be used for NPC scripting. All applications of this flag in scripts/ have been replaced with applications/removals of the UNIT_STATE_ROOT state.

Closes #17311

(cherry picked from commit 061b62a97d)
2017-02-12 16:52:18 +01:00
Shauren
dad19df69d Core/Units: Renamed and documented UNIT_FLAG_DISABLE_MOVE to prevent people from trying to use this flag to root a creature leaving them wondering why it doesn't do anything
(cherry picked from commit b36da77185)

Core/Scripts: build fix

(cherry picked from commit 258368a2bd)
2017-01-09 21:16:36 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Duarte Duarte
7eb4512eee Scripts: Minimize duplicated enum names in header files (#18346)
This reduces the number of cache resets with the Zapcc compiler

Standard followed is instance/raid TLA + DataTypes/CreaturesIds/etc
2016-12-01 01:51:07 +00:00
tkrokli
97b70abe54 Core/Scripts/Uldaman: change hardcoded text to enum
Change #define to enum {with brackets}

Possibly the smallest change so far in this series of core script changes.

(cherry picked from commit 627ec0e35e)
2016-04-02 16:47:35 +02:00
Vincent-Michael
478cc756eb Update copyright note for 2016
Happy new year (Again new year with idiots ...)
2016-01-01 00:34:25 +01:00
Carbenium
17a5f51a29 Fix non-PCH build 2015-11-13 14:17:01 +01:00
Kittnz
2cd545849c Scripts/Uldaman: Fix build & fix some movement suggested by josch
(cherry picked from commit cf286ea9cd)
2015-11-01 00:31:18 +01:00
Kittnz
c094e49e74 Scripts/Uldaman: Instance update
- Fixup Boss Ironaya
- Add the freeze animation for minions and archaedas
- Fix attack target for minions who wake up

(cherry picked from commit 9cb4cb52d8)
2015-11-01 00:31:00 +01:00
Daniel M. Weeks
7e474418d8 Mark overriding functions 2015-05-27 21:13:48 -04:00
Golrag
d999caee67 Core/AreaTrigger: Added 'bool entered' to OnTrigger 2015-04-18 11:22:30 +02:00
Vincent-Michael
ab90f74486 Update copyright note for 2015
Happy new year
2015-01-01 00:28:09 +01:00
jackpoz
79b9ca4a58 Scripts/Misc: Make InstanceScript::Initialize() obsolete
Move all InstanceScript initialization code from Initialize() to the constructor.
InstanceScript::Initialize() is now obsolete, please don't use it anymore. The only reason it's still in the sources is for backward compatibility.
2014-09-25 22:28:20 +02:00
Shauren
9b316fe689 Core/Scripts: Fixed PCH build 2014-09-16 00:44:56 +02:00