void GameEventMgr::UnApplyEvent(uint16 event_id) { m_ActiveEvents.erase(event_id); CharacterDatabase.PExecute("DELETE FROM game_event_status WHERE event = %u", event_id); sLog.outString("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); // un-spawn positive event tagged objects GameEventUnspawn(event_id); // spawn negative event tagget objects int16 event_nid = (-1) * event_id; GameEventSpawn(event_nid); // restore equipment or model UpdateCreatureData(event_id, false); // Remove quests that are events only to non event npc UpdateEventQuests(event_id, false); UpdateWorldStates(event_id, false); SendEventMails(event_nid); }
void GameEvent::ApplyNewEvent(uint16 event_id) { switch(sWorld.getConfig(CONFIG_EVENT_ANNOUNCE)) { case 0: // disable break; case 1: // announce events sWorld.SendWorldText(LANG_EVENTMESSAGE, mGameEvent[event_id].description.c_str()); break; } sLog.outString("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); // spawn positive event tagget objects GameEventSpawn(event_id); // un-spawn negative event tagged objects int16 event_nid = (-1) * event_id; GameEventUnspawn(event_nid); // Change equipement or model ChangeEquipOrModel(event_id, true); // Add quests that are events only to non event npc UpdateEventQuests(event_id, true); }
void GameEventMgr::ApplyNewEvent(uint16 event_id, bool resume) { m_ActiveEvents.insert(event_id); CharacterDatabase.PExecute("INSERT INTO game_event_status (event) VALUES (%u)", event_id); if (sWorld.getConfig(CONFIG_BOOL_EVENT_ANNOUNCE)) sWorld.SendWorldText(LANG_EVENTMESSAGE, mGameEvent[event_id].description.c_str()); sLog.outString("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); // spawn positive event tagget objects GameEventSpawn(event_id); // un-spawn negative event tagged objects int16 event_nid = (-1) * event_id; GameEventUnspawn(event_nid); // Change equipement or model UpdateCreatureData(event_id, true); // Add quests that are events only to non event npc UpdateEventQuests(event_id, true); // Not send mails at game event startup, if game event just resume after server shutdown (has been active at server before shutdown) if (!resume) SendEventMails(event_id); }