Commit Graph

253 Commits

Author SHA1 Message Date
Shauren
f8ad7017dd Core/Misc: Move (or delete) constructors and destructors to .cpp files (avoids compiling them in every file that includes them) 2022-02-12 21:36:46 +01:00
Meji
27cba3f523 Core/Scripts: Added script hook to execute actions after completing an achievement (#27718) 2022-02-08 23:23:05 +01:00
Treeston
358dc78e47 Scripts/AreaTrigger: Rename OnlyOnceAreaTriggerScript::_OnTrigger to TryHandleOnce, and make its return value useful.
(cherry picked from commit 0c7f6ac89f)
2022-02-05 14:53:54 +01:00
Shauren
0a1acb9c05 Scripts/Spells: Replace RegisterAuraScript with RegisterSpellScript and remove it
(cherry picked from commit 7d4fbf706a)
2022-02-04 00:27:10 +01:00
Shauren
e81b5838a6 Core/Scripts: Unify RegisterSpellScript and RegisterAuraScript macros to do the same thing and implemented passing custom arguments to spell script classes
(cherry picked from commit 75a6a7a0ad)
2022-02-03 00:25:03 +01:00
Peter Keresztes Schmidt
2e3c612c80 Core/Unit: Make HandleEmoteCommand typesafe (#25249)
* Scripts/ScarletMonastery: Fix wrong emote during Headless Horseman encounter

* Scripts/HoR: Fix wrong emote during escape event

* Core/Unit: Make improve type safety of HandleEmoteCommand

Change argument type to the expected enum type Emote

* Scripts/CoS: Use SetUInt32Value to set UNIT_NPC_EMOTESTATE

UNIT_NPC_EMOTESTATE is no flag field

(cherry picked from commit 6c7837f947)
2022-01-26 21:46:51 +01:00
Shauren
0d3235f569 Core/Guilds: Separate guild rank id from guild rank order
Co-authored-by: aquadeus <efectokoleos13@gmail.com>
2022-01-09 23:12:00 +01:00
Carbenium
49523a74a4 Battlefields: Move BF scripts out of game
This commit introduces the usual script interface
for battlefields.

(cherry picked from commit f7faf20254)
2022-01-07 00:20:57 +01:00
Ovah
5c258c1bbd Core/Scripting: fixed build. Re-enable ModifyVehiclePassengerExitPos for CreatureScript to allow scripted creatures that already have an AI to benefit from its functionality as well
(cherry picked from commit f0485cea39)
2021-12-20 23:56:45 +01:00
ccrs
6443116d5b Scripts/ScarletMonastery: instance script cleanup (#23889)
Adapt InstanceScript into newer structure and style
Adapt existing boss scripts into newer structure and style
Improve existing boss related definitions

Should make each boss more functionally reliable, but nothing new has been added

(cherry picked from commit 06c6b30ed4)
2021-12-18 23:36:17 +01:00
Wyrserth
1edd93bc0c Core/Script: add script hook to allow overriding of a vehicle passenger's exit position (#23322)
* Core/Script: add script hook to allow overriding of a vehicle passenger's exit position.

* Allow to change orientation, and fix nopch.

* Keep original orientation, thanks jackpoz!

* Update Unit.cpp

Code cleanup

* Update Unit.cpp

(cherry picked from commit 88c6c61b95)
2021-12-08 23:51:07 +01:00
Giacomo Pozzoni
ed5ba915f1 Core/Scripts: Change PlayerScript and CreatureScript inheritance (#23048)
Remove UnitScript from PlayerScript and CreatureScript classes as that's how the original system that was PR'd worked, see https://github.com/TrinityCore/TrinityCore/pull/7867 for reference.
Please note these are used as global hooks and should really just invoke stateless functions.
If you need to hook methods from PlayerScript/CreatureScript and UnitScript, just define 2 different scripts (this is how the original system worked and how it was designed to work)

(cherry picked from commit 5b7ead65bb)
2021-11-23 22:54:24 +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
Seyden
8f097e4425 Core/Scripts: Implement script name reloading
* Authored by Seyden
* Co-authored by Naios
* We thank Shauren for your helpful feedback
2021-10-22 12:52:37 +02:00
ModoX
6d9ce8e8ba Core/PacketIO: Implemented CMSG_CONVERSATION_LINE_STARTED (#27036)
* Added OnConversationLineStarted hook to ConversationScripts
* Added example for Defender of Azeroth conversation
2021-10-12 00:16:20 +02:00
Treeston
5c80f50734 Core/Spawning: Actually check spawn group state before processing a respawn. It feels like that is something that should've been noticed at some point.
Also remove CreatureScript::CanSpawn since nobody uses it, and spawn groups do the same thing.

(cherry picked from commit 94b5d9bfa1)
2021-08-08 21:21:34 +02:00
ariel-
88ae43fa51 Core/Misc: minor typo and codestyle fixes
- Replace NULL uses in new code with nullptr
- Fix wrong (accumulated) load time log when loading calendar invites
- Make Creature::CanRegenerateHealth const as its just a getter
- Mark OnlyOnceAreaTriggerScript::OnTrigger as final in case someone wants to override that (you are supposed to use protected _OnTrigger hook)

(cherry picked from commit 78a1c687a2)
2021-03-15 20:17:31 +01:00
Robingad
995fb23bc1 Core/Scripts: Add SpellInfo argument to ScriptMgr::ModifySpellDamageTaken (#26141) 2021-02-28 18:42:36 +01:00
Shauren
f269f60d8a Scripts/Quests: Implemented new quest scripting hook, OnQuestAcknowledgeAutoAccept, used when player closes quest frame after viewing details of autoaccept quests 2021-02-26 20:42:29 +01:00
Shauren
7851cd3a96 Core/AreaTriggers: Code cleanup 2021-01-30 18:10:21 +01:00
Matan Shukry
0417c5ff5f Core/AreaTriggers: Implementation for sever side area triggers
- Spawn GridLoader to spawn area triggers correctly now
- Removed SAI completely
- Removed remnants of smart scripts. Created different issue for it
- Calling InitDbPhaseShift and not InDbPhaseShift
- changed SpawnId to uint64 rather than uint32
- not using CellGuidSet typedef as to not include ObjectMgr.h in the header
2021-01-30 18:10:21 +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 971ed856a4)
2020-08-29 00:41:22 +02:00
r00ty-tc
03b125e6d1 Dynamic Creature/Go spawning:
- True blizzlike creature spawn/respawn behavior - new creature = new object
 - Toggleable spawn groups (with C++/SAI/command options to use them)
 - Custom feature: dynamic spawn rate scaling. Accelerates respawn rate based on players in the zone.
 - Backward compatibility mode (set via group and for summons)
   to support creatures/gos that currently don't work well with this
   (this should be removed once the exceptions are fixed)

Fixes and closes #2858
Tags #8661 as fixable.
Fixes and closes #13787
Fixes #15222.

(cherry picked from commit 59db2eeea0)
2020-08-22 12:59:57 +02:00
ariel-
bd96262248 Core/OutdoorPvP: refactor using Position and Quat to pack parameters
- Moved statics to cpp
- Save scriptids into an array

(cherry picked from commit 3e7b64b2f7)
2020-07-16 22:00:29 +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-
1929ca3aa1 Core/Scripts: remove OnDummyEffect hook/sOnDummyEffect ai hook
- Duplicated logic never used, sometimes only ScriptMgr version was called, sometimes only AI
- They only encourage bad scripting practices
- You can still use OnSpellHit or a SpellScript

(cherry picked from commit b6b59f6c23)
2020-04-29 01:36:46 +02:00
Shauren
aced88b09b Core/AuctionHouse: After taking a break at the start of patch 8.3 auction house is now back in business. 2020-04-20 20:36:24 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
ariel-
5f70be050f Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Closes #15734

(cherrypicked from eac9c1f0b9)
2019-08-17 20:04:14 +02:00
Kittnz
5291842a33 Game/Scripting: Add OnPlayerRepop hook
Called when a player presses release when he died

(cherrypicked from d550ba7392)
2019-06-15 18:41:09 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
vincent-michael
7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
Shauren
66621a85e9 Core/Quests: Implemented player choice rewards 2017-12-31 23:22:55 +01:00
Traesh
89c91c271b Core/Quests: Implemented player choices
* Implemented SPELL_EFFECT_LAUNCH_QUEST_CHOICE
* Script hook for player choices
2017-12-31 23:22:55 +01:00
Traesh
422ad436c7 Core/Scripts: Added new QuestScript hooks (#20950)
* OnQuestStatusChange and OnQuestObjectiveChange
2017-12-04 17:35:37 +01:00
funjoker
465012978f Core/Scripting: Implemented Conversation scripts (#20758) 2017-11-18 12:40:56 +01:00
Seyden
a9174d5eb7 Core/Scripts: Implement generic script loaders (and script registry macros) to greatly reduce code duplication (#19526) 2017-07-20 00:15:02 +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
Shauren
7e538980a2 Core/Database: Include cleanup 2017-05-12 18:50:27 +02:00
Traesh
9cc5273cd2 Core/AreaTriggers: Areatrigger rework script system + fix priest angelic feather
Closes #19171
2017-03-21 18:14:23 +01:00
Rochet2
117b45d768 Core/Scripts: Enhance quest status hook by making it catch more status changes (#17865)
(cherry picked from commit c52566a888)
2017-02-26 15:36:01 +01:00
treeston
e941d7e04b Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep.
(cherry picked from commit b3d44d6c36)

Game/Scripting: Follow-up to b3d44d6. Fix script selection for creatures on difficulty > 0.
(cherry picked from commit 91c2b3162d)

Build fix.
(cherry picked from commit a9f1151f2c)

Fine, this time I actually built it. Promise.
(cherry picked from commit 0c2c88ed50)
2017-02-26 15:30:15 +01:00
Traesh
6ab3877c91 Core/Entities: Basic AreaTrigger System (#18035)
* Implemented AreaTrigger Templates
* Implemented AreaTrigger Splines
* Implemented SPELL_AURA_AREA_TRIGGER
* and many more
2017-01-29 00:00:43 +01:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Krudor
1530c95697 Core/Scripts: Add server-side script support for movie completion (#18308) 2016-12-17 18:27:43 +01:00
ariel-
780d1019f2 Core/ScriptMgr: use vector instead of list to contain Spell and Aura scripts and hooks
(cherry picked from commit cbb5c073ce)
2016-11-14 05:35:41 -03:00
Traesh
d4887311e3 Core/Scenes: Implemented scene system
Closes #17858
Closes #17976
2016-09-25 16:13:12 +02:00
Shauren
3607d9eef5 Tools: Added game tables extractor 2016-07-19 19:50:44 +02:00
Shauren
a9a13d10f7 Merge branch '6.x' of https://github.com/TrinityCore/TrinityCore into legion 2016-07-17 17:37:06 +02:00