Public Function NPC_Type(ByVal IdNpc As Long) As Byte
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_KIND_OFFSET)
NPC_Type = Process_ReadByte(HandleProcess, IdNpc * NPC_DATA_SIZE + Read + NPC_KIND_OFFSET)
End Function
Public Function NPC_Level(ByVal IdNpc As Long) As Byte
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
NPC_Level = Process_ReadByte(HandleProcess, IdNpc * NPC_DATA_SIZE + Read + NPC_LEVEL_OFFSET)
End Function
Public Function Player_PosY() As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
Player_PosY = Process_ReadLong(HandleProcess, Player_ID * NPC_DATA_SIZE + Read + NPC_POSY_OFFSET)
End Function
Public Function Player_PosX() As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
Player_PosX = Process_ReadLong(HandleProcess, Player_ID * NPC_DATA_SIZE + Read + NPC_POSX_OFFSET)
End Function
Public Function Player_Name() As String
Dim Read As Long, Id As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
Player_Name = Process_ReadString(HandleProcess, Player_ID * NPC_DATA_SIZE + Read + NPC_NAME_OFFSET, 32)
End Function
Public Function Player_ID() As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, PLR_BASE_ADD)
Player_ID = Process_ReadLong(HandleProcess, Read + PLR_DATA_OFFSET)
''''''''''''''''''''''''ID Map''''''''''''''''''''''''
Public Function CUR_MAP(IdNpc As Long) As Long
CUR_MAP = Process_ReadLong(HandleProcess, CUR_MAP_ADD)
End Function
''''''''''''''''''''''''Hanh Dong''''''''''''''''''''''''
Public Function NPC_DOING(IdNpc As Long) As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
NPC_DOING = Process_ReadLong(HandleProcess, IdNpc * NPC_DATA_SIZE + Read + NPC_DOING_OFFSET)
End Function
''''''''''''''''''''''''Trang Thai''''''''''''''''''''''''
Public Function NPC_Status(IdNpc As Long) As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
NPC_Status = Process_ReadLong(HandleProcess, IdNpc * NPC_DATA_SIZE + Read + NPC_STATUS_OFFSET)
End Function
''''''''''''''''''''''''Toa Do''''''''''''''''''''''''
Public Function NPC_POS_Y(IdNpc As Long) As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
NPC_POS_Y = Process_ReadLong(HandleProcess, IdNpc * NPC_DATA_SIZE + Read + NPC_POSY_OFFSET)
End Function
Public Function NPC_POS_X(IdNpc As Long) As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
NPC_POS_X = Process_ReadLong(HandleProcess, IdNpc * NPC_DATA_SIZE + Read + NPC_POSX_OFFSET)
NPC_POS_X = NPC_POS_X
End Function
''''''''''''''''''''''''Money''''''''''''''''''''' '''
Public Function Player_Money1() As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, PLR_BASE_ADD)
Player_Money1 = Process_ReadLong(HandleProcess, Read + PLR_MONEY1_OFFSET)
End Function
Public Function Player_Money2() As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, PLR_BASE_ADD)
Player_Money2 = Process_ReadLong(HandleProcess, Read + PLR_MONEY2_OFFSET)
End Function
''''''''''''''''''''''''Mana'''''''''''''''''''''' ''
Public Function Player_Max_MP() As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
Player_Max_MP = Process_ReadLong(HandleProcess, Player_ID * NPC_DATA_SIZE + Read + NPC_MAXMANA_OFFSET)
End Function
Public Function Player_Cur_MP() As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
Player_Cur_MP = Process_ReadLong(HandleProcess, Player_ID * NPC_DATA_SIZE + Read + NPC_CURMANA_OFFSET)
End Function
''''''''''''''''''''''''HP''''''''''''''''''''''''
Public Function Player_Max_HP() As Long
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
Player_Max_HP = Process_ReadLong(HandleProcess, Player_ID * NPC_DATA_SIZE + Read + NPC_MAXLIFE_OFFSET)
End Function
Public Function Player_Cur_HP() As Long
Dim Read As Long, Id As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
Player_Cur_HP = Process_ReadLong(HandleProcess, Player_ID * NPC_DATA_SIZE + Read + NPC_CURLIFE_OFFSET)
End Function
''''''''''''''''''''''''Doc ten nv''''''''''''''''''''''''
Public Function NPC_Name(IdNpc As Long) As String
Dim Read As Long
Read = Process_ReadLong(HandleProcess, NPC_BASE_ADD)
NPC_Name = Process_ReadString(HandleProcess, IdNpc * NPC_DATA_SIZE + Read + NPC_NAME_OFFSET, 32)
End Function
bạn dựa vào đó để tìm base và offset
hook game
class KPlayer
{
public:
BYTE __unknown00[0x24];
/* 0x24 */
int m_nLeftSkillID;
int m_nLeftSkillLevel;
int m_nRightSkillID;
int m_nRightSkillLevel;
BYTE __unknown01[0x10];
/* 0x44 */
int m_nPeopleIdx;
int m_nObjectIdx;
int m_nPickObjectIdx;
int m_nPlayerIdx;
BYTE __unknown02[0x8C];
/* 0x0E0 */
int m_nRunStatus;
DWORD m_dwNextLevelLeadExp;
int m_nSendMoveFrames;
BYTE __unknown03[0x40];
/* 0x12C */
DWORD m_dwID;
int m_nNpcIdx;
BYTE __unknown04[0x4];
/* 0x138 */
BYTE __unknown05[0x4E74];
/* 0x4FAC */
int m_nBuyIdx;
BYTE __unknown06[0x58C];
/* 0x553C */
int m_nAttributePoint;
int m_nSkillPoint;
int m_nStrength;
int m_nDexterity;
int m_nVitality;
int m_nEngergy;
int m_nLucky;
BYTE __unknown07[0x4];
/* 0x555C */
int m_nCurStrength;
int m_nCurDexterity;
int m_nCurVitality;
int m_nCurEngergy;
int m_nCurLucky;
__int64 m_nCurEXP;
__int64 m_nNextLevelEXP;
DWORD m_dwLeadEXP;
DWORD m_dwLeadLevel;
BYTE __unknown08[0x20];
/* 0x55A8 */
BYTE __unknown09[0x5A8];
/* 0x5B50 */
int m_nCurFaction;
BYTE __unknown10[0x4];
/* 0x5B58 */
int m_nFaction;
BYTE __unknown11[0x274];
/* 0x5DD0 */
BYTE __unknown12[0x2A20];
public:
int GetSelfIndex() { return m_nNpcIdx; }
};
class KNpc
class KNpc
{
public:
DWORD m_dwID;
int m_nIndex;
BYTE __unknown00[0x18];
/* 0x20 */
int m_nLevel;
int m_nKind;
int m_nSeries;
BYTE __unknown01[0x10];
/* 0x3C */
BYTE __unknown02[0x54];
/* 0x90 */
KState m_PoisonState;
KState m_FreezeState;
KState m_StunState;
BYTE __unknown03[0x54 - sizeof(KState)*3];
/* 0x0E4 */
int m_nCamp;
int m_nCurCamp;
NPCCMD m_Doing;
CLIENTACTION m_ClientDoing;
BYTE __unknown04[0x8];
/* 0x0FC */
KList m_SkillStateList;
BYTE __unknown05[0x0C - sizeof(KList)];
/* 0x108 */
int m_nActiveSkillID;
int m_nActiveAuraSkillID;
KSkillList m_SkillList;
BYTE __unknown06[0x0F2C - sizeof(KSkillList)];
/* 0x103C */
int m_nSubWorldIdx;
int m_nRegionIdx;
BYTE __unknown07[0x4];
/* 0x1048 */
int m_nCurLife;
int m_nCurLifeReplenish;
BYTE __unknown08[0x0C];
/* 0x105C */
int m_nCurMana;
int m_nCurManaReplenish;
int m_nCurStamina;
int m_nCurStaminaMax;
int m_nCurStaminaGain;
int m_nCurStaminaLoss;
BYTE __unknown09[0x0A0];
/* 0x1114 */
int m_nCurAttackRating;
int m_nCurDefend;
BYTE __unknown10[0x0C];
/* 0x1128 */
int m_nCurFireResistMax;
int m_nCurColdResistMax;
int m_nCurPoisonResistMax;
int m_nCurLightResistMax;
int m_nCurPhysicsResistMax;
BYTE __unknown11[0x08];
/* 0x1144 */
int m_nCurWalkSpeed;
int m_nCurRunSpeed;
BYTE __unknown12[0x0C];
/* 0x1158 */
int m_nCurJumpSpeed;
int m_nCurJumpFrame;
int m_nCurVisionRadius;
int m_nCurAttackRadius;
int m_nCurActiveRadius;
BYTE __unknown13[0x1B4];
/* 0x1320 */
int m_nMapX, m_nMapY, m_nMapZ;
int m_nOffX, m_nOffY;
int m_nDesX, m_nDesY;
BYTE __unknown14[0x49];
/* 0x1385 */
char m_szName[32];
int m_nSex;
BYTE __unknown15[0x6B];
/* 0x1414 */
int m_nPeopleIdx;
BYTE __unknown16[0x0C];
int m_nObjectIdx;
BYTE __unknown17[0x4];
/* 0x142C */
int m_nLifeMax;
int m_nLifeReplenish;
int m_nManaMax;
int m_nManaReplenish;
int m_nStaminaMax;
int m_nStaminaGain;
int m_nAttackRating;
int m_nDefend;
int m_nFireResist;
int m_nColdResist;
int m_nPoisonResist;
int m_nLightResist;
int m_nPhysicsResist;
int m_nFireResistMax;
int m_nColdResistMax;
int m_nPoisonResistMax;
int m_nLightResistMax;
int m_nPhysicsResistMax;
int m_nWalkSpeed;
int m_nRunSpeed;
int m_nJumpSpeed;
int m_nAttackSpeed;
int m_nCastSpeed;
int m_nVisionRadius;
int m_nDialogRadius;
int m_nActiveRadius;
int m_nHitRecover;
int m_nTreasure;
BYTE __unknown18[0x164];
/* 0x1600 */
int m_nHeadImage;
int m_nFightMode;
BYTE __unknown19[0x28];
/* 0x1630 */
DWORD m_dwRegionID;
BYTE __unknown20[0x18];
/* 0x164C */
int m_nPKFlag;
BYTE __unknown21[0x1D4];
/* 0x1824 */
BOOL m_bRideHorse;
BYTE __unknown22[0x8];
/* 0x1830 */
char m_szTongName[64];
BYTE __unknown23[0x15C0];
/* 0x2D84 */
BYTE __unknown24[0x64C];
/* 0x347C */
int m_nMenuState;
BYTE __unknown25[0x0DF2C];
/* 0x113AC */
int m_nCurLifeMax;
BYTE __unknown26[0x4];
/* 0x113B4 */
int m_nCurManaMax;
BYTE __unknown27[0xAC];
public:
void GetMpsPos(int* pX, int* pY)
{
(*pX) = ((LOWORD(m_dwRegionID) * REGION_GRID_WIDTH + m_nMapX) << 5) + (m_nOffX >> 10);
(*pY) = ((HIWORD(m_dwRegionID) * REGION_GRID_HEIGHT + m_nMapY) << 5) + (m_nOffY >> 10);
}
};