short nLevel; char nSex; char nHair; char nFace; unsigned long nXP; int nBP; float fBonusRate; unsigned short nPrize; unsigned short nHP; unsigned short nAP; unsigned short nMaxWeight; unsigned short nSafeFalls; unsigned short nFR; unsigned short nCR; unsigned short nER; unsigned short nWR; unsigned long nEquipedItemDesc[12]; int nUGradeID; unsigned int nClanCLID; }; struct MTD_ExtendInfo{ char nTeam;//this+0x0 unsigned char nPlayerFlags;//this+0x1 unsigned char nReserved1;//this+0x2 unsigned char nReserved2;//this+0x3 unsigned char nReserved3;//this+0x4 }; struct MTD_PeerListNode{ MUID uidChar;//this+0x0 char szIP[0x40];//this+0x8 unsigned int nPort;//this+0x48 MTD_CharInfo CharInfo;//this+0x4c MTD_ExtendInfo ExtendInfo;//this+0xde public: void MTD_PeerListNode_(); }; void* ZGame__OnAddPeerAddress = (void*)0x4A3C60; CDetour ZGame__OnAddPeerDetour; void __stdcall ZGame__OnAddPeerHook(MUID&a,unsigned long,int,MTD_PeerListNode* pNode){ for(int i = 0; i < 30; i++){ if(!players[i].secondID || players[i].secondID == 0){ //ZPrint("%d Added.",a.HighPart); players[i] = a; MaxPlayers++; break; } } } CDetour ZGameClient__OnCommandDetour; DWORD ZGameClient__OnCommandAddress = 0x004C7990; bool __stdcall ZGameClient__OnCommandHook(MCommand2* pCommand){ if (pCommand->m_pCommandDesc->m_nCommandId == 0xD3D9) { MUID uidPlayer; float x,y,z,damage,ratio; int ztype,wtype,mtype; uidPlayer.firstID = 0; if (!pCommand->GetParameter(&uidPlayer.secondID, 0, MPT_INT, -1)) { printf("Failed to get parameter MUID\n"); return true; } if (pCommand->m_uidSender.secondID != GetMe().secondID) { pCommand->GetParameter(&x, 1, MPT_FLOAT, -1); pCommand->GetParameter(&y, 2, MPT_FLOAT, -1); pCommand->GetParameter(&z, 3, MPT_FLOAT, -1); pCommand->GetParameter(&ztype, 4, MPT_INT, -1); pCommand->GetParameter(&wtype, 5, MPT_INT, -1); pCommand->GetParameter(&damage, 6, MPT_FLOAT, -1); pCommand->GetParameter(&ratio, 7, MPT_FLOAT, -1); pCommand->GetParameter(&mtype, 8, MPT_INT, -1); D3DXVECTOR3 pos; pos.x = x; pos.y = y; pos.z = z; //ZCharacter2__OnDamagedDetour.Remove(); if (uidPlayer.secondID == GetMe().secondID) { MSTAGE_SETTING_NODE* pNode; _asm { pushad call ZGetGameClientAddress LEA ECX,DWORD PTR DS:[ESI+0xCD4] //MMatchStageSetting LEA EDI,DWORD PTR DS:[ECX+4] //MSTAGE_SETTING_NODE mov pNode, EDI popad } if ((pNode->type == 0 || pNode->type == 2 || pNode->type == 6 || pNode->type == 5 || pNode->type == 10) || (Find(GetMe())->IsTeam(Find(pCommand->m_uidSender)) && pNode->friendlyFire) || !Find(GetMe())->IsTeam(Find(pCommand->m_uidSender))) { //zCPrint("Player: (%s) tried to attack %s for %f damage (%f ratio) with item: %i.", Find(pCommand->m_uidSender)->Name, Find(uidPlayer)->Name, damage, ratio, ztype); float damageAp = damage * ratio; float damageHp = damage - damageAp; int ap = Find(GetMe())->GetAP() - damageAp; int hp = Find(GetMe())->GetHP() - damageHp; Find(GetMe())->SetAP(ap); Find(GetMe())->SetHP(hp); DWORD* me = (DWORD*)Find(GetMe()); DWORD secondID = pCommand->m_uidSender.firstID; DWORD firstID = pCommand->m_uidSender.secondID; _asm { pushad mov eax, me MOV EAX,DWORD PTR DS:[EAX+0x32C] mov edx, secondID mov ebx, firstID mov DWORD PTR DS:[EAX+0x1C], edx mov DWORD PTR DS:[EAX+0x20], ebx popad } } } //ZCharacter2__OnDamagedDetour.Apply(); } } } void MuidManagerClearer() { while(true) { if(ZGameClient::GetInstance() != NULL) { if(ZGameClient::GetInstance()->StageMUID.secondID > 0) { for(int i = 0;i<30;i++) { if(!(ZGameClient::GetInstance()->StageMUID.secondID > 0)) break; if(players[i].secondID != 0) { if (ZCharacter2Manager::GetInstance() != NULL) { if(!Find(players[i])) { players[i].secondID = 0; MaxPlayers--; } } } } } } Sleep(500); } } void SetupNoLead() { ZGameClient__OnCommandDetour.Detour((PBYTE)ZGameClient__OnCommandAddress, (PBYTE)ZGameClient__OnCommandHook, true); ZGameClient__OnCommandDetour.Apply(); ZCharacter2__OnDamagedDetour.Detour((unsigned char*)ZCharacter2__OnDamagedAddress,(unsigned char*)ZCharacter2__OnDamagedHook,true); ZCharacter2__OnDamagedDetour.Apply(); ZGame__OnAddPeerDetour.Detour((unsigned char*)ZGame__OnAddPeerAddress, (unsigned char*)ZGame__OnAddPeerHook, true); ZGame__OnAddPeerDetour.Apply(); MAddSharedCommandTableDet.Detour((PBYTE)MAddSharedCommandTableAddress, (PBYTE)MAddSharedCommandTableHook, true); MAddSharedCommandTableDet.Apply(); }Creditos:Jacob - por codar a source.Eu - por ser um dos unicos a conseguir e postar aqui.