- -- dracaryS
- # d.notice("blabla",true) - Big Notice
- # d.notice("blabla",false) - Mini Notice
- dungeon.cpp
- search
- void CDungeon::Notice(const char* msg)
- and change all function
- void CDungeon::Notice(const char* msg, bool bFlag)
- {
- sys_log(0, "XXX Dungeon Notice %p %s", this, msg);
- LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
- if (!pMap)
- {
- sys_err("cannot find map by index %d", m_lMapIndex);
- return;
- }
- FNotice f(msg,bFlag);
- pMap->for_each(f);
- }
- ##################################################
- search
- struct FNotice
- and change all
- struct FNotice
- {
- const char * m_psz;
- bool GetFlag;
- FNotice(const char * psz, bool bFlag)
- :m_psz(psz), GetFlag(bFlag)
- {}
- void operator() (LPENTITY ent)
- {
- if (ent->IsType(ENTITY_CHARACTER))
- {
- LPCHARACTER ch = (LPCHARACTER) ent;
- if(ch->IsPC())
- {
- if(GetFlag)
- {
- ch->ChatPacket(CHAT_TYPE_BIG_NOTICE, "%s", m_psz);
- }
- else
- {
- ch->ChatPacket(CHAT_TYPE_NOTICE, "%s", m_psz);
- }
- }
- }
- }
- };
- ##################################################################
- questlua_dungeon.cpp open
- search
- int dungeon_notice(lua_State* L)
- change function
- int dungeon_notice(lua_State* L)
- {
- if (!lua_isstring(L, 1) || !lua_isstring(L, 2))
- return 0;
- CQuestManager& q = CQuestManager::instance();
- LPDUNGEON pDungeon = q.GetCurrentDungeon();
- if (pDungeon == NULL || !pDungeon)
- return 0;
- if (pDungeon)
- pDungeon->Notice(lua_tostring(L, 1),lua_tostring(L, 2));
- return 0;
- }