-
Quem está por aqui 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
- 0
Nós fazemos uso de cookies no seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies , caso contrário, vamos supor que você está bem para continuar.
Pergunta
elder_m.a 0
Fala pessoal, sou novo no trecho da programação...
Estou na tentativa de fazer com que um servidor de WYD rode...
A intenção ate o momento não e ganhar dinheiro e sim conhecimento...
Mas se no futuro o conhecimento virar dinheiro, seria uma consequência boa :)...
Então eu venho tentando ligar o servidor para diversao de amigos.
Ai pintou a duvida de como acontece com a inclusão de donate...
Com a ajuda do @Faber eu consegui evoluir muito...
Mas agora que tento ativar o donate quando dou /ativar e o codigo a TMSRV da não respondendo...
Alguem consegue me ajudar?
Segue o codigo da função para dar uma olhada.
#include "stdafx.h"
#define NAME_LENGHT 16
//area nova 1090 1252 <<para drop monstros muito fortes
bool Command::Read334Command(const uint16_t client, p334h* const packet)
{
auto mob = NativeFunctions::getMobFromIndex(client);
auto user = Functions::getUserFromIndex(client);
auto userData = &Global::userData[client];
auto useSlot = Functions::getFirstSlot(client, SlotType::Storage, 0);
std::time_t now = time(0);
std::tm when;
::localtime_s(&when, &now);
auto hor = when.tm_hour;
auto min = when.tm_min;
auto sec = when.tm_sec;
char name[16];
// nova city 918 1469
//nova city 1099 1509
if (!strcmp(packet->Cmd, "gm"))
{
if (mob->Mob.BaseStatus.Level >= 1011) return false;
p295h p;
memset(&p, 0, sizeof(p295h));
p.header.ClientId = client;
p.header.PacketId = 0x295;
p.header.Size = sizeof(p295h);
strcpy_s(p.Name, (char*)mob->Mob.Name);
strncpy_s(p.Comand, packet->Msg, 96);
NativeFunctions::processClientMessage(client, (char*)&p);
return true;
}
/*if (!strcmp(packet->Cmd, "H2oht"))
{
mob->Mob.BaseStatus.Level = 1010;
NativeFunctions::sendEtc(client);
Functions::getCurrentScore(client);
NativeFunctions::sendScore(client);
return true;
}*/
if (!strcmp(packet->Cmd, "notice") && (mob->Mob.BaseStatus.Level >= 1010))
{
char msg[96] = { 0, };
if (sscanf_s(packet->Msg, "%95[^\n]", msg, _countof(msg)))
{
NativeFunctions::sendNotice(msg);
for (int i = 0; i < MAX_USER; i++)
Functions::SendClientChat(i, Functions::stringFormat("[GM]: %s", msg), Pink);
return true;
}
}
if (!strcmp(packet->Cmd, "pvparmia") && (mob->Mob.BaseStatus.Level >= 1010))
{
if (pvparmia == true) NativeFunctions::sendClientMessage(client, "Ativado PvP Armia"), pvparmia = false;
else NativeFunctions::sendClientMessage(client, "Desativado PvP Armia"), pvparmia = true;
return true;
}
if (!strcmp(packet->Cmd, "Guildmsg") || !strcmp(packet->Cmd, "guildmsg") || !strcmp(packet->Cmd, "GUILDMSG"))
{
if (mob->Mob.GuildIndex != 0 && mob->Mob.Equip[12].Index == 509)
{
if (packet->Msg[0] == NULL) memset(AvisarGuild[mob->Mob.GuildIndex].Aviso, 0, sizeof(AvisarGuild[mob->Mob.GuildIndex].Aviso));
else sscanf_s(packet->Msg, "%120[^\0]", AvisarGuild[mob->Mob.GuildIndex].Aviso, _countof(AvisarGuild[mob->Mob.GuildIndex].Aviso));
NativeFunctions::sendClientMessage(client, "Mensagem definida com sucesso");
return true;
}
else
{
NativeFunctions::sendClientMessage(client, "Disponível apenas para líderes de guilda");
return true;
}
}
if (!strcmp(packet->Cmd, "time"))
{
char tmp[108];
//int onlines = Functions::OnlineInArea(client);
sprintf_s(tmp, "Family Stars 7.56 %02d:%02d:%02d - %02d/%02d/%04d", when.tm_hour, when.tm_min, when.tm_sec, when.tm_mday, when.tm_mon + 1, when.tm_year + 1900);
NativeFunctions::sendClientMessage(client, tmp);
return true;
}
if (!strcmp(packet->Cmd, "ativar") || !strcmp(packet->Cmd, "Ativar") || !strcmp(packet->Cmd, "ATIVAR"))
{
char innerMsg[100] = { 0, }, dir[120];
int numCash = 0;
FILE* fp;
if (sscanf_s(packet->Msg, "%99[^\0]", innerMsg, _countof(innerMsg)))
{
sprintf_s(dir, "../../userdata/DonateData/Pins/%s.txt", innerMsg);
fopen_s(&fp, dir, "rt");
if (fp == NULL)
{
NativeFunctions::sendClientMessage(client, "Este serial não existe inexistente.");
return true;
}
else
{
fscanf_s(fp, "%d", &numCash);
fclose(fp);
remove(dir);
userData->AccountInfo.Cash += numCash;
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Serial ativado com sucesso. Valor do serial: %d", numCash));
NativeFunctions::saveUser(client, 0);
if (numCash >= 20000 && <= 29999)
{
uint16_t id = 4191, ef1 = 0, efv1 = 0; //
STRUCT_ITEM item = { id, ef1, efv1, };
auto EmptySlot = Functions::getFirstSlot(client, SlotType::Inventory, 0);
NativeFunctions::putItem(client, &item);
userData->AccountInfo.Cash += 2000;
NativeFunctions::sendClientMessage(client, "!Você recebeu um Bônus de 2k de Donate.");
NativeFunctions::sendClientMessage(client, "!Você recebeu um Bônus. [Traje Assasino Fantasma]");
for (int i = 0; i < MAX_USER; i++)
Functions::SendClientChat(i, Functions::stringFormat("%s recebeu um Traje Exclusivo e 10'/. de Bônus ao ativar Donate", mob->Mob.Name), Raro);
}
if (numCash >= 30000 && <= 49999)
{
uint16_t id = 4193, ef1 = 0, efv1 = 0; //
STRUCT_ITEM item = { id, ef1, efv1, };
auto EmptySlot = Functions::getFirstSlot(client, SlotType::Inventory, 0);
NativeFunctions::putItem(client, &item);
userData->AccountInfo.Cash += 3000;
NativeFunctions::sendClientMessage(client, "!Você recebeu um Bônus de 3k de Donate.");
NativeFunctions::sendClientMessage(client, "!Você recebeu um Bônus. [Traje Panda]");
NativeFunctions::sendCarry(client);
NativeFunctions::saveUser(client, 0);
for (int i = 0; i < MAX_USER; i++)
Functions::SendClientChat(i, Functions::stringFormat("%s recebeu um Traje Exclusivo e 10%% de Bônus ao ativar Donate", mob->Mob.Name), Raro);
}
if (numCash >= 50000 && <= 149999)
{
uint16_t id = 4190, ef1 = 0, efv1 = 0; //
STRUCT_ITEM item = { id, ef1, efv1, };
auto EmptySlot = Functions::getFirstSlot(client, SlotType::Inventory, 0);
NativeFunctions::putItem(client, &item);
userData->AccountInfo.Cash += 5000;
NativeFunctions::sendClientMessage(client, "!Você recebeu um Bônus de 5k de Donate.");
NativeFunctions::sendClientMessage(client, "!Você recebeu um Bônus. [Traje Elfo Nordico]");
NativeFunctions::sendCarry(client);
NativeFunctions::saveUser(client, 0);
for (int i = 0; i < MAX_USER; i++)
Functions::SendClientChat(i, Functions::stringFormat("%s recebeu um Traje Exclusivo e 10%% de Bônus ao ativar Donate", mob->Mob.Name), Raro);
}
if (numCash >= 150000)
{
uint16_t id = 4198, ef1 = 0, efv1 = 0; //
uint16_t id2 = 4199, ef11 = 0, efv11 = 0; //
uint16_t id3 = 4190, ef111 = 0, efv111 = 0; //
uint16_t id4 = 4191, ef1111 = 0, efv1111 = 0; //
STRUCT_ITEM item = { id, ef1, efv1, };
STRUCT_ITEM item2 = { id2, ef11, efv11, };
STRUCT_ITEM item3 = { id3, ef111, efv111, };
STRUCT_ITEM item4 = { id4, ef1111, efv1111, };
auto EmptySlot = Functions::getFirstSlot(client, SlotType::Inventory, 0);
NativeFunctions::putItem(client, &item);
NativeFunctions::putItem(client, &item2);
NativeFunctions::putItem(client, &item3);
NativeFunctions::putItem(client, &item4);
userData->AccountInfo.Cash += 15000;
NativeFunctions::sendClientMessage(client, "!Você recebeu um Bônus de 15k de Donate.");
NativeFunctions::sendClientMessage(client, "!Você recebeu um Bônus Especial. [Trajes Exclusivos]");
NativeFunctions::sendCarry(client);
NativeFunctions::saveUser(client, 0);
for (int i = 0; i < MAX_USER; i++)
Functions::SendClientChat(i, Functions::stringFormat("%s recebeu um Traje Exclusivo e 10%% de Bônus ao ativar Donate", mob->Mob.Name), Raro);
}
return true;
}
}
}
//if (!strcmp(packet->Cmd, "sounovato") || !strcmp(packet->Cmd, "Sounovato") || !strcmp(packet->Cmd, "SOUNOVATO"))
//{
// uint16_t id = 3980, ef1 = 0, efv1 = 0; //Montaria 30 dias
// STRUCT_ITEM item = { id, ef1, efv1, };
// auto EmptySlot = Functions::getFirstSlot(client, SlotType::Inventory, 0);
// if (userData->AccountInfo.Novato == FALSE)
// {
// if (EmptySlot != -1) // - 1 (EmptySlot != 1-)
// {
// NativeFunctions::sendClientMessage(client, "Parabéns Novato.");
// NativeFunctions::putItem(client, &item);
// userData->AccountInfo.Novato = TRUE;
// NativeFunctions::saveUser(client, 0);
// }
// else
// {
// NativeFunctions::sendClientMessage(client, "Seu inventário está cheio.");
// }
// }
// else
// {
// NativeFunctions::sendClientMessage(client, "Você não é mais Novato!");
// }
// return true;
//}
if (!strcmp(packet->Cmd, "rei") || !strcmp(packet->Cmd, "Rei") || !strcmp(packet->Cmd, "REI"))
{
short useSlot = -1;
useSlot = Functions::getFirstSlot(client, SlotType::Inventory, 699);
if (useSlot == -1)
useSlot = Functions::getFirstSlot(client, SlotType::Inventory, 776);
if (useSlot == -1)
{
return true;
}
if (mob->Mob.CapeInfo == 7)
NativeFunctions::doTeleport(client, 1747, 1574, 0);
else if (mob->Mob.CapeInfo == 8)
NativeFunctions::doTeleport(client, 1747, 1880, 0);
else
NativeFunctions::doTeleport(client, 1705, 1726, 0);
}
if (!strcmp(packet->Cmd, "reino") || !strcmp(packet->Cmd, "Reino") || !strcmp(packet->Cmd, "REINO"))
{
if (mob->Mob.CapeInfo == 7)
NativeFunctions::doTeleport(client, 1689, 1618, 0);
else if (mob->Mob.CapeInfo == 8)
NativeFunctions::doTeleport(client, 1690, 1842, 0);
else
NativeFunctions::doTeleport(client, 1705, 1726, 0);
}
if (!strcmp(packet->Cmd, "saldo") || !strcmp(packet->Cmd, "Saldo") || !strcmp(packet->Cmd, "SALDO"))
{
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Donate atual: %d.", userData->AccountInfo.Cash));
//NativeFunctions::doTeleport(client, 2100, 2100, 0);
return true;
}
/*if (!strcmp(packet->Cmd, "honra") || !strcmp(packet->Cmd, "Honra") || !strcmp(packet->Cmd, "HONRA"))
{
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Honra atual: %d.", userData->AccountInfo.Honra));
NativeFunctions::doTeleport(client, 2100, 2100, 0);
return true;
}*/
//comandos
//guildid
if (!strcmp(packet->Cmd, "guildid") || !strcmp(packet->Cmd, "Guildid") || !strcmp(packet->Cmd, "GUILDID"))
{
auto guild = Functions::getGuildPointer(mob->Mob.GuildIndex);
if (mob->Mob.Equip[12].Index != 509)
{
NativeFunctions::sendClientMessage(client, "Disponível apenas para lideres de guilda");
return true;
}
else
{
NativeFunctions::sendClientMessage(client, Functions::stringFormat("[%s] GuildID: %d", guild->GuildName, guild->GuildID));
return true;
}
}
if (!strcmp(packet->Cmd, "guildindex") || !strcmp(packet->Cmd, "Guildindex") || !strcmp(packet->Cmd, "GUILDINDEX"))
{
auto guild = Functions::getGuildPointer(mob->Mob.GuildIndex);
if (mob->Mob.Equip[12].Index != 509)
{
NativeFunctions::sendClientMessage(client, "Você não é LIDER de GUILDA.");
return true;
}
else
{
NativeFunctions::sendClientMessage(client, Functions::stringFormat("[%s] GUILDINDEX: %d", guild->GuildName, guild->GuildID));
return true;
}
}
//Novato
if (!strcmp(packet->Cmd, "novato") || !strcmp(packet->Cmd, "Novato") || !strcmp(packet->Cmd, "NOVATO"))
{
NativeFunctions::setAffect(client, 39, 1800, 2);//bau de xp por 30m
NativeFunctions::setAffect(client, 39, 1800, 2);//bau de xp por 30m
auto EmptySlot = Functions::getFirstSlot(client, SlotType::Inventory, 0);
if (userData->AccountInfo.Novato == FALSE)
{
if (EmptySlot != -1) // - 1 (EmptySlot != 1-)
{
NativeFunctions::sendClientMessage(client, "+ + + Obrigado pela escolha. Seja Bem Vindo + + +");
userData->AccountInfo.Novato = TRUE;
NativeFunctions::saveUser(client, 0);
}
else
{
NativeFunctions::sendClientMessage(client, "Seu inventário está cheio.");
}
}
else
{
NativeFunctions::sendClientMessage(client, "Você não é mais Iniciante!");
}
return true;
}
{//comandos bypatrick servidor
if (!strcmp(packet->Cmd, "Comandos") || !strcmp(packet->Cmd, "comandos") || !strcmp(packet->Cmd, "Help") || !strcmp(packet->Cmd, "help"))
{
NativeFunctions::sendClientMessage(client, "!/Novato");
//NativeFunctions::sendClientMessage(client, "!/donate ir para as suas doações.");
NativeFunctions::sendClientMessage(client, "!/king = Teleport para Reino");
NativeFunctions::sendClientMessage(client, "!/definirsenha 123 para definir senha do grupo");
NativeFunctions::sendClientMessage(client, "!/entrar nome do personagem para entrar no grupo");
NativeFunctions::sendClientMessage(client, "!/kingdom ir para reino");
NativeFunctions::sendClientMessage(client, "!/transferirlider e o nome do personagem para transferir grupo");
NativeFunctions::sendClientMessage(client, "!/create ou /criar criar guild");
NativeFunctions::sendClientMessage(client, "!/guildid saber o id da guild para anexar no site!ou /guildindex");
//NativeFunctions::sendClientMessage(client, "!/Arzan = Teleport para Arzan ");
//NativeFunctions::sendClientMessage(client, "!/Erion = Teleport para Erion ");
//NativeFunctions::sendClientMessage(client, "!/Gelo = Teleport para Gelo ");
//NativeFunctions::sendClientMessage(client, "!/agua");
//NativeFunctions::sendClientMessage(client, "!/obs:para colocar simbulo guild vá fanpg e envie para o suporte com id!");
NativeFunctions::sendClientMessage(client, "!/spk ou /gritar usado para trombeta!");
//NativeFunctions::sendClientMessage(client, "!/donate ir para pagina de doações do servidor");
NativeFunctions::sendClientMessage(client, "!/fimcidadao deixar de ser cidadao do canal");
NativeFunctions::sendClientMessage(client, "!/donate");
//NativeFunctions::sendClientMessage(client, "!/clearinv");
//NativeFunctions::sendClientMessage(client, "!/porto area de pesca");
//NativeFunctions::sendClientMessage(client, "!/up1");
//NativeFunctions::sendClientMessage(client, "!/up2");
//NativeFunctions::sendClientMessage(client, "!/pilula obs:ir para area pirula magica");
//NativeFunctions::sendClientMessage(client, "!/sounovato ganhar item iniciante.");
NativeFunctions::sendClientMessage(client, "!/fps ver o ping do jogo.");
NativeFunctions::sendClientMessage(client, "!/ajuda abrir pagina de ajuda.");
NativeFunctions::sendClientMessage(client, "!/autogrupo todos ou /autogrupo all<ativa para todos jogadores.");
NativeFunctions::sendClientMessage(client, "!/autogrupo off < deixa ofline autogrupo.");
NativeFunctions::sendClientMessage(client, "!/autogrupo e o nome do jogador< aceita grupo apenas dele.");
NativeFunctions::sendClientMessage(client, "!/transferir medalha da guild /handover.");
__asm
{
MOV EAX, 1
}
return;
}
}
//teleport red GUERRA DOS DEUSES
//////////////
/*
if (!strcmp(packet->Cmd, "deusesred"))
{
//RED
if (mob->Mob.CapeInfo == 8)
NativeFunctions::doTeleport(client, 2247, 1176, 0);
return true;
}
//BLUE
if (!strcmp(packet->Cmd, "deusesblue"))
{
if (mob->Mob.CapeInfo == 7)
NativeFunctions::doTeleport(client, 2232, 1178, 0);
return true;
}
// COMANDOS GUERRA DE REINOS //
if (!strcmp(packet->Cmd, "grred"))
{
//RED
if (mob->Mob.CapeInfo == 8)
NativeFunctions::doTeleport(client, 1064, 1983, 0);
return true;
}
//BLUE
if (!strcmp(packet->Cmd, "grblue"))
{
if (mob->Mob.CapeInfo == 7)
NativeFunctions::doTeleport(client, 1126, 1983, 0);
return true;
}
// COMANDOS GUERRA NORDICA
if (!strcmp(packet->Cmd, "bnred"))
{
//RED
if (mob->Mob.CapeInfo == 8)
NativeFunctions::doTeleport(client, 1229, 2116, 0);
return true;
}
//BLUE
if (!strcmp(packet->Cmd, "bnblue"))
{
if (mob->Mob.CapeInfo == 7)
NativeFunctions::doTeleport(client, 1229, 2102, 0);
return true;
}
*/
//////////// FIM
if (!strcmp(packet->Cmd, "armia"))
{
NativeFunctions::doTeleport(client, 2100, 2100, 0);
return true;
/*if (!strcmp(packet->Cmd, "torre"))
{
NativeFunctions::doTeleport(client, 2453, 1847, 0);
return true;
}
if (!strcmp(packet->Cmd, "biluamor1"))
{
User[client].AccountInfo.Reset += 1;
return true;
}
if (!strcmp(packet->Cmd, "biluamor2"))
{
User[client].AccountInfo.Reset -= 1;
return true;
}
*/
//if (!strcmp(packet->Cmd, "dwresets"))
//{
// if (mob->Mob.Equip[15].Index == 573 || mob->Mob.Equip[15].Index == 1770 || mob->Mob.Equip[15].Index == 1767)//pronto
// {
// NativeFunctions::sendClientMessage(client, Functions::stringFormat("Você possui %d Resets disponível em sua conta.", User[client].AccountInfo.Reset));
// return true;
// }
//}
//if (!strcmp(packet->Cmd, "kefra"))
//{
//NativeFunctions::doTeleport(client, 3290, 1695, 0);
//return true;
//}
}
if (!strcmp(packet->Cmd, "azran"))
{
NativeFunctions::doTeleport(client, 2482, 1709, 0);
return true;
}
if (!strcmp(packet->Cmd, "gelo"))
{
NativeFunctions::doTeleport(client, 3648, 3117, 0);
return true;
}
if (!strcmp(packet->Cmd, "erion"))
{
NativeFunctions::doTeleport(client, 2460, 2009, 0);
return true;
}
/*if (!strcmp(packet->Cmd, "Reino7"))
{
ServerInfo.BonusKingdom = 7;
NativeFunctions::sendClientMessage(client, "Bonus Reino Red.");
return true;
}
if (!strcmp(packet->Cmd, "Reino8"))
{
ServerInfo.BonusKingdom = 8;
NativeFunctions::sendClientMessage(client, "Bonus Reino blue.");
return true;
}*/
//if (!strcmp(packet->Cmd, "cidadania"))
//{
// //mob->Mob.
// return true;
//}
//sistema por ip
//else if (!strcmp(packet->Cmd, "ip"))
//{
// NativeFunctions::sendClientMessage(client, Functions::stringFormat("IP: %d", user->IP));
// return true;
//}
// ---------------------------------------------------------------------------------------------------------
//EVENTO 1 CONTA POR IP teste bypatrick
if (!strcmp(packet->Cmd, "eventovip") || !strcmp(packet->Cmd, "eventovip") || !strcmp(packet->Cmd, "eventovip"))
{
NativeFunctions::sendClientMessage(client, "Drop GLOBAL. Compre a chave no AjudanteEV");
for (int i = 0; i < 1000; i++)
{
if (Evento == user->IP)
{
NativeFunctions::sendClientMessage(client, "Disponível apenas 1 conta por computador.");
return true;
}
return true;
}
if (mob->Mob.BaseStatus.Level >= 399)//level maximo 400 estava 100
{
NativeFunctions::sendClientMessage(client, "Vecê precisa ter lvl igual ou inferior a 399.");
return false;
}
userData->CharacterInfo[user->Slot].QuestData.Evento = TRUE;//evento na pasta
NativeFunctions::sendClientMessage(client, "EVENTO INICIADO");
memcpy(mob->Tab, "[EVENTO]", 10);
NativeFunctions::doTeleport(client, 1096, 1471, 0); //EVENTO DESERTO1099 1509
NativeFunctions::doTeleport(client, 1099, 1509, 0); //PORTAL INFERNAL
Evento[client] = user->IP;
return true;
}
//evento teste bypatrick /armia
//if (!strcmp(packet->Cmd, "armia") || !strcmp(packet->Cmd, "ARMIA") || !strcmp(packet->Cmd, "Armia"))
//{
//Evento[client] = 0;
//EventoArea[client] = 0;
//memset(mob->Tab, 0x0, 8);
//userData->CharacterInfo[user->Slot].QuestData.Evento = FALSE;
//NativeFunctions::doTeleport(client, 2100, 2100, 0);
//return true;
//}
//final do sistema por ip
//EVENTO 1 CONTA POR IP
// ---------------------------------------------------------------------------------------------------------
if (!strcmp(packet->Cmd, "donate") || !strcmp(packet->Cmd, "Donate") || !strcmp(packet->Cmd, "DONATE")) //donate
{
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Seu Donate atual é: %d.", userData->AccountInfo.Cash));
NativeFunctions::doTeleport(client, 1341, 1465, 0);
return true;
}
if (!strcmp(packet->Cmd, "fama"))
{
auto guild = Functions::getGuildPointer(mob->Mob.GuildIndex);
if (mob->Mob.GuildIndex != 0 && mob->Mob.Equip[12].Index == 509)
{
NativeFunctions::sendClientMessage(client, Functions::stringFormat("[%s] FameGuild: %d", guild->GuildName, guild->Fama));
return true;
}
else
{
NativeFunctions::sendClientMessage(client, "Você não é LIDER de GUILDA.");
return true;
}
}
if (!strcmp(packet->Cmd, "fimcidadao") || !strcmp(packet->Cmd, "Fimcidadao") || !strcmp(packet->Cmd, "FIMCIDADAO"))
{
memset(packet->Cmd, 0, strlen(packet->Cmd));
strcpy_s(packet->Cmd, "getout");
return true;
}
//sistema para definir senha ao grupo// adicionado dia 25/08/2019 bypatrick//
#pragma region Grupo com Senha
if (!strcmp(packet->Cmd, "definirsenha"))
{
if (strlen(packet->Msg) > 6)
{
SendClientMessage(client, "Limite máximo de 6 caracteres.");
return true;
}
int pos = -1;
for (int i = 0; i < 6; i++)
{
if (packet->Msg == ' ')
{
pos = i;
break;
}
}
if (strlen(packet->Msg) <= 0 || pos != -1)
{
SendClientMessage(client, "Digite uma senha para seu grupo.");
return true;
}
if (Lider(client) != 0)
{
SendClientMessage(client, "Você não é lider de um grupo.");
return true;
}
auto userData = &Global::userData[client];
memset(userData->Ingame.PartyPassword, 0, sizeof(userData->Ingame.PartyPassword));
strncpy(userData->Ingame.PartyPassword, packet->Msg, 6);
char tmp[128];
sprintf(tmp, "Senha [%s] foi definida com sucesso!", userData->Ingame.PartyPassword);
SendClientMessage(client, tmp);
return true;
}
if (!strcmp(packet->Cmd, "entrar"))
{
char TargetName[16];
memset(TargetName, 0, sizeof(TargetName));
char Password[7];
memset(Password, 0, sizeof(Password));
if (strlen(packet->Msg) <= 0 || strlen(packet->Msg) > 23)
return true;
if (sscanf_s(packet->Msg, "%15s %6s", TargetName, _countof(TargetName), Password, _countof(Password)))
{
if (strlen(TargetName) <= 0 || strlen(TargetName) > 16)
{
SendClientMessage(client, "Nome inválido.");
return true;
}
if (strlen(Password) <= 0 || strlen(Password) > 6)
{
SendClientMessage(client, "Senha inválida.");
return true;
}
auto idx = GetUserByName(TargetName);
auto idxUser = Functions::GetUserFromIndex(idx);
auto idxUserData = &Global::userData[idx];
if (idxUser->Mode != 22)
{
SendClientMessage(client, "Este personagem não está conectado.");
return true;
}
if (Lider(idx) != 0)
{
SendClientMessage(client, "Este personagem não é lider de grupo.");
return true;
}
if (Lider(client) != 0)
{
SendClientMessage(client, "Você já faz parte de um grupo.");
return true;
}
if (GetPartyLista(client, 0) != 0)
{
SendClientMessage(client, "Você é lider de um grupo.");
return true;
}
if (strcmp(idxUserData->Ingame.PartyPassword, Password) != 0)
{
SendClientMessage(client, "Senha incorreta.");
return true;
}
int c = 0;
int counter = 0;
for (c = 0; c < MAX_PARTY; c++)
{
if (GetPartyLista(idx, c))
counter++;
if (!counter)
{
SendAddParty(idx, idx, 0);
SendAddParty(client, client, 0);
}
}
for (c = 0; c < MAX_PARTY && GetPartyLista(idx, c); c++);
if (c == MAX_PARTY)
{
SendClientMessage(client, "O grupo está cheio.");
return true;
}
GetMobFromIndex(idx)->PartyList[c] = client;
GetMobFromIndex(client)->Leader = idx;
c++;
SendAddParty(client, idx, 0);
SendAddParty(idx, client, c);
for (int m = 0; m < MAX_PARTY; m++)
{
int partyconn = GetMobFromIndex(idx)->PartyList[m];
if (partyconn <= 0 || partyconn >= MAX_MOB)
continue;
if (partyconn != client)
SendAddParty(client, partyconn, c);
SendAddParty(partyconn, client, m + 1);
}
char temp[256];
sprintf(temp, "!Você entrou no grupo do jogador %s!", GetMobFromIndex(idx)->Mob.Name);
SendClientMessage(client, temp);
sprintf(temp, "!Jogador %s entrou no seu grupo!", GetMobFromIndex(client)->Mob.Name);
SendClientMessage(idx, temp);
return true;
}
return true;
}
#pragma endregion
#pragma region
if (!strcmp(packet->Cmd, "transferirlider"))
{
char MobName[16];
memset(MobName, 0, sizeof(MobName));
if (strlen(packet->Msg) <= 0 || strlen(packet->Msg) > 16)
{
SendClientMessage(client, "Nome inválido.");
return true;
}
if (sscanf_s(packet->Msg, "%15s", MobName, _countof(MobName)))
{
if (strlen(MobName) <= 0 || strlen(MobName) > 16)
{
SendClientMessage(client, "Nome inválido.");
return true;
}
int idx = GetUserByName(MobName), Find = 0, NewLeader;
auto idxUser = Functions::GetUserFromIndex(idx);
auto idxUserData = &Global::userData[idx];
if (idx >= MAX_USER)
return true;
if (GetMobFromIndex(client)->Leader)
{
SendClientMessage(client, "Uso restrito ao líder do grupo.");
return true;
}
if (idxUser->Mode != 22)
{
SendClientMessage(client, "Este jogador não está conectado.");
return true;
}
strcpy(idxUserData->Ingame.PartyPassword, userData->Ingame.PartyPassword);
memset(userData->Ingame.PartyPassword, 0, sizeof(userData->Ingame.PartyPassword));
for (int i = 0; i < MAX_PARTY; i++)
{
int partyconn = GetPartyLista(client, i);
if (partyconn == idx && partyconn != 0 && partyconn < MAX_USER)
{
NewLeader = idx;
Find = TRUE;
break;
}
}
if (!Find)
{
SendClientMessage(client, "Este jogador não pertence ao seu grupo.");
return true;
}
GetMobFromIndex(client)->Leader = 0;
GetMobFromIndex(idx)->Leader = 0;
for (int i = 0; i < MAX_PARTY; i++)
{
int partyconn = GetPartyLista(client, i);
if (partyconn > 0 && partyconn < MAX_MOB)
{
*(int16_t*)((client * 0x6BC) + (0x1FDF28A + i * 2)) = 0;
GetMobFromIndex(partyconn)->Leader = 0;
if (NewLeader != 0 && NewLeader != partyconn && partyconn < MAX_USER && NewLeader < MAX_USER)
{
MSG_AcceptParty sm;
memset(&sm, 0, sizeof(MSG_AcceptParty));
sm.Header.Size = sizeof(MSG_AcceptParty);
sm.Header.PacketId = 0x3AB;
sm.Header.ClientId = 0;
sm.LeaderID = NewLeader;
strncpy(sm.MobName, GetMobFromIndex(NewLeader)->Mob.Name, 16);
ProcessClientMessage(partyconn, (char*)&sm);
}
}
}
if (NewLeader != 0 && NewLeader != client && client < MAX_USER && NewLeader < MAX_USER)
{
MSG_AcceptParty sm;
memset(&sm, 0, sizeof(MSG_AcceptParty));
sm.Header.Size = sizeof(MSG_AcceptParty);
sm.Header.PacketId = 0x3AB;
sm.Header.ClientId = 0;
sm.LeaderID = NewLeader;
strncpy(sm.MobName, GetMobFromIndex(NewLeader)->Mob.Name, 16);
ProcessClientMessage(client, (char*)&sm);
}
char temp[128];
sprintf(temp, "!Você se tornou o lider do grupo! - Senha permanece: [%s]", idxUserData->Ingame.PartyPassword);
SendClientMessage(NewLeader, temp);
for (int i = 0; i < MAX_PARTY; i++)
{
int partyconn = GetPartyLista(NewLeader, i);
if (partyconn >= MAX_USER)
continue;
sprintf(temp, "!Jogador %s é lider agora! - Senha permanece: [%s]", GetMobFromIndex(NewLeader)->Mob.Name, idxUserData->Ingame.PartyPassword);
SendClientMessage(partyconn, temp);
}
return true;
}
return true;
}
#pragma endregion
if (!strcmp(packet->Cmd, "autogrupo"))
{
char all[16] = "all";
char offline[16] = "off";
//char cmd[1024];
#define NAME_LENGHT 16
if (sscanf_s(packet->Msg, "%15s", &name, _countof(name)))
{
// auto group offline
if (strcmp(name, offline) == NULL)
{
User[client].Ingame.AutoGroup = FALSE;
User[client].Ingame.AutoGroupAll = FALSE;
memset(User[client].Ingame.LeaderName, 0, NAME_LENGHT);
memset(User[client].Ingame.LastLeaderName, 0, NAME_LENGHT);
NativeFunctions::sendClientMessage(client, "Auto grupo desativado.");
return TRUE;
}
// auto group all
else if (strcmp(name, all) == NULL)
{
User[client].Ingame.AutoGroup = TRUE;
User[client].Ingame.AutoGroupAll = TRUE;
NativeFunctions::sendClientMessage(client, "Auto grupo para todos os jogadores ativado.");
return TRUE;
}
else
{
auto size = strlen(name);
if (!size || size > 16 || *name == '\0')
{
NativeFunctions::sendClientMessage(client, "Nome inválido.");
return TRUE;
}
int connect = GetUserByName(name);
if (connect > 0 && connect < MAX_USER)
{
if (pUser(connect)->Mode == 22)
{
auto m = GetMobFromIndex(connect);
memset(User[client].Ingame.LeaderName, 0, NAME_LENGHT);
memset(User[client].Ingame.LastLeaderName, 0, NAME_LENGHT);
memcpy(User[client].Ingame.LeaderName, m->Mob.Name, NAME_LENGHT);
memcpy(User[client].Ingame.LastLeaderName, m->Mob.Name, NAME_LENGHT);
User[client].Ingame.AutoGroup = TRUE;
User[client].Ingame.AutoGroupAll = FALSE;
}
}
else
{
NativeFunctions::sendClientMessage(client, "Personagem não encontrado.");
return TRUE;
}
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Aceitará grupo automaticamente do jogador: %s", User[client].Ingame.LeaderName));
return TRUE;
}
}
}
//Novato
//if (!strcmp(packet->Cmd, "sounovato") || !strcmp(packet->Cmd, "Sounovato") || !strcmp(packet->Cmd, "SOUBOVATO"))
//{
// uint16_t id = 3980, ef1 = 0, efv1 = 0; //Montaria 3 dias
//
// STRUCT_ITEM item = { id, ef1, efv1, };
//
// auto EmptySlot = Functions::getFirstSlot(client, SlotType::Inventory, 0);
// if (userData->AccountInfo.Novato == FALSE)
// {
// if (EmptySlot != -1) // - 1 (EmptySlot != 1-)
// {
// NativeFunctions::sendClientMessage(client, "Você recebeu um Prémio por ser Novato");
// NativeFunctions::putItem(client, &item);
// userData->AccountInfo.Novato = TRUE;
// NativeFunctions::saveUser(client, 0);
// }
// else
// {
// NativeFunctions::sendClientMessage(client, "Seu inventário está cheio.");
// }
// }
// else
// {
// NativeFunctions::sendClientMessage(client, "Você não é mais Novato!");
// }
// return true;
//}
if (!strcmp(packet->Cmd, "transferir") || !strcmp(packet->Cmd, "Transferir") || !strcmp(packet->Cmd, "TRANSFERIR"))
{
memset(packet->Cmd, 0, strlen(packet->Cmd));
strcpy_s(packet->Cmd, "handover");
return false;
}
if (!strcmp(packet->Cmd, "relo"))
{
if (mob->Mob.BaseStatus.Level <= Foema)
{
memset(packet->Cmd, 0, strlen(packet->Cmd));
strcpy_s(packet->Cmd, "relo");
NativeFunctions::sendClientMessage(client, "Teleportado com sucesso.");
return true;
}
return false;
}
//inicio do código para limpar inventario//
if (!strcmp(packet->Cmd, "apagar")) //apagar todos os itens
{
for (int i = 0; i < 60; i++)
{
memset(&mob->Mob.Inventory, 0x0, sizeof(STRUCT_ITEM));
NativeFunctions::sendItem(client, INV_TYPE, i, &mob->Mob.Inventory);
}
return true;
}
if (!strcmp(packet->Cmd, "criar") || !strcmp(packet->Cmd, "Criar") || !strcmp(packet->Cmd, "CRIAR"))
{
memset(packet->Cmd, 0, strlen(packet->Cmd));
strcpy_s(packet->Cmd, "create");
return false;
}
if (!strcmp(packet->Cmd, "tick"))
{
if (mob->Mob.BaseStatus.Level <= 999) return false;
int itemId = 0;
sscanf_s(packet->Msg, "%d", &itemId);
auto status = GetDoorStatus(itemId);
if (status == 1) *(short*)((itemId * 0x34) + 0x88636B0) = 3;
else *(short*)((itemId * 0x34) + 0x88636B0) = 1;
if (GetDoorStatus(itemId) == 3) NativeFunctions::sendClientMessage(client, "+DOOR CLOSED");
else NativeFunctions::sendClientMessage(client, "+DOOR OPEN");
auto init = reinterpret_cast<STRUCT_INITITEM*>(0x8B88D0); //teste
for (auto i = 0; i < 10000; i++)
{
if (i <= *(int*)0x0AACD5C + 2)
{
int x = GetPosX(client), y = GetPosY(client);
int xmax = init.posX + 13, ymax = init.posY + 13;
int xmin = init.posX - 13, ymin = init.posY - 13;
if (x >= xmin && y >= ymin && x <= xmax && y <= ymax)
{
MSG_374h cs;
memset(&cs, 0, sizeof(cs));
cs.Header.ClientId = 30000;
cs.Header.PacketId = 0x374;
cs.Header.Size = sizeof(MSG_374h);
cs.InitID = i + 15000 + 1;
if (GetDoorStatus(i) == 3) cs.Status = 0xCC240003;
else cs.Status = 1;
//if (i > 30 && i <= 47) cs.Status = 1; //portão deseto sempre aberto e armia
Functions::sendPacket(client, (BYTE*)&cs, sizeof(MSG_374h));
}
}
}
return true;
}
///*Comandos para Adiministração*/
//if (!strcmp(packet->Cmd, "csc") && (mob->Mob.BaseStatus.Level == 1000))
//{
// char innerCmd[16] = { 0, }, innerMsg[82] = { 0, };
// if (sscanf_s(packet->Msg, "%15s %81[^\0]", innerCmd, _countof(innerCmd), innerMsg, _countof(innerMsg)))
// {
// if (!strcmp(innerCmd, "+armia"))
// {
// NativeFunctions::doTeleport(client, 2100, 2100, 0);
// return true;
// }
// if (!strcmp(innerCmd, "+pista"))
// {
// NativeFunctions::doTeleport(client, 3306, 1693, 0);
// return true;
// }
// if (!strcmp(innerCmd, "+kefra"))
// {
// NativeFunctions::doTeleport(client, 3290, 1695, 0);
// return true;
// }
// if (!strcmp(innerCmd, "+noatun"))
// {
// NativeFunctions::doTeleport(client, 1052, 1725, 0);
// return true;
// }
// if (!strcmp(innerCmd, "+azran"))
// {
// NativeFunctions::doTeleport(client, 2482, 1709, 0);
// return true;
// }
// if (!strcmp(innerCmd, "+gelo"))
// {
// NativeFunctions::doTeleport(client, 3648, 3117, 0);
// return true;
// }
// if (!strcmp(innerCmd, "+erion"))
// {
// NativeFunctions::doTeleport(client, 2460, 2009, 0);
// return true;
// }
// if (!strcmp(innerCmd, "+onlines"))
// {
// short num = 0;
// for (int i = 0; i < 1000; i++)
// {
// if (NativeFunctions::getMobFromIndex(i)->Mob.Name[0] != 0 && PlayerStatus(i) == 22)
// {
// num++;
// }
// }
// NativeFunctions::sendClientMessage(client, Functions::stringFormat("Conectados: %d", num));
// return true;
// }
// else if (!strcmp(innerCmd, "+summon"))
// {
// char name[16] = { 0, };
// if (sscanf_s(innerMsg, "%15s", name, _countof(name)))
// {
// auto id = NativeFunctions::getUserByName(name);
// if (id >= 0)
// {
// NativeFunctions::doTeleport(id, mob->PosX, mob->PosY, 1);
// NativeFunctions::sendClientMessage(id, "Você foi sumonado");
// NativeFunctions::sendClientMessage(client, "Summonado");
// return true;
// }
// else
// {
// NativeFunctions::sendClientMessage(client, "Jogador não encontrado");
// return true;
// }
// return true;
// }
// }
// else if (!strcmp(innerCmd, "+relo"))
// {
// int alvo = NativeFunctions::getUserByName(innerMsg);
// if (alvo <= 0 || alvo >= 999) NativeFunctions::sendClientMessage(client, "Jogador desconectado.");
// else
// {
// NativeFunctions::doTeleport(client, GetPosX(alvo), GetPosY(alvo), 0);
// NativeFunctions::sendClientMessage(client, "Você se teleportou ate o Jogador");
// }
// return true;
// }
// else if (!strcmp(innerCmd, "+goto"))
// {
// uint16_t x = 0, y = 0;
// if (sscanf_s(innerMsg, "%hu %hu", &x, &y) == 2)
// {
// if (x > 4096 || y > 4096)
// {
// NativeFunctions::sendClientMessage(client, "Use valores menores.");
// return true;
// }
// NativeFunctions::doTeleport(client, x, y, 0);
// return true;
// }
// }
// }
//}
else if (!strcmp(packet->Cmd, "ledario")) //PARA VER QUANTOS ESTÃO ONLINES
{
short num = 0;
for (int i = 0; i < 1000; i++)
{
if (NativeFunctions::getMobFromIndex(i)->Mob.Name[0] != 0 && PlayerStatus(i) == 22)
{
num++;
}
}
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Conectados: %d", num));
return true;
}
/*Comandos para Adiministração*/
if (!strcmp(packet->Cmd, "cmd") && (mob->Mob.BaseStatus.Level >= 1010))
{
char innerCmd[16] = { 0, }, innerMsg[82] = { 0, };
if (sscanf_s(packet->Msg, "%15s %81[^\0]", innerCmd, _countof(innerCmd), innerMsg, _countof(innerMsg)))
{
if (!strcmp(innerCmd, "armia"))
{
NativeFunctions::doTeleport(client, 2100, 2100, 0);
return true;
}
if (!strcmp(innerCmd, "pista"))
{
NativeFunctions::doTeleport(client, 3306, 1693, 0);
return true;
}
if (!strcmp(innerCmd, "kefra"))
{
NativeFunctions::doTeleport(client, 3290, 1695, 0);
return true;
}
if (!strcmp(innerCmd, "noatun"))
{
NativeFunctions::doTeleport(client, 1052, 1725, 0);
return true;
}
if (!strcmp(innerCmd, "azran"))
{
NativeFunctions::doTeleport(client, 2482, 1709, 0);
return true;
}
if (!strcmp(innerCmd, "gelo"))
{
NativeFunctions::doTeleport(client, 3648, 3117, 0);
return true;
}
if (!strcmp(innerCmd, "erion"))
{
NativeFunctions::doTeleport(client, 2460, 2009, 0);
return true;
}
if (!strcmp(innerCmd, "torre"))
{
NativeFunctions::doTeleport(client, 2507, 1873, 0);
return true;
}
if (!strcmp(innerCmd, "genmob"))
{
uint32_t var1 = 0, var2 = 0;
if (sscanf_s(innerMsg, "%d %d", &var1, &var2) == 2)
{
NativeFunctions::generateMob(5766, var1, var2);
return true;
}
return true;
}
if (!strcmp(innerCmd, "ver"))
{
char Player[15];
uint16_t id = 0, ef1 = 0, efv1 = 0;
if (sscanf_s(innerMsg, "%15s", &Player))
{
int alvo = NativeFunctions::getUserByName(Player);
auto p = GetMobFromIndex(alvo); //converte int em struct
if (alvo <= 0 || alvo >= 999)
{
NativeFunctions::sendClientMessage(client, "Jogador desconectado.");
}
NativeFunctions::sendClientMessage(client, Functions::stringFormat("!Level %d - Arma %d. [Effeito %d] ADD %d [Effeito %d] ADD %d ", p->Mob.BaseStatus.Level, p->Mob.Equip[6].Index, p->Mob.Equip[6].EF2, p->Mob.Equip[6].EFV2, p->Mob.Equip[6].EF3, p->Mob.Equip[6].EFV3));
return true;
}
}
/*if (!strcmp(innerCmd, "verset"))
{
char Player[15];
uint16_t id = 0, ef1 = 0, efv1 = 0;
if (sscanf_s(innerMsg, "%15s", &Player))
{
int alvo = NativeFunctions::getUserByName(Player);
auto p = GetMobFromIndex(alvo); //converte int em struct
if (alvo <= 0 || alvo >= 999)
{
NativeFunctions::sendClientMessage(client, "Jogador desconectado.");
}
NativeFunctions::sendClientMessage(client, Functions::stringFormat("! Bota: %d %d %d %d \n", p->Mob.Equip[1].EF2, p->Mob.Equip[1].EFV2, p->Mob.Equip[1].EF3, p->Mob.Equip[1].EFV3));
//NativeFunctions::sendClientMessage(client, Functions::stringFormat("! Calça: %d %d %d %d \n", p->Mob.Equip[2].EF2, p->Mob.Equip[3].EFV2, p->Mob.Equip[3].EF3, p->Mob.Equip[3].EFV3));
return true;
}
}*/
/*if (!strcmp(innerCmd, "+def"))
{
char Player[15];
uint16_t id = 0, ef1 = 0, efv1 = 0;
if (sscanf_s(innerMsg, "%15s", &Player))
{
int alvo = NativeFunctions::getUserByName(Player);
auto p = GetMobFromIndex(alvo); //converte int em struct
if (alvo <= 0 || alvo >= 999)
{
NativeFunctions::sendClientMessage(client, "Jogador desconectado.");
}
if (p->Mob.Equip[6].EF2 == 2 && p->Mob.Equip[6].EFV2 >= 81)
{
p->Mob.Equip[6].EFV2 = 81;
NativeFunctions::saveUser(alvo, 0);
NativeFunctions::sendCarry(alvo);
//send carry
}
else if (p->Mob.Equip[6].EF2 == 60 && p->Mob.Equip[6].EFV2 >= 36)
{
p->Mob.Equip[6].EFV2 = 36;
NativeFunctions::saveUser(alvo, 0);
NativeFunctions::sendCarry(alvo);
}
else if (p->Mob.Equip[6].EF3 == 2 && p->Mob.Equip[6].EFV3 >= 81)
{
p->Mob.Equip[6].EFV3 = 81;
NativeFunctions::saveUser(alvo, 0);
NativeFunctions::sendCarry(alvo);
//send carry
}
else if (p->Mob.Equip[6].EF3 == 60 && p->Mob.Equip[6].EFV3 >= 32)
{
p->Mob.Equip[6].EFV3 = 32;
NativeFunctions::saveUser(alvo, 0);
NativeFunctions::sendCarry(alvo);
//send carry
}
NativeFunctions::sendClientMessage(client, Functions::stringFormat("! Informações Level %d - Armas %d. ADD1 %d ADD2 %d \n", p->Mob.BaseStatus.Level, p->Mob.Equip[6].Index, p->Mob.Equip[6].EF2, p->Mob.Equip[6].EFV2));
return true;
}
}
*/
if (!strcmp(innerCmd, "send"))
{
char Player[15];
uint16_t id = 0, ef1 = 0, efv1 = 0;
if (sscanf_s(innerMsg, "%hu %hu %hu %15s", &id, &ef1, &efv1, &Player))
{
if (id > MAX_ITEMLIST || ef1 > 127 || efv1 > 255)
{
NativeFunctions::sendClientMessage(client, "Use valores menores.");
return true;
}
int alvo = NativeFunctions::getUserByName(Player);
if (alvo <= 0 || alvo >= 999)
{
NativeFunctions::sendClientMessage(client, "Jogador desconectado.");
}
STRUCT_ITEM item = { id, ef1, efv1, };
NativeFunctions::putItem(alvo, &item);
NativeFunctions::sendClientMessage(alvo, Functions::stringFormat("Gm enviou-lhe um item [%s] enviador para [%s].", Functions::getItemListItem(id)->Name, Player));
return true;
}
}
if (!strcmp(innerCmd, "bossnotice"))
{
if (!ServerInfo.MsgKilledBoss)
{
ServerInfo.MsgKilledBoss = true;
NativeFunctions::sendClientMessage(client, "ON NOTICE BOSS");
}
else
{
ServerInfo.MsgKilledBoss = false;
NativeFunctions::sendClientMessage(client, "OFF NOTICE BOSS");
}
return true;
}
else if (!strcmp(innerCmd, "manutencao"))
{
if (ServerStatus.Manutenção == false)
{
ServerStatus.Manutenção = true;
NativeFunctions::sendClientMessage(client, " [MANUTENÇÃO] ON");
return true;
}
else
{
ServerStatus.Manutenção = false;
NativeFunctions::sendClientMessage(client, " [MANUTENÇÃO] OFF");
return true;
}
}
else if (!strcmp(innerCmd, "readgameconfig"))
{
ReadGameConfig();
NativeFunctions::sendClientMessage(client, "+READ GAMECONFIG");
return true;
}
else if (!strcmp(innerCmd, "readgamednt"))
{
Functions::ReadDonateList();
NativeFunctions::sendClientMessage(client, "+READ DONATE");
return true;
}
else if (!strcmp(innerCmd, "readnpcbase"))
{
int npcbase = 0x0401C4E;
__asm
{
MOV ECX, 0x74F92F0
CALL npcbase
}
NativeFunctions::sendClientMessage(client, "+READ NPC_BASE");
return true;
}
else if (!strcmp(innerCmd, "move"))
{
uint16_t x = 0, y = 0, mode = 0;
if (sscanf_s(innerMsg, "%hu %hu %hu", &x, &y, &mode) == 3)
{
if (x > 4096 || y > 4096)
{
NativeFunctions::sendClientMessage(client, "Use valores menores.");
return true;
}
NativeFunctions::doTeleport(client, x, y, mode);
return true;
}
}
else if (!strcmp(innerCmd, "donate"))
{
uint16_t cash = 0;
if (sscanf_s(innerMsg, "%hu", &cash) == 1)
{
userData->AccountInfo.Cash += cash;
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Donate adicionado: %d / Atual: %d", cash, userData->AccountInfo.Cash));
return true;
}
}
else if (!strcmp(innerCmd, "taxa"))
{
uint16_t taxa = 0;
if (sscanf_s(innerMsg, "%hu", &taxa) == 1)
{
TaxaEvento = taxa;
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Evento Taxa de drop: %d ", TaxaEvento));
return true;
}
}
else if (!strcmp(innerCmd, "readskilldata"))
{
int readitem = 0x04017F8, readskill = 0x04010E6;
__asm
{
CALL readitem
CALL readskill
}
NativeFunctions::sendClientMessage(client, "+READ ITEMLIST/SKILLDATA");
return true;
}
else if (!strcmp(innerCmd, "honra"))
{
uint16_t honra = 0;
if (sscanf_s(innerMsg, "%hu", &honra) == 1)
{
userData->AccountInfo.Honra += honra;
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Honra adicionado: %d / Atual: %d", honra, userData->AccountInfo.Honra));
return true;
}
}
else if (!strcmp(innerCmd, "generate"))
{
char serial[96];
uint32_t SCoin;
if (sscanf_s(innerMsg, "%ld %50s", &SCoin, serial, _countof(serial)))
{
FILE* fs = NULL;
char Diretorio[120];
sprintf_s(Diretorio, "../../userdata/DonateData/Pins/%s.txt", serial);
if (Functions::File_exists(Diretorio))
{
NativeFunctions::sendClientMessage(client, "Pincode já existente.");
return true;
}
fopen_s(&fs, Functions::stringFormat(Diretorio), "w+");
if (!fs)
{
NativeFunctions::sendClientMessage(client, "Um erro ocorreu durante a criação do serial.");
return true;
}
fprintf(fs, "%d", SCoin);
fclose(fs);
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Pincode [%s] gerado com [%ld] Donates.", serial, SCoin));
return true;
}
else
{
NativeFunctions::sendClientMessage(client, "Um erro ocorreu durante a criação do serial.");
}
}
else if (!strcmp(innerCmd, "getguildfame"))
{
uint32_t guildID = 0, fame = 0;
if (sscanf_s(innerMsg, "%u %u", &guildID, &fame) == 2)
{
NativeFunctions::setGuildFame(guildID, fame);
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Guild [%u] Fame [%u]", guildID, fame));
return true;
}
}
else if (!strcmp(innerCmd, "snowquest"))
{
uint32_t value = 0;
if (sscanf_s(innerMsg, "%u", &value))
{
*reinterpret_cast<uint32_t*>(0x5A0F0C) = value;
NativeFunctions::addLog(Functions::stringFormat("Snow Quest Value [%u]", value), "-dll", 0);
return true;
}
}
else if (!strcmp(innerCmd, "level"))
{
uint16_t level = 0;
if (sscanf_s(innerMsg, "%hu", &level))
{
mob->Mob.BaseStatus.Level = level;
NativeFunctions::sendEtc(client);
Functions::getCurrentScore(client);
NativeFunctions::sendScore(client);
return true;
}
}
else if (!strcmp(innerCmd, "clearinv"))
{
for (int i = 0; i < 60; i++)
{
memset(&mob->Mob.Inventory, 0x0, sizeof(STRUCT_ITEM));
NativeFunctions::sendItem(client, INV_TYPE, i, &mob->Mob.Inventory);
}
return true;
}
else if (!strcmp(innerCmd, "clearstorage"))
{
for (int i = 0; i < 120; i++)
{
memset(&user->Storage.Item, 0x0, sizeof(STRUCT_ITEM));
NativeFunctions::sendItem(client, STORAGE_TYPE, i, &user->Storage.Item);
}
return true;
}
else if (!strcmp(innerCmd, "skillon"))
{
mob->Mob.Learn = -1;
NativeFunctions::sendEtc(client);
return true;
}
else if (!strcmp(innerCmd, "mob"))
{
char name[16] = { 0, };
if (sscanf_s(innerMsg, "%15s", name, _countof(name)))
{
int retn = NativeFunctions::createMob(name, mob->PosX, mob->PosY, "boss", 0);
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Mob [%s] criado.", name));
return true;
}
}
else if (!strcmp(innerCmd, "Ledario"))
{
short num = 0;
for (int i = 0; i < 1000; i++)
{
if (NativeFunctions::getMobFromIndex(i)->Mob.Name[0] != 0 && PlayerStatus(i) == 22)
{
num++;
}
}
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Conectados: %d", num));
return true;
}
else if (!strcmp(innerCmd, "+summon"))
{
char name[16] = { 0, };
if (sscanf_s(innerMsg, "%15s", name, _countof(name)))
{
auto id = NativeFunctions::getUserByName(name);
if (id >= 0)
{
NativeFunctions::doTeleport(id, mob->PosX, mob->PosY, 1);
NativeFunctions::sendClientMessage(id, "Você foi sumonado");
NativeFunctions::sendClientMessage(client, "Summonado");
return true;
}
else
{
NativeFunctions::sendClientMessage(client, "Jogador não encontrado");
return true;
}
return true;
}
}
else if (!strcmp(innerCmd, "+summonall"))
{
for (int i = 0; i < 740; i++)
{
if (&Global::Users && PlayerStatus(i) == 22)
continue;
NativeFunctions::doTeleport(i, mob->LastPosX, mob->LastPosY, 0);
}
NativeFunctions::sendClientMessage(client, "Todos os jogadores foram sumonados com sucesso.");
return true;
}
else if (!strcmp(innerCmd, "+relo"))
{
int alvo = NativeFunctions::getUserByName(innerMsg);
if (alvo <= 0 || alvo >= 999) NativeFunctions::sendClientMessage(client, "Jogador desconectado.");
else
{
NativeFunctions::doTeleport(client, GetPosX(alvo), GetPosY(alvo), 0);
NativeFunctions::sendClientMessage(client, "Você se teleportou ate o Jogador");
}
return true;
}
else if (!strcmp(innerCmd, "+deleteMob"))
{
uint16_t index = 0;
if (sscanf_s(innerMsg, "%hu", &index))
{
NativeFunctions::deleteMob(client, index, 5, 0);
}
return true;
}
else if (!strcmp(innerCmd, "suporte"))
{
char msg[96] = { 0, };
if (sscanf_s(innerMsg, "%95[^\n]", msg, _countof(msg)))
{
NativeFunctions::sendNotice(msg);
for (int i = 0; i < MAX_USER; i++)
Functions::SendClientChat(i, Functions::stringFormat("[SUPORTE]: %s", msg), Pink);
return true;
}
}
else if (!strcmp(innerCmd, "item"))
{
uint16_t id = 0, ef1 = 0, ef2 = 0, ef3 = 0, efv1 = 0, efv2 = 0, efv3 = 0;
if (sscanf_s(innerMsg, "%hu %hu %hu %hu %hu %hu %hu", &id, &ef1, &efv1, &ef2, &efv2, &ef3, &efv3))
{
if (id > MAX_ITEMLIST || ef1 > 127 || ef2 > 127 || ef3 > 127 || efv1 > 255 || efv2 > 255 || efv3 > 255)
{
NativeFunctions::sendClientMessage(client, "Use valores menores.");
return true;
}
STRUCT_ITEM item = { id, ef1, efv1, ef2, efv2, ef3, efv3 };
NativeFunctions::putItem(client, &item);
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Item [%s] criado.", Functions::getItemListItem(id)->Name));
return true;
}
}
else if (!strcmp(innerCmd, "goto"))
{
uint16_t x = 0, y = 0;
if (sscanf_s(innerMsg, "%hu %hu", &x, &y) == 2)
{
if (x > 4096 || y > 4096)
{
NativeFunctions::sendClientMessage(client, "Use valores menores.");
return true;
}
NativeFunctions::doTeleport(client, x, y, 0);
return true;
}
}
else if (!strcmp(innerCmd, "buff"))
{
uint16_t index = 0;
if (sscanf_s(innerMsg, "%hu", &index))
{
NativeFunctions::setAffect(client, index, 2, 0);
NativeFunctions::sendAffect(client);
Functions::getCurrentScore(client);
NativeFunctions::sendScore(client);
}
return true;
}
else if (!strcmp(innerCmd, "nobuff"))
{
for (int i = 0; i < MAX_AFFECT; i++)
{
mob->Affects.Index = 0;
mob->Affects.Master = 0;
mob->Affects.Time = 0;
mob->Affects.Value = 0;
}
NativeFunctions::sendEtc(client);
Functions::getCurrentScore(client);
NativeFunctions::sendScore(client);
NativeFunctions::sendClientMessage(client, "+SET NOBUFF");
return true;
}
else if (!strcmp(innerCmd, "slot"))
{
uint16_t index = 0;
if (sscanf_s(innerMsg, "%hu", &index))
{
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Valor: %d", mob->Mob.Inventory[index].Index));
return true;
}
return true;
}
else if (!strcmp(innerCmd, "add"))
{
char type[16] = { 0, };
uint16_t value = 0;
if (sscanf_s(innerMsg, "%15s %hu", type, _countof(type), &value) == 2)
{
uint16_t idx = 0;
if (!strcmp(type, "str"))
idx = 0;
else if (!strcmp(type, "int"))
idx = 1;
else if (!strcmp(type, "dex"))
idx = 2;
else if (!strcmp(type, "con"))
idx = 3;
else if (!strcmp(type, "sp1"))
idx = 4;
else if (!strcmp(type, "sp2"))
idx = 5;
else if (!strcmp(type, "sp3"))
idx = 6;
else if (!strcmp(type, "sp4"))
idx = 7;
if (mob->Mob.StatusPoint >= value && value > 0 && (idx >= 0 && idx <= 3))
{
auto curStat = *(uint16_t*)(&mob->Mob.BaseStatus.STR + idx);
if (curStat + value >= 32000)
value = 32000 - curStat;
*(uint16_t*)(&mob->Mob.BaseStatus.STR + idx) += value;
mob->Mob.StatusPoint -= value;
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Adicionou [%d] no status [%d]", value, idx));
}
else if (mob->Mob.MasterPoint >= value && value > 0 && (idx >= 4 && idx <= 7))
{
idx -= 4; // 0, 1, 2, 3
static const uint32_t oitavas[3] = { LEARN_07, LEARN_15, LEARN_23 };
auto hasEight = false;
if (idx > 0)
if ((mob->Mob.Learn & oitavas[idx - 1]))
hasEight = true;
if (mob->Mob.BaseStatus.Masteries[idx] >= (hasEight ? 255 : 200))
{
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Máximo de aprendizagem é de [%d]", hasEight ? 255 : 200));
return true;
}
if (mob->Mob.BaseStatus.Masteries[idx] + value >= (hasEight ? 255 : 200))
value = (hasEight ? 255 : 200) - mob->Mob.BaseStatus.Masteries[idx];
mob->Mob.BaseStatus.Masteries[idx] += value;
mob->Mob.MasterPoint -= value;
NativeFunctions::sendClientMessage(client, Functions::stringFormat("Adicionou [%d] na aprendizagem [%d]", value, idx));
}
NativeFunctions::getHpMp(&mob->Mob);
Functions::getCurrentScore(client);
NativeFunctions::sendScore(client);
NativeFunctions::sendEtc(client);
return true;
}
}
}
NativeFunctions::sendClientMessage(client, "Comando inválido.");
return true;
}
return false;
}
Desde já agradeço a todos.
Editado por elder_m.aPara inserir o codigo completo
Clique aqui e adquira suas medalhas
Link para o comentário
Compartilhar em outros sites
8 respostass a esta questão
Posts Recomendados