PDA

View Full Version : |Source| Função player reflesh



antoniofr
01/04/2015, 03:36 PM
Segue a função usada para a criação de comandos sem relogar, tinha feito uma função semelhante mais usando a função gObjDel e não vinha funcionando
muito bem, então fui procurando outros métodos e encontrei essas duas funções originais do gameserver.
usei a função gObjTeleport no final porque depois de execultado a função os mobs não apareciam mais.

as offsets usadas são para a versão 97d.



STRUCTS:

struct PMSG_CHARMAPJOINRESULT
{
// static data ------------------------------------

// non-static data --------------------------------
/*<thisrel this+0x0>*/ /*|0x3|*/ struct PBMSG_HEAD h;
/*<thisrel this+0x3>*/ /*|0x1|*/ unsigned char subcode;
/*<thisrel this+0x4>*/ /*|0x1|*/ unsigned char MapX;
/*<thisrel this+0x5>*/ /*|0x1|*/ unsigned char MapY;
/*<thisrel this+0x6>*/ /*|0x1|*/ unsigned char MapNumber;
/*<thisrel this+0x7>*/ /*|0x1|*/ unsigned char Dir;
/*<thisrel this+0x8>*/ /*|0x4|*/ unsigned long Exp;
/*<thisrel this+0xc>*/ /*|0x4|*/ unsigned long NextExp;
/*<thisrel this+0x10>*/ /*|0x2|*/ unsigned short LevelUpPoint;
/*<thisrel this+0x12>*/ /*|0x2|*/ unsigned short Str;
/*<thisrel this+0x14>*/ /*|0x2|*/ unsigned short Dex;
/*<thisrel this+0x16>*/ /*|0x2|*/ unsigned short Vit;
/*<thisrel this+0x18>*/ /*|0x2|*/ unsigned short Energy;
/*<thisrel this+0x1a>*/ /*|0x2|*/ unsigned short Life;
/*<thisrel this+0x1c>*/ /*|0x2|*/ unsigned short MaxLife;
/*<thisrel this+0x1e>*/ /*|0x2|*/ unsigned short Mana;
/*<thisrel this+0x20>*/ /*|0x2|*/ unsigned short MaxMana;
/*<thisrel this+0x22>*/ /*|0x2|*/ unsigned short BP;
/*<thisrel this+0x24>*/ /*|0x2|*/ unsigned short MaxBP;
/*<thisrel this+0x28>*/ /*|0x4|*/ int Money;
/*<thisrel this+0x2c>*/ /*|0x1|*/ unsigned char PkLevel;
/*<thisrel this+0x2d>*/ /*|0x1|*/ unsigned char CtlCode;
/*<thisrel this+0x2e>*/ /*|0x2|*/ short AddPoint;
/*<thisrel this+0x30>*/ /*|0x2|*/ short MaxAddPoint;

// base classes -----------------------------------

// friends ----------------------------------------

// static functions -------------------------------

// non-virtual functions --------------------------

// virtual functions ------------------------------
};

struct PMSG_CHARREGEN
{
PBMSG_HEAD h;
char subcode;
char MapX;
char MapY;
char MapNumber;
char Dir;
unsigned short Life;
unsigned short Mana;
unsigned short BP;
unsigned int Exp;
unsigned int Money;
};


Função:

void Functions::PlayerRefresh(DWORD aIndex)
{
//------------------------------------------------------------
// CHAR MAP JOIN - SEND [CREATE]
//------------------------------------------------------------
PMSG_CHARMAPJOINRESULT lpMsg;
lpMsg.h.c = 0xC3;
lpMsg.h.head = 0xF3;
lpMsg.h.size = 0x33;
lpMsg.subcode = 0x03;
lpMsg.MapX = lpObj[aIndex].X;
lpMsg.MapY = lpObj[aIndex].Y;
lpMsg.MapNumber = lpObj[aIndex].MapNumber;
lpMsg.Dir = lpObj[aIndex].Dir;
lpMsg.Exp = lpObj[aIndex].Experience;
lpMsg.NextExp = lpObj[aIndex].NextExp;
lpMsg.LevelUpPoint = lpObj[aIndex].LevelUpPoints;
lpMsg.Str = lpObj[aIndex].Strength;
lpMsg.Dex = lpObj[aIndex].Dexterity;
lpMsg.Vit = lpObj[aIndex].Vitality;
lpMsg.Energy = lpObj[aIndex].Energy;
lpMsg.Money = lpObj[aIndex].Money;
lpMsg.PkLevel = lpObj[aIndex].PK_Level;
lpMsg.Life = (short)lpObj[aIndex].Life;
lpMsg.MaxLife = (short)((double)lpObj[aIndex].AddLife + lpObj[aIndex].MaxLife);
lpMsg.Mana = (short)lpObj[aIndex].Mana;
lpMsg.MaxMana = (short)((double)lpObj[aIndex].AddMana + lpObj[aIndex].MaxMana);
lpMsg.CtlCode = (short)lpObj[aIndex].Authority;
lpMsg.BP = lpObj[aIndex].BP;
lpMsg.MaxBP = lpObj[aIndex].AddBP + lpObj[aIndex].MaxBP;
DataSend(aIndex, &lpMsg.h.c, (DWORD)lpMsg.h.size);

//------------------------------------------------------------
// CHAR REGEN - SEND [DESTROY]
//------------------------------------------------------------
PMSG_CHARREGEN pMsg;
pMsg.h.c = 0xC1;
pMsg.h.head = 0xF3;
pMsg.h.size = 0x24;
pMsg.subcode = 0x04;
pMsg.Dir = lpObj[aIndex].Dir;
pMsg.MapX = LOBYTE(lpObj[aIndex].X);
pMsg.MapY = LOBYTE(lpObj[aIndex].Y);
pMsg.Life = (float)lpObj[aIndex].Life;
pMsg.Mana = (float)lpObj[aIndex].Mana;
pMsg.Exp = lpObj[aIndex].Experience;
pMsg.MapNumber = lpObj[aIndex].MapNumber;
pMsg.Money = lpObj[aIndex].Money;
pMsg.BP = LOWORD(lpObj[aIndex].BP);
pObj[aIndex].PathCount = 0;
DataSend(aIndex, &pMsg.h.c, (DWORD)pMsg.h.size);

gObjTeleport(aIndex,lpObj[aIndex].MapNumber,lpObj[aIndex].X,lpObj[aIndex].Y);
GCItemListSend(aIndex);
CGRequestQuestInfo(aIndex);
DGGuildMemberInfoRequest(aIndex);
}

OFFSETS:
#define GCItemListSend ((void(*)(int aIndex))0x00411010)
#define CGRequestQuestInfo ((void(*)(int aIndex))0x0042A7C0)
#define DGGuildMemberInfoRequest ((void(*)(int aIndex))0x0042C460)


Créditos: antonio.fr

InFamous
01/04/2015, 04:17 PM
Cara Sou teu fã, depois desse Post.

Hugo
01/04/2015, 04:44 PM
Opa Vai Ser Mt Útil ;) Vlw Antoninho :3

InFamous
02/04/2015, 01:56 AM
Usando somente função no meu sistema de reset.
o char reseta mas e movido para a coordenada 0 0 de lorencia.



gObj->Level = 1;
gObj->Experience = 0;
gObj->Money = gObj->Money - Price;
gs_func.PlayerRefresh(aIndex);
sprintf_s(Resetado, "[%s] Reset efetuado com sucesso.", gObj->Name);
GCServerMsgStringSend(Resetado,aIndex,1);
SetConsoleText(LIGHTCYAN,"[%s] --> Acabou de utilizar o comando /reset \n",gObj->Name);

Mr.Haziel
02/04/2015, 08:49 PM
Função perfeita apesar de eu usar de forma um pouco diferente, essa é totalmente funcional pode ser usada até a season 6 na 700 o main tem uma proteção no protocolo que não deixa usar a função !!
Fui o primeiro a desenvolver esse sistema para reset e add, mas apenas tive a ideia e coidei do meu modo.O verdadeiro coderz cria seu modo usando as ideias está de Parabéns antonio.fr,grande abraço !!
Aqui o vídeo de quando na época tive a ideia de programa esse sistema. lembrando que o cogido do vídeo é um pouco diferente do cogido acima mas ambos funcionam da mesma maneira


[Only registered and activated users can see links]

antoniofr
03/04/2015, 10:13 PM
Função perfeita apesar de eu usar de forma um pouco diferente, essa é totalmente funcional pode ser usada até a season 6 na 700 o main tem uma proteção no protocolo que não deixa usar a função !!
Fui o primeiro a desenvolver esse sistema para reset e add, mas apenas tive a ideia e coidei do meu modo.O verdadeiro coderz cria seu modo usando as ideias está de Parabéns antonio.fr,grande abraço !!
Aqui o vídeo de quando na época tive a ideia de programa esse sistema. lembrando que o cogido do vídeo é um pouco diferente do cogido acima mas ambos funcionam da mesma maneira


Na verdade, CHAR REGEN abrevia todo o processo de destruir e recriar a viewport.

Major
18/09/2015, 10:45 AM
alguem pode me da um help pra atualizar o lvl apos o reset

Maykon
10/12/2015, 09:35 PM
alguem pode me da um help pra atualizar o lvl apos o reset



GCLevelUpMsgSend(aIndex,gObj[aIndex].Level,gObj[aIndex].LevelUpPoint,(WORD)(gObj[aIndex].MaxLife+gObj[aIndex].AddLife),(WORD)(gObj[aIndex].MaxMana+gObj[aIndex].AddMana),(WORD)(gObj[aIndex].MaxBP+gObj[aIndex].AddBP));

viniciusvj
04/02/2016, 03:43 PM
Bom, quando eu adiciono os pontos utilizando essa função o meu personagem duplica.
Alguém sabe o que pode ser?
Já conferir todos os endereços e estão corretos.

Resolvido