Resultados 1 a 9 de 9
  1. #1
    Developer C++ antoniofr's Avatar
    Data de Ingresso
    Feb 2015
    Posts
    28
    Thanks Thanks Given 
    16
    Thanks Thanks Received 
    16
    Thanked in
    1 Post
    Mencionado
    13 Post(s)
    MEU HUMOR
    Cold
    País
    Brazil

    Função player refresh

    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.


    Código:
    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
    Last edited by antoniofr; 02/04/2015 at 01:34 PM.

  2. #2
    Developer C++ InFamous's Avatar


    Data de Ingresso
    Sep 2014
    Posts
    375
    Thanks Thanks Given 
    152
    Thanks Thanks Received 
    839
    Thanked in
    47 Posts
    Mencionado
    109 Post(s)
    MEU HUMOR
    Devilish
    País
    Brazil
    Cara Sou teu fã, depois desse Post.

  3. #3
    Banido Hugo's Avatar
    Data de Ingresso
    Jan 2015
    Posts
    228
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    47
    Thanked in
    6 Posts
    Mencionado
    110 Post(s)
    MEU HUMOR
    Sleepy
    País
    Brazil
    Opa Vai Ser Mt Útil Vlw Antoninho :3
    [CENTER][IMG]http://i.imgur.com/09jSTLF.gif[/IMG][/CENTER]

  4. #4
    Developer C++ InFamous's Avatar


    Data de Ingresso
    Sep 2014
    Posts
    375
    Thanks Thanks Given 
    152
    Thanks Thanks Received 
    839
    Thanked in
    47 Posts
    Mencionado
    109 Post(s)
    MEU HUMOR
    Devilish
    País
    Brazil
    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);

  5. #5
    Developer C++ Mr.Haziel's Avatar


    Data de Ingresso
    Apr 2015
    Posts
    67
    Thanks Thanks Given 
    77
    Thanks Thanks Received 
    23
    Thanked in
    10 Posts
    Mencionado
    57 Post(s)
    MEU HUMOR
    Cold
    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

    Last edited by Mr.Haziel; 10/04/2015 at 03:26 PM.

  6. #6
    Developer C++ antoniofr's Avatar
    Data de Ingresso
    Feb 2015
    Posts
    28
    Thanks Thanks Given 
    16
    Thanks Thanks Received 
    16
    Thanked in
    1 Post
    Mencionado
    13 Post(s)
    MEU HUMOR
    Cold
    País
    Brazil
    Citação Originally Posted by Mr.Haziel Ver Post
    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.

  7. #7
    Membro Major's Avatar
    Data de Ingresso
    Sep 2015
    Posts
    13
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Mencionado
    6 Post(s)
    MEU HUMOR
    Cynical
    alguem pode me da um help pra atualizar o lvl apos o reset

  8. #8
    Developer C++ Maykon's Avatar
    Data de Ingresso
    Jan 2015
    Posts
    213
    Thanks Thanks Given 
    192
    Thanks Thanks Received 
    630
    Thanked in
    40 Posts
    Mencionado
    64 Post(s)
    MEU HUMOR
    Innocent
    Citação Originally Posted by Major Ver Post
    alguem pode me da um help pra atualizar o lvl apos o reset
    Código:
    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));

  9. #9
    Membro viniciusvj's Avatar
    Data de Ingresso
    May 2015
    Posts
    5
    Thanks Thanks Given 
    10
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts
    Mencionado
    1 Post(s)
    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
    Last edited by viniciusvj; 06/02/2016 at 08:08 PM.

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • You may not post Resposta(s)
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •  
Sobre nós
Somos uma comunidade em atividade a 8 anos que aborda assuntos relacionados a games em geral, principalmente games MMORPG. e que busca sempre ajudar os membros através de conteúdos, tutoriais e suporte...
Nossos anunciantes
Hinetworks
VelozHost
InovHost
Rede Sociais