📄 map.h
字号:
////////////////////////////////////////////////////////////////////////////////////////
// Map Array包府 (AOI 单捞鸥 棺 阿辆 Object包府)
//
//
// - 眠饶 Map Manager客 Map阑 备炼甫 函版矫糯
////////////////////////////////////////////////////////////////////////////////////////
#if !defined(_MAP_H_)
#define _MAP_H_
#include "SafeList.h" // STL LIST
#include "SafeMap.h" // STL MAP
#include "npc.h" // NPC Class
#include "tgaBase.h" // Added by ClassView
#include "Party.h"
// ------------------------------------------------------------------------------------
// Map Type
// ------------------------------------------------------------------------------------
#define MAP_NORMAL 0 // 老馆甘
#define MAP_EVENT 1 // 颇萍傈侩 捞亥飘甘
#define MAP_AZIT 2 // 酒瘤飘 傈侩 甘
////////////////////////////////////////////////////////////////////////////////////////
// Map 包府
//
// 1. Map 柳涝啊/阂啊
//
// -> 眠饶 鸥 瘤开 楷悼矫 Link肺 荤侩
// 包访 Struct 弥利拳 累诀 鞘夸
////////////////////////////////////////////////////////////////////////////////////////
#define CHK_MOVE 0x01
#define CHK_SAFEZONE 0x02
#define CHK_FIGHTZONE 0x04
#define CHK_PKZONE 0x08
typedef struct
{
// move 1 safezone 2 bIsFightzone 4 bIsPKZone 8
BYTE nCheckBit ;
BYTE nType; // 1 : PC / 2 : NPC / 3: SUMMONNPC /
DWORD dwHandle; // PC/NPC Handle
void* pObject; // Object Handle (Memory);
DWORD dwItemHandle; // Item Handle
void* pItemObject; // Item Object
} _GAME_MAP_ ;
////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////
class Map
{
// Attributes
public:
// Operations
public:
Map();
~Map();
protected:
// --------------------------------------------------------------------------------
// Memory Temp Handle 包府 (Memory俊 烙矫肺 荤侩且 Key惯鞭)
// --------------------------------------------------------------------------------
int m_nTempHandle; // Temp Handle
CRITICAL_SECTION m_MapLock; // MAP 傈侩 Critical Section
public:
CRITICAL_SECTION m_DBLock; // DB 傈侩 Critical Section
int m_nMaxLayer;
bool m_bHaveFightzone ;
// --------------------------------------------------------------------------------
// MAP狼 加己 沥焊
// --------------------------------------------------------------------------------
class _MapConfig_
{
public:
int nMapType; // 甘狼 辆幅 - Duke Kim 2004-08-02
// ----------------------------------------------------------------------------
// DB 加己 沥焊
// ----------------------------------------------------------------------------
int nMaxX;
int nMaxY;
BYTE nMapID;
DWORD dwMapSeq;
BOOL bPKMode;
CBeing GlobalMapProperty; // Map Global Property
char strMapTitle[20]; // MAP TITLE
_POINT StartPoint; // 纳腐磐 矫累 困摹
// ----------------------------------------------------------------------------
// FightZone 甘老锭
// ----------------------------------------------------------------------------
bool m_bIsFightZone ;
char m_strMapFile[100];
_POINT PvpSpawnPoint[2]; // 荤捧厘俊辑 磷阑 版快 矫累 困摹 - Jason : 2004-07-02
//
// 酒瘤飘 包访 悸泼
//
int nAzitMax;
#ifdef DEF_AZITSIMULATION
// 甘狼 穿利 技陛
__int64 m_i64TotalTax ;
#endif
} MapConfig[MAX_MAPLAYER];
// --------------------------------------------------------------------------------
// MAP Object
// --------------------------------------------------------------------------------
_GAME_MAP_ ** _MAP[MAX_MAPLAYER]; // AOI Control Memory
SafeMap * m_MapNPC[MAX_MAPLAYER]; // MAP NPC
struct
{
DWORD dwMapID;
_POINT StartPoint; // 纳腐磐 矫累 困摹
} _LOBBY_ ;
struct
{
DWORD dwMapID;
_POINT StartPoint; // 纳腐磐 矫累 困摹
} _HIDDENLOBBY_ ;
// --------------------------------------------------------------------------------
// Memory Pool ( Player / Skill / Item ) - 眠饶 Pool Class肺 盒府矫糯
// --------------------------------------------------------------------------------
SafeList m_PoolSocket; // SOCKET Memory POOL
SafeList m_PoolSkill; // SKILL Memory POOL
SafeList m_PoolItem; // ITEM Memory POOL
SafeList m_PoolParty; // PARTY Memory POOL
SafeList m_PoolGuild; // Guild Memory POOL
// --------------------------------------------------------------------------------
// Object Control ( NPC / Player List )
// --------------------------------------------------------------------------------
SafeMap m_MapAccountID; // 立加 ACCOUNT ID
SafeMap m_MapPlayerID; // 立加 PLYAER ID
SafeMap m_MapPlayerHandle; // 立加 PLAYER SOCKET
//#ifdef DEF_LOGOUT_TO_WORLD
// SafeMap m_MapTempPlayerID; // 烙矫 历厘侩 AccountID
//#endif
SafeList m_LocationNPC; // NPC狼 檬扁 困摹 包府
SafeMap m_MapItem; // Field俊 积己等 Item包府
SafeMap m_MapParty; // PARTY 沥焊 包府
SafeMap m_MapGuild; // 辨靛沥焊 沥焊 包府
public:
bool IsChannelMap( BYTE pLayer );
bool Initialize();
bool IsFightMap( BYTE pMapLayer );
void Delete_Player(char * pPlayerID);
//
// 酒瘤飘 殿废 甘
//
#ifdef DEF_AZIT
void AzitNPC_Create(NPC *pNPC, _POINT_TILE pTile);
#endif
#ifdef DEF_AZITSIMULATION
void AddAzitTax(BYTE pMapLayer,int iAddTax)
{
if(pMapLayer >= m_nMaxLayer ) return ;
// 技啦 * 10父 飘扼啊 弥措 甸绢棵 荐 乐绰 技陛捞促.
// 技啦捞 5 捞搁 50父 飘扼啊 弥措 技陛捞促.
iAddTax = MIN( DEF_AZITTAX_DEFAULTRATE*100 * 100000 , iAddTax) / 2 ;
MapConfig[pMapLayer].m_i64TotalTax += iAddTax ;
}
#endif
////////////////////////////////////////////////////////////////////////////////////////
// Monster 殿废 矫糯 (UNIQUE)
////////////////////////////////////////////////////////////////////////////////////////
void Monster_Create(NPC *pNPC)
{
if(pNPC->m_nMapLayer >= m_nMaxLayer ) return ;
m_MapNPC[pNPC->m_nMapLayer]->Insert( pNPC->m_dwHandle, pNPC ); // NPC包府 Map 秦寸 沥焊甫 涝仿 矫糯
};
bool IsMoveable(BYTE pMapLayer, _POINT_TILE pPoint );
// --------------------------------------------------------------------------------
// 甘 扁夯 沥焊 包府
// --------------------------------------------------------------------------------
#ifdef DEF_AZITSIMULATION
void SetMapConfig( BYTE pLayer, DWORD pMapSeq, BYTE pMapID, BOOL pPKMode, char * ,__int64 i64Tax );
#else // DEF_AZITSIMULATION
void SetMapConfig( BYTE pLayer, DWORD pMapSeq, BYTE pMapID, BOOL pPKMode, char * );
#endif // DEF_AZITSIMULATION
// --------------------------------------------------------------------------------
// 秦寸 Layer狼 MAP ID甫 馆券 矫糯
// --------------------------------------------------------------------------------
int GetMapID(BYTE pLayer)
{
return MapConfig[ pLayer ].nMapID;
}
// --------------------------------------------------------------------------------
// 秦寸 Layer狼 MAP SEQ甫 馆券 矫糯
// --------------------------------------------------------------------------------
DWORD GetMapSeq(BYTE pLayer)
{
return MapConfig[ pLayer ].dwMapSeq;
}
// --------------------------------------------------------------------------------
// 甘 加己 沥焊 包府
// --------------------------------------------------------------------------------
void SetGlobalMapProperty( int pMapType,
BYTE pLayer,
int pMaxX,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -