#pragma once //======================================================================================================================= /// Quest class /** @author Kim Min Wook < taiyo@webzen.com > @since 2006. 3. 25 @remarks - °øÀ¯µÈ QuestInfo¸¦ »ç¿ëÇÏ´Â °¢ GameObject ¸¶´Ù °¡Áø °³º° °´Ã¼ - QuestManager¿¡¼­ Quest°ü¸® - m_ExpiredTimer(ŸÀÓÄù½ºÆ®°ª) ´Â Build½Ã ÇÒ´çµÇ¸ç, º¸»ó(DoReward), Æ÷±â(DoAbandon), ½ÇÆÐ(Update) ½Ã ÇØÁ¦µÈ´Ù. @history - 2006.4.22 : void DoAbandon( void * pvParam ); Ãß°¡ */ //======================================================================================================================= #include "QuestInfo.h" #include "QuestDefine.h" #include "QuestStruct.h" #include "timer.h" #include class QuestCondition; class QuestAction; class QuestInfoManager; class QuestManager; typedef util::SolarHashTable QUEST_COND_HASH; typedef util::SolarHashTable QUEST_ACT_HASH; typedef util::SolarHashTable::iterator QUEST_COND_HASH_IT; typedef util::SolarHashTable::iterator QUEST_ACT_HASH_IT; #ifdef _NA_004157_20120409_QUEST_BANDWITH_INCREASING typedef WORD QUESTCOUNT; #else typedef BYTE QUESTCOUNT; #endif enum eQUEST_STATE { QS_NORMAL, QS_COMPLETED, QS_FAILED, #ifdef _NA_007085_BUG_GUILD_DAILYQUEST_ACCEPT_CONDITION QS_NONE, // Äù½ºÆ® ACCEPTµÇÁö ¾ÊÀº »óÅÂ, Æ÷±âµÈ »óÅ QS_MAX, #endif //_NA_007085_BUG_GUILD_DAILYQUEST_ACCEPT_CONDITION }; enum eDAILYQUEST_TYPE { DAILYQUEST_NORMAL = 1, DAILYQUEST_GUILD, #ifdef _NA_007407_20140710_CHALLENGE_DAILY_QUEST DAILYQUEST_CHALLENGE, #endif //_NA_007407_20140710_CHALLENGE_DAILY_QUEST }; class Quest { __DECL_CUSTOMPOOL_PTR( Quest ) public: Quest(void); virtual ~Quest(void); void Init( QuestInfoManager * pInfoMgr, QuestManager * pMgr, QUESTPART_COMPL * pQCompl ); // Quest°¡ À¯È¿ÇÑ »óÅ¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖÀ½ void Serialize( QUESTPART_PROGR & QProgrStream, eQUEST_SERIALIZE eType ); void Build( const QUESTPART_PROGR * pStream ); void Destroy(); BOOL Update(); BOOL Event( eQUEST_EVENT evt, QUEST_MSG * pMsg ); RC::eQUEST_RESULT CanAccept( void * pvParam ); RC::eQUEST_RESULT CanComplete( void * pvParam ); // ÀÚµ¿À¸·Î ÇØÁÖ³ª? ¿ÜºÎ¿¡¼­ ÇØÁÖ³ª? °í·Á!!!! void DoAccept( void * pvParam ); void DoComplete( void * pvParam ); void DoReward( void * pvParam ); void DoAbandon( void * pvParam ); inline QUEST_COND_HASH & GetAcceptContionHash() { return m_AcceptConditionHash; } inline QUEST_ACT_HASH & GetAcceptActionHash() { return m_AcceptActionHash; } inline QUEST_COND_HASH & GetCompleteConditionHash() { return m_CompleteConditionHash; } inline QUEST_ACT_HASH & GetCompleteActionHash() { return m_CompleteActionHash; } #pragma warning ( push ) #pragma warning ( disable : 4311) inline void AddAcceptCondition( QuestCondition * pCondition ) { m_AcceptConditionHash.Add( pCondition, (DWORD)pCondition ); } inline void AddAcceptAction( QuestAction * pAction ) { m_AcceptActionHash.Add( pAction, (DWORD)pAction ); } inline void AddCompleteCondition( QuestCondition * pCondition ) { m_CompleteConditionHash.Add( pCondition, (DWORD)pCondition ); } inline void AddCompleteAction( QuestAction * pAction ) { m_CompleteActionHash.Add( pAction, (DWORD)pAction ); } inline void AddAbandonAction( QuestAction * pAction ) { m_AbandonActionHash.Add( pAction, (DWORD)pAction ); } #pragma warning ( pop ) void StartTimer( const QUESTPART_PROGR * pStream ); void EndTimer(); DWORD GetRemainedTime() { return m_ExpiredTimer.GetRemainedTime(); } util::Timer & GetTimer() { return m_ExpiredTimer; } inline QCODE GetQuestCode() { return m_pQuestInfo->GetQuestCode(); } inline DWORD GetRewardCode( const eCHAR_TYPE charType ) { return m_pQuestInfo->GetRewardCode( charType ); } inline QUESTCOUNT GetRepeatNum() { if(m_pRepeatedNum) return *m_pRepeatedNum; return 0; } #ifdef _YJ_RENEWAL_QUEST_UI_001265 inline BYTE GetQType() { return m_pQuestInfo->GetQtype(); } #endif //_YJ_RENEWAL_QUEST_UI_001265 inline DWORD GetRewardMapCode() {return m_pQuestInfo->GetRewardMapCode();} inline DWORD GetKillMonsterMapCode(int idx) { // (CHANGES) (100220) (WAVERIX) #9499 fix up invalid copy operation \ // which is not matched source and dest. types assert(idx < MAX_QUEST_KILL_MONSTER_MAP_CODE); return m_pQuestInfo->GetKillMonsterMapCode(static_cast(idx)); } inline bool IsTimeQuest() { return !!m_pQuestInfo->GetExpiredTime(); } private: QUEST_COND_HASH m_AcceptConditionHash; QUEST_ACT_HASH m_AcceptActionHash; QUEST_COND_HASH m_CompleteConditionHash; QUEST_ACT_HASH m_CompleteActionHash; //< ÇöÀç count == 0 util::Timer m_ExpiredTimer; QUESTCOUNT* m_pRepeatedNum; //< ¹Ýº¹µÈ Ƚ¼ö QUEST_ACT_HASH m_AbandonActionHash; __PTR_PROPERTY( QuestManager, QuestManager ) __PTR_PROPERTY( QuestInfoManager, QuestInfoManager ) __PTR_PROPERTY( QuestInfo, QuestInfo ) __PROPERTY( eQUEST_STATE, QState ) };