1. -- dracaryS
  2. # d.notice("blabla",true) - Big Notice
  3. # d.notice("blabla",false) - Mini Notice
  4. dungeon.cpp
  5. search
  6. void CDungeon::Notice(const char* msg)
  7. and change all function
  8. void CDungeon::Notice(const char* msg, bool bFlag)
  9. {
  10. sys_log(0, "XXX Dungeon Notice %p %s", this, msg);
  11. LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
  12. if (!pMap)
  13. {
  14. sys_err("cannot find map by index %d", m_lMapIndex);
  15. return;
  16. }
  17. FNotice f(msg,bFlag);
  18. pMap->for_each(f);
  19. }
  20. ##################################################
  21. search
  22. struct FNotice
  23. and change all
  24. struct FNotice
  25. {
  26. const char * m_psz;
  27. bool GetFlag;
  28. FNotice(const char * psz, bool bFlag)
  29. :m_psz(psz), GetFlag(bFlag)
  30. {}
  31. void operator() (LPENTITY ent)
  32. {
  33. if (ent->IsType(ENTITY_CHARACTER))
  34. {
  35. LPCHARACTER ch = (LPCHARACTER) ent;
  36. if(ch->IsPC())
  37. {
  38. if(GetFlag)
  39. {
  40. ch->ChatPacket(CHAT_TYPE_BIG_NOTICE, "%s", m_psz);
  41. }
  42. else
  43. {
  44. ch->ChatPacket(CHAT_TYPE_NOTICE, "%s", m_psz);
  45. }
  46. }
  47. }
  48. }
  49. };
  50. ##################################################################
  51. questlua_dungeon.cpp open
  52. search
  53. int dungeon_notice(lua_State* L)
  54. change function
  55. int dungeon_notice(lua_State* L)
  56. {
  57. if (!lua_isstring(L, 1) || !lua_isstring(L, 2))
  58. return 0;
  59. CQuestManager& q = CQuestManager::instance();
  60. LPDUNGEON pDungeon = q.GetCurrentDungeon();
  61. if (pDungeon == NULL || !pDungeon)
  62. return 0;
  63. if (pDungeon)
  64. pDungeon->Notice(lua_tostring(L, 1),lua_tostring(L, 2));
  65. return 0;
  66. }