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

Results 1 to 10 of 10
  1. #1
    Newbie :) Pinkof is offline
    MemberRank
    Mar 2008 Join Date
    760Posts

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

    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;
    }


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

    This is for monster number 400 in monster.txt


  2. #2
    Lage Company™ afonsolage is offline
    MemberRank
    Mar 2012 Join Date
    Fortaleza, BRALocation
    244Posts

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

    You rock Pinkof!

    Nice job!

  3. #3
    Member Omegamon is offline
    MemberRank
    Jan 2012 Join Date
    BrazilLocation
    77Posts

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

    Pinkof can you post main?, and you have defines offsets with args for coding in C
    PS Sorry for my English

  4. #4
    Darkness Member Kiosani is offline
    MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,276Posts

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

    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.

  5. #5
    Proficient Member [KeysS] is offline
    MemberRank
    Aug 2008 Join Date
    PeruLocation
    159Posts

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

    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 by [KeysS]; 30-07-13 at 02:52 AM.

  6. #6
    Darkness Member Kiosani is offline
    MemberRank
    Oct 2007 Join Date
    ArgentinaLocation
    1,276Posts

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

    Quote Originally Posted by [KeysS] View Post
    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?

  7. #7
    C/C++,PHP,HTML,Java,ASM zasmqniq is offline
    MemberRank
    Jan 2009 Join Date
    BulgariaLocation
    435Posts

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

    Good Work but i think there are a lot more better than this one this is old stuff i think :)!

  8. #8
    Newbie :) Pinkof is offline
    MemberRank
    Mar 2008 Join Date
    760Posts

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

    Quote Originally Posted by zasmqniq View Post
    Good Work but i think there are a lot more better than this one this is old stuff i think :)!
    and where you want use it?

  9. #9
    C/C++,PHP,HTML,Java,ASM zasmqniq is offline
    MemberRank
    Jan 2009 Join Date
    BulgariaLocation
    435Posts

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

    Doesnt matter pinkof thanks you or all the good job :)!

  10. #10
    Enthusiast MagicBlad is offline
    MemberRank
    Oct 2006 Join Date
    PeruLocation
    33Posts

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

    any source for 99b main?



Advertisement