• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Development] Source for add Titus NPC on Main 1.02c

Joined
Mar 13, 2008
Messages
758
Reaction score
1,005
Main.CPP
Code:
#include "StdAfx.h"

CHAR *ItemDir     = "Data\\Npc\\";
CHAR *ItemFolder = "Npc\\";
CHAR * NpcName = "Titus";


void __declspec(naked) main()
{
    _asm
    {
CMP DWORD PTR SS:[EBP-0x18],0x18f //Compare mob 400  
jnz noes;
PUSH 0x2c4
mov eax,0x0685FFD
call eax
ADD ESP,0x4
PUSH 0
MOV CL,BYTE PTR SS:[EBP+0x10]
PUSH ECX
MOV DL,BYTE PTR SS:[EBP+0xC]
PUSH EDX
PUSH 0x2c4
MOV EAX,DWORD PTR SS:[EBP+0x14]
PUSH EAX
mov eax,0x0531B17
call eax
ADD ESP,0x14
MOV DWORD PTR SS:[EBP-0x4],EAX
MOV ECX,DWORD PTR SS:[EBP-0x4]
MOV DWORD PTR SS:[EBP-0xC],ECX
mov eax,0x053788D
jmp eax;
noes:
CMP DWORD PTR SS:[EBP-0x18],0x18f //compare mob 400
jnz noes2;
PUSH 0x2c5
mov eax,0x0685FFD
call eax
ADD ESP,0x4
PUSH 0
MOV CL,BYTE PTR SS:[EBP+0x10]
PUSH ECX
MOV DL,BYTE PTR SS:[EBP+0xC]
PUSH EDX
PUSH 0x2c5
MOV EAX,DWORD PTR SS:[EBP+0x14]
PUSH EAX
mov eax,0x0531B17
call eax
ADD ESP,0x14
MOV DWORD PTR SS:[EBP-0x4],EAX
MOV ECX,DWORD PTR SS:[EBP-0x4]
MOV DWORD PTR SS:[EBP-0xC],ECX
mov eax,0x053788D
jmp eax;
noes2:
CMP DWORD PTR SS:[EBP-0x18],0x176
mov eax,0x0534150
jmp eax;




    }


}


void __declspec(naked)load2()
{
    _asm
    {
    
    cmp edx,0x2c4
    jnz noes;
    xor ecx,ecx
    push -1
    push NpcName
    push ItemDir
    push 0x2c4
    mov eax,0x067FFA3
    call eax
    add esp,0x10
    push 0x1
    push 0x2600
    push 0x2901
    PUSH 0x7A99E4
    push 0x2c4
    mov eax,0x067FB27
    call eax
    add esp,0x14
    mov eax,0x0686C60
    jmp eax
noes:
cmp edx,0x2c5
    jnz noes2;
    xor ecx,ecx
    push -1
    push NpcName
    push ItemDir
    push 0x2c5
    mov eax,0x067FFA3
    call eax
    add esp,0x10
    push 0x1
    push 0x2600
    push 0x2901
    PUSH 0x7A99E4
    push 0x2c5
    mov eax,0x067FB27
    call eax
    add esp,0x14
    mov eax,0x0686C60
    jmp eax
noes2:
    CMP DWORD PTR SS:[EBP-0xC],0x43
    ja seguir;
    MOV EDX,DWORD PTR SS:[EBP-0xC]
    XOR ECX,ECX
    MOV CL,BYTE PTR DS:[EDX+0x686D64]
    JMP DWORD PTR DS:[ECX*0x4+0x686CC0]


seguir:
mov eax,0x0686C60
jmp eax;


    }
}


void __declspec(naked) NpcTalk()
{
    _asm
    {
        CMP DWORD PTR SS:[EBP+0xC],0x190 //cmp mob 400 
            jnz falso
            MOV EAX,DWORD PTR SS:[EBP-0x8]
            MOV BYTE PTR DS:[EAX+0xBC],4 //--- 4=NPC(Enable Talk) --- 2=MOB? ---1=Player?
            mov eax,0x0533ED7
            jmp eax
falso:
            CMP DWORD PTR SS:[EBP+0xC],0xC8
            mov eax,0x0533E6A
            jmp eax;


    }
}
BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
    *(DWORD*)(0x0534149+1) = (DWORD)&main - (0x0534149+5);
    *(BYTE*)(0x0534149) = 0xE9;






        *(DWORD*)(0x0686044+1) = (DWORD)&load2 - (0x0686044+5);
    *(BYTE*)(0x0686044) = 0xE9;


            *(DWORD*)(0x0533E55+1) = (DWORD)&NpcTalk - (0x0533E55+5);
    *(BYTE*)(0x0533E55) = 0xE9;


    




    return true;
}
Pinkof - [Development] Source for add Titus NPC on Main 1.02c - RaGEZONE Forums


This not is the best way for add a new npc but work fine..

This is for monster number 400 in monster.txt
 
Junior Spellweaver
Joined
Aug 5, 2008
Messages
149
Reaction score
38
Nice job pink ^^

Mauro: Ya deberias aprender a escribir en ingles, tanto tiempo en rz y sigue con la misma estupides de ingles que nadie entiende =S

Edit: Sin remedio, solo miren su respuesta :D
 
Last edited:
Joined
Oct 29, 2007
Messages
1,292
Reaction score
1,314
Nice job pink ^^

Mauro: Ya deberias aprender a escribir en ingles, tanto tiempo en rz y sigue con la misma estupides de ingles que nadie entiende =S

English:
Very nice.. Pinkof really, you understand (like: me), that code any thing to: client side, always is better directly in: ASM, that using decompiled code by: IDA. Good work! congratz.

Translated to Spanish (using Google Translate):
Muy bonito .. Pinkof realmente usted entiende (como: yo), que el código de cualquier cosa: del lado del cliente, siempre es mejor directamente en: ASM, que el uso de código descompilado por: IDA. Buen trabajo! congratz.

Lo que quise decir:
Muy bonito .. Pinkof, realmente usted entiende (como: yo), que el código de cualquier cosa: para lado del cliente, siempre es mejor hacerlo directamente en: ASM, que utilizando código descompilado por: IDA. Buen trabajo! Felicidades.

Spanish:
¿Que es lo que no se entiende?

English:
What do not you understand?
 
Elite Diviner
Joined
Jan 20, 2009
Messages
420
Reaction score
77
Good Work but i think there are a lot more better than this one this is old stuff i think :)!
 
Elite Diviner
Joined
Jan 20, 2009
Messages
420
Reaction score
77
Doesnt matter pinkof thanks you or all the good job :)!
 
Back
Top