//Get MySelf Obj
void _stdcall GameLib_Data_GetMySelfPlayerObj(struct TRetMyPlayerMessage *pOutMySelf)
{
USES_CONVERSION;
__try
{
//dd [[[[[2462418]+0x4B4]+0x4*0]+0x40]+0x2C8]
DWORD pPlayerPawn=0;
pPlayerPawn=*(DWORD *)(CCMCGameEngineAddr); //
pPlayerPawn=*(DWORD *)(pPlayerPawn+0x4B4); //
pPlayerPawn=*(DWORD *)(pPlayerPawn+0x4*0);
pPlayerPawn=*(DWORD *)(pPlayerPawn+0x40); //
pPlayerPawn=*(DWORD *)(pPlayerPawn+0x2C8);//
OutputDebugPrintf("*** pPlayerPawn=0x%x",pPlayerPawn);
if(pPlayerPawn)
{
//dd [[[[[2462418]+0x4B4]+0x4*0]+0x40]+0x2C8]+0x54
float x=*(float *)(pPlayerPawn+Off_CActor_X); //
float y=*(float *)(pPlayerPawn+Off_CActor_Y);
float z=*(float *)(pPlayerPawn+Off_CActor_Z);
pOutMySelf->pObj=pPlayerPawn;
pOutMySelf->fx=x;
pOutMySelf->fz=z;
pOutMySelf->fy=y;
OutputDebugPrintf("*** 坐标=%0.2f,%0.2f,%0.2f",x,y,z);
//struct CMCActorInfo_LocalPlayer
DWORD pCMCActorInfo_LocalPlayer=*(DWORD *)(pPlayerPawn+0x204);
char *name=NULL; //
char *proname=NULL; //
DWORD dwType=0;
DWORD dwLevel=0;
if(pCMCActorInfo_LocalPlayer)
{
dwType=*(BYTE *)(pCMCActorInfo_LocalPlayer+0x40);//sub_11D42B0 1 monster怪物; 2 player玩家; 3角色自己 ; 5 NPC ;6 hero; 7UserShop
dwLevel=*(DWORD *)(pCMCActorInfo_LocalPlayer+0x4C); //等级
pOutMySelf->dwLevel=dwLevel;
pOutMySelf->dwType=dwType;
DWORD pWName=*(DWORD *)(pCMCActorInfo_LocalPlayer+0x1CC); //名字 unicode ok
WCHAR WName[0x64]={0};
wcscpy(WName,(WCHAR *)pWName);
name=W2A(WName); //
OutputDebugPrintf("*** name=%s",name);
strcpy(pOutMySelf->name,name);
DWORD pCMCCharacterAttr=*(DWORD *)(pCMCActorInfo_LocalPlayer+0x1DC);
if(pCMCCharacterAttr)
{
DWORD pWName=*(DWORD *)(pCMCCharacterAttr+0x54); //名字 unicode ok
WCHAR WName[0x64]={0};
wcscpy(WName,(WCHAR *)pWName);
proname=W2A(WName); //
OutputDebugPrintf("*** proname=%s",proname);
strcpy(pOutMySelf->proname,proname);
}
}
//调用虚函数得到血量蓝量
DWORD dwHp=0;
DWORD dwMaxHp=0;
DWORD dwMp=0;
DWORD dwMaxMp=0;
DWORD dwDead=0;
//struct CMCStatusComponent
DWORD pCMCStatusComponent=*(DWORD *)(pPlayerPawn+0x1E4);
if(pCMCStatusComponent)
{
dwHp=GamePrivateCallCStatusComponentVF(pCMCStatusC omponent,0x18C);
dwMaxHp=GamePrivateCallCStatusComponentVF(pCMCStat usComponent,0x194);
dwMp=GamePrivateCallCStatusComponentVF(pCMCStatusC omponent,0x1A4);
dwMaxMp=GamePrivateCallCStatusComponentVF(pCMCStat usComponent,0x1AC);
dwDead=GamePrivateCallCStatusComponentVF(pCMCStatu sComponent,0x1C0);
dwMp=dwMp/100;
dwMaxMp=dwMaxMp/100;
OutputDebugPrintf("蓝量=%d,%d,血量:%d,%d",dwMp,dwMaxMp ,dwHp,dwMaxHp);
pOutMySelf->dwMp=dwMp;
pOutMySelf->dwMaxMp=dwMaxMp;
pOutMySelf->dwHp=dwHp;
pOutMySelf->dwMaxHp=dwMaxHp;
pOutMySelf->dwDead=dwDead;
}
}
}
__except(1)
{
#ifdef USING_INNER_MYSELF
OutputDebugPrintf("***** Game_Data_GetMySelfPlayerObj 异常");
#endif
}
}