Commit Graph

475 Commits

Author SHA1 Message Date
Treeston
971ed856a4 Core/Scripts: Implemented OnlyOnceAreaTriggerScript (#20288) 2017-09-14 22:53:02 -03:00
Aokromes
7ed36d353a Core/Scripting: remove long time dead code 2017-09-11 18:03:57 +02:00
Yehonal
4ee16fb536 Core/Scripts: FOR_SCRIPTS macro shouldn't return early (#20187)
FOR_SCRIPTS, insteadof FOR_SCRIPTS_RET, shouldn't return
otherwise methods such as void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player) will end prematurely
2017-08-22 21:24:22 +02:00
ccrs
7fff83d675 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)
2017-08-12 01:40:25 +02:00
r00ty-tc
59db2eeea0 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.
2017-07-31 21:21:04 +02:00
treeston
fb87ac8e8d Core/Scripts: Implement generic script loaders (and script registry macros) to greatly reduce code duplication (#19526) (cherry-picked from commit a9174d5). 2017-07-20 00:27:20 +02:00
ariel-
85a7d5ce9a Core: ported headers cleanup from master branch 2017-06-19 23:20:06 -03:00
ariel-
3e7b64b2f7 Core/OutdoorPvP: refactor using Position and Quat to pack parameters
- Moved statics to cpp
- Save scriptids into an array
2017-06-11 17:02:01 -03:00
treeston
aeaa8ecfab Fix an issue where CanSpawn would never get invoked on creatures without per-guid script. 2017-05-31 14:03:48 +02:00
DoctorKraft
04dfd78dac Core/Hotswap: Fix Reload on Linux
* Closes #19465
2017-05-23 18:17:40 +02:00
Shauren
cb5d22a6cb Core/Hotswap: Replace #ifdef conditions with comparisons of values defined in CompilerDefs.h
(cherry picked from commit 43510a258c)
2017-05-23 18:16:02 +02:00
ForesterDev
abea8bf4cb Core/Defines: define faction templates and replace magic numbers from scripts 2017-05-23 12:30:27 +02:00
ariel-
f913f3bb89 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)
2017-05-01 18:19:36 -03:00
ariel-
b6b59f6c23 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
2017-04-28 18:59:14 -03:00
S.V
f3d795d8dd Core/ScriptReloadMgr: Fixed scripts hot swapping on OS X (#19365) 2017-03-31 23:10:18 +02:00
Aokromes
0999ef0b77 Core/Scripts: Add support for spawn specific C++ scripts
By Krudor
2017-03-26 13:32:28 +02:00
ariel-
eac9c1f0b9 Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Closes #15734
2017-02-21 22:38:30 -03:00
Kittnz
9d74252e8d Reverting: Game/Scripting: Add OnGameEvent hook for game objects. 2017-02-17 20:30:52 +01:00
Kittnz
a5ccbe9906 Fix tabs 2017-02-17 20:19:05 +01:00
Kittnz
343d2c7f91 Game/Scripting: Add OnGameEvent hook for game objects.
Called when specific game event starts
2017-02-17 20:16:22 +01:00
Kittnz
d550ba7392 Game/Scripting: Add OnPlayerRepop hook
Called when a player presses release when he died
2017-02-07 17:28:16 +01:00
ariel-
57798b649c Core/Scripts: fix dynamic build 2017-02-06 21:32:40 -03:00
Shauren
bf2121680f Core/Misc: Added regex compatibility layer to fall back to boost::regex for really old compiler
(cherry picked from commit b6f1f8405f)
2017-02-06 21:12:27 -03:00
sirikfoll
afa8527338 Core/Scripting: Fixed hotswap calling evade mode for dead creatures 2017-01-13 14:26:43 -03:00
tkrokli
6a51a88767 Update Copyright notice for 2017
Happy new year!
2017-01-02 19:52:45 +01:00
Gustavo
7e0a616657 Core/Misc Remove WhiteSpaces (#18379) 2016-12-02 02:23:02 +01:00
ariel-
cbb5c073ce Core/ScriptMgr: use vector instead of list to contain Spell and Aura scripts and hooks 2016-11-14 02:05:51 -03:00
treeston
84cf239fda Various: Fix coverity reported issues. 2016-10-04 13:49:05 +02:00
treeston
3ec1b2f27e Core/Movement: Fix a DB spline chain overload I missed in 2170541 2016-09-21 01:29:48 +02:00
treeston
2170541a51 Core/Unit: Standardize SetFacingTo and SetFacingToObject behavior while moving. Both now fail while moving unless arg2 bool is true.
Movement/SplineChain: Bump value range for DB chainId up to uint16 (0 to 65535) from uint8 (0 to 255). Turns out sniffs generate far more chains than I expected.
2016-09-20 20:19:15 +02:00
treeston
4a1a460241 PCH build fix. Again.
(( Alright, you made me waste 20 minutes of my life on a full nonPCH rebuild of the core now. ))
(( I hope you're happy. ))
2016-09-20 13:23:21 +02:00
treeston
4fa646c0b2 Core/Movement: Add a convenience default ctor to SplineChainResumeInfo, and fix PCH build in some configurations (zzz why do we even keep Appveyor and Travis around). 2016-09-20 12:45:11 +02:00
treeston
6d00d3f283 Core/Movement: Add new SplineChainMovementGenerator that allows accurate replication of sniffed waypoints in static sequences, along with DB facilities that allow loading of waypoints from DB. 2016-09-20 00:37:36 +02:00
Naios
79adaf4ee0 Core/Scripts: Fix a crash when adding/removing objects from the map while swapping
* Ref #17833
2016-09-15 15:13:57 +02:00
Rochet2
c52566a888 Core/Scripts: Enhance quest status hook by making it catch more status changes (#17865) 2016-09-09 21:11:36 +02:00
treeston
0c2c88ed50 Fine, this time I actually built it. Promise. 2016-09-09 19:48:31 +02:00
treeston
a9f1151f2c Build fix. 2016-09-09 19:43:29 +02:00
treeston
91c2b3162d Game/Scripting: Follow-up to b3d44d6. Fix script selection for creatures on difficulty > 0. 2016-09-09 19:37:04 +02:00
treeston
3c32086b81 Core/Maps: Add override to allow InstanceMap const* -> InstanceScript const*.
Also tighten const-ness on CanSpawn method of CreatureScript.
2016-09-09 18:08:43 +02:00
treeston
b3d44d6c36 Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep. 2016-09-09 16:21:27 +02:00
Naios
445746c402 Core/Scripting: Fix acquiring of references between script swaps
* Delay unloading of shared libraries to the next update tick
  to prevent crashes in the destructor of the last referenced
  script instance.
* Closes #17557
2016-07-13 21:58:50 +02:00
Naios
d68316fcd2 Core/Scripting: Don't force event cancellation when swapping creatures.
* EventProcessor::KillAllEvents(force = false) should only be used
  by the EventProcessor.
2016-07-03 00:14:22 +02:00
Naios
851c73b3e4 Core/Scripting: Kill pending unit events when swapping AI's 2016-05-01 17:49:37 +02:00
Naios
86b0fcf67a Core/Scripting: Use the path of the worldserver executable to search for the scripts dir
* Fixes issues when starting the worldserver not in the bin directory
  or the CMAKE_INSTALL_PREFIX directory using the -c option.
2016-04-18 21:02:01 +02:00
Naios
081720b5dd Core/Scripting: Use the systems temporary path for caching shared libs
* Disables the shared library caching on platforms completely which
  never block files on usage (like linux).
2016-04-18 21:02:00 +02:00
Naios
11b5de63cb Core/Scripting: Add the info how much time the system took to reload 2016-04-17 18:11:05 +02:00
Naios
1e0a93d3d8 Core/Scripting: Improve the error message when the script reloader fails to create a cache entry
(cherry picked from commit 8fa52860ab)
2016-04-16 22:09:25 +02:00
Vincent-Michael
fe90fdcba1 Core: Removed Whitespaces
(cherry picked from commit 3cd19d3b30)

# Conflicts:
#	src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
#	src/server/game/Handlers/NPCHandler.cpp
#	src/server/game/Server/Packets/ChatPackets.cpp
#	src/server/game/Server/Packets/NPCPackets.h
#	src/server/game/Server/Packets/PartyPackets.h
#	src/server/game/Server/Packets/PetPackets.cpp
#	src/server/game/Server/Packets/PetPackets.h
#	src/server/game/Server/Packets/TicketPackets.h
#	src/server/game/Server/Packets/VoicePackets.h
#	src/server/game/Server/Packets/WardenPackets.h
#	src/server/scripts/Commands/cs_cheat.cpp
2016-04-16 16:52:23 +01:00
Naios
ea627589d6 Core/Scripting: Fix a typo in b970a684 2016-04-14 22:14:06 +02:00
Naios
b970a68473 Core/Scripting: Wait until the debugger is detached before rebuilding scripts.
* Thanks Shauren for the IsDebuggerPresent() hint.
2016-04-14 21:27:39 +02:00