Core/Events: Remove support for the game_event_npc_gossip table.
Gossip for game events should be done with the conditions system.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
DROP TABLE `game_event_npc_gossip`;
|
||||
@@ -833,46 +833,6 @@ void GameEventMgr::LoadFromDB()
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
// Load game event npc gossip ids
|
||||
|
||||
sLog->outString("Loading Game Event NPC Gossip Data...");
|
||||
oldMSTime = getMSTime();
|
||||
|
||||
// 0 1 2
|
||||
result = WorldDatabase.Query("SELECT guid, event_id, textid FROM game_event_npc_gossip");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outString(">> Loaded 0 npc gossip textids in game events. DB table `game_event_npc_gossip` is empty.");
|
||||
sLog->outString();
|
||||
}
|
||||
else
|
||||
{
|
||||
count = 0;
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
|
||||
uint32 guid = fields[0].GetUInt32();
|
||||
uint16 event_id = fields[1].GetUInt16();
|
||||
uint32 textid = fields[2].GetUInt32();
|
||||
|
||||
if (event_id >= mGameEvent.size())
|
||||
{
|
||||
sLog->outErrorDb("`game_event_npc_gossip` game event id (%u) is out of range compared to max event id in `game_event`",event_id);
|
||||
continue;
|
||||
}
|
||||
|
||||
mNPCGossipIds[guid]=EventNPCGossipIdPair(event_id, textid);
|
||||
|
||||
++count;
|
||||
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u npc gossip textids in game events in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
// Load game event battleground flags
|
||||
|
||||
sLog->outString("Loading Game Event Battleground Data...");
|
||||
@@ -986,15 +946,6 @@ uint32 GameEventMgr::GetNPCFlag(Creature * cr)
|
||||
return mask;
|
||||
}
|
||||
|
||||
uint32 GameEventMgr::GetNpcTextId(uint32 guid)
|
||||
{
|
||||
GuidEventNpcGossipIdMap::iterator itr = mNPCGossipIds.find(guid);
|
||||
if (itr != mNPCGossipIds.end())
|
||||
if (IsActiveEvent(itr->second.first))
|
||||
return itr->second.second;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 GameEventMgr::Initialize() // return the next event delay in ms
|
||||
{
|
||||
m_ActiveEvents.clear();
|
||||
@@ -1615,18 +1566,6 @@ void GameEventMgr::SaveWorldEventStateToDB(uint16 event_id)
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
void GameEventMgr::HandleWorldEventGossip(Player *plr, Creature *c)
|
||||
{
|
||||
// this function is used to send world state update before sending gossip menu
|
||||
// find the npc's gossip id (if set) in an active game event
|
||||
// if present, send the event's world states
|
||||
GuidEventNpcGossipIdMap::iterator itr = mNPCGossipIds.find(c->GetDBTableGUIDLow());
|
||||
if (itr != mNPCGossipIds.end())
|
||||
if (IsActiveEvent(itr->second.first))
|
||||
// send world state updates to the player about the progress
|
||||
SendWorldStateUpdate(plr, itr->second.first);
|
||||
}
|
||||
|
||||
void GameEventMgr::SendWorldStateUpdate(Player * plr, uint16 event_id)
|
||||
{
|
||||
std::map<uint32,GameEventFinishCondition>::iterator itr;
|
||||
|
||||
@@ -150,8 +150,6 @@ class GameEventMgr
|
||||
typedef std::pair<uint32 /*guid*/, uint32 /*npcflag*/> GuidNPCFlagPair;
|
||||
typedef std::list<GuidNPCFlagPair> NPCFlagList;
|
||||
typedef std::vector<NPCFlagList> GameEventNPCFlagMap;
|
||||
typedef std::pair<uint16 /*event id*/, uint32 /*gossip id*/> EventNPCGossipIdPair;
|
||||
typedef std::map<uint32 /*guid*/, EventNPCGossipIdPair> GuidEventNpcGossipIdMap;
|
||||
typedef std::vector<uint32> GameEventBitmask;
|
||||
GameEventQuestMap mGameEventCreatureQuests;
|
||||
GameEventQuestMap mGameEventGameObjectQuests;
|
||||
@@ -164,7 +162,6 @@ class GameEventMgr
|
||||
GameEventBitmask mGameEventBattlegroundHolidays;
|
||||
QuestIdToEventConditionMap mQuestToEventConditions;
|
||||
GameEventNPCFlagMap mGameEventNPCFlags;
|
||||
GuidEventNpcGossipIdMap mNPCGossipIds;
|
||||
ActiveEvents m_ActiveEvents;
|
||||
bool isSystemInit;
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user