Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
137 lines
6.3 KiB
C++
137 lines
6.3 KiB
C++
#ifndef _RYL_DBAGENT_SIEGE_OBJECT_DB_H_
|
|
#define _RYL_DBAGENT_SIEGE_OBJECT_DB_H_
|
|
|
|
#pragma once
|
|
|
|
#include <Network/Packet/PacketStruct/CastlePacket.h>
|
|
#include <Creature/CreatureStructure.h>
|
|
|
|
using namespace Siege;
|
|
|
|
// forward decl.
|
|
class CDBComponent;
|
|
|
|
class CSiegeObjectDB
|
|
{
|
|
public:
|
|
|
|
virtual ~CSiegeObjectDB();
|
|
|
|
// Process ÇÔ¼ö
|
|
virtual Siege::eReturn Process() { return Siege::RET_OK; }
|
|
|
|
// Cmd ó¸® °¡»ó ÇÔ¼ö
|
|
virtual bool CancelBuild() { return false; }
|
|
virtual bool Cancel() { return false; }
|
|
virtual bool Build(unsigned short wType, unsigned char cDevelopTime, unsigned long dwDevelopGold = 0, unsigned long dwOwnerID = 0) { return false; }
|
|
virtual bool Upgrade(unsigned char cUpgradeTime, unsigned long dwUpgradeGold = 0, unsigned char cUpgradeType = Siege::NO_JEWEL) { return false; }
|
|
virtual bool Repair(unsigned long dwRepairHP, unsigned long dwRepairGold = 0) { return false; }
|
|
virtual bool Restore(unsigned char cRestoreTime, unsigned long dwRestoreGold = 0) { return false; }
|
|
virtual bool Destroy(unsigned long dwEnemyNation = 0, bool bDeductFame = false) { return false; }
|
|
virtual bool ChangeType(unsigned short wType) { return false; }
|
|
|
|
virtual void UpdateRewardFame() { }
|
|
|
|
virtual void UpdateLastUseTime(bool bInit=false);
|
|
virtual void UpdateHP(unsigned long dwNowHP) { m_dwHP = dwNowHP; }
|
|
virtual bool ToStartKit() { return false; }
|
|
|
|
// To GameServer
|
|
void SendCampCmd(unsigned char cSubCmd, unsigned long dwValue1=0, unsigned long dwValue2=0);
|
|
void SendCastleCmd(unsigned long dwValue, unsigned char cSubCmd);
|
|
void SendSiegeArmsCmd(unsigned long dwValue, unsigned char cSubCmd);
|
|
|
|
// Get / Set ÇÔ¼ö
|
|
bool IsEmblem() const { return (Siege::EMBLEM == m_wObjectType); }
|
|
bool IsCamp() const;
|
|
bool IsGate() const { return (Siege::GATE == m_wObjectType); }
|
|
bool IsGuard() const { return (Siege::GUARD == m_wObjectType); }
|
|
bool IsCastleObject() const;
|
|
bool IsCastleArms() const;
|
|
bool IsSiegeArms() const;
|
|
bool IsRidable() const;
|
|
bool IsWorldWeapon() const;
|
|
|
|
unsigned long GetCID() const { return m_dwCID; }
|
|
unsigned long GetGID() const { return m_dwGID; } // ÁÖÀÇ!! ¿ä»õ ¹× ¿ùµå¿þÆù¸¸ °¡´É
|
|
unsigned long GetNation() const { return m_cNation; } // ÁÖÀÇ!! °ø¼º ¹× ¼ö¼º °ü·Ã ¿ÀºêÁ§Æ®µé¸¸ °¡´É
|
|
unsigned long GetNowHP() const { return m_dwHP; }
|
|
unsigned char GetState() const { return m_cState; }
|
|
unsigned char GetSubState() const { return m_cSubState; }
|
|
unsigned char GetUpgradeStep() const { return m_cUpgradeStep; }
|
|
unsigned char GetZone() const { return m_cZone; }
|
|
unsigned char GetChannel() const { return m_cChannel; }
|
|
const Position& GetPosition() const { return m_Pos; }
|
|
unsigned char GetMaterialNum() const { return m_cMaterial; }
|
|
unsigned char GetSiegeCount() const { return m_cSiegeCount; }
|
|
unsigned short GetObjectType() const { return m_wObjectType; }
|
|
unsigned char GetDevelopTime() const { return m_cDevelopTime; }
|
|
unsigned char GetUpgradeTime() const { return m_cUpgradeTime; }
|
|
unsigned char GetRepairTime() const { return m_cRepairTime; }
|
|
unsigned char GetChangeTime() const { return m_cChangeTime; }
|
|
|
|
const TIME& GetTimeValue() const { return m_TimeValue; }
|
|
const TIME& GetLastUseTime() const { return m_LastUseTime; }
|
|
|
|
unsigned long GetCastleID() const { return m_dwCampOrCastleID; } // ¼º »ó¡¹°, ¼º¹®/µÞ¹®, ¼ö¼º º´±â
|
|
unsigned long GetCampID() const { return m_dwCampOrCastleID; } // ±æµå ¿ä»õ
|
|
unsigned long GetOwnerID() const { return m_dwOwnerID; } // ±Ù°Å¸®/¿ø°Å¸® ¼ö¼ºº´±â, ±Ù°Å¸®/¿ø°Å¸® °ø¼º º´±â, ºñ°øÁ¤
|
|
|
|
void SetGID(unsigned long dwGID); // ÁÖÀÇ!! ¿ä»õ ¹× ¿ùµå¿þÆù¸¸ °¡´É
|
|
void SetNation(unsigned char cNation); // ÁÖÀÇ!! °ø¼º ¹× ¼ö¼º°ü·Ã ¿ÀºêÁ§Æ®µé¸¸ °¡´É
|
|
void SetZoneChannel(unsigned char cZone, unsigned char cChannel);
|
|
virtual void SetMaterialNum(unsigned char cMaterial);
|
|
void SetSiegeCount(unsigned char cSiegeCount) { m_cSiegeCount = cSiegeCount; }
|
|
|
|
protected:
|
|
|
|
CSiegeObjectDB(CDBComponent& DBComponent, const CastleObjectInfoDB& CastleObject);
|
|
CSiegeObjectDB(CDBComponent& DBComponent, const CampInfoDB& CampInfo);
|
|
|
|
CSiegeObjectDB(CDBComponent& DBComponent, unsigned long dwCampID,
|
|
unsigned long dwGID, unsigned char cZone, unsigned char cChannel, Position Pos);
|
|
|
|
CSiegeObjectDB(CDBComponent& DBComponent, unsigned long dwOwnerID,
|
|
unsigned char cNation, unsigned short wObjectType, unsigned char cUpgradeStep,
|
|
unsigned char cZone, unsigned char cChannel, Position Pos);
|
|
|
|
void SetCID(unsigned long dwCID) { m_dwCID = dwCID; }
|
|
|
|
unsigned long m_dwCID; // CID : SIEGE_OBJECT_BIT ÀÌ ¼³Á¤µÈ CreatureID
|
|
unsigned long m_dwCampOrCastleID; // CampID : ÁøÁöÀÇ ±æµå ¿ä»õ ¹× ¿ùµå ¿þÆù
|
|
// CastleID : ¼º »ó¡¹°, ¼º¹®, µÞ¹®, °¡µå, ±Ù°Å¸®/¿ø°Å¸® ¼ö¼ºº´±âÀÇ ¼ºID
|
|
unsigned long m_dwOwnerID; // CID : ±Ù°Å¸®/¿ø°Å¸® °ø¼ºº´±â, ºñ°øÁ¤ÀÇ ÁÖÀÎ, ±Ù°Å¸®/¿ø°Å¸® ¼ö¼ºº´±â
|
|
|
|
unsigned long m_dwGID; // GID : ±æµå ¿ä»õ ¼ÒÀ¯ ±æµåÀÇ ±æµåID (¿ä»õ ¹× ¿ùµå¿þÆù¸¸ »ç¿ëÇÔ)
|
|
unsigned char m_cNation; // ¼º »ó¡¹°, ¼º¹®, µÞ¹®, °¡µå, ±Ù°Å¸®/¿ø°Å¸® ¼ö¼ºº´±âÀÇ ±¹°¡ (°ø¼ºÀü ¿ÀºêÁ§Æ®µé¸¸ »ç¿ë)
|
|
unsigned long m_dwHP; // HP
|
|
|
|
unsigned short m_wObjectType; // °ø¼º °ü·Ã ¿ÀºêÁ§Æ® ŸÀÔ
|
|
unsigned char m_cState; // ÇöÀç ¿ÀºêÁ§Æ®ÀÇ »óÅÂ
|
|
unsigned char m_cSubState; // ÇöÀç ¿ÀºêÁ§Æ®ÀÇ ¼ºê »óÅ (Use EMBLEM & GATE)
|
|
unsigned char m_cUpgradeStep; // ÇöÀç ¿ÀºêÁ§Æ®ÀÇ ¾÷±×·¹ÀÌµå ´Ü°è
|
|
unsigned char m_cUpgradeType; // ¼º »ó¡¹°ÀÇ ¾÷±×·¹À̵å ŸÀÔ (Only EMBLEM)
|
|
|
|
unsigned char m_cDevelopTime; // °³¹ß(º¹±¸)¿¡ °É¸®´Â ½Ã°£ (ºÐ)
|
|
unsigned char m_cUpgradeTime; // ¾÷±×·¹À̵忡 °É¸®´Â ½Ã°£ (ºÐ)
|
|
unsigned char m_cRepairTime; // ¼ö¸®¿¡ °É¸®´Â ½Ã°£ (ÃÊ)
|
|
unsigned char m_cChangeTime; // ŸÀÔ º¯Çü¿¡ °É¸®´Â ½Ã°£ (ºÐ)
|
|
|
|
unsigned char m_cZone; // Á¸ (Only CAMP)
|
|
unsigned char m_cChannel; // ä³Î (Only CAMP)
|
|
TIME m_TimeValue; // °¢Á¾ ½Ã°£ ÀúÀå º¯¼ö
|
|
TIME m_LastUseTime; // ÁøÁöÀÇ ¸¶Áö¸· »ç¿ë ½Ã°£ (Use CAMP & SIEGE_ARMS & CASTLE_ARMS)
|
|
Position m_Pos; // À§Ä¡
|
|
unsigned char m_cMaterial; // °ø¼º¿ë ÀÚÀç °¹¼ö
|
|
unsigned char m_cSiegeCount; // °ø¼º Áö³ Ƚ¼ö
|
|
|
|
unsigned long m_dwRepairHP; // ¼ö¸® ¿Ï·á½Ã ȸº¹ÇÒ HP ¾ç
|
|
float m_fDefaultDir; // ¼ö¼º º´±âÀÇ ±âº» ¹æÇâ
|
|
|
|
CDBComponent& m_DBComponent; // DB
|
|
|
|
friend class CSiegeObjectDBMgr;
|
|
};
|
|
|
|
#endif // _RYL_DBAGENT_SIEGE_OBJECT_DB_H_
|