[11940] Rewrite and cleanup DB Script Engine

* 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>
This commit is contained in:
Schmoozerd 2012-04-06 21:56:21 +02:00
parent fe3f4a43ee
commit 8e0edc0383
18 changed files with 1530 additions and 1803 deletions

View file

@ -59,7 +59,7 @@ void WaypointManager::Load()
std::set<uint32> movementScriptSet;
for(ScriptMapMap::const_iterator itr = sCreatureMovementScripts.begin(); itr != sCreatureMovementScripts.end(); ++itr)
for(ScriptMapMap::const_iterator itr = sCreatureMovementScripts.second.begin(); itr != sCreatureMovementScripts.second.end(); ++itr)
movementScriptSet.insert(itr->first);
// creature_movement
@ -162,7 +162,7 @@ void WaypointManager::Load()
if (node.script_id)
{
if (sCreatureMovementScripts.find(node.script_id) == sCreatureMovementScripts.end())
if (sCreatureMovementScripts.second.find(node.script_id) == sCreatureMovementScripts.second.end())
{
sLog.outErrorDb("Table creature_movement for id %u, point %u have script_id %u that does not exist in `creature_movement_scripts`, ignoring", id, point, node.script_id);
continue;
@ -327,7 +327,7 @@ void WaypointManager::Load()
if (node.script_id)
{
if (sCreatureMovementScripts.find(node.script_id) == sCreatureMovementScripts.end())
if (sCreatureMovementScripts.second.find(node.script_id) == sCreatureMovementScripts.second.end())
{
sLog.outErrorDb("Table creature_movement_template for entry %u, point %u have script_id %u that does not exist in `creature_movement_scripts`, ignoring", entry, point, node.script_id);
continue;