mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Merge branch 'master' into 303
This commit is contained in:
commit
8b55b2de78
14 changed files with 189 additions and 33 deletions
|
|
@ -22,7 +22,7 @@
|
||||||
DROP TABLE IF EXISTS `db_version`;
|
DROP TABLE IF EXISTS `db_version`;
|
||||||
CREATE TABLE `db_version` (
|
CREATE TABLE `db_version` (
|
||||||
`version` varchar(120) default NULL,
|
`version` varchar(120) default NULL,
|
||||||
`required_2008_11_09_03_mangos_mangos_string` bit(1) default NULL
|
`required_2008_11_11_02_mangos_scripts` 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';
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
@ -67,6 +67,15 @@ CREATE TABLE `areatrigger_scripts` (
|
||||||
PRIMARY KEY ( `entry` )
|
PRIMARY KEY ( `entry` )
|
||||||
) ENGINE = MYISAM DEFAULT CHARSET=utf8;
|
) 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`
|
||||||
--
|
--
|
||||||
|
|
@ -813,6 +822,34 @@ LOCK TABLES `creature_template_addon` WRITE;
|
||||||
/*!40000 ALTER TABLE `creature_template_addon` ENABLE KEYS */;
|
/*!40000 ALTER TABLE `creature_template_addon` ENABLE KEYS */;
|
||||||
UNLOCK TABLES;
|
UNLOCK TABLES;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `db_script_string`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `db_script_string`;
|
||||||
|
CREATE TABLE `db_script_string` (
|
||||||
|
`entry` mediumint(8) unsigned NOT NULL default '0',
|
||||||
|
`content_default` text NOT NULL,
|
||||||
|
`content_loc1` text,
|
||||||
|
`content_loc2` text,
|
||||||
|
`content_loc3` text,
|
||||||
|
`content_loc4` text,
|
||||||
|
`content_loc5` text,
|
||||||
|
`content_loc6` text,
|
||||||
|
`content_loc7` text,
|
||||||
|
`content_loc8` text,
|
||||||
|
PRIMARY KEY (`entry`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `db_script_string`
|
||||||
|
--
|
||||||
|
|
||||||
|
LOCK TABLES `db_script_string` WRITE;
|
||||||
|
/*!40000 ALTER TABLE `db_script_string` DISABLE KEYS */;
|
||||||
|
/*!40000 ALTER TABLE `db_script_string` ENABLE KEYS */;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `disenchant_loot_template`
|
-- Table structure for table `disenchant_loot_template`
|
||||||
--
|
--
|
||||||
|
|
@ -851,7 +888,7 @@ CREATE TABLE `event_scripts` (
|
||||||
`command` mediumint(8) unsigned NOT NULL default '0',
|
`command` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong2` int(10) unsigned NOT NULL default '0',
|
`datalong2` int(10) unsigned NOT NULL default '0',
|
||||||
`datatext` text NOT NULL,
|
`dataint` int(11) NOT NULL default '0',
|
||||||
`x` float NOT NULL default '0',
|
`x` float NOT NULL default '0',
|
||||||
`y` float NOT NULL default '0',
|
`y` float NOT NULL default '0',
|
||||||
`z` float NOT NULL default '0',
|
`z` float NOT NULL default '0',
|
||||||
|
|
@ -1303,7 +1340,7 @@ CREATE TABLE `gameobject_scripts` (
|
||||||
`command` mediumint(8) unsigned NOT NULL default '0',
|
`command` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong2` int(10) unsigned NOT NULL default '0',
|
`datalong2` int(10) unsigned NOT NULL default '0',
|
||||||
`datatext` text NOT NULL,
|
`dataint` int(11) NOT NULL default '0',
|
||||||
`x` float NOT NULL default '0',
|
`x` float NOT NULL default '0',
|
||||||
`y` float NOT NULL default '0',
|
`y` float NOT NULL default '0',
|
||||||
`z` float NOT NULL default '0',
|
`z` float NOT NULL default '0',
|
||||||
|
|
@ -10531,7 +10568,7 @@ CREATE TABLE `quest_end_scripts` (
|
||||||
`command` mediumint(8) unsigned NOT NULL default '0',
|
`command` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong2` int(10) unsigned NOT NULL default '0',
|
`datalong2` int(10) unsigned NOT NULL default '0',
|
||||||
`datatext` text NOT NULL,
|
`dataint` int(11) NOT NULL default '0',
|
||||||
`x` float NOT NULL default '0',
|
`x` float NOT NULL default '0',
|
||||||
`y` float NOT NULL default '0',
|
`y` float NOT NULL default '0',
|
||||||
`z` float NOT NULL default '0',
|
`z` float NOT NULL default '0',
|
||||||
|
|
@ -10558,7 +10595,7 @@ CREATE TABLE `quest_start_scripts` (
|
||||||
`command` mediumint(8) unsigned NOT NULL default '0',
|
`command` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong2` int(10) unsigned NOT NULL default '0',
|
`datalong2` int(10) unsigned NOT NULL default '0',
|
||||||
`datatext` text NOT NULL,
|
`dataint` int(11) NOT NULL default '0',
|
||||||
`x` float NOT NULL default '0',
|
`x` float NOT NULL default '0',
|
||||||
`y` float NOT NULL default '0',
|
`y` float NOT NULL default '0',
|
||||||
`z` float NOT NULL default '0',
|
`z` float NOT NULL default '0',
|
||||||
|
|
@ -15283,7 +15320,7 @@ CREATE TABLE `spell_scripts` (
|
||||||
`command` mediumint(8) unsigned NOT NULL default '0',
|
`command` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
`datalong` mediumint(8) unsigned NOT NULL default '0',
|
||||||
`datalong2` int(10) unsigned NOT NULL default '0',
|
`datalong2` int(10) unsigned NOT NULL default '0',
|
||||||
`datatext` text NOT NULL,
|
`dataint` int(11) NOT NULL default '0',
|
||||||
`x` float NOT NULL default '0',
|
`x` float NOT NULL default '0',
|
||||||
`y` float NOT NULL default '0',
|
`y` float NOT NULL default '0',
|
||||||
`z` float NOT NULL default '0',
|
`z` float NOT NULL default '0',
|
||||||
|
|
|
||||||
21
sql/updates/2008_11_11_01_mangos_db_script_string.sql
Normal file
21
sql/updates/2008_11_11_01_mangos_db_script_string.sql
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_2008_11_09_03_mangos_mangos_string required_2008_11_11_01_mangos_db_script_string bit;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `db_script_string`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `db_script_string`;
|
||||||
|
CREATE TABLE `db_script_string` (
|
||||||
|
`entry` int(11) unsigned NOT NULL default '0',
|
||||||
|
`content_default` text NOT NULL,
|
||||||
|
`content_loc1` text,
|
||||||
|
`content_loc2` text,
|
||||||
|
`content_loc3` text,
|
||||||
|
`content_loc4` text,
|
||||||
|
`content_loc5` text,
|
||||||
|
`content_loc6` text,
|
||||||
|
`content_loc7` text,
|
||||||
|
`content_loc8` text,
|
||||||
|
PRIMARY KEY (`entry`)
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
21
sql/updates/2008_11_11_02_mangos_scripts.sql
Normal file
21
sql/updates/2008_11_11_02_mangos_scripts.sql
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
ALTER TABLE db_version CHANGE COLUMN required_2008_11_11_01_mangos_db_script_string required_2008_11_11_02_mangos_scripts bit;
|
||||||
|
|
||||||
|
ALTER TABLE event_scripts
|
||||||
|
DROP datatext,
|
||||||
|
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||||
|
|
||||||
|
ALTER TABLE gameobject_scripts
|
||||||
|
DROP datatext,
|
||||||
|
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||||
|
|
||||||
|
ALTER TABLE quest_end_scripts
|
||||||
|
DROP datatext,
|
||||||
|
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||||
|
|
||||||
|
ALTER TABLE quest_start_scripts
|
||||||
|
DROP datatext,
|
||||||
|
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||||
|
|
||||||
|
ALTER TABLE spell_scripts
|
||||||
|
DROP datatext,
|
||||||
|
ADD COLUMN dataint int(11) NOT NULL default '0';
|
||||||
|
|
@ -130,6 +130,8 @@ pkgdata_DATA = \
|
||||||
2008_11_09_01_mangos_command.sql \
|
2008_11_09_01_mangos_command.sql \
|
||||||
2008_11_09_02_mangos_command.sql \
|
2008_11_09_02_mangos_command.sql \
|
||||||
2008_11_09_03_mangos_mangos_string.sql \
|
2008_11_09_03_mangos_mangos_string.sql \
|
||||||
|
2008_11_11_01_mangos_db_script_string.sql \
|
||||||
|
2008_11_11_02_mangos_scripts.sql \
|
||||||
README
|
README
|
||||||
|
|
||||||
## Additional files to include when running 'make dist'
|
## Additional files to include when running 'make dist'
|
||||||
|
|
@ -241,4 +243,6 @@ EXTRA_DIST = \
|
||||||
2008_11_09_01_mangos_command.sql \
|
2008_11_09_01_mangos_command.sql \
|
||||||
2008_11_09_02_mangos_command.sql \
|
2008_11_09_02_mangos_command.sql \
|
||||||
2008_11_09_03_mangos_mangos_string.sql \
|
2008_11_09_03_mangos_mangos_string.sql \
|
||||||
|
2008_11_11_01_mangos_db_script_string.sql \
|
||||||
|
2008_11_11_02_mangos_scripts.sql \
|
||||||
README
|
README
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand,"",NULL },
|
{ "creature_involvedrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestInvRelationsCommand,"",NULL },
|
||||||
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", NULL },
|
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesCreatureCommand, "", NULL },
|
||||||
{ "creature_questrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestRelationsCommand, "", NULL },
|
{ "creature_questrelation", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadCreatureQuestRelationsCommand, "", NULL },
|
||||||
|
{ "db_script_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadDbScriptStringCommand, "", NULL },
|
||||||
{ "disenchant_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesDisenchantCommand, "", NULL },
|
{ "disenchant_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesDisenchantCommand, "", NULL },
|
||||||
{ "fishing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesFishingCommand, "", NULL },
|
{ "fishing_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesFishingCommand, "", NULL },
|
||||||
{ "game_graveyard_zone", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameGraveyardZoneCommand, "", NULL },
|
{ "game_graveyard_zone", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGameGraveyardZoneCommand, "", NULL },
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@ class ChatHandler
|
||||||
bool HandleReloadCommandCommand(const char* args);
|
bool HandleReloadCommandCommand(const char* args);
|
||||||
bool HandleReloadCreatureQuestRelationsCommand(const char* args);
|
bool HandleReloadCreatureQuestRelationsCommand(const char* args);
|
||||||
bool HandleReloadCreatureQuestInvRelationsCommand(const char* args);
|
bool HandleReloadCreatureQuestInvRelationsCommand(const char* args);
|
||||||
|
bool HandleReloadDbScriptStringCommand(const char* args);
|
||||||
bool HandleReloadGameGraveyardZoneCommand(const char* args);
|
bool HandleReloadGameGraveyardZoneCommand(const char* args);
|
||||||
bool HandleReloadGameObjectScriptsCommand(const char* args);
|
bool HandleReloadGameObjectScriptsCommand(const char* args);
|
||||||
bool HandleReloadGameTeleCommand(const char* args);
|
bool HandleReloadGameTeleCommand(const char* args);
|
||||||
|
|
|
||||||
|
|
@ -707,6 +707,8 @@ enum MangosStrings
|
||||||
|
|
||||||
// Use for custom patches 11000-11999
|
// Use for custom patches 11000-11999
|
||||||
|
|
||||||
// NOT RESERVED IDS 12000-
|
// NOT RESERVED IDS 12000-1999999999
|
||||||
|
// `db_script_string` table index 2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
|
||||||
|
// For other tables maybe 2000010000-2147483647 (max index)
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ bool ChatHandler::HandleReloadAllScriptsCommand(const char*)
|
||||||
HandleReloadQuestStartScriptsCommand("a");
|
HandleReloadQuestStartScriptsCommand("a");
|
||||||
HandleReloadSpellScriptsCommand("a");
|
HandleReloadSpellScriptsCommand("a");
|
||||||
SendGlobalSysMessage("DB tables `*_scripts` reloaded.");
|
SendGlobalSysMessage("DB tables `*_scripts` reloaded.");
|
||||||
|
HandleReloadDbScriptStringCommand("a");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -597,6 +598,14 @@ bool ChatHandler::HandleReloadSpellScriptsCommand(const char* arg)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ChatHandler::HandleReloadDbScriptStringCommand(const char* arg)
|
||||||
|
{
|
||||||
|
sLog.outString( "Re-Loading Script strings from `db_script_string`...");
|
||||||
|
objmgr.LoadDbScriptStrings();
|
||||||
|
SendGlobalSysMessage("DB table `db_script_string` reloaded.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ChatHandler::HandleReloadGameGraveyardZoneCommand(const char* /*arg*/)
|
bool ChatHandler::HandleReloadGameGraveyardZoneCommand(const char* /*arg*/)
|
||||||
{
|
{
|
||||||
sLog.outString( "Re-Loading Graveyard-zone links...");
|
sLog.outString( "Re-Loading Graveyard-zone links...");
|
||||||
|
|
|
||||||
|
|
@ -493,7 +493,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult *result, uint32 acc
|
||||||
delete result;
|
delete result;
|
||||||
|
|
||||||
WorldSession * session = sWorld.FindSession(accountId);
|
WorldSession * session = sWorld.FindSession(accountId);
|
||||||
if(!session)
|
if(!session || !session->GetPlayer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FriendsResult friendResult = FRIEND_NOT_FOUND;
|
FriendsResult friendResult = FRIEND_NOT_FOUND;
|
||||||
|
|
@ -576,7 +576,7 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(QueryResult *result, uint32 acc
|
||||||
delete result;
|
delete result;
|
||||||
|
|
||||||
WorldSession * session = sWorld.FindSession(accountId);
|
WorldSession * session = sWorld.FindSession(accountId);
|
||||||
if(!session)
|
if(!session || !session->GetPlayer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FriendsResult ignoreResult = FRIEND_IGNORE_NOT_FOUND;
|
FriendsResult ignoreResult = FRIEND_IGNORE_NOT_FOUND;
|
||||||
|
|
|
||||||
|
|
@ -3704,7 +3704,7 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
||||||
|
|
||||||
scripts.clear(); // need for reload support
|
scripts.clear(); // need for reload support
|
||||||
|
|
||||||
QueryResult *result = WorldDatabase.PQuery( "SELECT id,delay,command,datalong,datalong2,datatext, x, y, z, o FROM %s", tablename );
|
QueryResult *result = WorldDatabase.PQuery( "SELECT id,delay,command,datalong,datalong2,dataint, x, y, z, o FROM %s", tablename );
|
||||||
|
|
||||||
uint32 count = 0;
|
uint32 count = 0;
|
||||||
|
|
||||||
|
|
@ -3726,16 +3726,16 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
||||||
|
|
||||||
Field *fields = result->Fetch();
|
Field *fields = result->Fetch();
|
||||||
ScriptInfo tmp;
|
ScriptInfo tmp;
|
||||||
tmp.id = fields[0].GetUInt32();
|
tmp.id = fields[0].GetUInt32();
|
||||||
tmp.delay = fields[1].GetUInt32();
|
tmp.delay = fields[1].GetUInt32();
|
||||||
tmp.command = fields[2].GetUInt32();
|
tmp.command = fields[2].GetUInt32();
|
||||||
tmp.datalong = fields[3].GetUInt32();
|
tmp.datalong = fields[3].GetUInt32();
|
||||||
tmp.datalong2 = fields[4].GetUInt32();
|
tmp.datalong2 = fields[4].GetUInt32();
|
||||||
tmp.datatext = fields[5].GetCppString();
|
tmp.dataint = fields[5].GetInt32();
|
||||||
tmp.x = fields[6].GetFloat();
|
tmp.x = fields[6].GetFloat();
|
||||||
tmp.y = fields[7].GetFloat();
|
tmp.y = fields[7].GetFloat();
|
||||||
tmp.z = fields[8].GetFloat();
|
tmp.z = fields[8].GetFloat();
|
||||||
tmp.o = fields[9].GetFloat();
|
tmp.o = fields[9].GetFloat();
|
||||||
|
|
||||||
// generic command args check
|
// generic command args check
|
||||||
switch(tmp.command)
|
switch(tmp.command)
|
||||||
|
|
@ -3747,6 +3747,21 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
||||||
sLog.outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.datalong,tmp.id);
|
sLog.outErrorDb("Table `%s` has invalid talk type (datalong = %u) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.datalong,tmp.id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if(tmp.dataint==0)
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table `%s` has invalid talk text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.dataint,tmp.id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(tmp.dataint < MIN_DB_SCRIPT_STRING_ID || tmp.dataint >= MAX_DB_SCRIPT_STRING_ID)
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table `%s` has out of range text id (dataint = %i expected %u-%u) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.dataint,MIN_DB_SCRIPT_STRING_ID,MAX_DB_SCRIPT_STRING_ID,tmp.id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(!objmgr.GetMangosStringLocale(tmp.dataint))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Table `%s` has not existed text id (dataint = %i) in SCRIPT_COMMAND_TALK for script id %u",tablename,tmp.dataint,tmp.id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7264,6 +7279,44 @@ bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 m
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectMgr::CheckScripts(ScriptMapMap const& scripts,std::set<int32>& ids)
|
||||||
|
{
|
||||||
|
for(ScriptMapMap::const_iterator itrMM = scripts.begin(); itrMM != scripts.end(); ++itrMM)
|
||||||
|
{
|
||||||
|
for(ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM)
|
||||||
|
{
|
||||||
|
if(itrM->second.dataint)
|
||||||
|
{
|
||||||
|
if(ids.count(itrM->second.dataint))
|
||||||
|
ids.erase(itrM->second.dataint);
|
||||||
|
else
|
||||||
|
sLog.outErrorDb( "Table `db_script_string` has not existed string id %u", *itrM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjectMgr::LoadDbScriptStrings()
|
||||||
|
{
|
||||||
|
LoadMangosStrings(WorldDatabase,"db_script_string",MIN_DB_SCRIPT_STRING_ID,MAX_DB_SCRIPT_STRING_ID);
|
||||||
|
|
||||||
|
std::set<int32> ids;
|
||||||
|
|
||||||
|
for(int32 i = MIN_DB_SCRIPT_STRING_ID; i < MAX_DB_SCRIPT_STRING_ID; ++i)
|
||||||
|
if(GetMangosStringLocale(i))
|
||||||
|
ids.insert(i);
|
||||||
|
|
||||||
|
CheckScripts(sQuestEndScripts,ids);
|
||||||
|
CheckScripts(sQuestStartScripts,ids);
|
||||||
|
CheckScripts(sSpellScripts,ids);
|
||||||
|
CheckScripts(sGameObjectScripts,ids);
|
||||||
|
CheckScripts(sEventScripts,ids);
|
||||||
|
|
||||||
|
for(std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
|
||||||
|
sLog.outErrorDb( "Table `db_script_string` has unused string id %u", *itr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Functions for scripting access
|
// Functions for scripting access
|
||||||
const char* GetAreaTriggerScriptNameById(uint32 id)
|
const char* GetAreaTriggerScriptNameById(uint32 id)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ struct ScriptInfo
|
||||||
uint32 command;
|
uint32 command;
|
||||||
uint32 datalong;
|
uint32 datalong;
|
||||||
uint32 datalong2;
|
uint32 datalong2;
|
||||||
std::string datatext;
|
int32 dataint;
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
float z;
|
float z;
|
||||||
|
|
@ -125,6 +125,13 @@ typedef UNORDERED_MAP<uint32/*(mapid,spawnMode) pair*/,CellObjectGuidsMap> MapOb
|
||||||
|
|
||||||
typedef UNORDERED_MAP<uint64/*(instance,guid) pair*/,time_t> RespawnTimes;
|
typedef UNORDERED_MAP<uint64/*(instance,guid) pair*/,time_t> RespawnTimes;
|
||||||
|
|
||||||
|
|
||||||
|
// mangos string ranges
|
||||||
|
#define MIN_MANGOS_STRING_ID 1
|
||||||
|
#define MAX_MANGOS_STRING_ID 2000000000
|
||||||
|
#define MIN_DB_SCRIPT_STRING_ID MAX_MANGOS_STRING_ID
|
||||||
|
#define MAX_DB_SCRIPT_STRING_ID 2000010000
|
||||||
|
|
||||||
struct MangosStringLocale
|
struct MangosStringLocale
|
||||||
{
|
{
|
||||||
std::vector<std::string> Content; // 0 -> default, i -> i-1 locale index
|
std::vector<std::string> Content; // 0 -> default, i -> i-1 locale index
|
||||||
|
|
@ -501,7 +508,8 @@ class ObjectMgr
|
||||||
void LoadSpellScripts();
|
void LoadSpellScripts();
|
||||||
|
|
||||||
bool LoadMangosStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
|
bool LoadMangosStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
|
||||||
bool LoadMangosStrings() { return LoadMangosStrings(WorldDatabase,"mangos_string",1,std::numeric_limits<int32>::max()); }
|
bool LoadMangosStrings() { return LoadMangosStrings(WorldDatabase,"mangos_string",MIN_MANGOS_STRING_ID,MAX_MANGOS_STRING_ID); }
|
||||||
|
void LoadDbScriptStrings();
|
||||||
void LoadPetCreateSpells();
|
void LoadPetCreateSpells();
|
||||||
void LoadCreatureLocales();
|
void LoadCreatureLocales();
|
||||||
void LoadCreatureTemplates();
|
void LoadCreatureTemplates();
|
||||||
|
|
@ -832,6 +840,7 @@ class ObjectMgr
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadScripts(ScriptMapMap& scripts, char const* tablename);
|
void LoadScripts(ScriptMapMap& scripts, char const* tablename);
|
||||||
|
void CheckScripts(ScriptMapMap const& scripts,std::set<int32>& ids);
|
||||||
void ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* table, char const* guidEntryStr);
|
void ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const* table, char const* guidEntryStr);
|
||||||
void LoadQuestRelationsHelper(QuestRelations& map,char const* table);
|
void LoadQuestRelationsHelper(QuestRelations& map,char const* table);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8176,7 +8176,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
|
||||||
// ..taken
|
// ..taken
|
||||||
AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
|
AuraList const& mDamageTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_TAKEN);
|
||||||
for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
|
for(AuraList::const_iterator i = mDamageTaken.begin();i != mDamageTaken.end(); ++i)
|
||||||
if((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
|
if((*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask())
|
||||||
TakenFlatBenefit += (*i)->GetModifier()->m_amount;
|
TakenFlatBenefit += (*i)->GetModifier()->m_amount;
|
||||||
|
|
||||||
if(attType!=RANGED_ATTACK)
|
if(attType!=RANGED_ATTACK)
|
||||||
|
|
@ -8200,7 +8200,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT
|
||||||
// ..taken
|
// ..taken
|
||||||
AuraList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
|
AuraList const& mModDamagePercentTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN);
|
||||||
for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
|
for(AuraList::const_iterator i = mModDamagePercentTaken.begin(); i != mModDamagePercentTaken.end(); ++i)
|
||||||
if((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
|
if((*i)->GetModifier()->m_miscvalue & GetMeleeDamageSchoolMask())
|
||||||
TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
|
||||||
|
|
||||||
// .. taken pct: dummy auras
|
// .. taken pct: dummy auras
|
||||||
|
|
|
||||||
|
|
@ -1150,6 +1150,9 @@ void World::SetInitialWorldSettings()
|
||||||
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
|
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||||
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
|
||||||
|
|
||||||
|
sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls
|
||||||
|
objmgr.LoadDbScriptStrings();
|
||||||
|
|
||||||
sLog.outString( "Initializing Scripts..." );
|
sLog.outString( "Initializing Scripts..." );
|
||||||
if(!LoadScriptingModule())
|
if(!LoadScriptingModule())
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
@ -1576,11 +1579,6 @@ void World::ScriptsProcess()
|
||||||
sLog.outError("SCRIPT_COMMAND_TALK call for non-creature (TypeId: %u), skipping.",source->GetTypeId());
|
sLog.outError("SCRIPT_COMMAND_TALK call for non-creature (TypeId: %u), skipping.",source->GetTypeId());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(step.script->datalong > 3)
|
|
||||||
{
|
|
||||||
sLog.outError("SCRIPT_COMMAND_TALK invalid chat type (%u), skipping.",step.script->datalong);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint64 unit_target = target ? target->GetGUID() : 0;
|
uint64 unit_target = target ? target->GetGUID() : 0;
|
||||||
|
|
||||||
|
|
@ -1588,7 +1586,7 @@ void World::ScriptsProcess()
|
||||||
switch(step.script->datalong)
|
switch(step.script->datalong)
|
||||||
{
|
{
|
||||||
case 0: // Say
|
case 0: // Say
|
||||||
((Creature *)source)->Say(step.script->datatext.c_str(), LANG_UNIVERSAL, unit_target);
|
((Creature *)source)->Say(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||||
break;
|
break;
|
||||||
case 1: // Whisper
|
case 1: // Whisper
|
||||||
if(!unit_target)
|
if(!unit_target)
|
||||||
|
|
@ -1596,13 +1594,13 @@ void World::ScriptsProcess()
|
||||||
sLog.outError("SCRIPT_COMMAND_TALK attempt to whisper (%u) NULL, skipping.",step.script->datalong);
|
sLog.outError("SCRIPT_COMMAND_TALK attempt to whisper (%u) NULL, skipping.",step.script->datalong);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
((Creature *)source)->Whisper(step.script->datatext.c_str(),unit_target);
|
((Creature *)source)->Whisper(step.script->dataint,unit_target);
|
||||||
break;
|
break;
|
||||||
case 2: // Yell
|
case 2: // Yell
|
||||||
((Creature *)source)->Yell(step.script->datatext.c_str(), LANG_UNIVERSAL, unit_target);
|
((Creature *)source)->Yell(step.script->dataint, LANG_UNIVERSAL, unit_target);
|
||||||
break;
|
break;
|
||||||
case 3: // Emote text
|
case 3: // Emote text
|
||||||
((Creature *)source)->TextEmote(step.script->datatext.c_str(), unit_target);
|
((Creature *)source)->TextEmote(step.script->dataint, unit_target);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break; // must be already checked at load
|
break; // must be already checked at load
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6817"
|
#define REVISION_NR "6818"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue