forked from metin2/server
Add project files.
This commit is contained in:
65
game/src/OXEvent.h
Normal file
65
game/src/OXEvent.h
Normal file
@ -0,0 +1,65 @@
|
||||
|
||||
#define OXEVENT_MAP_INDEX 113
|
||||
|
||||
struct tag_Quiz
|
||||
{
|
||||
char level;
|
||||
char Quiz[256];
|
||||
bool answer;
|
||||
};
|
||||
|
||||
enum OXEventStatus
|
||||
{
|
||||
OXEVENT_FINISH = 0, // OX<4F>̺<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
OXEVENT_OPEN = 1, // OX<4F>̺<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD>۵<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(20012)<29><> <20><><EFBFBD>ؼ<EFBFBD> <20><><EFBFBD>尡<EFBFBD><E5B0A1>
|
||||
OXEVENT_CLOSE = 2, // OX<4F>̺<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(20012)<29><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ܵ<EFBFBD>
|
||||
OXEVENT_QUIZ = 3, // <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
OXEVENT_ERR = 0xff
|
||||
};
|
||||
|
||||
class COXEventManager : public singleton<COXEventManager>
|
||||
{
|
||||
private :
|
||||
std::map<DWORD, DWORD> m_map_char;
|
||||
std::map<DWORD, DWORD> m_map_attender;
|
||||
std::map<DWORD, DWORD> m_map_miss;
|
||||
|
||||
std::vector<std::vector<tag_Quiz> > m_vec_quiz;
|
||||
|
||||
LPEVENT m_timedEvent;
|
||||
|
||||
protected :
|
||||
bool CheckAnswer();
|
||||
|
||||
bool EnterAudience(LPCHARACTER pChar);
|
||||
bool EnterAttender(LPCHARACTER pChar);
|
||||
|
||||
public :
|
||||
bool Initialize();
|
||||
void Destroy();
|
||||
|
||||
OXEventStatus GetStatus();
|
||||
void SetStatus(OXEventStatus status);
|
||||
|
||||
bool LoadQuizScript(const char* szFileName);
|
||||
|
||||
bool Enter(LPCHARACTER pChar);
|
||||
|
||||
bool CloseEvent();
|
||||
|
||||
void ClearQuiz();
|
||||
bool AddQuiz(unsigned char level, const char* pszQuestion, bool answer);
|
||||
bool ShowQuizList(LPCHARACTER pChar);
|
||||
|
||||
bool Quiz(unsigned char level, int timelimit);
|
||||
bool GiveItemToAttender(DWORD dwItemVnum, BYTE count);
|
||||
|
||||
bool CheckAnswer(bool answer);
|
||||
void WarpToAudience();
|
||||
|
||||
bool LogWinner();
|
||||
|
||||
DWORD GetAttenderCount() { return m_map_attender.size(); }
|
||||
};
|
||||
|
Reference in New Issue
Block a user