gcr_fc
Bronze Membergcr_fc's Achievements
-
gcr_fc começou a seguir Descompilção CreateSubGuild TMSrv 7.57 e Descompilção CreateGuild TMSrv 7.57
-
caso queiram usar troquem pMob_New para pMob e pUser_New para pUser //TMSrv 7.57 00586550 int CreateGuild(int conn, const char* guildName) { //Função Ok int clan = pMob_New[conn].MOB.Clan; if (clan != KINGDOM_BLUE && clan != KINGDOM_RED) { SendClientMessage(conn, FALSE, _NN_Only_InKingdom_B_R); return FALSE; } if (WarDay == GuildDay) { SendClientMessage(conn, FALSE, _NN_NotEquip_Saturday); return FALSE; } if (VsModeState == 1) { SendClientMessage(conn, FALSE, _NN_VS_Server); return FALSE; } if (ServerIndex == -1) { pLog.Error("Buy Guild Item, But, Server Index Undefined", pUser_New[conn].AccountName, pUser_New[conn].IP); return FALSE; } // 00586638 if (GuildCounter == 0) { pLog.Error("Buy Guild Item, But, Guild Counter Zero", pUser_New[conn].AccountName, pUser_New[conn].IP); return FALSE; } // 00586673 if (GuildCounter >= MAX_GUILD) { SendClientMessage(conn, FALSE, _NN_Not_GuildSlotInSrv); pLog.Error("GuildCounter Max.", pUser_New[conn].AccountName, pUser_New[conn].IP); GuildCounter = MAX_GUILD; return FALSE; } // 005866CE int nameLen = strlen(guildName); //Local.3 if (nameLen >= 12 || nameLen <= 0) { SendClientMessage(conn, FALSE, _NN_GSTRING_ERR); return FALSE; } // 00586701 if (pMob_New[conn].Ext2.Quest[9] == 1) { return FALSE; } int inUseName = CheckGuildName(guildName); //Local.6 if (inUseName == TRUE) { SendClientMessage(conn, FALSE, _NN_CANT_USE_ID); return FALSE; } if (pMob_New[conn].MOB.Guild != 0) { return FALSE; } // 00586761 int cost = CreateGuildCost; //Local.9 if ((pMob_New[conn].MOB.Coin - cost) < 0) { SendClientMessage(conn, FALSE, _NN_Not_Enough_Money); return FALSE; } // 00586795 int guildId = (ServerIndex * MAX_GUILD) + GuildCounter; //Local.15 int server = guildId / MAX_GUILD; //Local.18 int guild = guildId & (MAX_GUILD - 1); //Local.21 if (g_pGuildList[server][guild].GuildIndex != 0) { pLog.Error(pLog.Format("Create Guild Samed Index {}-{}-{}", server, guild, guildId), pUser_New[conn].AccountName, pUser_New[conn].IP); GuildCounter++; return FALSE; } // 0058683C pMob_New[conn].MOB.Guild = guildId; pMob_New[conn].MOB.GuildLevel = 9; // Líder pMob_New[conn].GetCurrentScore(conn); GuildCounter++; pMob_New[conn].MOB.Coin -= cost; SendUpdateCoin(conn); SendClientMessage(conn, FALSE, _SN_CREATEGUILD, pLog.Format("{}", guildName)); // 005868D1 MSG_CreateMob pCreateMob{}; GetCreateMob(conn, &pCreateMob); GridMulticast(pMob_New[conn].TargetX, pMob_New[conn].TargetY, (MSG_STANDARD*)&pCreateMob, FALSE); SaveUser(conn, 0); pLog.System(pLog.Format("Create Guild Medal {}({}), Idx:{} Count:{}", pMob_New[conn].MOB.MobName, guildName, guildId, GuildCounter), pUser_New[conn].AccountName, pUser_New[conn].IP); MSG_CreateGuild pCreateGuild{}; pCreateGuild.Header.Type = _MSG_CreateGuild; pCreateGuild.Header.ID = conn; pCreateGuild.Header.Size = sizeof(MSG_CreateGuild); pCreateGuild.GuildId = guildId; strncpy_s(pCreateGuild.GuildName, 12, guildName, 12); pCreateGuild.Citizen = GetCitizen(conn); DBServerSocket.SendOneMessage((char*)&pCreateGuild, pCreateGuild.Header.Size); return TRUE; }
-
caso queiram usar troquem pMob_New para pMob e pUser_New para pUser //TMSrv 7.57 00586A60 int CreateSubGuild(int conn, const char* targetName) { //Função Ok if (WarDay == GuildDay) { SendClientMessage(conn, FALSE, _NN_NotEquip_Saturday); return FALSE; } // 00586AAD int guildId = pMob_New[conn].MOB.Guild; //Local.3 if (guildId == 0 || pMob_New[conn].MOB.GuildLevel < 9) { SendClientMessage(conn, FALSE, _NN_Only_Guild_Master_Can); return FALSE; } // 00586AF3 int cost = CreateSubGuildCost; //Local.6 if ((pMob_New[conn].MOB.Coin - cost) < 0) { SendClientMessage(conn, FALSE, _NN_Not_Enough_Money); return FALSE; } // 00586B27 char firstName[64]{}; //Local.24 char lastName[64]{}; //Local.42 sscanf_s(targetName, "%s %s", firstName, 64, lastName, 64); int nameLen = strlen(firstName); //Local.45 if (nameLen >= 12 || nameLen <= 0) { SendClientMessage(conn, FALSE, _NN_GSTRING_ERR); return FALSE; } // 00586BA6 int targetConn = FindUserByName(lastName); if (targetConn == 0) { SendClientMessage(conn, FALSE, _NN_Not_Connected); return FALSE; } if (targetConn == conn) { SendClientMessage(conn, FALSE, _NN_Cant_Use_To_Yourself); return FALSE; } // 00586BF9 if (pMob_New[targetConn].MOB.Guild != guildId) { SendClientMessage(conn, FALSE, _NN_SNot_GuildMember, pLog.Format("{}", pMob_New[targetConn].MOB.MobName)); return FALSE; } int targetRank = pMob_New[targetConn].MOB.GuildLevel; if (targetRank != 0 && targetRank != 1) { return FALSE; } // 00586C4A int targetCape = pMob_New[targetConn].MOB.Equip[CAPE].Index; //Local.51 int targetKingdom = BASE_GetKingdom(targetCape); //Local.54 if (targetKingdom == 0 || targetKingdom != pMob_New[conn].MOB.Clan) { SendClientMessage(conn, FALSE, _NN_Not_SameKingdom); return FALSE; } // 00586CB1 int server = guildId / MAX_GUILD; //Local.57 int guild = guildId & (MAX_GUILD - 1); //Local.60 int subSlot = 0; //Local.63 for (int i = 1; i < 4; i++) { //Local.66 if (g_pGuildList[server][guild].GuildName[i][0] == 0 && g_pGuildList[server][guild].GuildName[i][1] == 0) { subSlot = i; break; } } // 00586D68 if (subSlot == 0 || subSlot == 4) { pLog.System(pLog.Format("Create Sub Guild Can Not {} ", g_pGuildList[server][guild].GuildName[0]), pUser_New[conn].AccountName, pUser_New[conn].IP ); return FALSE; } // 00586DDB strncpy_s(g_pGuildList[server][guild].GuildName[subSlot], 12, firstName, 12); pLog.System(pLog.Format("Create Sub Guild {} - {}", g_pGuildList[server][guild].GuildName[0], g_pGuildList[server][guild].GuildName[subSlot]), pUser_New[conn].AccountName, pUser_New[conn].IP ); // 00586E99 SendClientMessage(conn, FALSE, _SN_CREATEGUILD, pLog.Format("{}-{}", g_pGuildList[server][guild].GuildName[0], g_pGuildList[server][guild].GuildName[subSlot])); // 00586F0A STRUCT_ITEM newMedal{}; //EBP-118 newMedal.EF1 = EF_HWORDGUILD; newMedal.EFV1 = (guildId >> 8) & 0xFF; newMedal.EF2 = EF_LWORDGUILD; newMedal.EFV2 = guildId & 0xFF; pMob_New[targetConn].MOB.Guild = BASE_GetGuild(&newMedal); pMob_New[targetConn].MOB.GuildLevel = subSlot + 2; // 00586F81 SaveUser(targetConn, 0); pMob_New[conn].MOB.Coin -= cost; SendUpdateCoin(conn); g_pGuildList[server][guild].GuildName[subSlot][10] = '\0'; g_pGuildList[server][guild].GuildName[subSlot][11] = '\0'; // 00587004 MSG_CreateSubGuild pSubGuild{}; pSubGuild.Header.Type = _MSG_CreateSubGuild; pSubGuild.Header.ID = conn; pSubGuild.Header.Size = sizeof(MSG_CreateSubGuild); pSubGuild.TargetConn = targetConn; pSubGuild.GuildId = guildId; pSubGuild.SubSlot = subSlot; strncpy_s(pSubGuild.SubGuildName, 12, firstName, 12); DBServerSocket.SendOneMessage((char*)&pSubGuild, pSubGuild.Header.Size); return TRUE; }
-
gcr_fc começou a seguir Novo sistema de logs
-
Fala pessoal blz? estou entrando de ferias da oficina e vou dar uma focada no meu emulador novamente, entao refiz o sistema de log padrao e vou disponibilizar aqui caso alguem tenha interesse em usar ou melhorar. Segue o link do Projeto: GitHub GuiCan na main tem uma implementação simples so para teste e poderem ver como funciona. ficou bem bacana pode ser expandida conforme a necessidade e aprimorada tem sistema de rotação de logs quando chega ao tamanha maximo do arquivo depois de X dias os arquivos sao zipados e se tiver configurado pode ser feito upload para algum servidor ftp se sua escolha para guardar backups apos X dias os logs antigos sao removidos. basicamente é isso.
-
gcr_fc começou a seguir Descompilação TrainingCamp , Descompilção CUser TMSrv 7.57+ , Descompilação Exec_MSG_ReqRanking 0x39F - TMsrv 7.56 / TMsrv 7.57 e 2 outros
-
gcr_fc obteve troféu Feliz Natal 2024
-
void ProcessGoldenDragon(int conn, int npcId, int future) { int ret = FALSE; if (pMob[conn].MOB.Equip[PET].Index == 4060) //Immaturity_Angel { int itemSanc = BASE_GetItemSanc(&pMob[conn].MOB.Equip[PET]); int sanc9plus = TRUE; if (itemSanc < 9) sanc9plus = FALSE; if (pMob[conn].Affect[MAX_AFFECT - 1].Type) sanc9plus = FALSE; if (pMob[conn].CheckEvolution() != ARCH) { sanc9plus = FALSE; SendClientMessage(conn, FALSE, _NN_Need_Trans); } if (sanc9plus) { STRUCT_ITEM item{}; item.Index = 5338; //Ideal item.EF1 = EF_NOTRADE; item.EFV1 = EF_NOTRADE; ret = SendPutItemInvCarry(conn, 0, &item); } //004F893D if (ret) { memset(&pMob[conn].MOB.Equip[PET], 0, sizeof STRUCT_ITEM); SendItem(conn, EQUIP_TYPE, PET, &pMob[conn].MOB.Equip[PET]); pMob[conn].Affect[MAX_AFFECT - 1].Type = 49; pMob[conn].Affect[MAX_AFFECT - 1].Level = 0; pMob[conn].Affect[MAX_AFFECT - 1].Time += 75600; pMob[conn].GetCurrentScore(conn); SendAffect(conn); SendClientMessage(conn, FALSE, _NN_Congratulations); } return; } //004F8A06 if(CombineTreasureMap(conn)) return; for (int i = 0; i < MAX_VISIBLE_INVENTORY; i++) { if (pMob[conn].MOB.Inventory[i].Index <= 0) continue; for (int j = 0; j < MAX_TREASURE; j++) { if (g_pTreasure[j].Source <= 0) continue; if (pMob[conn].MOB.Inventory[i].Index != g_pTreasure[j].Source) continue; //004F8ACF char tmpBuffer[128]{}; sprintf_s(temp, "tra,_gold_ 0"); BASE_GetItemCode(&pMob[conn].MOB.Inventory[i], tmpBuffer); strcat(temp, tmpBuffer); Log(temp, pUser[conn].AccountName, pUser[conn].IP); memset(&pMob[conn].MOB.Inventory[i], 0, sizeof STRUCT_ITEM); SendItem(conn, INVEN_TYPE, i, &pMob[conn].MOB.Inventory[i]); int sortItem = rand() % 1000; STRUCT_ITEM item{}; if (sortItem < g_pTreasure[j].Rate[0]) memcpy(&item, &g_pTreasure[j].Target[0], sizeof STRUCT_ITEM); else if (sortItem < g_pTreasure[j].Rate[1]) memcpy(&item, &g_pTreasure[j].Target[1], sizeof STRUCT_ITEM); else if (sortItem < g_pTreasure[j].Rate[2]) memcpy(&item, &g_pTreasure[j].Target[2], sizeof STRUCT_ITEM); else if (sortItem < g_pTreasure[j].Rate[3]) memcpy(&item, &g_pTreasure[j].Target[3], sizeof STRUCT_ITEM); else if (sortItem < g_pTreasure[j].Rate[4]) memcpy(&item, &g_pTreasure[j].Target[4], sizeof STRUCT_ITEM); if (!item.Index) { SendClientMessage(npcId, TRUE, _NN_Next_Chance); return; } sprintf_s(temp, "tra,%s 0", pUser[conn].AccountName); BASE_GetItemCode(&item, tmpBuffer); strcat(temp, tmpBuffer); Log(temp, "_gold_", pUser[conn].IP); if (PutItem(conn, &item)) { SendClientMessage(npcId, TRUE, _NN_Congratulations); return; } } } //004F8DCF int crystal[7]{}; int crystalCount = 0; for (int i = 0; i < MAX_VISIBLE_INVENTORY; i++) { if (pMob[conn].MOB.Inventory[i].Index < 421 || pMob[conn].MOB.Inventory[i].Index > 427) continue; crystal[pMob[conn].MOB.Inventory[i].Index - 421] = 1; crystalCount++; } //004F8E78 if (!crystal[0] || !crystal[1] || !crystal[2] || !crystal[3] || !crystal[4] || !crystal[5] || !crystal[6]) { SendClientMessage(npcId, TRUE, _NN_Gather_7_Clistals); return; } if(!pMob[conn].MOB.Inventory[WEAPON].Index) { SendClientMessage(npcId, TRUE, _NN_Equip_Weapon_To_Enchant); return; } if (pMob[conn].MOB.Inventory[WEAPON].Index >= 3000 && pMob[conn].MOB.Inventory[WEAPON].Index < 3200) { SendClientMessage(npcId, TRUE, _NN_Equip_Weapon_To_Enchant); return; } int weaponMobType = BASE_GetItemAbility(&pMob[conn].MOB.Inventory[WEAPON], EF_MOBTYPE); if (weaponMobType == ARCH || weaponMobType == CELESTIAL) { SendClientMessage(npcId, TRUE, _NN_NOT_TRANS3ITEM); return; } SendEmotion(conn, 23, 0); STRUCT_ITEM weapon = pMob[conn].MOB.Inventory[WEAPON]; STRUCT_ITEM tmpWeapon = weapon; int calcItemLvl = (crystalCount / 10) * 25; int itemReqLvl = g_pItemList[weapon.Index].ReqLvl; weapon.EF1 = 0; weapon.EFV1 = 0; weapon.EF2 = 0; weapon.EFV2 = 0; weapon.EF3 = 0; weapon.EFV3 = 0; SetItemBonus(&weapon, calcItemLvl + itemReqLvl, TRUE, 1104, FALSE); for (int i = 0; i < MAX_VISIBLE_INVENTORY; i++) { if (pMob[conn].MOB.Inventory[i].Index < 421 || pMob[conn].MOB.Inventory[i].Index > 427) continue; pMob[conn].MOB.Inventory[i].Index = 0; memset(&pMob[conn].MOB.Inventory[i], 0, sizeof STRUCT_ITEM); } SendCarry(conn); SendItem(conn, EQUIP_TYPE, WEAPON, &weapon); SendClientMessage(npcId, TRUE, _SN_Now_I_Will_Enchant_Your, pMob[conn].MOB.MobName); SetTick(conn, 44, 200, 200); SendScore(conn); sprintf_s(temp, "etc,crystal %d-%d from %d:%d %d:%d %d:%d to %d:%d %d:%d %d:%d", crystalCount, tmpWeapon.Index, tmpWeapon.EF1, tmpWeapon.EFV1, tmpWeapon.EF2, tmpWeapon.EFV2, tmpWeapon.EF3, tmpWeapon.EFV3, weapon.EF1, weapon.EFV1, weapon.EF2, weapon.EFV2, weapon.EF3, weapon.EFV3); Log(temp, pUser[conn].AccountName, pUser[conn].IP); }
- 2 respostas
-
- 53
-
-
-
gcr_fc obteve troféu WebCheats#2023
-
gcr_fc obteve troféu Feliz Páscoa 2023
-
gcr_fc obteve troféu Arauto
-
gcr_fc obteve troféu Old Member
-
gcr_fc obteve troféu Extrovertido!
-
//00420ED0 addr da AddMessage na TMSrv 7.56 BOOL CPSock::AddMessage(char* pMsg, int Size) { int Keyword = 0; //local 2 if (SendQueue[0] != 0) { //00420F03 if (SendCount > 15) { //00420F10 if (EncodeKey != 0) { //00420F19 int encKey = EncodeKey; //local 3 char key = (char)(encKey); //local 4 //00420F28 if (key == 0) key = (char)(encKey + 3); //00420F39 if (key == 0) key = 13; //00420F45 Keyword = ((encKey + 2) + (encKey + 3)) - ((encKey + 1) * key); if (Keyword == 0) Keyword = (char)(encKey); //00420F77 Keyword ^= 255; } //00420F85 else { if ((SendQueue[15] % 2) != 0) //004207F1 Keyword = ((SendQueue[13] + SendQueue[11]) - SendQueue[9]) + 4; else //00420812 Keyword = (SendQueue[5] + (SendQueue[1] + SendQueue[3])) - 87; Keyword ^= 255; } } //00420FED else if (SendQueue[0] != 0) { if (SendCount > 15) { if ((SendQueue[15] % 2) != 0) //00421005 Keyword = ((SendQueue[13] + SendQueue[11]) - SendQueue[9]) + 4; else //0042103E Keyword = (SendQueue[5] + (SendQueue[1] + SendQueue[3])) - 87; Keyword ^= 255; } //0042106A else { Keyword = SendQueue[SendCount]; Keyword ^= 255; SendCount++; } } } //00421096 BOOL err = AddMessage(pMsg, Size, Keyword); return err; } //00421140 addr da AddMessage na TMSrv 7.56 BOOL CPSock::AddMessage(char* pMsg, int Size, int sendKeyWord) { //0042115D MSG_STANDARD packet = *(MSG_STANDARD*)(pMsg); //local 2 if (Sock <= EMPTY_SOCKET) { ErrCount = 10; return FALSE; } //0042117C if (nSendPosition + Size >= SEND_BUFFER_SIZE) { ErrCount = 1; return FALSE; } //0042119E unsigned char iKeyWord = sendKeyWord; //local 3 if (sendKeyWord == 0) iKeyWord = rand() % 256; //004211C0 unsigned char KeyWord = pKeyWord[iKeyWord][0]; //local 4 unsigned char checkSum = 0; //local 5 packet.Size = Size; packet.KeyWord = iKeyWord; packet.CheckSum = checkSum; packet.ClientTick = CurrentTime; LastSendTime = CurrentTime; unsigned char Sum1 = 0; //local 6 unsigned char Sum2 = 0; //local 7 int pos = KeyWord; //local 8 for (int i = 4; i < Size; i++, pos++) //local 9 { Sum1 = Sum1 + pMsg[i]; int qKeyWord = pos % 256; //local 10 unsigned char Trans = pKeyWord[qKeyWord][1]; //local 11 int mod = i & 3; //local 12 if (mod == 0) pSendBuffer[i + nSendPosition] = pMsg[i] + (Trans * 2); else if (mod == 1) pSendBuffer[i + nSendPosition] = pMsg[i] - (Trans >> 3); else if (mod == 2) pSendBuffer[i + nSendPosition] = pMsg[i] + (Trans * 4); else if (mod == 3) pSendBuffer[i + nSendPosition] = pMsg[i] - (Trans >> 5); Sum2 = Sum2 + (pSendBuffer[i + nSendPosition]); } //00421350 checkSum = Sum2 - Sum1; packet.CheckSum = checkSum; //00421370 memcpy(&pSendBuffer[nSendPosition], pMsg, 4); nSendPosition = nSendPosition + Size; return TRUE; } Como de costume o ideal é fazer uma revisão
- 2 respostas
-
- 51
-
-

