#ifndef _SOLAR_SLOT_SCITEMSLOT_H #define _SOLAR_SLOT_SCITEMSLOT_H #pragma once //================================================================================================== /// ¾ÆÀÌÅÛ ½½·Ô Ŭ·¡½º /** @author Kim Min Wook < taiyo@webzen.co.kr > @since 2004. 12. 29 @remark - ÇϳªÀÇ ¾ÆÀÌÅÛÀ» ³ªÅ¸³»´Â Ŭ·¡½º @note - DuraÀÇ °ªÀº WithDuraÀ϶§ ³»±¸µµ, ¾Æ´Ò¶§´Â °³¼öÀÌ´Ù. ±×·¯¹Ç·Î 1°³ÀÌ»ó - ITEMSTREAMÀÇ byDuraÇʵå´Â »ç¿ëÇÏÁö ¾Ê´Â´Ù. @history - 2006/1/9 : SCRankInfo, SCSocketInfo¸É¹ö·Î µû·Î ¿É¼Ç Á¤º¸ ºÐ¸® - 2006/1/11 : ·©Å©,ÀÎþƮ ·¹º§ÇÔ¼ö¸¦ È£ÃâÇÒ¶§ ó¸®ÇÏ´Â ¹æ½ÄÀ¸·Î º¯°æ - 2006/1/13 : ³»±¸µµ¿Í °³¼ö º°°³ ó¸® + GetMaxNum() Ãß°¡ - 2006/1/17 : ExistEmptySocket()ÇÔ¼ö Ãß°¡ - 2006/2/8 : 1. IsBlocked()ÇÔ¼ö Ãß°¡ : ¾ÆÀÌÅÛ ½½·Ô¿¡ ÀÌ¿ëÁ¤Áö ¿©ºÎ üũ (m_Set == 15À̸é, ÀÌ¿ëÁ¤Áö»óÅÂ) 2. void CopyOut(RENDER_ITEMSTREAMEX& OUT ItemStream) ÇÔ¼ö Ãß°¡ - 2006/2/13 : RENDER_ITEMSTREAM¿Í EX°ü·Ã ÇÔ¼öµé Ãß°¡ - 2006/3/17 : SCNOption Á¤º¸ Ãß°¡ - 2006/4/25 : DropLV => WORD->DWORD·Î ¼öÁ¤ - 2006/5/16 : OPT_ITEMSTREAMEX°ü·Ã ó¸® - 2006/5/17 : ³»±¸µµ °ü·Ã ó¸® BOOL DecreasingDura(DWORD param1, DWORD param2); param1 = °ø°Ý ¼º°ø µ¥¹ÌÁö or ¹æ¾î·Â param2 = ÇǰÝÀÚ ¹æ¾î·Â or °ø°Ý ¹ÞÀº ¹°¸® µ¥¹ÌÁö return TRUE = Dura°¡ °¨¼ÒÇßÀ» °æ¿ì return FALSE = Dura°¡ °¨¼ÒÇÏÁö ¾Ê¾ÒÀ» °æ¿ì - 2006/5/23 : IsLocked(), IsBlocked() ±¸ºÐó¸® - 2007/1/19 : SetFixedDateTime(int d) Ãß°¡ : ½Ã°£°ª(d)À» °¡°øÇÏÁö ¾Ê°í m_DateTime¿¡ ¹Ù·Î °ªÀ» ¼ÂÆÃ - 09.09.06 | waverix | code rearrangement @usage - °ãÃÄÁö´Â ¾ÆÀÌÅÛÀÎÁö ¿©ºÎ : IsOverlap() - ³»±¸µµ°¡ Á¸ÀçÇÏ´Â ¾ÆÀÌÅÛÀÎÁö ¿©ºÎ : WithDura() - OnEquip() ÀÇ ¹Ýȯ°ª ÀÇ¹Ì : eCHARGE_SUB_FIXED_AMOUNT_EXŸÀÔÀ϶§, óÀ½ ÀåÂøÇÑ °æ¿ì TRUE¹Ýȯ, ±×¿Ü FALSE¹Ýȯ - [À¯·áÈ­ °ü·Ã ¾ÆÀÌÅÛ »ç¿ë¹ý] SCItemSlot slot; switch(slot.GetItemInfo()->m_byChargeSubType) { case eCHARGE_SUB_FIXED_AMOUNT: { // ½Ã°£À» ¼ÂÆÃ(ÃÊ´ÜÀ§) // if it will be 30ÀÏ ±âÇÑ ¾ÆÀÌÅÛ slot.SetDateTime(30*24*60*60); // ³¯Â¥¸¦ »ç¿ë SYSTEMTIME systime; YYYYMMDDHHMMSSToSYSTEMTIME(slot.GetDateTime(), systime); //or if(!slot.GetDateTimeToSYSTEMTIME(systime)) { // ¾ÆÀÌÅÛÀÌ »ç¿ë ³¯Â¥°¡ Áö³²(¸¸·áµÊ) } // systime¸¦ °¡Á®´Ù ¾²¸é µÈ´Ù. //...... }break; case eCHARGE_SUB_FIXED_AMOUNT_EX: { // ½Ã°£ ¼ÂÆÃ(ÃÊ´ÜÀ§) // ´Ù¸¸ ÃÊ´ÜÀ§ÀÇ ¼ýÀÚ´Â ¹«½ÃµÊ!(½Ã°£´ÜÀ§·Î °è»êµÊ) // if it will be 30½Ã°£ ÀÌ¿ë ¾ÆÀÌÅÛ slot.SetDateTime(30*60*60); // ³¯Â¥¸¦ »ç¿ë if(slot.IsProgressTime()) { // 20061107240023 SYSTEMTIME systime; YYYYMMDDHHMMSSToSYSTEMTIME(slot.GetDateTime(), systime); //or if(!slot.GetDateTimeToSYSTEMTIME(systime)) { // ¾ÆÀÌÅÛÀÌ »ç¿ë ³¯Â¥°¡ Áö³²(¸¸·áµÊ) } // systime¸¦ °¡Á®´Ù ¾²¸é µÈ´Ù. //..... } else { // »ç¿ëÇÒ¼öÀִ½ð£ int remain_hours = slot.GetDateTime()/(60*60) //.... } }break; case eCHARGE_SUB_FIXED_QUANTITY: { // »ç¿ë ½Ã°£ ÀÔ·Â(ÃÊ´ÜÀ§·Î ÀÔ·Â) // if it will be 30½Ã°£ ÀÌ¿ë ¾ÆÀÌÅÛ slot.SetDateTime(30*60*60); // ³²Àº »ç¿ë ½Ã°£ int remain_hours = slot.GetDateTime()/(60*60) //.... }break; case eCHARGE_SUB_COORDINATE: { // ÁÂÇ¥ ¼³Á¤ slot.SetMapCode(10001); slot.SetX(13); slot.SetY(145); slot.SetZ(21); // ÁÂÇ¥ ÀÌ¿ë slot.GetMapCode(); slot.GetX(); slot.GetY(); slot.GetZ(); }break; } */ //================================================================================================== #include "SCSlotHeader.h" #include "SCSlotStruct.h" #include "ItemOptionHeader.h" #include "ISlotUpdater.h" //-------------------------------------------------------------------------------------------------- // SubOptions #include "SCSlot.h" #include "SCItemFuncBranch.h" #include "SCRankInfo.h" #ifdef _NA_0_20100727_SOCKET_SYSTEM_CONVERT #include "SCSocketOptionInfo.h" #else #include "SCSocketInfo.h" #endif // _NA_0_20100727_SOCKET_SYSTEM_CONVERT #include "SCNOption.h" #include "SCLimitedInfo.h" #include "SCFateInfo.h" #include "SCPetInfo.h" #include "SCLottoInfo.h" #include "SCLaxLock.hpp" #include "SCWayPointInfo.h" #include "SCRiderInfo.h" #ifdef _NA_003740_20111122_RANDOM_ITEM #include "SCRandomInfo.h" #endif // _NA_003740_20111122_RANDOM_ITEM //================================================================================================== // // class CSunOnlineItem; //================================================================================================== // class SCItemSlot : public SCSlot { enum { FIXED_AMOUNT_EXPIRE_WAIT_TIME = 7 * 24 * 60 * 60 }; //< 7ÀÏ ´ë±âÈÄ »èÁ¦ public: class EditModeTransaction; SCItemSlot(void); virtual ~SCItemSlot(void); inline SCItemSlot(const SCItemSlot& r); inline SCItemSlot& operator=(const SCItemSlot& r); //SCItemSlot(const ITEMSTREAM& item_stream); //< ¿É¼ÇÀ» Á¦¿ÜÇÑ Á¤º¸¸¸À» ¼ÂÆÃ SCItemSlot(const ITEMSTREAMEX& item_stream); //< ¿É¼ÇÀ» Æ÷ÇÔÇÑ Á¤º¸¸¦ ¼ÂÆÃ //SCItemSlot(const RENDER_ITEMSTREAM& item_stream); SCItemSlot(const RENDER_ITEMSTREAMEX& item_stream); SCItemSlot(const OPT_ITEMSTREAMEX& item_stream); void Copy(const ITEMSTREAMEX& IN item_stream); //void Copy(const ITEMSTREAM& IN item_stream); //void Copy(const RENDER_ITEMSTREAM& IN item_stream); //< ¼­¹ö¿¡¼­±¸Çö¾ÈÇÔ void Copy(const RENDER_ITEMSTREAMEX& IN item_stream); //< ¼­¹ö¿¡¼­±¸Çö¾ÈÇÔ void Copy(const OPT_ITEMSTREAMEX& IN item_stream); void CopyOut(ITEMSTREAMEX& OUT item_stream) const; //void CopyOut(ITEMSTREAM& OUT item_stream) const; //< ¿É¼Ç Á¦¿Ü void CopyOut(RENDER_ITEMSTREAMEX& OUT item_stream) const; //< ½Ã¸®¾ó Á¦¿Ü //void CopyOut(RENDER_ITEMSTREAM& OUT item_stream) const; //< ½Ã¸®¾ó+¿É¼Ç Á¦¿Ü void CopyOut(OPT_ITEMSTREAMEX& OUT item_stream) const; //< ½Ã¸®¾ó+¿É¼Ç¼öÄ¡ Á¦¿Ü virtual void Copy(BitStream& IN stream, eSLOT_SERIALIZE eType); virtual void CopyOut(BitStream& OUT stream, eSLOT_SERIALIZE eType); virtual void Copy(BitStream& IN stream); virtual void CopyOut(BitStream& OUT stream); virtual void Copy_Render(BitStream& IN stream); virtual void CopyOut_Render(BitStream& OUT stream); private: // ³»ºÎÀûÀ¸·Î »ç¿ëÇÒ ¼ÂÆÃ ÇÔ¼ö void CopyPart(const ITEMPART& IN rPart); void CopyPart(const RENDER_ITEMPART& IN rPart); void CopyPart(const OPT_ITEMPART& IN rPart); void CopyOutPart(ITEMPART& OUT rPart) const; void CopyOutPart(RENDER_ITEMPART& OUT rPart) const; void CopyOutPart(OPT_ITEMPART& OUT rPart) const; // //void CopyPart(const OPTIONPART_VER5& IN rPart); //void CopyOutPart(OPTIONPART_VER5& OUT rPart) const; void CopyPart(const RENDER_OPTIONPART& IN rPart); void CopyOutPart(RENDER_OPTIONPART& OUT rPart) const; void CopyPart(const OPTIONPART& IN rPart); // (090911) (ADD-IN) void CopyOutPart(OPTIONPART& OUT rPart) const; // (090911) (ADD-IN) public: virtual void Copy(SCSlot& IN slot); virtual void Clear(); virtual void SetSlotType(eSlotType type); virtual eSlotType GetSlotType() const; virtual void SetSerial(DBSERIAL serial); virtual DBSERIAL GetSerial() const; // (WAVERIX) (NOTE) ¾ÆÀÌÅÛ ¼³Á¤½Ã ÃÖÃÊ¿¡ ¼³Á¤ÇؾßÇÏ´Â ÄÚµå : Äڵ尡 Á¤ÇØÁ®¾ß ´ÙÀ½ Á¤Ã¥ÀÌ ¼¼¿öÁø´Ù. // ÀüÁ¦: SCItemSlot instance°¡ ¿Ï·áµÇ¾î ÀÖ¾î¾ß ÇÑ´Ù. (Áï, ÃʱâÈ­ µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù.) // ¿¹¿Ü: Copy(from server stream, db stream)ÀÇ °æ¿ì¶ó¸é, SetCode´Â ³»ºÎ¿¡¼­ È£ÃâµÈ´Ù. virtual void SetCode(SLOTCODE code); virtual SLOTCODE GetCode() const; SLOTCODE GetItemCode() const; // NOTE: f110422.3L, add default accessability to easy acquisition SLOTCODE GetImageCode() const; //_NA000109_100427_ITEM_CUSTOMIZING_CONTENTS_ BYTE GetType() const; void SetType(BYTE type); DBWLDSERIAL GetWorldSerial() const; bool IsContainValidItem() const; // (WAVERIX) (CHANGES) support for client, see a .inl //BASE_ITEMINFO* GetItemInfo(); const BASE_ITEMINFO* GetItemInfo() const; const BASE_ITEMINFO* GetImageItemInfo() const; const nsSlot::ItemRuleInfo& GetItemRuleInfo() const; void SetUserBlocked(BOOL val); void SetBlocked(BOOL val); bool IsLocked() const; void SetLock(bool val); bool IsBlocked() const; bool IsUserBlocked() const; // Game issue¿¡ ÀÇÇØ ¶ôÀ» °É¾î¾ß ÇÏ´Â °æ¿ì, ex) Æê/¶óÀÌ´õ ¼Òȯ »óÅ + wings spreading bool IsPetLocked() const; // UserBlock»ç¿ë ÁßÀÌ´Ù. = 'IsUserBlocked' || 'IsRiderSummoned' // f100909.1L void SetOptionTag(const KindOfItemTag& tag); const KindOfItemTag& GetOptionTag() const; // °³¼ö DURATYPE GetMaxNum() const; //---------------------------------------------------------------------------------------------- // ¾ÆÀÌÅÛ º¹»ç(for stat change) - serial key not issued, need serial key // (090929) (ADD-IN) bool CopyFromSrcForStatChange(SLOTCODE to_change_item_code, const SCItemSlot& src); // f100910.1L, (for inheritable tag option) related "f100909.1L' and "(Get/Set)OptionTag()" // WARNING: this method is not support a stat change operation. // NOTE: usage case = { make a clone item, making item from a lottery item, and that. } bool CopyFromInheritableOption(const SCItemSlot& src); // CHANGES: f110327.1L, changes charge_sub_type access field // to support various making item with timer // accetable = { sDefault -> sTime, sEquip -> sEquipTime, sEquipEtc -> sEquipEtcTime } bool ChangeItemToUsingTimer(); //---------------------------------------------------------------------------------------------- // ³»±¸µµ °ü·Ã // pseudo // if ³»±¸µµ·Î »ç¿ëÇϴ°¡? // (true) // elif °³¼ö·Î »ç¿ëÇϴ°¡? // (false) bool WithDura() const; DURATYPE GetDura() const; void SetDura(DURATYPE dura); DURATYPE GetMaxDura() const; BOOL DecreasingDura(eDecDuraType eDecType); BOOL IsNeedToRepair(); BOOL StoreDamageNDecreaseDura(const DWORD Damage); MONEY GetPriceForRepair() const; public: // °ãÃÄÁö´Â ¾ÆÀÌÅ×ÀÎÁö¿©ºÎ üũ bool IsOverlap() const; static bool IsOverlap(SLOTCODE code); // °è»ê½ÄÀÌ ÇÊ¿äÇÑ ITEMINFO ÇÔ¼ö Ãß°¡ ¿¹Á¤ MONEY GetPriceForBuy() const; MONEY GetPriceForSell() const; MONEY GetPriceForUpGradeFare() const; private: LEVELTYPE GetLimitLevel() const; // (UNUSED) ?? //DWORD GetPhyDef() const; // (UNUSED) ?? MONEY GetDropLevel() const; public: //---------------------------------------------------------------------------------------------- // Enchant Option void SetEnchant(BYTE enchant); //(lst1024)(080918)(2447)ÀÎæƮ½Ã ³»±¸µµ¸¦ ´Ù½Ã ¼ÂÆÃ ÇØÁØ´Ù. void SetEnchantUpdateDura(BYTE enchant); BYTE GetEnchant() const; eENCHANTLEVEL GetEnchantLV() const; #ifdef _NA_008124_20150313_AWAKENING_SYSTEM //---------------------------------------------------------------------------------------------- // Awakening Option void SetAwakening(BYTE awakening); BYTE GetAwakening() const; bool EnableAwakening() const; #endif // _NA_008124_20150313_AWAKENING_SYSTEM //---------------------------------------------------------------------------------------------- // Divine Option (old comment) Set Á¤º¸ bool IsDivine() const; void SetSet(BYTE set); // Divine... bool GetSet() const; //---------------------------------------------------------------------------------------------- // Rank Option // get current item rank information eRANK GetRank() const; int GetRankAttrIndex(eRANK rank) const; eATTR_TYPE GetRankAttr(eRANK rank) const; int GetRankAttrValue(eRANK rank) const; const sRANK_OPTION* GetRankAttrDesc(eRANK rank) const; eRANK_LEVEL GetRankLevel() const; // #if SUN_CODE_BACKUP // an unused sections at this point in this time // item rank up based on current rank // prev_rank == result_rank -> Fail (highest, etc...) // prev_rank != result_rank -> Success & update rank (assert: prev_rank + 1 == result_rank) eRANK Rankup(const sRANK_OPTION* rank_option); // item rank down based on current rank // prev_rank == result_rank -> Fail (lowest, etc...) // prev_rank != result_rank -> Success & update rank (assert: prev_rank - 1 == result_rank) eRANK Rankdown(); #endif #if DEPRECATE_CODE_DELETE_RESERVED //<- delete reserved section // old version corresponding interfaces /*DEPRECATE_RESERVED*/ void SetRank(eRANK rank); /*DEPRECATE_RESERVED*/ void SetRankAttr(eRANK rank, const sRANK_OPTION* pRankOption); /*DEPRECATE_RESERVED*/ void DelRankAttr(eRANK rank); #endif //WAVERIX_DELETE_RESERVED<- delete reserved section //---------------------------------------------------------------------------------------------- // ÁÂÇ¥ bool IsCoordinateItem() const; WORD GetMapCode() const; short GetX() const; short GetY() const; short GetZ() const; void SetMapCode(WORD v); void SetX(short v); void SetY(short v); void SetZ(short v); //---------------------------------------------------------------------------------------------- // ³¯Â¥ bool IsProgressTime() const; void SetProgressTime(bool bFlag); DWORD64 GetDateTime() const; BOOL GetDateTimeToSYSTEMTIME(SYSTEMTIME& systime OUT); void SetDateTime(DWORD64 d/*second*/); void SetFixedDateTime(DWORD64 d); //< ÁÖÀÇ! : ŸÀÔ¿¡ µû¶ó ´Ù¸¥ Çü½ÄÀÇ °ªÀ» ÀÔ·ÂÇØ¾ßÇÔ bool IsExpiredWaitTime() const; void SetExpiredWaitTime(bool bFlag); bool IsExpiredTime() const; void SetExpiredTime(bool bFlag); bool StartQuantity(); void EndQuantity(); //---------------------------------------------------------------------------------------------- // Socket Option information BYTE GetSocketNum() const; void SetSocketNum(BYTE num); #ifdef _NA_0_20100727_SOCKET_SYSTEM_CONVERT eSOCKET_IDENTIFY_TYPE GetSocketIdentifyType() const; void SetSocketIdentifyType(const eSOCKET_IDENTIFY_TYPE socket_identify_type); void SetSocketOption(eSOCKET sock, SOCKETINDEX index); const sSOCKET_OPTION* GetSocketOption(eSOCKET sock) const; void CopySocketInfo(const SCSocketOptionInfo& sock_info); const SCSocketOptionInfo& GetSocketInfo(); #else void SetSocketAttr(eSOCKET sock, eSOCKET_LEVEL level, const sSOCKET_OPTION* socket_option); eATTR_TYPE GetSocketAttr(eSOCKET sock) const; int GetSocketAttrValue(eSOCKET sock) const; eSOCKET_LEVEL GetSocketAttrLevel(eSOCKET sock) const; int GetSocketAttrIndex(eSOCKET sock) const; const sSOCKET_OPTION* GetSocketAttrDesc(eSOCKET sock) const; void CopySocketInfo(const SCSocketInfo& sock_info); const SCSocketInfo& GetSocketInfo(); #endif // _NA_0_20100727_SOCKET_SYSTEM_CONVERT bool ExistEmptySocket(eSOCKET& OUT EmptySocket) const; // ÇØ´ç µî±ÞÀÇ Àðµå°¡ »ðÀÔ °¡´ÉÇÑÁö °Ë»çÇÑ´Ù. bool IsEnableFillSocketByGrade(const eSOCKET_LEVEL zard_grade) const; //---------------------------------------------------------------------------------------------- // NOption Á¤º¸ // - (NOTE) ExtraStone OptionÀ̶õ´Ù... eATTR_TYPE GetNOptionAttr() const; int GetNOptionAttrValue() const; int GetNOptionAttrIndex() const; const sEXTRASTONE_OPT_INFO* GetNOptionAttrDesc() const; int GetNOptionValueIndex() const; void SetNOptionAttr(int iAttrValueIndex); public: //---------------------------------------------------------------------------------------------- // Limited Item Option bool IsLimited() const; // (WARNING) ¿ÜºÎ¿¡¼­ Á¦¾îÇÏ´Â ½ÃÁ¡Àº 2±ºµ¥, { drop, gmcmd } À̰ÍÀÌ ¼³Á¤µÈ ÀÌÈÄ·Î // ½Ã¸®¾ó Ű ÀÎÁõÀÌ µÇ¸é »ç¿ëÀÌ °¡´ÉÇÏ´Ù. // (NOTE) Ãß°¡ 1°³¼Ò (Ç츣¸Þ½ÃÁòÀÇ ¼º¼­) À̰ÍÀº ÀÌ¹Ì ÀÎÁõµÈ ¾ÆÀÌÅÛ¿¡ ´ëÇØ¼­ °ªÀ» º¯°æÇÏ´Â °Í. // ´Ù¸¥ SetÇÔ¼ö´Â »ç¿ëÇÏÁö ¸» °Í. ´ëü ÀÎÅÍÆäÀ̽º Á¦°ø(CopyFromSrcForStatChange) void SetLimitedIndex(WORD limited_index); WORD GetLimitedIndex(); int GetDamageRatio() const; int GetLimitValueRatio() const; DURATYPE GetLimitedDuraMax() const; DURATYPE GetLimitedDuraMMax() const; BYTE GetLimitedRepairCount() const; // called state: // on Recv Serial key, called by 'ItemManager::AddSerialCode' void CalLimited(); void RepairMaxDura(); BOOL DecreasingMaxDura(); //----------------------------------------------------------------------------------- private: void SetDamageRatio(int value); // guide - don't use, delete reserved void SetLimitValueRatio(int value); // guide - don't use, delete reserved void SetLimitedDuraMax(WORD value); // guide - don't use, delete reserved void SetLimitedDuraMMax(WORD value); // guide - don't use, delete reserved void SetLimitedRepairCount(BYTE value); // guide - don't use, delete reserved bool _CanChangeToLimited() const; bool _ChangeToLimitedType(); // must be true, pre-check '_CanChangeToLimited()' + a // ref: SCItemSlot::CalLimited() public: //---------------------------------------------------------------------------------------------- // (FateItem) bool IsFateItem() const; bool CalFateInfo(); bool CalFateDateTime(DWORD& OUT date_time); WORD GetFateAtkDefRatio() const; bool GetFateIdentify() const; DURATYPE GetFateDuraMax() const; WORD GetFatePeriod() const; void SetFateAtkDefRatio(WORD value); void SetFateIdentify(BOOL identify); void SetFateDuraMax(WORD value); void SetFatePeriod(WORD period); //---------------------------------------------------------------------------------------------- // (ISlotUpdater) void RegisterISlotUpdater(ISlotUpdater* pISlotUpdater); void UnRegisterISlotUpdater(); bool IsPetItem() const; /*const*/ SCPetInfo* GetPetInfo() const; bool IsEquipEtherDevice() const; void SetEquipEtherDevice(BOOL bValue); BYTE GetEtherBulletIndex() const; void SetEtherBulletIndex(BYTE byIndex); SCLaxLock* GetLaxLock(); //---------------------------------------------------------------------------------------------- // Lotto Info bool IsLottoItem() const; bool IsPandoraOpen() const; // (WARNING) Ŭ¶óÀÌ¾ðÆ®¿¡¼­ RefreshÇÏ´Â »ç·Ê°¡ ¹ß°ßµÇ¾î »ó¼öÈ­ÇÏÁö ¸øÇß´Ù. SCLottoInfo* GetLottoInfo() const; #ifdef _NA_0_20100727_SOCKET_SYSTEM_CONVERT WORD GetExtendData() const; void SetExtendData(WORD v); bool IsZardItem() const; // Àðµå ¾ÆÀÌÅÛÀÎÁö °Ë»çÇÑ´Ù. bool IsZardAdditiveItem() const; // Àðµå ÇÕ¼º ÷°¡Á¦ ¾ÆÀÌÅÛÀÎÁö °Ë»çÇÑ´Ù. // ¼ÒÄÏ »ý¼ºÀÌ °¡´ÉÇÑ ¾ÆÀÌÅÛÀÏ °æ¿ì ¼ÒÄÏÀ» »ý¼ºÇÑ´Ù. bool CreateSocketItem(const BYTE number_of_socket, const bool is_recreate); #endif // _NA_0_20100727_SOCKET_SYSTEM_CONVERT #ifdef _NA_003033_20110831_DICECAST_ITEM_ROUTING BYTE GetDiceCastType(); void SetDiceCastType(BYTE _type); #endif //_NA_003033_20110831_DICECAST_ITEM_ROUTING // ·£´ýÈ­ °¡´ÉÇÑ ¾ÆÀÌÅÛÀÎÁö °Ë»çÇÑ´Ù. bool EnableRandomize() const; #ifdef _NA_003740_20111122_RANDOM_ITEM // ·£´ýÈ­ °¡´ÉÇÑ ¾ÆÀÌÅÛÀÏ °æ¿ì ·£´ýÀ¸·Î ¾ÆÀÌÅÛ ´É·ÂÄ¡¸¦ ´Ù½Ã ¼³Á¤ÇÑ´Ù. bool Randomize(const RandomValueTypeGrade::Value value_type_grade); // ·£´ýÈ­µÈ ¿É¼ÇÀÇ µî±ÞÀ» ¾ò´Â´Ù. RandomValueGrade::Value GetRandomOptionGrade(const uint8_t index) const; // ·£´ýÈ­µÈ ¿É¼ÇÀÇ ¹®ÀÚ¿­ Ç¥ÇöÀ» ¾ò´Â´Ù. template < size_t kConvStrBufSize > void RandomOptionToString( const RandomValueTypeGrade::Value value_type_grade, TCHAR OUT conv_str[] ) const { random_info_.OptionToString(value_type_grade, conv_str); } #endif // _NA_003740_20111122_RANDOM_ITEM //---------------------------------------------------------------------------------------------- // WayPoint Info bool FireUp_DateTime(); // frame´ÜÀ§·Î º¯°æÇÒ Çʿ䰡 ÀÖ´Ù. void ClearWayPointItem(); // for GM command bool IsWayPointItem() const; //bool IsProgressTime() const; bool CanWayPointDelete() const; void ResetWayPointDelete(); //---------------------------------------------------------------------------------------------- // Possession Info void SetIdentifyPossession(BOOLEAN value); bool GetIdentifyPossession() const; // (WARNING) ÇØ´ç ¾ÆÀÌÅÛÀÌ ±Í¼Ó °¡´ÉÇÑÁöÀÇ ¿©ºÎÀ̸ç, ¾ÆÀÌÅÛÀÇ ±Í¼Ó ¿©ºÎ°¡ ¾Æ´Ô. bool IsPossessionItem() const; // __NA_0_POSSESSION_ITEM_DROP = { void SetDestroyItem(BOOL value); bool IsDestroyItem() const; //_NA002823_WINGS_EQUIPMENTS_EXTENTION bool IsWingItem() const; // }; bool IsRiderItem() const; bool IsRiderSummoned() const; // is rider summoned? UserBlock(t/f) nsSlot::RiderUpdateBits RiderSummonStatus(BOOLEAN is_summoned); // for server support interface with ProgramCommon // (returns) if exist then Acquire 'SCItemSlot|Parts Item' // { exist | empty (empty item, need check IsRiderPartsItem) } // else then return 0 { index out of range | is not rider_item } bool GetRiderPartsInfo(eRIDER_PARTS_POS pos, SCRiderPartsData* OUT parts_data) const; // for Client support interface // (returns) if exist then Acquire 'SCItemSlot|Parts Item' // { exist | empty (empty item, need check IsRiderPartsItem) } // else then return 0 { index out of range | is not rider_item } bool GetRiderPartsItem(eRIDER_PARTS_POS pos, SCItemSlot* OUT parts_item) const; // for server support interface nsSlot::RiderUpdateBits GetRiderAttrChangedInfo() const; RC::eITEM_RESULT CanEquipRiderParts(const SCItemSlot& rider_part_item); // for server support interface // sequence // 1) check deletable inventory slot // 2) CanEquipRiderParts // 3) delete from inventory slot // 4) insert parts in rider (EquipRiderParts) -> change None->Active|Inactive // 5) check modification (need update attribute(+)?) // 6) update attribute (+) bool EquipRiderParts(const SCItemSlot& rider_part_item); // for server support interface // (returns) ÃßÃâµÈ Àåºñ À§Ä¡°¡ ±âÇÑ ¸¸·á »óŶó¸é ¹Ý¿µµÇÁö ¾ÊÀº °á°ú¸¦ ¹ÝȯÇÑ´Ù. // Attribute °è»ê¿¡ ÇÊ¿ä. bool CanUnEquipRiderParts(eRIDER_PARTS_POS pos, nsSlot::RiderUpdateBits* update_bits); // for server support interface // sequence // 1) check insertable inventory slot // 2) update attribute (-) // 3) delete parts from rider (UnEquipRiderParts)-> get SCItemSlot // 4) insert slot // 5) serial code issue (lock->unlock) -> change (in)Active -> (in)Active // int pos : eRIDER_PARTS_POS::eValue { 91, 92, 93 } // // (returns) ÃßÃâµÈ Àåºñ À§Ä¡¸¦ ±â·ÏÇÑ °á°ú¸¦ ¹ÝȯÇÑ´Ù. 'CanUnEquipRiderParts' ¼±Çà °Ë»ç ÇÊ¿ä bool UnEquipRiderParts(eRIDER_PARTS_POS pos, SCItemSlot* rider_part_item); //bool UpdateRiderItem(ISlotUpdater); // // (f100727.1L) Shared interface for the Etheria control eEtheriaHistory GetEtheriaHistory() const; //---------------------------------------------------------------------------------------------- // checkers for item facilities // (CHANGES) (f100510.1L) redirected interfaces to support the contents of an etheria static bool CanEquip(const BASE_ITEMINFO* item_info); // (CHANGES) (f100510.1L) redirected interfaces to support the contents of an etheria static bool CanUseMixture(const BASE_ITEMINFO* item_info, eMIXTURE_FLAG flag); // (CHANGES) (f100510.1L) whether the 'is_blocked' value is blocked static bool CanTradeSell(const BASE_ITEMINFO* item_info, eITEM_TRADESELL_TYPE is_blocked); // (CHANGES) (f100510.1L) added interfaces to support the contents of an etheria bool CanEquip() const; // (CHANGES) (f100510.1L) added interfaces to support the contents of an etheria bool CanUseMixture(eMIXTURE_FLAG flag) const; // (CHANGES) (f100510.1L) added interfaces to support the contents of an etheria, // whether the 'is_blocked' value is blocked bool CanTradeSell(eITEM_TRADESELL_TYPE is_blocked) const; // the result is fails, // if mount(by rider) items or pet items is changed to the shell or the etheria bool CanSummonStatus() const; //---------------------------------------------------------------------------------------------- bool IsEtheriaItem() const; bool IsShellItem() const; //{ _NA000109_100427_ITEM_CUSTOMIZING_CONTENTS_ bool CanExtractToEtheria(RC::eITEM_RESULT* result) const; // this check routine should be called by the shell item. bool CanCombineWithEtheria(RC::eITEM_RESULT* result) const; // this check routine should be called by the etheria item. bool CanCombineWithShell(RC::eITEM_RESULT* result) const; // it is operated internally. an item object with options is changed to a default item. bool ChangeToShellItem(); // it is operated internally. an item object with options is changed to an etheria item which // is equal to the base item except an image link and an uncorrectable mode (is_editable == 0) bool ChangeToEtheriaItem(); // this -|-> the shell item // |-> the etheria item (from making_item) RC::eITEM_RESULT ExtractToEtheria(SCItemSlot* making_item); // this(the shell item) -|-> the combination item // the etheria item -|-> post action=delete // the etheria item should be cleared, no control in this slot to logic control RC::eITEM_RESULT CombineWithEtheria(const SCItemSlot& etheria_item); //} virtual BOOL OnEquip(); virtual void OnUnEquip(); virtual BOOL Update(BOOL is_playing_in_pcroom); //¹öÀü °ü¸®¸¦ À§ÇÑ ½ºÆ®¸² º¯È¯ // (f100803.4L) change the type of a result stream to ITEMSTREAMEX static BOOL ConvertStream(int IN from_version, BYTE* IN from_stream, int& OUT to_version, ITEMSTREAMEX* OUT to_stream); static BOOL _ConvertStream(int latest_version, int IN from_version, BYTE* IN from_stream, int& OUT to_version, BYTE* OUT to_stream); static BOOL UnderVersion3StreamConvertTo3(int IN from_version, BYTE* IN from_stream, int& OUT to_version, BYTE* OUT to_stream); static BOOL Version3StreamConvertTo4(BYTE* IN from_stream, int& OUT to_version, BYTE* OUT to_stream); static BOOL Version4StreamConvertTo5(BYTE* IN from_stream, int& OUT to_version, BYTE* OUT to_stream); static BOOL Version5StreamConvertTo6(BYTE* IN from_stream, int& OUT to_version, BYTE* OUT to_stream); static BOOL Version6StreamConvertTo7(BYTE* IN from_stream, int& OUT to_version, BYTE* OUT to_stream); //#ifdef _NA000109_100427_SOLAR_SLOT_UPDATE_TO_VER8_ // static BOOL VersionXStreamConvertToX(BYTE* IN from_stream, int& OUT to_version, BYTE* OUT to_stream); //#endif #ifdef _NA000000_110218_RANK_REPORTER_IN_DBUNIT // NOTE: f110221.1L, result of one item convert if it has version upgrade static void ClearConvertResult(); static bool GetConvertResult(eRANK* rank); #endif //============================================================================================== private: //private methods static bool _InitializeBinding(const SCItemSlot* first); static void _DestroyBinding(const SCItemSlot* deleting_obj); static nsSlot::SerializeItemOption* _GetBindingBlock(); // (f100803.3L) change a binder allocator to support multiple versions and types static bool _SerializeToItemStream(OPTIONPART* OUT serialized_stream, int query_version); static bool _SerializeFromItemStream(SLOTCODE item_code, const OPTIONPART* serialized_stream); static int _SerializeUsedBits(const ItemParseType::ValueType parse_type); //#ifdef _NA002237_100802_EP2_SOCKET_SYSTEM_DB_ // (f100803.4L) detach a convert version with binder from an old version converter. static bool _ConvertStreamWithBinder(int start_version, ITEMSTREAMEX* start_stream, int* result_latest_version, ITEMSTREAMEX* result_latest_stream); //#endif //{ _NA000109_100427_ITEM_CUSTOMIZING_CONTENTS_ // inline function in a code file. // reset rules based on the value of a lock_info.history_. bool ChangeImageItemRule(eEtheriaHistory::value_type history); // change an image link which is shapes for an icon, a render image, and etc. // will be a implicit call about the ChangeImageItemRule // if the value of a history is not eEtheriaHistory::eHistory::None; bool ChangeImageItem(SLOTCODE image_item_code, eEtheriaHistory::value_type history); //} bool _SetItemInfo(); bool _UpdateTime(); // (WARNING) ¾ÆÀÌÅÛ Å¸ÀÔº°(ref:SerializeItemOptionÀ¸·Î ±¸º°µÇ´Â)·Î °øÀ¯Á¤º¸ »ç¿ëÇÏ´Â »ç·Ê°¡ ÀÖ´Ù. // À̰ÍÀÌ »ç¿ë ÁßÀÏ °æ¿ì, ´Ù¸¥ °øÀ¯ Á¤º¸ »ç¿ëÇϴ ŸÀÔÀ¸·ÎÀÇ Àüȯ ¶Ç´Â »ç¿ëÀº Çã¿ëµÇÁö ¾Ê´Â´Ù. bool _CanReuseSharedBlock() const; #ifdef _NA_003740_20111122_RANDOM_ITEM SCRandomInfo random_info_; #endif // _NA_003740_20111122_RANDOM_ITEM eSlotType SlotType_info_; //============================================================================================== // data fields //---------------------------------------------------------------------------------------------- // Start Data Field //---------------------------------------------------------------------------------------------- union { BYTE item_slot_point_holder_start_[1]; // (WARNING) ¹Ýµå½Ã µ¥ÀÌÅÍ Çʵå óÀ½¿¡ À§Ä¡½ÃÄÑ¾ß ÇÑ´Ù. }; //---------------------------------------------------------------------------------------------- // Default item serializing structure (server internal) (client temporary) union { struct { DWORD64 m_dwSerial : 40; DWORD64 m_byType : 8; DWORD64 m_byReserved2 : 8; DWORD64 m_byReserved1 : 8; }; DWORD64 m_WorldSerial; }; //---------------------------------------------------------------------------------------------- SLOTCODE item_code_; SLOTCODE image_item_code_; //_NA000109_100427_ITEM_CUSTOMIZING_CONTENTS_ DURATYPE duration_; //210924 BY RTX ±©Â¶½Ó¿ÚÖ±½ÓÍⲿʹÓà public: // //---------------------------------------------------------------------------------------------- // const BASE_ITEMINFO* item_info_; // ÀÌ Æ÷ÀÎÅÍ ¼³Á¤ ¿©ºÎ¿¡ µû¶ó ½½·Ô ÀÚüÀÇ È°¼º »óŸ¦ Ç¥±âÇÒ ¼ö ÀÖ´Ù. private: const BASE_ITEMINFO* image_item_info_; const nsSlot::ItemRuleInfo item_rule_info_; BYTE item_slot_point_holder_options_[1]; // (MARK) ¾ÆÀÌÅÛ ½½·Ô °íÀ¯ ¿É¼Çµé ½ÃÀÛ À§Ä¡ ISlotUpdaterD slot_updater_; //---------------------------------------------------------------------------------------------- // Lock Information nsSlot::SCItemLockInfo lock_info_; SCLaxLock m_LaxLock; //res.SCItemLockInfo //¾îÂ÷ÇÇ À̵¿ ¸øÇϹǷΠCopy¿¡ ±¸Çö ¾ÈÇÔ //---------------------------------------------------------------------------------------------- // Sharing Part - separated block nsSlot::SCEquipInfo equip_info_; /*const */SCNOption n_option_info_; /*const */SCRankInfo rank_info_; #ifdef _NA_0_20100727_SOCKET_SYSTEM_CONVERT /*const */SCSocketOptionInfo socket_info_; SCSocketOptionInfo socket_info_2;//xiaomi add test #else /*const */SCSocketInfo socket_info_; #endif // _NA_0_20100727_SOCKET_SYSTEM_CONVERT #ifdef _NA_003033_20110831_DICECAST_ITEM_ROUTING BYTE dicecast_type_; #endif //_NA_003033_20110831_DICECAST_ITEM_ROUTING //---------------------------------------------------------------------------------------------- // Sharing Part - address union block struct SharedBlock { union { SCLimitedInfo limited_info_; SCFateInfo fate_info_; SCPetInfo pet_info_; SCWayPointInfo waypoint_info_; SCLottoInfo lotto_info_; nsSlot::SCCoordinateInfo coordinate_info_; SCRiderInfo rider_info_; SCRiderPartsInfo rider_parts_info_; // _NA_0_20100727_SOCKET_SYSTEM_CONVERT nsSlot::SCDefaultEtcInfo default_ect_info_; }; } shared_; nsSlot::SCTimeInfo time_info_; //---------------------------------------------------------------------------------------------- // Item Options Data Block //OPTIONPART backup_; //removed f100909.2L // delete reserved //WORD m_MapCode; //shared_.coordinate_info_ //short m_X; //shared_.coordinate_info_ //short m_Y; //shared_.coordinate_info_ //short m_Z; //shared_.coordinate_info_ // ? DWORD m_DamageStoreForDura; //? //---------------------------------------------------------------------------------------------- // ItemSlot Control Field // (WARNING) ¹Ýµå½Ã µ¥ÀÌÅÍ ÇÊµå ¸¶Áö¸·¿¡ À§Ä¡½ÃÄÑ¾ß ÇÑ´Ù. BYTE item_slot_point_holder_last_[1]; // //---------------------------------------------------------------------------------------------- static const SCItemSlot Null_Slot; static const BASE_ITEMINFO Null_ItemInfo; //---------------------------------------------------------------------------------------------- // end of data field section //---------------------------------------------------------------------------------------------- friend class SCRiderInfo; friend class SCRiderPartsInfo; friend class EditModeTransaction; // °ÔÀÓ ·ÎÁ÷ COM Ŭ·¡½º¿¡¼­ SCItemSlotÀÇ private ¸â¹ö ÇÔ¼öµéÀ» »ç¿ëÇÒ ¼ö ÀÖµµ·Ï // Àӽà Á¶Ä¡À̸ç, °ÔÀÓ ·ÎÁ÷ ÀÎÅÍÆäÀ̽º°¡ Á¤¸®µÇ´Â ´ë·Î ÀÌ friend °ü°è´Â »èÁ¦ ¿¹Á¤ friend class CCSunOnline; friend class CSunOnlineItem; }; //end of class 'SCItemSlot' //-------------------------------------------------------------------------------------------------- // the change mode class to support the GameLogic library is supported can modify options class SCItemSlot::EditModeTransaction { public: EditModeTransaction(SCItemSlot* item_slot); ~EditModeTransaction(); private: const bool first_value_; // to support toggle SCItemSlot* const item_slot_; __DISABLE_COPY(EditModeTransaction); }; //-------------------------------------------------------------------------------------------------- class CSVendorItem : public SCItemSlot { public: virtual eSlotType GetSlotType() const; }; // inline function implementation #define _SOLAR_SLOT_SCITEMSLOT_INL #include "./SCItemSlot.inl" #undef _SOLAR_SLOT_SCITEMSLOT_INL //-------------------------------------------------------------------------------------------------- //================================================================================================== //================================================================================================== //================================================================================================== #endif //_SOLAR_SLOT_SCITEMSLOT_H