/* ========================================================================== * ÆÄ ÀÏ : Party.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2007-11-05 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Party_Common.h" const float PARTY_RANGE = 4000; // 40M // ÁÖ»çÀ§ ±¼¸®±â Âü¿© ¸â¹ö struct sDiceMember { wchar_t mCharName[MAX_NAME_BUFFER_SIZE]; unsigned long mUserIdx; unsigned short mRandom; // ·£´ý°ª bool mRoll; // ±¼¸®±â/Æ÷±â ¼±Åà ¿©ºÎ sDiceMember() { memset(this, 0, sizeof(sDiceMember)); } }; class cParty { public: cParty( ); ~cParty( ); // ¸Þ¸ð¸®Ç®À» ÀÌ¿ëÇϹǷΠnew, delete ¿À¹ö·Îµù void* operator new ( size_t n ); void operator delete ( void* ptr, size_t n ); void Init ( unsigned long index, unsigned long leaderIdx, PARTY_DIVIDE_TYPE type, unsigned long accumTime ); void SetIndex ( unsigned long index ) { mIndex = index; } void SetDivideType ( PARTY_DIVIDE_TYPE type ) { mDivideType = type; } unsigned long* GetUserArr ( ) { return mUserArr; } unsigned int GetCount ( ) { return mCount; } bool IsUser ( unsigned long userIdx ); bool AddUser ( unsigned long userIdx ); bool DeleteUser ( unsigned long userIdx ); sPartyUserData* GetUserData ( ) { return mUserDat; } bool SetUserData ( sPartyUserData* userData, unsigned long tickCount ); bool SetUserData ( cPlayer* player, unsigned long tickCount ); bool IsLeader ( unsigned long userIdx ) { return (mLeaderIndex == userIdx); } void SetLeader ( unsigned long userIdx ) { mLeaderIndex = userIdx; } unsigned long GetLeader ( ) { return mLeaderIndex; } unsigned long NextLeader ( ); // [¼ø¼­ºÐ¹è]ÀÇ À¯ÀúÀ妽º ȹµæ unsigned long GetTurnUser ( unsigned short mapNumber, float x, float y ); // [·£´ýºÐ¹è]ÀÇ À¯ÀúÀ妽º ȹµæ unsigned long GetRandomUser ( unsigned short mapNumber, float x, float y ); void SetOwnUserNum ( unsigned int num ) { mOwnUserNum = num; } unsigned int GetOwnUserNum ( ) { return mOwnUserNum; } unsigned long GetIndex ( ) { return mIndex; } PARTY_DIVIDE_TYPE GetDivideType ( ) { return mDivideType; } // °æÇèÄ¡ drop ó¸® void AddDropValue ( unsigned long maxHP, unsigned long damage, float money, float exp, float sxp ); // Á¶°ÇÀ» ¸¸Á·ÇÏ´Â ÆÄƼ¿ø Áß ¸ðµÎ¿¡°Ô µå¶ø ¼öÄ¡ ºÐ¹è void DivideDropValue ( unsigned long monsterIdx, unsigned char monsterLevel ); // °»½Å ½Ã°£ ÀúÀå void SetLastAccumTime ( unsigned long accumTime ) { mLastAccumTime = accumTime; } unsigned long GetLastAccumTime ( ) { return mLastAccumTime; } // ÁÖ»çÀ§ ±¼¸®±â unsigned long GetDiceEndTime ( ) { return mDiceEndTime; } unsigned int GetDiceCount ( ) { return mDiceCount; } sDiceMember* GetDiceMember ( unsigned int index ) { return &mDiceMember[index]; } sDiceMember* GetDiceMember ( unsigned long userIdx ); bool IsDiceRollEnd ( ) { return ( mDiceCount > 0 && mDiceCount == mDiceRollCnt ) ? true : false; } bool DiceStart ( ); void DiceRelease ( ); int DiceRollReq ( unsigned long userIdx, unsigned short randVal ); void SetDiceRoll ( unsigned long userIdx, unsigned short randVal ); unsigned long GetLostPlayer ( unsigned long accumTime ); void SendPartyAddoneSyn ( sPartyUserData* userData ); void SendPartyOutSyn ( unsigned long playerIdx ); void SendPartyThrowSyn ( unsigned long playerIdx ); void SendPartyLeaderSyn ( unsigned long leaderIdx ); void SendPartyDivideType ( char type ); void SendPartyDataLevelSyn ( unsigned long playerIdx, unsigned char level ); void SendPartyMapchangeSyn ( unsigned long playerIdx, short map, short room, DWORD channelnum ); void SendPartyDeleteSyn ( ); void SendChat ( sInventory* inventory, wchar_t* name, wchar_t* message, unsigned long characterIdx, unsigned short job ); void SendUpdate ( ); private: unsigned long mIndex; // ÆÄƼ À妽º PARTY_DIVIDE_TYPE mDivideType; // ÆÄƼ ºÐ¹è¹æ½Ä unsigned long mUserArr[MAX_PARTYUSER]; // ÆÄƼÀ¯Àú À妽º sPartyUserData mUserDat[MAX_PARTYUSER]; // ÆÄƼÀ¯Àú µ¥ÀÌŸ unsigned long mUserTsp[MAX_PARTYUSER]; // ÆÄƼÀ¯Àú ŸÀÓ - À©µµ¿ìÁî ŸÀÌ¸Ó »ç¿ë. unsigned int mCount; // ÆÄƼÀοø¼ö unsigned long mLeaderIndex; // ÆÄƼÀå À妽º int mOwnUserNum; // ¾ÆÀÌÅÛ ¼ÒÀ¯±Ç À¯Àú ¹è¿­ ¹øÈ£ /// ÆÄƼ¿¡ dropµÈ money float mDropMoney; float mDropExp; float mDropSxp; unsigned long mMonsterMaxHP; // µå·Óº¸»óÇÒ ¸ó½ºÅÍÀÇ ÃÖ´ë hp unsigned long mDamage; // ¸ó½ºÅͰ¡ ¹ÞÀº µ¥¹ÌÁö unsigned long mLastAccumTime; // ÆÄƼ °»½Å ½Ã°£ /// ÁÖ»çÀ§ ±¼¸®±â sDiceMember mDiceMember[MAX_PARTYUSER]; unsigned short mDiceCount; // Âü¿© ¸â¹ö ¼ö unsigned short mDiceRollCnt; // ±¼¸®±â/Æ÷±â ¼±ÅÃÇÑ Àοø ¼ö unsigned long mDiceEndTime; };