Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: OffSet liberar limite de wings 100 MuEmu  (Visto 2272 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline xampoulis Posteado: April 07, 2018, 01:14:01 PM | Modificado: April 07, 2018, 01:16:50 PM by xampoulis

  • 0 puntos por ventas
  • *
  • Rank: Dedicado
  • Posts: 33
  • Gracias recibida: 1725
  • gy
GameServer


#define  MAX_CUSTOM_WING 100

Procurar no Item.cpp

Citar
__declspec(naked) void WingMakePreviewCharSet() // OK
{
   static DWORD WingMakePreviewCharSetAddress1 = 0x004F71DE;
   static DWORD WingMakePreviewCharSetAddress2 = 0x004F717D;

   _asm
   {
      Mov Ecx,Dword Ptr Ss:[Ebp+0x0C]
      Movzx Edx,Byte Ptr Ds:[Ecx+0x10]
      Sar Edx,0x01
      And Edx,0xFF
      Test Edx,Edx
      Je EXIT
      Mov Eax,Dword Ptr Ss:[Ebp+0x0C]
      Movzx Ecx,Byte Ptr Ds:[Eax+0x10]
      Sar Ecx,0x01
      And Ecx,0xFF
      Sub Ecx,0x01
      Push Ecx
      Lea Ecx,gCustomWing
      Call [CCustomWing::CheckCustomWing]
      Test Eax,Eax
      Je EXIT
      Mov Edx,Dword Ptr Ss:[Ebp+0x0C]
      Movzx Eax,Byte Ptr Ds:[Edx+0x10]
      Sar Eax,0x01
      And Eax,0xFF
      Sub Eax,0x01
      Push Eax
      Lea Ecx,gCustomWing
      Call [CCustomWing::GetCustomWingItem]
      Add Eax,ITEM_BASE_MODEL
      Mov Ecx,Dword Ptr Ss:[Ebp-0x08]
      Mov Word Ptr Ds:[Ecx+0x1C0],Ax
      Jmp [WingMakePreviewCharSetAddress1]
      EXIT:
      Mov Eax,Dword Ptr Ss:[Ebp-0x04]
      And Eax,0xFF
      Jmp [WingMakePreviewCharSetAddress2]
   }
}





CustomWing.h


Code: [Select]
// CustomWing.h: interface for the CCustomWing class.
//
//////////////////////////////////////////////////////////////////////

#pragma once

[URL=http://perfectzone.com.br/usertag.php?do=list&action=hash&hash=define]#define[/URL]  MAX_CUSTOM_WING 100

struct CUSTOM_WING_INFO
{
int Index;
int ItemIndex;
int DefenseConstA;
int IncDamageConstA;
int IncDamageConstB;
int DecDamageConstA;
int DecDamageConstB;
int OptionIndex1;
int OptionValue1;
int OptionIndex2;
int OptionValue2;
int OptionIndex3;
int OptionValue3;
int NewOptionIndex1;
int NewOptionValue1;
int NewOptionIndex2;
int NewOptionValue2;
int NewOptionIndex3;
int NewOptionValue3;
int NewOptionIndex4;
int NewOptionValue4;
int ModelType;
char ModelName[32];
};

class CCustomWing
{
public:
CCustomWing();
virtual ~CCustomWing();
void Init();
void Load(char* path);
void SetInfo(CUSTOM_WING_INFO info);
CUSTOM_WING_INFO* GetInfo(int index);
CUSTOM_WING_INFO* GetInfoByItem(int ItemIndex);
bool CheckCustomWing(int index);
bool CheckCustomWingByItem(int ItemIndex);
int GetCustomWingIndex(int ItemIndex);
int GetCustomWingDefense(int ItemIndex,int ItemLevel);
int GetCustomWingIncDamage(int ItemIndex,int ItemLevel);
int GetCustomWingDecDamage(int ItemIndex,int ItemLevel);
int GetCustomWingOptionIndex(int ItemIndex,int OptionNumber);
int GetCustomWingOptionValue(int ItemIndex,int OptionNumber);
int GetCustomWingNewOptionIndex(int ItemIndex,int OptionNumber);
int GetCustomWingNewOptionValue(int ItemIndex,int OptionNumber);
public:
CUSTOM_WING_INFO m_CustomWingInfo[MAX_CUSTOM_WING];
};

extern CCustomWing gCustomWing;

CustomWing.cpp

Code: [Select]
// CustomWing.cpp: implementation of the CCustomWing class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "CustomWing.h"
#include "MemScript.h"
#include "Util.h"

CCustomWing gCustomWing;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCustomWing::CCustomWing() // OK
{
this->Init();
}

CCustomWing::~CCustomWing() // OK
{

}

void CCustomWing::Init() // OK
{
for(int n=0;n < MAX_CUSTOM_WING;n++)
{
this->m_CustomWingInfo[n].Index = -1;
}
}

void CCustomWing::Load(char* path) // OK
{
CMemScript* lpMemScript = new CMemScript;

if(lpMemScript == 0)
{
ErrorMessageBox(MEM_SCRIPT_ALLOC_ERROR,path);
return;
}

if(lpMemScript->SetBuffer(path) == 0)
{
ErrorMessageBox(lpMemScript->GetLastError());
delete lpMemScript;
return;
}

this->Init();

try
{
while(true)
{
if(lpMemScript->GetToken() == TOKEN_END)
{
break;
}

if(strcmp("end",lpMemScript->GetString()) == 0)
{
break;
}

CUSTOM_WING_INFO info;

memset(&info,0,sizeof(info));

info.Index = lpMemScript->GetNumber();

info.ItemIndex = lpMemScript->GetAsNumber();

info.DefenseConstA = lpMemScript->GetAsNumber();

info.IncDamageConstA = lpMemScript->GetAsNumber();

info.IncDamageConstB = lpMemScript->GetAsNumber();

info.DecDamageConstA = lpMemScript->GetAsNumber();

info.DecDamageConstB = lpMemScript->GetAsNumber();

info.OptionIndex1 = lpMemScript->GetAsNumber();

info.OptionValue1 = lpMemScript->GetAsNumber();

info.OptionIndex2 = lpMemScript->GetAsNumber();

info.OptionValue2 = lpMemScript->GetAsNumber();

info.OptionIndex3 = lpMemScript->GetAsNumber();

info.OptionValue3 = lpMemScript->GetAsNumber();

info.NewOptionIndex1 = lpMemScript->GetAsNumber();

info.NewOptionValue1 = lpMemScript->GetAsNumber();

info.NewOptionIndex2 = lpMemScript->GetAsNumber();

info.NewOptionValue2 = lpMemScript->GetAsNumber();

info.NewOptionIndex3 = lpMemScript->GetAsNumber();

info.NewOptionValue3 = lpMemScript->GetAsNumber();

info.NewOptionIndex4 = lpMemScript->GetAsNumber();

info.NewOptionValue4 = lpMemScript->GetAsNumber();

info.ModelType = lpMemScript->GetAsNumber();

strcpy_s(info.ModelName,lpMemScript->GetAsString());

this->SetInfo(info);
}
}
catch(...)
{
ErrorMessageBox(lpMemScript->GetLastError());
}

delete lpMemScript;
}

void CCustomWing::SetInfo(CUSTOM_WING_INFO info) // OK
{
if(info.Index < 0 || info.Index >= MAX_CUSTOM_WING)
{
return;
}

this->m_CustomWingInfo[info.Index] = info;
}

CUSTOM_WING_INFO* CCustomWing::GetInfo(int index) // OK
{
if(index < 0 || index >= MAX_CUSTOM_WING)
{
return 0;
}

if(this->m_CustomWingInfo[index].Index != index)
{
return 0;
}

return &this->m_CustomWingInfo[index];
}

CUSTOM_WING_INFO* CCustomWing::GetInfoByItem(int ItemIndex) // OK
{
for(int n=0;n < MAX_CUSTOM_WING;n++)
{
CUSTOM_WING_INFO* lpInfo = this->GetInfo(n);

if(lpInfo == 0)
{
continue;
}

if(lpInfo->ItemIndex == ItemIndex)
{
return lpInfo;
}
}

return 0;
}

bool CCustomWing::CheckCustomWing(int index) // OK
{
if(this->GetInfo(index) != 0)
{
return 1;
}

return 0;
}

bool CCustomWing::CheckCustomWingByItem(int ItemIndex) // OK
{
if(this->GetInfoByItem(ItemIndex) != 0)
{
return 1;
}

return 0;
}

int CCustomWing::GetCustomWingIndex(int ItemIndex) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

return lpInfo->Index;
}

int CCustomWing::GetCustomWingDefense(int ItemIndex,int ItemLevel) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

return (lpInfo->DefenseConstA*ItemLevel);
}

int CCustomWing::GetCustomWingIncDamage(int ItemIndex,int ItemLevel) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 100;
}

return (lpInfo->IncDamageConstA+(ItemLevel*lpInfo->IncDamageConstB));
}

int CCustomWing::GetCustomWingDecDamage(int ItemIndex,int ItemLevel) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 100;
}

return (lpInfo->DecDamageConstA-(ItemLevel*lpInfo->DecDamageConstB));
}

int CCustomWing::GetCustomWingOptionIndex(int ItemIndex,int OptionNumber) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

switch(OptionNumber)
{
case 0:
return lpInfo->OptionIndex1;
case 1:
return lpInfo->OptionIndex2;
case 2:
return lpInfo->OptionIndex3;
}

return 0;
}

int CCustomWing::GetCustomWingOptionValue(int ItemIndex,int OptionNumber) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

switch(OptionNumber)
{
case 0:
return lpInfo->OptionValue1;
case 1:
return lpInfo->OptionValue2;
case 2:
return lpInfo->OptionValue3;
}

return 0;
}

int CCustomWing::GetCustomWingNewOptionIndex(int ItemIndex,int OptionNumber) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

switch(OptionNumber)
{
case 0:
return lpInfo->NewOptionIndex1;
case 1:
return lpInfo->NewOptionIndex2;
case 2:
return lpInfo->NewOptionIndex3;
case 3:
return lpInfo->NewOptionIndex4;
}

return 0;
}

int CCustomWing::GetCustomWingNewOptionValue(int ItemIndex,int OptionNumber) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

switch(OptionNumber)
{
case 0:
return lpInfo->NewOptionValue1;
case 1:
return lpInfo->NewOptionValue2;
case 2:
return lpInfo->NewOptionValue3;
case 3:
return lpInfo->NewOptionValue4;
}

return 0;
}


Main

CustomWing.cpp

Code: [Select]
// CustomWing.cpp: implementation of the CCustomWing class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "CustomWing.h"

CCustomWing gCustomWing;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CCustomWing::CCustomWing() // OK
{
this->Init();
}

CCustomWing::~CCustomWing() // OK
{

}

void CCustomWing::Init() // OK
{
for(int n=0;n < MAX_CUSTOM_WING;n++)
{
this->m_CustomWingInfo[n].Index = -1;
}
}

void CCustomWing::Load(CUSTOM_WING_INFO* info) // OK
{
for(int n=0;n < MAX_CUSTOM_WING;n++)
{
this->SetInfo(info[n]);
}
}

void CCustomWing::SetInfo(CUSTOM_WING_INFO info) // OK
{
if(info.Index < 0 || info.Index >= MAX_CUSTOM_WING)
{
return;
}

this->m_CustomWingInfo[info.Index] = info;
}

CUSTOM_WING_INFO* CCustomWing::GetInfo(int index) // OK
{
if(index < 0 || index >= MAX_CUSTOM_WING)
{
return 0;
}

if(this->m_CustomWingInfo[index].Index != index)
{
return 0;
}

return &this->m_CustomWingInfo[index];
}

CUSTOM_WING_INFO* CCustomWing::GetInfoByItem(int ItemIndex) // OK
{
for(int n=0;n < MAX_CUSTOM_WING;n++)
{
CUSTOM_WING_INFO* lpInfo = this->GetInfo(n);

if(lpInfo == 0)
{
continue;
}

if(lpInfo->ItemIndex == ItemIndex)
{
return lpInfo;
}
}

return 0;
}

BOOL CCustomWing::CheckCustomWing(int index) // OK
{
if(this->GetInfo(index) != 0)
{
return 1;
}

return 0;
}

BOOL CCustomWing::CheckCustomWingByItem(int ItemIndex) // OK
{
if(this->GetInfoByItem(ItemIndex) != 0)
{
return 1;
}

return 0;
}

BOOL CCustomWing::CheckCustomWingByModelType(int ItemIndex,int ModelType) // OK
{
for(int n=0;n < MAX_CUSTOM_WING;n++)
{
CUSTOM_WING_INFO* lpInfo = this->GetInfo(n);

if(lpInfo == 0)
{
continue;
}

if(lpInfo->ItemIndex == ItemIndex && lpInfo->ModelType == ModelType)
{
return 1;
}
}

return 0;
}

int CCustomWing::GetCustomWingItem(int index) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfo(index);

if(lpInfo == 0)
{
return 0;
}

return lpInfo->ItemIndex;
}

int CCustomWing::GetCustomWingIndex(int ItemIndex) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

return lpInfo->Index;
}

int CCustomWing::GetCustomWingDefense(int ItemIndex,int ItemLevel) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

return (lpInfo->DefenseConstA*ItemLevel);
}

int CCustomWing::GetCustomWingIncDamage(int ItemIndex,int ItemLevel) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

return ((lpInfo->IncDamageConstA+(ItemLevel*lpInfo->IncDamageConstB))-100);
}

int CCustomWing::GetCustomWingDecDamage(int ItemIndex,int ItemLevel) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

return (100-(lpInfo->DecDamageConstA-(ItemLevel*lpInfo->DecDamageConstB)));
}

int CCustomWing::GetCustomWingOptionIndex(int ItemIndex,int OptionNumber) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

switch(OptionNumber)
{
case 0:
return lpInfo->OptionIndex1;
case 1:
return lpInfo->OptionIndex2;
case 2:
return lpInfo->OptionIndex3;
}

return 0;
}

int CCustomWing::GetCustomWingOptionValue(int ItemIndex,int OptionNumber) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

switch(OptionNumber)
{
case 0:
return lpInfo->OptionValue1;
case 1:
return lpInfo->OptionValue2;
case 2:
return lpInfo->OptionValue3;
}

return 0;
}

int CCustomWing::GetCustomWingNewOptionIndex(int ItemIndex,int OptionNumber) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

switch(OptionNumber)
{
case 0:
return lpInfo->NewOptionIndex1;
case 1:
return lpInfo->NewOptionIndex2;
case 2:
return lpInfo->NewOptionIndex3;
case 3:
return lpInfo->NewOptionIndex4;
}

return 0;
}

int CCustomWing::GetCustomWingNewOptionValue(int ItemIndex,int OptionNumber) // OK
{
CUSTOM_WING_INFO* lpInfo = this->GetInfoByItem(ItemIndex);

if(lpInfo == 0)
{
return 0;
}

switch(OptionNumber)
{
case 0:
return lpInfo->NewOptionValue1;
case 1:
return lpInfo->NewOptionValue2;
case 2:
return lpInfo->NewOptionValue3;
case 3:
return lpInfo->NewOptionValue4;
}

return 0;
}

CustomWing.h

Code: [Select]
// CustomWing.h: interface for the CCustomWing class.
//
//////////////////////////////////////////////////////////////////////

#pragma once

struct CUSTOM_WING_INFO
{
int Index;
int ItemIndex;
int DefenseConstA;
int IncDamageConstA;
int IncDamageConstB;
int DecDamageConstA;
int DecDamageConstB;
int OptionIndex1;
int OptionValue1;
int OptionIndex2;
int OptionValue2;
int OptionIndex3;
int OptionValue3;
int NewOptionIndex1;
int NewOptionValue1;
int NewOptionIndex2;
int NewOptionValue2;
int NewOptionIndex3;
int NewOptionValue3;
int NewOptionIndex4;
int NewOptionValue4;
int ModelType;
char ModelName[32];
};

class CCustomWing
{
public:
CCustomWing();
virtual ~CCustomWing();
void Init();
void Load(CUSTOM_WING_INFO* info);
void SetInfo(CUSTOM_WING_INFO info);
CUSTOM_WING_INFO* GetInfo(int index);
CUSTOM_WING_INFO* GetInfoByItem(int ItemIndex);
BOOL CheckCustomWing(int index);
BOOL CheckCustomWingByItem(int ItemIndex);
BOOL CheckCustomWingByModelType(int ItemIndex,int ModelType);
int GetCustomWingItem(int index);
int GetCustomWingIndex(int ItemIndex);
int GetCustomWingDefense(int ItemIndex,int ItemLevel);
int GetCustomWingIncDamage(int ItemIndex,int ItemLevel);
int GetCustomWingDecDamage(int ItemIndex,int ItemLevel);
int GetCustomWingOptionIndex(int ItemIndex,int OptionNumber);
int GetCustomWingOptionValue(int ItemIndex,int OptionNumber);
int GetCustomWingNewOptionIndex(int ItemIndex,int OptionNumber);
int GetCustomWingNewOptionValue(int ItemIndex,int OptionNumber);
public:
CUSTOM_WING_INFO m_CustomWingInfo[MAX_CUSTOM_WING];
};

extern CCustomWing gCustomWing;

Credits
Louis

Gracias:


Offline darkjano #1 Posteado: April 09, 2018, 03:50:47 AM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 1.042
  • Gracias recibida: 882
  • cl
Para que main es? Season 6?


Offline djagripnos #2 Posteado: April 09, 2018, 06:47:18 AM

  • MAESTRO

  • US. DE HONOR

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 824
  • Gracias recibida: 27510
  • gr

Gracias:


Offline Stanly #3 Posteado: May 04, 2018, 05:48:33 PM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 10
  • Gracias recibida: 0
  • pe
podrias aportar el main con dichos limites en las wings para files xemu?


Offline Crowley #4 Posteado: March 13, 2020, 12:16:30 PM

  • 0 puntos por ventas
  • *
  • Rank: Principiante
  • Posts: 16
  • Gracias recibida: 8
  • it

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
1 Replies
1159 Views
Last post September 17, 2023, 01:24:53 AM
by Azzlaer
4 Replies
1233 Views
Last post December 20, 2019, 02:26:15 PM
by ghostx
0 Replies
868 Views
Last post August 31, 2020, 11:52:38 AM
by ConejoMalo
13 Replies
1746 Views
Last post February 25, 2021, 11:04:22 AM
by Ifreat
10 Replies
1585 Views
Last post May 16, 2023, 03:56:02 AM
by 2str0kE