diff options
| author | runningnak3d <runningnak3d@gmail.com> | 2011-02-11 15:50:48 -0700 |
|---|---|---|
| committer | runningnak3d <runningnak3d@gmail.com> | 2011-02-11 15:50:48 -0700 |
| commit | 6728d4116bd0ac191f0032abf1d68bb3d933e6c2 (patch) | |
| tree | 87cc8434057e2f3058db2aeaa635fd45ac002953 | |
| parent | 01a80ec8d62706f8f869629a2c93aedd5aa1eae7 (diff) | |
Core/Events: Remove support for the `game_event_npc_gossip` table.
Gossip for game events should be done with the conditions system.
| -rw-r--r-- | sql/updates/world/2011_02_11_4_world_game_event_npc_gossip.sql | 1 | ||||
| -rwxr-xr-x | src/server/game/Events/GameEventMgr.cpp | 61 | ||||
| -rwxr-xr-x | src/server/game/Events/GameEventMgr.h | 3 |
3 files changed, 1 insertions, 64 deletions
diff --git a/sql/updates/world/2011_02_11_4_world_game_event_npc_gossip.sql b/sql/updates/world/2011_02_11_4_world_game_event_npc_gossip.sql new file mode 100644 index 00000000000..83f7613d6c9 --- /dev/null +++ b/sql/updates/world/2011_02_11_4_world_game_event_npc_gossip.sql @@ -0,0 +1 @@ +DROP TABLE `game_event_npc_gossip`; diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index d424853894a..d7c0f2e4a9b 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -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; diff --git a/src/server/game/Events/GameEventMgr.h b/src/server/game/Events/GameEventMgr.h index 34635129efc..f030d97a586 100755 --- a/src/server/game/Events/GameEventMgr.h +++ b/src/server/game/Events/GameEventMgr.h @@ -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: |
