[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

@ -8534,7 +8534,7 @@ void ObjectMgr::LoadGossipMenu(std::set<uint32>& gossipScriptSet)
// Check script-id
if (gMenu.script_id)
{
if (sGossipScripts.find(gMenu.script_id) == sGossipScripts.end())
if (sGossipScripts.second.find(gMenu.script_id) == sGossipScripts.second.end())
{
sLog.outErrorDb("Table gossip_menu for menu %u, text-id %u have script_id %u that does not exist in `gossip_scripts`, ignoring", gMenu.entry, gMenu.text_id, gMenu.script_id);
continue;
@ -8743,7 +8743,7 @@ void ObjectMgr::LoadGossipMenuItems(std::set<uint32>& gossipScriptSet)
if (gMenuItem.action_script_id)
{
if (sGossipScripts.find(gMenuItem.action_script_id) == sGossipScripts.end())
if (sGossipScripts.second.find(gMenuItem.action_script_id) == sGossipScripts.second.end())
{
sLog.outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u that does not exist in `gossip_scripts`, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_script_id);
continue;
@ -8780,7 +8780,7 @@ void ObjectMgr::LoadGossipMenus()
{
// Check which script-ids in gossip_scripts are not used
std::set<uint32> gossipScriptSet;
for (ScriptMapMap::const_iterator itr = sGossipScripts.begin(); itr != sGossipScripts.end(); ++itr)
for (ScriptMapMap::const_iterator itr = sGossipScripts.second.begin(); itr != sGossipScripts.second.end(); ++itr)
gossipScriptSet.insert(itr->first);
// Load gossip_menu and gossip_menu_option data