huythao229
16-12-12, 03:50 PM
Mình thêm 1 case vào thì sao server nó nhận được case đó. Ý mình muốn hỏi là Server SCF không tìm thấy File user.cpp . Mình add thêm case vào làm sao cho GS nó nhận?
void gObjCharacterWingsSetPreview(short ItemType, unsigned char *CharSet)
{
switch(ItemType)
{
case 0x1824:
CharSet[16] = WINGS_OF_STORM;
break;
case 0x1825:
CharSet[16] = WINGS_OF_VORTEX;
break;
case 0x1826:
CharSet[16] = WINGS_OF_ILLUSION;
break;
case 0x1827:
CharSet[16] = WINGS_OF_HURRICANE;
break;
case 0x1828:
CharSet[16] = MANTLE_OF_MONARCH;
break;
case 0x1829:
CharSet[16] = MISERY_WINGS;
break;
case 0x182A:
CharSet[16] = DESPAIR_WINGS;
break;
case 0x182B:
CharSet[16] = DIMENSION_WINGS;
break;
}
}
All code user.cpp :
#include "stdafx.h"
#include "user.h"
#include "utilities.h"
#include "items.h"
#include <stdio.h>
//ADDITIONALOBJSTRUCT a_gObj[1000];
void FixItemDurRepaire() {
unsigned char FixItemDurRepair[54] = {
0x8B,0x45,0xF0,0x3D,0x00,0x1C,0x00,0x00,0x7D,0x3E, 0x3D,0x00,0x1A,0x00,0x00,0x7C,
0x07,0x3D,0x04,0x1A,0x00,0x00,0x7C,0x30,0x3D,0x0A, 0x1A,0x00,0x00,0x74,0x29,0x3D,
0x07,0x18,0x00,0x00,0x7C,0x10,0x3D,0x24,0x18,0x00, 0x00,0x7C,0x1B,0x3D,0x00,0x1A,
0x00,0x00,0x7D,0x3B,0x90,0x90 };
memcpy((void*)(0x43BD7B), FixItemDurRepair, 54);
}
bool FixWingsRepair() {
BYTE FixWings[48]={0xE9,0xEC,0x01,0x00,0x00,0x90,0x90,0x81,0x7D,0xF 0,0x24,
0x18,0x00,0x00,0x7C,0x0E,0x81,0x7D,0xF0,0x28,0x1C, 0x00,
0x00,0x7F,0x05,0xE9,0x2E,0xFE,0xFF,0xFF,0x81,0x7D, 0xF0,
0x00,0x1C,0x00,0x00,0x0F,0x8D,0x33,0xFE,0xFF,0xFF, 0xE9,
0xEF,0xFD,0xFF,0xFF};
memcpy((void*)(0x43BD7B), &FixWings[0], 7);
memcpy((void*)(0x43BF6C), &FixWings[7], 41);
return true;
}
void __declspec(naked) LoadNewClasses()
{
_asm {
cmp edx, DB_SOUL_MASTER;
je ClassAllowed;
cmp edx, DB_GRAND_MASTER;
je ClassAllowed;
cmp edx, DB_DARK_KNIGHT;
je ClassAllowed;
cmp edx, DB_BLADE_KNIGHT;
je ClassAllowed;
cmp edx, DB_BLADE_MASTER;
je ClassAllowed;
cmp edx, DB_FAIRY_ELF;
je ClassAllowed;
cmp edx, DB_MUSE_ELF;
je ClassAllowed;
cmp edx, DB_HIGH_ELF;
je ClassAllowed;
cmp edx, DB_MAGIC_GLADIATOR;
je ClassAllowed;
cmp edx, DB_DUEL_MASTER;
je ClassAllowed;
cmp edx, DB_DARK_LORD;
je ClassAllowed;
cmp edx, DB_LORD_EMPEROR;
je ClassAllowed;
cmp edx, DB_SUMMONER;
je ClassAllowed;
cmp edx, DB_BLOODY_SUMMONER;
je ClassAllowed;
cmp edx, DB_DIMENSION_MASTER;
je ClassAllowed;
mov edi, CLASSTYPE_ADR_DENY;
jmp edi;
ClassAllowed:
mov edi, CLASSTYPE_ADR_ALLOW;
jmp edi;
};
}
void gObjCharacterClassSetPreview(int DbClass, unsigned char *CharSet) {
register unsigned char Preview = 0;
switch(DbClass)
{
case DB_DARK_WIZARD:
Preview = PR_DARK_WIZARD;
break;
case DB_SOUL_MASTER:
CharSet[0] = PR_SOUL_MASTER;
break;
case DB_GRAND_MASTER:
CharSet[0] = PR_GRAND_MASTER;
break;
case DB_DARK_KNIGHT:
CharSet[0] = PR_DARK_KNIGHT;
break;
case DB_BLADE_KNIGHT:
CharSet[0] = PR_BLADE_KNIGHT;
break;
case DB_BLADE_MASTER:
CharSet[0] = PR_BLADE_MASTER;
break;
case DB_FAIRY_ELF:
CharSet[0] = PR_FAIRY_ELF;
break;
case DB_MUSE_ELF:
CharSet[0] = PR_MUSE_ELF;
break;
case DB_HIGH_ELF:
CharSet[0] = PR_HIGH_ELF;
break;
case DB_MAGIC_GLADIATOR:
CharSet[0] = PR_MAGIC_GLADIATOR;
break;
case 49:
case 50:
CharSet[0] = PR_DUEL_MASTER;
break;
case DB_DARK_LORD:
CharSet[0] = PR_DARK_LORD;
break;
case 65:
case 66:
CharSet[0] = PR_LORD_EMPEROR;
break;
case DB_SUMMONER:
CharSet[0] = PR_SUMMONER;
break;
case DB_BLOODY_SUMMONER:
CharSet[0] = PR_BLOODY_SUMMONER;
break;
case DB_DIMENSION_MASTER:
CharSet[0] = PR_DIMENSION_MASTER;
break;
default:
CharSet[0] = PR_UNKNOWN;
break;
}
}
void gObjCharacterWingsSetPreview(short ItemType, unsigned char *CharSet)
{
switch(ItemType)
{
case 0x1824:
CharSet[16] = WINGS_OF_STORM;
break;
case 0x1825:
CharSet[16] = WINGS_OF_VORTEX;
break;
case 0x1826:
CharSet[16] = WINGS_OF_ILLUSION;
break;
case 0x1827:
CharSet[16] = WINGS_OF_HURRICANE;
break;
case 0x1828:
CharSet[16] = MANTLE_OF_MONARCH;
break;
case 0x1829:
CharSet[16] = MISERY_WINGS;
break;
case 0x182A:
CharSet[16] = DESPAIR_WINGS;
break;
case 0x182B:
CharSet[16] = DIMENSION_WINGS;
break;
}
}
void __stdcall JGPGetCharListEx(int Loop, unsigned char *DSPacket, unsigned char *toClientPacket) {
unsigned char ItemType = DSPacket[72 + (66 * Loop)];
unsigned char UserClass = DSPacket[42 + (66 * Loop)];
register int nCol = (Loop * 34) + 38;
//Wing fix
switch(ItemType)
{
case 0x24:
toClientPacket[nCol] = 0x07;
break;
case 0x25:
toClientPacket[nCol] = 0x08;
break;
case 0x26:
toClientPacket[nCol] = 0x0c;
break;
case 0x27:
toClientPacket[nCol] = 0x10;
break;
case 0x28:
toClientPacket[nCol] = 0x14;
break;
case 0x29:
toClientPacket[nCol] = 0x18;
break;
case 0x2A:
toClientPacket[nCol] = 0x1c;
break;
case 0x2B:
toClientPacket[nCol] = 0x1b;
break;
}
nCol = (Loop * 34) + 22;
//Class fix
switch(UserClass)
{
case DB_GRAND_MASTER:
toClientPacket[nCol] = PR_GRAND_MASTER;
break;
case DB_BLADE_MASTER:
toClientPacket[nCol] = PR_BLADE_MASTER;
break;
case DB_HIGH_ELF:
toClientPacket[nCol] = PR_HIGH_ELF;
break;
case DB_DUEL_MASTER:
toClientPacket[nCol] = PR_DUEL_MASTER;
break;
case DB_LORD_EMPEROR:
toClientPacket[nCol] = PR_LORD_EMPEROR;
break;
case DB_SUMMONER:
toClientPacket[nCol] = PR_SUMMONER;
break;
case DB_BLOODY_SUMMONER:
toClientPacket[nCol] = PR_BLOODY_SUMMONER;
break;
case DB_DIMENSION_MASTER:
toClientPacket[nCol] = PR_DIMENSION_MASTER;
break;
}
}
void gObjCharacterFenrirSetPreview(short ItemType, unsigned char *CharSet, unsigned char FenrirType)
{
register unsigned char PreviewFenrir = FENRIR_EMPTY;
int aNewValue = 0;
switch (ItemType)
{
case FENRIR_TYPE:
switch (FenrirType)
{
case 0x04://gold
PreviewFenrir = FENRIR_GOLD;
CharSet[17] = PreviewFenrir;
break;
}
}
}
void __declspec(naked) GoldFenrirVisualFix()
{
/* [DDT] By.Kim */
__asm
{
mov cl, byte ptr ds:[eax+0x32];
and ecx, 0x3f;
cmp cl, 0x04;
je ponto1;
jmp ponto2;
ponto1:
mov byte ptr ss:[ebp-0x130], 0x01;
jmp ponto2;
ponto2:
mov edi, 0x0004257B6;
jmp edi
}
}
void __stdcall gObjViewportPatchExecute(OBJECTSTRUCT *lpObj)
{
gObjCharacterClassSetPreview(lpObj->DbClass, lpObj->CharSet);
if(lpObj->pInventory[WINGS].m_Type != SLOT_EMPTY)
gObjCharacterWingsSetPreview(lpObj->pInventory[WINGS].m_Type, lpObj->CharSet);
if ((lpObj->pInventory[GUARDIAN].m_Type != SLOT_EMPTY) && (lpObj->pInventory[WINGS].m_Type == SLOT_EMPTY))
{
gObjCharacterFenrirSetPreview(lpObj->pInventory[GUARDIAN].m_Type, lpObj->CharSet, lpObj->pInventory[GUARDIAN].m_NewOption);
}
}
void UserHookInit()
{
//Liberar entrada com Summoner e chars 3ª Classe (kimdu) - NÃO É VISUAL
memset((PBYTE)0x004CDA4D,0xE9,1);
HookThis((DWORD)&LoadNewClasses,0x004CDA4D);
//Visual Bug InGame (class & wings)
//Agradecimento ao f1x
*(unsigned int*)0x0B5F0040 = (unsigned int)gObjViewportPatchExecute;
BYTE VisualBug1[] = {0xFF,0x75,0xF8,0xFF,0x15,0x40,0x00,0x5F,0x0B,0x5F ,0x5E,0x5B,0x8B,0xE5,0x5D,0xC3};
memcpy((DWORD*)0x004E996D,VisualBug1,sizeof(Visual Bug1));
SetNop(0x004F0ABF,6);
SetNop(0x004F0B17,6);
//Visual Bug SelectScreen (wings)
*(unsigned int*)0x0B5F0050 = (unsigned int)JGPGetCharListEx;
memset((PBYTE)0x00423C57,0x3F,1);
memset((PBYTE)0x00423CD0,0x85,1);
memset((PBYTE)0x00423D03,0x52,1);
unsigned char VisualBug2[] = {
0x8D,0xBD,0xEC,0xFE,0xFF,0xFF,0x57,0xFF,0x75,0x08, 0xFF,0xB5,0x94,0xFE,0xFF,0xFF,
0xFF,0x15,0x50,0x00,0x5F,0x0B,0xE9,0x87,0xE4,0xFF, 0xFF,0x8A,0x95,0xE8,0xFE,0xFF,
0xFF,0x88,0x95,0xD5,0xFE,0xFF,0xFF,0x6A,0x07,0x8D, 0x85,0xD4,0xFE,0xFF,0xFF,0x50,
0x8D,0x8D,0xEC,0xFE,0xFF,0xFF,0x51,0xE8,0x26,0xAB, 0x15,0x00,0x83,0xC4,0x0C,0x8B,
0x95,0xE8,0xFE,0xFF,0xFF,0x52,0x8D,0x85,0xEC,0xFE, 0xFF,0xFF,0x50,0x8B,0x8D,0xE0,
0xFE,0xFF,0xFF,0x51,0xE8,0x4B,0xF8,0xFD,0xFF,0x83, 0xC4,0x0C,0x5F,0x5E,0x5B,0x8B,
0xE5,0x5D,0xC3 };
memcpy((DWORD*)0x0042583E,VisualBug2,sizeof(Visual Bug2));
//GoldFenrir Visual Bug Fix - SelectScreen
memset((PBYTE)0x004257B0,0xE9,1);
HookThis((DWORD)&GoldFenrirVisualFix,0x004257B0);
//memset((PBYTE)0x00427415,0x90,1);
SetByte(0x004257B5, 0xe9);
FixItemDurRepaire();
FixWingsRepair();
}
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.