* Allow SCRIPT_COMMAND_KILL_CREDIT to give the kill of an involved npc.
This is marked by datalong (creature-entry) == 0
* Remove immediate execution of commands. This will prevent infinite loops when db-scripts trigger db-scripts which are executed immediately
* Add check for SCRIPT_COMMAND_PLAY_SOUND
* Add check to catch an invalid command
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
* Support to script Dummy spells with spell_scripts
* Support to script TriggerSpell spells which have no existing triggered spell
Note that the order which spell-effect actually triggers the DB script is well-defined (SCRIPT_EFFECT before DUMMY before other)
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
Idea for this patch by Klark20 (maybe he also was the author of this patch as well, I cannot check in this moment)
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This changes the handling of SCRIPT_COMMAND_MOVE_TO, to not expect some travel-time, but directly provide the speed for the movement (*100).
Attention to DB-Devs, please check your MOVE_TO scripts.
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
* Moved actual script processing code to ScriptMgr
* Unifed and improved log output. Now table-name is passed to each script execution
* Added the "buddy concept" to all commands (except the outdated direct field change commands):
Now all commands support to search a creature (or go for some commands) in a radius, with which to do some stuff.
See doc/script_commands.txt for more details and information
Attention DB Devs:
Current DB-Scripts are converted automatically as far as possible, but some old target selecting mechanics were not reasonable to do automated.
For such cases the command is marked with data_flags & 0x10 (==16), which will throw DB-Errors to track them down faster
Thanks to NeatElves and especially Grz3s for testing!
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
Thanks to faq for pointing.
I checked both udb and ytdb, and they don't use this command yet;
If however you use it already check your scripts. (The toggle/add/remove flag must be set in `data_flags`) Sorry for the inconvenience.
Alos added a forgotten break.
Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
* Not reset lock/interact state in instances (so until instance reset)
* Do unti-cheating checks for use attempts locked/non-intareactive GOs
* Implement SCRIPT_COMMAND_GO_LOCK_STATE for control lock/interact state of GOs from scripts.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
A new specialized function SetFactionTemporary for creatures are added. It work just like setFaction but has in addition option to set flags.
The flags determine if default faction should be restored and when; most commonly just before respawn and when reaching home after evade.
SCRIPT_COMMAND_SET_FACTION for DB scripts and ACTION_T_SET_FACTION for creature_ai_scripts are now capable of using the system (documentation updated)
The intention of the system is to be able to solve basic events that include faction changes, with the use of database only and in easier ways.
It is advised that DB devs revise current database scripts to check if changes should be made. The same goes for EventAI devs regarding ACTION_T_SET_FACTION.
Signed-off-by: NoFantasy <nofantasy@nf.no>
Also allow play emote on Player when player is source.
Gameobject may be source of script but are only allowed as searcher for creature when defined.
Signed-off-by: NoFantasy <nofantasy@nf.no>
All commands can only have creature as the affected by command
*_SET_ACTIVEOBJECT - switch activeObject state on/off
*_SET_FACTION - changes faction
*_MORPH_TO_ENTRY_OR_MODEL - changes model to model from creature_template entry or model id explicit
*_MOUNT_TO_ENTRY_OR_MODEL - mounts on model from creature_template entry or model id explicit
*_SET_RUN - switch walkmode on/off
Signed-off-by: NoFantasy <nofantasy@nf.no>
In addition to adding fields for text id storage (in total 4 text id's), also added a comments field for developers notes in scripts (it may help those being old of age to remember what goes on in a script).
Signed-off-by: NoFantasy <nofantasy@nf.no>