Siga-nos em...
Follow us on Twitter Follow us on Facebook Watch us on YouTube
Registro

Alpha Servers
Resultados 1 a 5 de 5

Tópico: Fix Agility 97d+

Visão do Encadeamento

  1. #1

    Avatar de Maykon
    Data de Ingresso
    Apr 2014
    Localização
    Imperyus Games
    Idade
    30
    Posts
    124
    Agradecido
    302
    Agradeceu
    80
    Peso da Avaliação
    12

    Padrão Fix Agility 97d+

    Para o servidor:



    Struct:

    Código:
    struct PMSG_CHARINFOMAIN
    {
    	PBMSG_HEAD h;
    	BYTE Code;
    	BYTE Class;
    	WORD Dexterity;
    	WORD AttackSpeed;
    	WORD MagicSpeed;
    };
    Functions.cpp:

    Código:
    #include "StdAfx.h"
    
    Functions func;
    
    BOOL Functions::gObjSetCharacterEx(LPBYTE lpdata, int aIndex)
    {
    	BOOL retornar = gObjSetCharacter(lpdata,aIndex);
    
    	if(retornar == TRUE)
    	{
    		PMSG_CHARINFOMAIN Result;
    
    		Result.h.c = 0xC1;
    		Result.h.size = sizeof(Result);
    		Result.h.head = 0xFE;
    		Result.Code = 0x07;
    		Result.Class = gObj[aIndex].Class;
    		Result.Dexterity = (WORD)(gObj[aIndex].Dexterity);
    		Result.AttackSpeed = (WORD)(gObj[aIndex].m_AttackSpeed);
    		Result.MagicSpeed = (WORD)(gObj[aIndex].m_MagicSpeed);
    
    		DataSend(aIndex, (LPBYTE)(&Result), Result.h.size);
    	}
    	
    	return retornar;
    }
    
    void Functions::gObjCalCharacterEx(int aIndex)
    {
    	gObjCalCharacter(aIndex);
    
    	PMSG_CHARINFOMAIN Result;
    
    	Result.h.c = 0xC1;
    	Result.h.size = sizeof(Result);
    	Result.h.head = 0xFE;
    	Result.Code = 0x07;
    	Result.Class = gObj[aIndex].Class;
    	Result.Dexterity = (WORD)(gObj[aIndex].Dexterity);
    	Result.AttackSpeed = (WORD)(gObj[aIndex].m_AttackSpeed);
    	Result.MagicSpeed = (WORD)(gObj[aIndex].m_MagicSpeed);
    
    	DataSend(aIndex, (LPBYTE)(&Result), Result.h.size);
    }
    Functions.h:

    Código:
    #pragma once
    
    class Functions
    {
    public:
    	static BOOL gObjSetCharacterEx(LPBYTE lpdata, int aIndex);
    	static void gObjCalCharacterEx(int aIndex);
    };
    
    extern Functions func;

    Defines:

    Código:
    #define gObjSetCharacter                ((bool(*)(LPBYTE lpdata, int aIndex)) 0x0045C370)
    #define gObjCalCharacter	        ((void(*)(int aIndex)) 0x00451DE0)
    Hooks:

    Código:
    func.HookThis((DWORD)&Functions::gObjSetCharacterEx,0x004026CB);
    func.HookThis((DWORD)&Functions::gObjCalCharacterEx,0x004015AF);


    Para o cliente:



    Struct:

    Código:
    struct PMSG_CHARINFOMAIN
    {
    	PBMSG_HEAD h;
    	BYTE Code;
    	BYTE Class;
    	WORD Dexterity;
    	WORD AttackSpeed;
    	WORD MagicSpeed;
    };
    Naked.h:

    Código:
    #pragma once
    
    DWORD nProtocolCoreBack  = 0x4384FB;
    LPBYTE nProtocolCoreData = nullptr;
    
    void __declspec(naked) nProtocolCore()
    {
    	__asm MOV nProtocolCoreData, EBP;
    
    	ProtocolCore(nProtocolCoreData);
    
    	__asm MOV EDX, DWORD PTR DS : [0x8311134];
    	__asm JMP nProtocolCoreBack;
    }
    Protocol.cpp:

    Código:
    #include "StdAfx.h"
    
    BYTE PlayerClass = 0;
    WORD PlayerDexterity = 0;
    WORD PlayerASpeed = 0;
    WORD PlayerMSpeed = 0;
    
    void ProtocolCore(LPBYTE aRecv)
    {
    	if (aRecv[0] == 0xC1 || aRecv[0] == 0xC3)
    	{
    		switch (aRecv[2])
    		{
    		case 0xF3:
    			{
    				switch(aRecv[3])
    				{
    				case 0x03:
    					{
    						ApplyDexterityFix();
    					}
    					break;
    				}
    			}
    			break;
    		case 0xFE:
    			{
    				switch(aRecv[3])
    				{
    				case 0x07:
    					{
    						PMSG_CHARINFOMAIN* Info = (PMSG_CHARINFOMAIN*)(aRecv);
    
    						PlayerClass = Info->Class;
    						PlayerDexterity = Info->Dexterity;
    						PlayerASpeed = Info->AttackSpeed;
    						PlayerMSpeed = Info->MagicSpeed;
    
    						ApplyDexterityFix();
    					}
    					break;
    				}
    			}
    			break;
    		}
    	}
    }
    
    void ApplyDexterityFix()
    {
    	switch (PlayerClass)
    	{
    	case 0:
    		{
    			if (PlayerMSpeed >= 455 && PlayerMSpeed <= 479)
    			{
    				*eMainSpeedFrame2 = 0.0024700f;
    			}
    			else if (PlayerMSpeed >= 605 && PlayerMSpeed <= 636)
    			{
    				*eMainSpeedFrame2 = 0.0019000f;
    			}
    			else if (PlayerMSpeed >= 637 && PlayerMSpeed <= 668)
    			{
    				*eMainSpeedFrame2 = 0.0018000f;
    			}
    			else if (PlayerMSpeed >= 669 && PlayerMSpeed <= 688)
    			{
    				*eMainSpeedFrame2 = 0.0017000f;
    			}
    			else if (PlayerMSpeed >= 855 && PlayerMSpeed <= 1040)
    			{
    				*eMainSpeedFrame2 = 0.0016300f;
    			}
    			else if (PlayerMSpeed >= 1041 && PlayerMSpeed <= 1104)
    			{
    				*eMainSpeedFrame2 = 0.0015500f;
    			}
    			else if (PlayerMSpeed >= 1301 && PlayerMSpeed <= 1500)
    			{
    				*eMainSpeedFrame2 = 0.0017500f;
    			}
    			else if (PlayerMSpeed >= 1501 && PlayerMSpeed <= 1524)
    			{
    				*eMainSpeedFrame2 = 0.0015000f;
    			}
    			else if (PlayerMSpeed >= 1525 && PlayerMSpeed <= 1800)
    			{
    				*eMainSpeedFrame2 = 0.0014500f;
    			}
    			else if (PlayerMSpeed >= 1801 && PlayerMSpeed <= 1999)
    			{
    				*eMainSpeedFrame2 = 0.0013000f;
    			}
    			else if (PlayerMSpeed >= 2000 && PlayerMSpeed <= 2167)
    			{
    				*eMainSpeedFrame2 = 0.0012500f;
    			}
    			else if (PlayerMSpeed >= 2168 && PlayerMSpeed <= 2354)
    			{
    				*eMainSpeedFrame2 = 0.0011500f;
    			}
    			else if (PlayerMSpeed >= 2855 && PlayerMSpeed <= 3011)
    			{
    				*eMainSpeedFrame2 = 0.0009000f;
    			}
    			else if (PlayerMSpeed >= 3011)
    			{
    				*eMainSpeedFrame2 = 0.0008100f;
    
    			}
    			else
    			{
    				*eMainSpeedFrame2 = 0.0020000f;
    			}
    		}
    		break;
    	case 1:
    		{
    			*eMainSpeedFrame1 = 0.0040000f;
    			*eMainSpeedFrame2 = 0.0020000f;
    		}
    		break;
    	case 2:
    		{
    			if (PlayerASpeed >= 509 && PlayerASpeed <= 549)
    			{
    				*eMainSpeedFrame1 = 0.0026000f;
    			} 
    			else if (PlayerASpeed >= 550 && PlayerASpeed <= 750) 
    			{
    				*eMainSpeedFrame1 = 0.0017000f;
    			} 
    			else 
    			{
    				*eMainSpeedFrame1 = 0.0040000f;
    			}
    		}
    		break;
    	case 3:
    		{
    			if (PlayerMSpeed >= 455 && PlayerMSpeed <= 479)
    			{
    				*eMainSpeedFrame2 = 0.0024700f;
    			}
    			else if (PlayerMSpeed >= 605 && PlayerMSpeed <= 636)
    			{
    				*eMainSpeedFrame2 = 0.0019000f;
    			}
    			else if (PlayerMSpeed >= 637 && PlayerMSpeed <= 668)
    			{
    				*eMainSpeedFrame2 = 0.0018000f;
    			}
    			else if (PlayerMSpeed >= 669 && PlayerMSpeed <= 688)
    			{
    				*eMainSpeedFrame2 = 0.0017000f;
    			}
    			else if (PlayerMSpeed >= 855 && PlayerMSpeed <= 1040)
    			{
    				*eMainSpeedFrame2 = 0.0016300f;
    			}
    			else if (PlayerMSpeed >= 1041 && PlayerMSpeed <= 1104)
    			{
    				*eMainSpeedFrame2 = 0.0015500f;
    			}
    			else if (PlayerMSpeed >= 1301 && PlayerMSpeed <= 1500)
    			{
    				*eMainSpeedFrame2 = 0.0017500f;
    			}
    			else if (PlayerMSpeed >= 1501 && PlayerMSpeed <= 1524)
    			{
    				*eMainSpeedFrame2 = 0.0015000f;
    			}
    			else if (PlayerMSpeed >= 1525 && PlayerMSpeed <= 1800)
    			{
    				*eMainSpeedFrame2 = 0.0014500f;
    			}
    			else if (PlayerMSpeed >= 1801 && PlayerMSpeed <= 1999)
    			{
    				*eMainSpeedFrame2 = 0.0013000f;
    			}
    			else if (PlayerMSpeed >= 2000 && PlayerMSpeed <= 2167)
    			{
    				*eMainSpeedFrame2 = 0.0012500f;
    			}
    			else if (PlayerMSpeed >= 2168 && PlayerMSpeed <= 2354)
    			{
    				*eMainSpeedFrame2 = 0.0011500f;
    			}
    			else if (PlayerMSpeed >= 2855 && PlayerMSpeed <= 3011)
    			{
    				*eMainSpeedFrame2 = 0.0009000f;
    			}
    			else if (PlayerMSpeed >= 3011)
    			{
    				*eMainSpeedFrame2 = 0.0008100f;
    			}
    			else
    			{
    				*eMainSpeedFrame2 = 0.0020000f;
    			}
    		}
    		break;
    	}
    }
    Protocol.h:

    Código:
    #pragma once
    
    void ProtocolCore(LPBYTE aRecv);
    void ApplyDexterityFix();
    Defines:

    Código:
    #define eMainSpeedFrame1 (float*)(0x54D4BC)
    #define eMainSpeedFrame2 (float*)(0x54D8CC)
    Hooks:

    Código:
    HookOffset((DWORD)&nProtocolCore,0x4384F5,0xE9);


    Créditos: Maykon & Getulio
    Última edição por Maykon; 09-02-2017 às 08:17 PM.

  2. Os Seguintes 6 Usuários Agradeceram você Maykon Por este Post Útil:


 

 

Informações de Tópico

Usuários Navegando neste Tópico

Há 1 usuários navegando neste tópico. (0 registrados e 1 visitantes)

Tópicos Similares

  1. |Pedido| Main 1.07x Season 4 EP 4 Unpack (Fix Bug Agility 65K)
    Por Leroy no fórum Pedidos
    Respostas: 1
    Último Post: 10-01-2012, 09:06 AM

Marcadores

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • Você não pode enviar respostas
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •