mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[10307] Rename two tables to prefix scripted_, making the tables have consistent names
Both tables (areatrigger / event_id) are used explicit to store ScriptName for script library use. In addition rename to ScriptName in instance_template Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
0880454847
commit
c6f2f16e05
8 changed files with 69 additions and 54 deletions
|
|
@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`creature_ai_version` varchar(120) default NULL,
|
`creature_ai_version` varchar(120) default NULL,
|
||||||
`cache_id` int(10) default '0',
|
`cache_id` int(10) default '0',
|
||||||
`required_10299_01_mangos_event_id_scripts` bit(1) default NULL
|
`required_10307_03_mangos_scripted_event_id` bit(1) default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -106,26 +106,6 @@ LOCK TABLES `areatrigger_involvedrelation` WRITE;
|
||||||
/*!40000 ALTER TABLE `areatrigger_involvedrelation` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `areatrigger_involvedrelation` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `areatrigger_scripts`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `areatrigger_scripts`;
|
|
||||||
CREATE TABLE `areatrigger_scripts` (
|
|
||||||
`entry` MEDIUMINT( 8 ) NOT NULL ,
|
|
||||||
`ScriptName` CHAR( 64 ) NOT NULL ,
|
|
||||||
PRIMARY KEY ( `entry` )
|
|
||||||
) ENGINE = MYISAM DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Dumping data for table `areatrigger_scripts`
|
|
||||||
--
|
|
||||||
|
|
||||||
LOCK TABLES `areatrigger_scripts` WRITE;
|
|
||||||
/*!40000 ALTER TABLE `areatrigger_scripts` DISABLE KEYS */;
|
|
||||||
/*!40000 ALTER TABLE `areatrigger_scripts` ENABLE KEYS */;
|
|
||||||
UNLOCK TABLES;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `areatrigger_tavern`
|
-- Table structure for table `areatrigger_tavern`
|
||||||
--
|
--
|
||||||
|
|
@ -1417,26 +1397,6 @@ LOCK TABLES `creature_ai_texts` WRITE;
|
||||||
/*!40000 ALTER TABLE `creature_ai_texts` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `creature_ai_texts` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `event_id_scripts`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `event_id_scripts`;
|
|
||||||
CREATE TABLE `event_id_scripts` (
|
|
||||||
`id` mediumint(8) NOT NULL,
|
|
||||||
`ScriptName` char(64) NOT NULL,
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Script library scripted events';
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Dumping data for table `event_id_scripts`
|
|
||||||
--
|
|
||||||
|
|
||||||
LOCK TABLES `event_id_scripts` WRITE;
|
|
||||||
/*!40000 ALTER TABLE `event_id_scripts` DISABLE KEYS */;
|
|
||||||
/*!40000 ALTER TABLE `event_id_scripts` ENABLE KEYS */;
|
|
||||||
UNLOCK TABLES;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `event_scripts`
|
-- Table structure for table `event_scripts`
|
||||||
--
|
--
|
||||||
|
|
@ -2130,7 +2090,7 @@ CREATE TABLE `instance_template` (
|
||||||
`parent` smallint(5) unsigned NOT NULL default '0',
|
`parent` smallint(5) unsigned NOT NULL default '0',
|
||||||
`levelMin` tinyint(3) unsigned NOT NULL default '0',
|
`levelMin` tinyint(3) unsigned NOT NULL default '0',
|
||||||
`levelMax` tinyint(3) unsigned NOT NULL default '0',
|
`levelMax` tinyint(3) unsigned NOT NULL default '0',
|
||||||
`script` varchar(128) NOT NULL default '',
|
`ScriptName` varchar(128) NOT NULL default '',
|
||||||
PRIMARY KEY (`map`)
|
PRIMARY KEY (`map`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|
@ -14103,6 +14063,46 @@ LOCK TABLES `reserved_name` WRITE;
|
||||||
/*!40000 ALTER TABLE `reserved_name` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `reserved_name` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `scripted_areatrigger`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `scripted_areatrigger`;
|
||||||
|
CREATE TABLE `scripted_areatrigger` (
|
||||||
|
`entry` MEDIUMINT( 8 ) NOT NULL ,
|
||||||
|
`ScriptName` CHAR( 64 ) NOT NULL ,
|
||||||
|
PRIMARY KEY ( `entry` )
|
||||||
|
) ENGINE = MYISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `scripted_areatrigger`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `scripted_areatrigger` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `scripted_areatrigger` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `scripted_areatrigger` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `scripted_event_id`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `scripted_event_id`;
|
||||||
|
CREATE TABLE `event_id_scripts` (
|
||||||
|
`id` mediumint(8) NOT NULL,
|
||||||
|
`ScriptName` char(64) NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Script library scripted events';
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `scripted_event_id`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `scripted_event_id` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `scripted_event_id` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `scripted_event_id` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `skill_discovery_template`
|
-- Table structure for table `skill_discovery_template`
|
||||||
--
|
--
|
||||||
|
|
|
||||||
3
sql/updates/10307_01_mangos_instance_template.sql
Normal file
3
sql/updates/10307_01_mangos_instance_template.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_10299_01_mangos_event_id_scripts required_10307_01_mangos_instance_template bit;
|
||||||
|
|
||||||
|
ALTER TABLE instance_template CHANGE COLUMN `script` `ScriptName` varchar(128) NOT NULL default '';
|
||||||
3
sql/updates/10307_02_mangos_scripted_areatrigger.sql
Normal file
3
sql/updates/10307_02_mangos_scripted_areatrigger.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_10307_01_mangos_instance_template required_10307_02_mangos_scripted_areatrigger bit;
|
||||||
|
|
||||||
|
RENAME TABLE areatrigger_scripts TO scripted_areatrigger;
|
||||||
3
sql/updates/10307_03_mangos_scripted_event_id.sql
Normal file
3
sql/updates/10307_03_mangos_scripted_event_id.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_10307_02_mangos_scripted_areatrigger required_10307_03_mangos_scripted_event_id bit;
|
||||||
|
|
||||||
|
RENAME TABLE event_id_scripts TO scripted_event_id;
|
||||||
|
|
@ -61,6 +61,9 @@ pkgdata_DATA = \
|
||||||
10289_01_mangos_creature_template.sql \
|
10289_01_mangos_creature_template.sql \
|
||||||
10289_02_mangos_creature_model_info.sql \
|
10289_02_mangos_creature_model_info.sql \
|
||||||
10299_01_mangos_event_id_scripts.sql \
|
10299_01_mangos_event_id_scripts.sql \
|
||||||
|
10307_01_mangos_instance_template.sql \
|
||||||
|
10307_02_mangos_scripted_areatrigger.sql \
|
||||||
|
10307_03_mangos_scripted_event_id.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -102,4 +105,7 @@ EXTRA_DIST = \
|
||||||
10289_01_mangos_creature_template.sql \
|
10289_01_mangos_creature_template.sql \
|
||||||
10289_02_mangos_creature_model_info.sql \
|
10289_02_mangos_creature_model_info.sql \
|
||||||
10299_01_mangos_event_id_scripts.sql \
|
10299_01_mangos_event_id_scripts.sql \
|
||||||
|
10307_01_mangos_instance_template.sql \
|
||||||
|
10307_02_mangos_scripted_areatrigger.sql \
|
||||||
|
10307_03_mangos_scripted_event_id.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -5200,7 +5200,7 @@ void ObjectMgr::LoadTavernAreaTriggers()
|
||||||
void ObjectMgr::LoadAreaTriggerScripts()
|
void ObjectMgr::LoadAreaTriggerScripts()
|
||||||
{
|
{
|
||||||
mAreaTriggerScripts.clear(); // need for reload case
|
mAreaTriggerScripts.clear(); // need for reload case
|
||||||
QueryResult *result = WorldDatabase.Query("SELECT entry, ScriptName FROM areatrigger_scripts");
|
QueryResult *result = WorldDatabase.Query("SELECT entry, ScriptName FROM scripted_areatrigger");
|
||||||
|
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
||||||
|
|
@ -5210,7 +5210,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
|
||||||
bar.step();
|
bar.step();
|
||||||
|
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
sLog.outString( ">> Loaded %u areatrigger scripts", count );
|
sLog.outString( ">> Loaded %u scripted areatrigger", count );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5229,7 +5229,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
|
||||||
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
|
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID);
|
||||||
if (!atEntry)
|
if (!atEntry)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Table `areatrigger_scripts` has area trigger (ID:%u) not listed in `AreaTrigger.dbc`.", Trigger_ID);
|
sLog.outErrorDb("Table `scripted_areatrigger` has area trigger (ID:%u) not listed in `AreaTrigger.dbc`.", Trigger_ID);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5245,7 +5245,7 @@ void ObjectMgr::LoadAreaTriggerScripts()
|
||||||
void ObjectMgr::LoadEventIdScripts()
|
void ObjectMgr::LoadEventIdScripts()
|
||||||
{
|
{
|
||||||
mEventIdScripts.clear(); // need for reload case
|
mEventIdScripts.clear(); // need for reload case
|
||||||
QueryResult *result = WorldDatabase.Query("SELECT id, ScriptName FROM event_id_scripts");
|
QueryResult *result = WorldDatabase.Query("SELECT id, ScriptName FROM scripted_event_id");
|
||||||
|
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
||||||
|
|
@ -5255,7 +5255,7 @@ void ObjectMgr::LoadEventIdScripts()
|
||||||
bar.step();
|
bar.step();
|
||||||
|
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
sLog.outString( ">> Loaded %u event id scripts", count );
|
sLog.outString( ">> Loaded %u scripted event id", count );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5314,7 +5314,7 @@ void ObjectMgr::LoadEventIdScripts()
|
||||||
|
|
||||||
std::set<uint32>::const_iterator itr = evt_scripts.find(eventId);
|
std::set<uint32>::const_iterator itr = evt_scripts.find(eventId);
|
||||||
if (itr == evt_scripts.end())
|
if (itr == evt_scripts.end())
|
||||||
sLog.outErrorDb("Table `event_id_scripts` has id %u not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u or path taxi node data",
|
sLog.outErrorDb("Table `scripted_event_id` has id %u not referring to any gameobject_template type 10 data2 field, type 3 data6 field, type 13 data 2 field or any spell effect %u or path taxi node data",
|
||||||
eventId, SPELL_EFFECT_SEND_EVENT);
|
eventId, SPELL_EFFECT_SEND_EVENT);
|
||||||
|
|
||||||
mEventIdScripts[eventId] = GetScriptId(scriptName);
|
mEventIdScripts[eventId] = GetScriptId(scriptName);
|
||||||
|
|
@ -5323,7 +5323,7 @@ void ObjectMgr::LoadEventIdScripts()
|
||||||
delete result;
|
delete result;
|
||||||
|
|
||||||
sLog.outString();
|
sLog.outString();
|
||||||
sLog.outString( ">> Loaded %u event id scripts", count );
|
sLog.outString( ">> Loaded %u scripted event id", count );
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team )
|
uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, uint32 team )
|
||||||
|
|
@ -8859,11 +8859,11 @@ void ObjectMgr::LoadScriptNames()
|
||||||
"UNION "
|
"UNION "
|
||||||
"SELECT DISTINCT(ScriptName) FROM item_template WHERE ScriptName <> '' "
|
"SELECT DISTINCT(ScriptName) FROM item_template WHERE ScriptName <> '' "
|
||||||
"UNION "
|
"UNION "
|
||||||
"SELECT DISTINCT(ScriptName) FROM areatrigger_scripts WHERE ScriptName <> '' "
|
"SELECT DISTINCT(ScriptName) FROM scripted_areatrigger WHERE ScriptName <> '' "
|
||||||
"UNION "
|
"UNION "
|
||||||
"SELECT DISTINCT(ScriptName) FROM event_id_scripts WHERE ScriptName <> '' "
|
"SELECT DISTINCT(ScriptName) FROM scripted_event_id WHERE ScriptName <> '' "
|
||||||
"UNION "
|
"UNION "
|
||||||
"SELECT DISTINCT(script) FROM instance_template WHERE script <> ''");
|
"SELECT DISTINCT(ScriptName) FROM instance_template WHERE ScriptName <> ''");
|
||||||
|
|
||||||
if( !result )
|
if( !result )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10306"
|
#define REVISION_NR "10307"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#ifndef __REVISION_SQL_H__
|
#ifndef __REVISION_SQL_H__
|
||||||
#define __REVISION_SQL_H__
|
#define __REVISION_SQL_H__
|
||||||
#define REVISION_DB_CHARACTERS "required_10254_01_characters_auctionhouse"
|
#define REVISION_DB_CHARACTERS "required_10254_01_characters_auctionhouse"
|
||||||
#define REVISION_DB_MANGOS "required_10299_01_mangos_event_id_scripts"
|
#define REVISION_DB_MANGOS "required_10307_03_mangos_scripted_event_id"
|
||||||
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
|
||||||
#endif // __REVISION_SQL_H__
|
#endif // __REVISION_SQL_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue