* 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>
* Rename barGoLink -> BarGoLink as expected by mangos code style
* Add uint32/uint6 constructor versions for BarGoLink,
and remove lot casts required before for BarGoLink use
This can affect correct result in cases big guid values
(out of range for possitive part of int32 range) at x86 platforms.
Some other cases addded in addition to original patch fixes
where %d wrongly/unsafe used for unsigned values.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
ASSERT hard use in predictable way because diff. 3rd party libs code
redefine it inf different ways and hard make sure that used in end
of mangos define version. This is real detected problem make some
expected assert checks ignored and so bugs not detected as expected from code.
In addition made related changes:
* Common.h header expected to be first include in any src/game/header except most simple cases.
* Related FILE.h header expected to be first include in FILE.cpp
* Fixed some absent includes and type forwards for safe build without PCH enabled.
* Avoid using MANGOS_ASSERT in src/framework code
Template can be used for several cases:
* Unique creature that are already spawned in database (requires creature.MovementType=2 like guid based creature_movement)
* Summoned creature that has a pre-defined path (requires creature_template.MovementType=2)
Note that creature_template.MovementType=2 should be used with care, and must not be used for creatures that may be summoned in random locations in world.
Added additional startup checks for existing creature_movement-table
Signed-off-by: NoFantasy <nofantasy@nf.no>
New field script_id in creature_movement can be filled for each waypoint point and run the corresponding script from creature_movement_scripts.
Script_id can be any value and several points/creatures can share the same script (with limits of course, such as script depending on location and other factors).
DB projects are advised to move current text, spells and emotes data in creature_movement fields as these fields are strictly no longer needed and may be fully removed in the future.
Signed-off-by: NoFantasy <nofantasy@nf.no>
all warnings from Wunused
and some from Wall
cause unused may be most interesting for some:
they were in following files:
src/game/Level2.cpp
src/game/Map.cpp
src/game/SpellAuras.cpp
src/game/Unit.cpp
src/mangosd/Master.cpp
but i guess mostly someone just fogot to remove this code
for some unsigned vs signed warnings i used:
ack "for.*int .*size\(\)" | ack -v uint
also note for coding:
if you do something like
if( a && b || c)
just place parentheses around (a && b) && always will have
precedence over || but without parentheses this could be overseen
quite fast (at least that's my guess why gcc will warn for this)
Signed-off-by: balrok <der-coole-carl@gmx.net>
Implemented in same way as db script localization. creature_movemant now store indexes in db_script_string.
In game waypoint text setting disabled. Unclear how this possible implement with localization data.