aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/world_database.sql34
-rw-r--r--sql/updates/world/2011_06_18_05_world_misc.sql4
-rwxr-xr-xsrc/server/game/Entities/Creature/GossipDef.cpp3
-rwxr-xr-xsrc/server/game/Entities/Creature/GossipDef.h3
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp9
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.cpp48
-rwxr-xr-xsrc/server/game/Globals/ObjectMgr.h4
-rwxr-xr-xsrc/server/game/World/World.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp23
9 files changed, 12 insertions, 118 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index 94d2a7f1ed2..25ec7798ef9 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -597,7 +597,7 @@ INSERT INTO `command` VALUES
('reload all achievement',3,'Syntax: .reload all achievement\r\n\r\nReload achievement_reward, achievement_criteria_data tables.'),
('reload all area',3,'Syntax: .reload all area\r\n\r\nReload areatrigger_teleport, areatrigger_tavern, game_graveyard_zone tables.'),
('reload all eventai',3,'Syntax: .reload all eventai\r\n\r\nReload creature_ai_scripts, creature_ai_summons, creature_ai_texts tables.'),
-('reload all gossips',3,'Syntax: .reload all gossips\nReload gossip_menu, gossip_menu_option, gossip_scripts, points_of_interest tables.'),
+('reload all gossips',3,'Syntax: .reload all gossips\nReload gossip_menu, gossip_menu_option, points_of_interest tables.'),
('reload all item',3,'Syntax: .reload all item\nReload page_text, item_enchantment_table tables.'),
('reload all locales',3,'Syntax: .reload all locales\r\n\r\nReload all `locales_*` tables with reload support added and that can be _safe_ reloaded.'),
('reload all loot',3,'Syntax: .reload all loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'),
@@ -632,7 +632,6 @@ INSERT INTO `command` VALUES
('reload game_tele',3,'Syntax: .reload game_tele\nReload game_tele table.'),
('reload gossip_menu',3,'Syntax: .reload gossip_menu\nReload gossip_menu table.'),
('reload gossip_menu_option',3,'Syntax: .reload gossip_menu_option\nReload gossip_menu_option table.'),
-('reload gossip_scripts',3,'Syntax: .reload gossip_scripts\nReload gossip_scripts table.'),
('reload gm_tickets',3,'Syntax: .reload gm_tickets\nReload gm_tickets table.'),
('reload item_enchantment_template',3,'Syntax: .reload item_enchantment_template\nReload item_enchantment_template table.'),
('reload item_loot_template',3,'Syntax: .reload item_loot_template\nReload item_loot_template table.'),
@@ -2726,36 +2725,6 @@ LOCK TABLES `gameobject_template` WRITE;
UNLOCK TABLES;
--
--- Table structure for table `gossip_scripts`
---
-
-DROP TABLE IF EXISTS `gossip_scripts`;
-/*!40101 SET @saved_cs_client = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `gossip_scripts` (
- `id` mediumint(8) unsigned NOT NULL default '0',
- `delay` int(10) unsigned NOT NULL default '0',
- `command` mediumint(8) unsigned NOT NULL default '0',
- `datalong` mediumint(8) unsigned NOT NULL default '0',
- `datalong2` int(10) unsigned NOT NULL default '0',
- `dataint` int(11) NOT NULL default '0',
- `x` float NOT NULL default '0',
- `y` float NOT NULL default '0',
- `z` float NOT NULL default '0',
- `o` float NOT NULL default '0'
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
--- Dumping data for table `gossip_scripts`
---
-
-LOCK TABLES `gossip_scripts` WRITE;
-/*!40000 ALTER TABLE `gossip_scripts` DISABLE KEYS */;
-/*!40000 ALTER TABLE `gossip_scripts` ENABLE KEYS */;
-UNLOCK TABLES;
-
---
-- Table structure for table `gossip_menu`
--
@@ -2794,7 +2763,6 @@ CREATE TABLE gossip_menu_option (
npc_option_npcflag int(10) unsigned NOT NULL default '0',
action_menu_id mediumint(8) unsigned NOT NULL default '0',
action_poi_id mediumint(8) unsigned NOT NULL default '0',
- action_script_id mediumint(8) unsigned NOT NULL default '0',
box_coded tinyint(3) unsigned NOT NULL default '0',
box_money int(11) unsigned NOT NULL default '0',
box_text text,
diff --git a/sql/updates/world/2011_06_18_05_world_misc.sql b/sql/updates/world/2011_06_18_05_world_misc.sql
new file mode 100644
index 00000000000..502bd03a5b6
--- /dev/null
+++ b/sql/updates/world/2011_06_18_05_world_misc.sql
@@ -0,0 +1,4 @@
+UPDATE `command` SET `help` = 'Syntax: .reload all gossips\nReload gossip_menu, gossip_menu_option, gossip_scripts, points_of_interest tables.' WHERE `name`='reload all gossips';
+DELETE FROM `command` WHERE `name` = 'reload gossip_scripts';
+DROP TABLE IF EXISTS `gossip_scripts`;
+ALTER TABLE `gossip_menu_option` DROP `action_script_id`;
diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp
index 54da5ed3bb9..dfadebdf27e 100755
--- a/src/server/game/Entities/Creature/GossipDef.cpp
+++ b/src/server/game/Entities/Creature/GossipDef.cpp
@@ -68,13 +68,12 @@ void GossipMenu::AddMenuItem(int32 menuItemId, uint8 icon, std::string const& me
menuItem.BoxMoney = boxMoney;
}
-void GossipMenu::AddGossipMenuItemData(uint32 menuItemId, uint32 gossipActionMenuId, uint32 gossipActionPoi, uint32 gossipActionScript)
+void GossipMenu::AddGossipMenuItemData(uint32 menuItemId, uint32 gossipActionMenuId, uint32 gossipActionPoi)
{
GossipMenuItemData& itemData = _menuItemData[menuItemId];
itemData.GossipActionMenuId = gossipActionMenuId;
itemData.GossipActionPoi = gossipActionPoi;
- itemData.GossipActionScript = gossipActionScript;
}
uint32 GossipMenu::GetMenuItemSender(uint32 menuItemId) const
diff --git a/src/server/game/Entities/Creature/GossipDef.h b/src/server/game/Entities/Creature/GossipDef.h
index 07ac9423732..16966965b47 100755
--- a/src/server/game/Entities/Creature/GossipDef.h
+++ b/src/server/game/Entities/Creature/GossipDef.h
@@ -143,7 +143,6 @@ struct GossipMenuItemData
{
uint32 GossipActionMenuId; // MenuId of the gossip triggered by this action
uint32 GossipActionPoi;
- uint32 GossipActionScript;
};
// need an ordered container
@@ -168,7 +167,7 @@ class GossipMenu
void SetMenuId(uint32 menu_id) { _menuId = menu_id; }
uint32 GetMenuId() const { return _menuId; }
- void AddGossipMenuItemData(uint32 menuItemId, uint32 gossipActionMenuId, uint32 gossipActionPoi, uint32 gossipActionScript);
+ void AddGossipMenuItemData(uint32 menuItemId, uint32 gossipActionMenuId, uint32 gossipActionPoi);
uint32 GetMenuItemCount() const
{
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 8ae8d652a53..8f1467aa302 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -14096,7 +14096,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
}
menu->GetGossipMenu().AddMenuItem(itr->second.OptionIndex, itr->second.OptionIcon, strOptionText, 0, itr->second.OptionType, strBoxText, itr->second.BoxMoney, itr->second.BoxCoded);
- menu->GetGossipMenu().AddGossipMenuItemData(itr->second.OptionIndex, itr->second.ActionMenuId, itr->second.ActionPoiId, itr->second.ActionScriptId);
+ menu->GetGossipMenu().AddGossipMenuItemData(itr->second.OptionIndex, itr->second.ActionMenuId, itr->second.ActionPoiId);
}
}
}
@@ -14185,13 +14185,6 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
if (menuItemData->GossipActionPoi)
PlayerTalkClass->SendPointOfInterest(menuItemData->GossipActionPoi);
- if (menuItemData->GossipActionScript)
- {
- if (source->GetTypeId() == TYPEID_UNIT)
- GetMap()->ScriptsStart(sGossipScripts, menuItemData->GossipActionScript, this, source);
- else if (source->GetTypeId() == TYPEID_GAMEOBJECT)
- GetMap()->ScriptsStart(sGossipScripts, menuItemData->GossipActionScript, source, this);
- }
break;
}
case GOSSIP_OPTION_OUTDOORPVP:
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index ef161da9783..2640af253d4 100755
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -51,7 +51,6 @@ ScriptMapMap sQuestStartScripts;
ScriptMapMap sSpellScripts;
ScriptMapMap sGameObjectScripts;
ScriptMapMap sEventScripts;
-ScriptMapMap sGossipScripts;
ScriptMapMap sWaypointScripts;
std::string GetScriptsTableNameByType(ScriptsType type)
@@ -65,7 +64,6 @@ std::string GetScriptsTableNameByType(ScriptsType type)
case SCRIPTS_GAMEOBJECT: res = "gameobject_scripts"; break;
case SCRIPTS_EVENT: res = "event_scripts"; break;
case SCRIPTS_WAYPOINT: res = "waypoint_scripts"; break;
- case SCRIPTS_GOSSIP: res = "gossip_scripts"; break;
default: break;
}
return res;
@@ -82,7 +80,6 @@ ScriptMapMap* GetScriptsMapByType(ScriptsType type)
case SCRIPTS_GAMEOBJECT: res = &sGameObjectScripts; break;
case SCRIPTS_EVENT: res = &sEventScripts; break;
case SCRIPTS_WAYPOINT: res = &sWaypointScripts; break;
- case SCRIPTS_GOSSIP: res = &sGossipScripts; break;
default: break;
}
return res;
@@ -5091,13 +5088,6 @@ void ObjectMgr::ValidateSpellScripts()
sLog->outString();
}
-void ObjectMgr::LoadGossipScripts()
-{
- LoadScripts(SCRIPTS_GOSSIP);
-
- // checks are done in LoadGossipMenuItems
-}
-
void ObjectMgr::LoadPageTexts()
{
uint32 oldMSTime = getMSTime();
@@ -8515,7 +8505,7 @@ void ObjectMgr::LoadGossipMenuItems()
QueryResult result = WorldDatabase.Query(
"SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, "
- "action_menu_id, action_poi_id, action_script_id, box_coded, box_money, box_text "
+ "action_menu_id, action_poi_id, box_coded, box_money, box_text "
"FROM gossip_menu_option ORDER BY menu_id, id");
if (!result)
@@ -8527,14 +8517,8 @@ void ObjectMgr::LoadGossipMenuItems()
uint32 count = 0;
- std::set<uint32> gossipScriptSet;
-
- for (ScriptMapMap::const_iterator itr = sGossipScripts.begin(); itr != sGossipScripts.end(); ++itr)
- gossipScriptSet.insert(itr->first);
-
do
{
-
Field* fields = result->Fetch();
GossipMenuItems gMenuItem;
@@ -8547,10 +8531,9 @@ void ObjectMgr::LoadGossipMenuItems()
gMenuItem.OptionNpcflag = fields[5].GetUInt32();
gMenuItem.ActionMenuId = fields[6].GetUInt32();
gMenuItem.ActionPoiId = fields[7].GetUInt32();
- gMenuItem.ActionScriptId = fields[8].GetUInt32();
- gMenuItem.BoxCoded = fields[9].GetBool();
- gMenuItem.BoxMoney = fields[10].GetUInt32();
- gMenuItem.BoxText = fields[11].GetString();
+ gMenuItem.BoxCoded = fields[8].GetBool();
+ gMenuItem.BoxMoney = fields[9].GetUInt32();
+ gMenuItem.BoxText = fields[10].GetString();
if (gMenuItem.OptionIcon >= GOSSIP_ICON_MAX)
{
@@ -8567,34 +8550,11 @@ void ObjectMgr::LoadGossipMenuItems()
gMenuItem.ActionPoiId = 0;
}
- if (gMenuItem.ActionScriptId)
- {
- if (gMenuItem.OptionType != GOSSIP_OPTION_GOSSIP)
- {
- sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u but option_id is not GOSSIP_OPTION_GOSSIP, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionScriptId);
- continue;
- }
-
- if (sGossipScripts.find(gMenuItem.ActionScriptId) == sGossipScripts.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.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionScriptId);
- continue;
- }
-
- gossipScriptSet.erase(gMenuItem.ActionScriptId);
- }
-
m_mGossipMenuItemsMap.insert(GossipMenuItemsMap::value_type(gMenuItem.MenuId, gMenuItem));
++count;
}
while (result->NextRow());
- if (!gossipScriptSet.empty())
- {
- for (std::set<uint32>::const_iterator itr = gossipScriptSet.begin(); itr != gossipScriptSet.end(); ++itr)
- sLog->outErrorDb("Table `gossip_scripts` contain unused script, id %u.", *itr);
- }
-
sLog->outString(">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index ab1c7f1cfe4..f7468f19755 100755
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -94,7 +94,6 @@ enum ScriptsType
SCRIPTS_GAMEOBJECT,
SCRIPTS_EVENT,
SCRIPTS_WAYPOINT,
- SCRIPTS_GOSSIP,
SCRIPTS_LAST
};
@@ -329,7 +328,6 @@ extern ScriptMapMap sQuestStartScripts;
extern ScriptMapMap sSpellScripts;
extern ScriptMapMap sGameObjectScripts;
extern ScriptMapMap sEventScripts;
-extern ScriptMapMap sGossipScripts;
extern ScriptMapMap sWaypointScripts;
std::string GetScriptsTableNameByType(ScriptsType type);
@@ -483,7 +481,6 @@ struct GossipMenuItems
uint32 OptionNpcflag;
uint32 ActionMenuId;
uint32 ActionPoiId;
- uint32 ActionScriptId;
bool BoxCoded;
uint32 BoxMoney;
std::string BoxText;
@@ -862,7 +859,6 @@ class ObjectMgr
void LoadQuestStartScripts();
void LoadEventScripts();
void LoadSpellScripts();
- void LoadGossipScripts();
void LoadWaypointScripts();
void LoadSpellScriptNames();
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 97dda09c859..494908b848f 100755
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1538,8 +1538,6 @@ void World::SetInitialWorldSettings()
sLog->outString("Loading GameTeleports...");
sObjectMgr->LoadGameTele();
- sObjectMgr->LoadGossipScripts(); // must be before gossip menu options
-
sLog->outString("Loading Gossip menu...");
sObjectMgr->LoadGossipMenu();
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 44baf909a16..c51e148bcae 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -98,7 +98,6 @@ public:
{ "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "", NULL },
{ "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "", NULL },
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL },
- { "gossip_scripts", SEC_ADMINISTRATOR, true, &HandleReloadGossipScriptsCommand, "", NULL },
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &HandleReloadItemEnchantementsCommand, "", NULL },
{ "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "", NULL },
{ "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "", NULL },
@@ -257,7 +256,6 @@ public:
sLog->outString("Re-Loading Scripts...");
HandleReloadGameObjectScriptsCommand(handler, "a");
- HandleReloadGossipScriptsCommand(handler, "a");
HandleReloadEventScriptsCommand(handler, "a");
HandleReloadQuestEndScriptsCommand(handler, "a");
HandleReloadQuestStartScriptsCommand(handler, "a");
@@ -299,7 +297,6 @@ public:
HandleReloadGossipMenuCommand(handler, "a");
HandleReloadGossipMenuOptionCommand(handler, "a");
if(*args != 'a') // already reload from all_scripts
- HandleReloadGossipScriptsCommand(handler, "a");
HandleReloadPointsOfInterestCommand(handler, "a");
return true;
}
@@ -919,26 +916,6 @@ public:
return true;
}
- static bool HandleReloadGossipScriptsCommand(ChatHandler* handler, const char* args)
- {
- if (sScriptMgr->IsScriptScheduled())
- {
- handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
- handler->SetSentErrorMessage(true);
- return false;
- }
-
- if (*args != 'a')
- sLog->outString("Re-Loading Scripts from `gossip_scripts`...");
-
- sObjectMgr->LoadGossipScripts();
-
- if (*args != 'a')
- handler->SendGlobalGMSysMessage("DB table `gossip_scripts` reloaded.");
-
- return true;
- }
-
static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args)
{
if (sScriptMgr->IsScriptScheduled())