Resultados 1 a 6 de 6
  1. #1
    Membro Goten's Avatar
    Data de Ingresso
    Feb 2020
    Posts
    21
    Post Thanks / Like
    Mencionado
    2 Post(s)
    País
    Brazil

    Source custom bow + getmaininfo






    Nota
    GETMAININFO


    CustomCrossBow.h
    Código:
    #pragma once
    
    #define MAX_CUSTOM_BOW 200
    
    struct CUSTOM_BOW_INFO
    {
        int Index;
        int ItemIndex;
        char ModelName[32];
        int ItemType;
        int SkillShot;
        int ColorR;
        int ColorG;
        int ColorB;
    };
    
    class cCustomBow
    {
    public:
        cCustomBow();
        virtual ~cCustomBow();
        void Init();
        void Load(char* path);
        void SetInfo(CUSTOM_BOW_INFO info);
    public:
        CUSTOM_BOW_INFO m_CustomBowInfo[MAX_CUSTOM_BOW];
    }; extern cCustomBow gCustomCrossBow;
    CustomCrossBow.cpp
    Código:
    // CustomItem.cpp: implementation of the cCustomBow class.
    //
    //////////////////////////////////////////////////////////////////////
    
    #include "stdafx.h"
    #include "CustomCrossBow.h"
    #include "MemScript.h"
    
    cCustomBow gCustomCrossBow;
    //////////////////////////////////////////////////////////////////////
    // Construction/Destruction
    //////////////////////////////////////////////////////////////////////
    
    cCustomBow::cCustomBow() // OK
    {
        this->Init();
    }
    
    cCustomBow::~cCustomBow() // OK
    {
    
    }
    
    void cCustomBow::Init() // OK
    {
        for(int n=0;n < MAX_CUSTOM_BOW;n++)
        {
            this->m_CustomBowInfo[n].Index = -1;
        }
    }
    
    void cCustomBow::Load(char* path) // OK
    {
        CMemScript* lpMemScript = new CMemScript;
    
        if(lpMemScript == 0)
        {
            printf(MEM_SCRIPT_ALLOC_ERROR,path);
            return;
        }
    
        if(lpMemScript->SetBuffer(path) == 0)
        {
            printf(lpMemScript->GetLastError());
            delete lpMemScript;
            return;
        }
    
        this->Init();
    
        try
        {
            while(true)
            {
                if(lpMemScript->GetToken() == TOKEN_END)
                {
                    break;
                }
    
                if(strcmp("end",lpMemScript->GetString()) == 0)
                {
                    break;
                }
    
                CUSTOM_BOW_INFO info;
    
                memset(&info,0,sizeof(info));
    
                static int CustomItemIndexCount = 0;
    
                info.Index = CustomItemIndexCount++;
    
                info.ItemIndex = lpMemScript->GetNumber();
    
                strcpy_s(info.ModelName,lpMemScript->GetAsString());
    
                info.ItemType = lpMemScript->GetAsNumber();
    
                info.SkillShot = lpMemScript->GetAsNumber();
    
                info.ColorR = lpMemScript->GetAsNumber();
    
                info.ColorG = lpMemScript->GetAsNumber();
    
                info.ColorB = lpMemScript->GetAsNumber();
    
                this->SetInfo(info);
            }
        }
        catch(...)
        {
            printf(lpMemScript->GetLastError());
        }
    
        delete lpMemScript;
    }
    
    void cCustomBow::SetInfo(CUSTOM_BOW_INFO info) // OK
    {
        if(info.Index < 0 || info.Index >= MAX_CUSTOM_BOW)
        {
            return;
        }
    
        this->m_CustomBowInfo[info.Index] = info;
    }

    GetMainInfo.cpp
    Código:
    #include "CustomCrossBow.h"
    
    struct MAIN_FILE_INFO
    {
    //... aquí adentro al final del contenido...//
    CUSTOM_BOW_INFO CustomBowInfo[MAX_CUSTOM_BOW];
    }
    
    gCustomCrossBow.Load("CustomCrossbow.txt");
    memcpy(info.CustomBowInfo, gCustomCrossBow.m_CustomBowInfo, sizeof(info.CustomBowInfo));
    Nota
    MAIN.DLL


    CustomBow.h
    Código:
    #pragma once
    
    #define MAX_CUSTOM_BOW 200
    
    struct CUSTOM_BOW_INFO
    {
        int Index;
        int ItemIndex;
        char ModelName[32];
        int ItemType;
        int SkillShot;
        int ColorR;
        int ColorG;
        int ColorB;
    };
    
    class CCustomBow
    {
    public:
        CCustomBow();
        virtual ~CCustomBow();
        void Init();
        void Load(CUSTOM_BOW_INFO* info);
        void SetInfo(CUSTOM_BOW_INFO info);
        CUSTOM_BOW_INFO* GetInfo(int index);
        CUSTOM_BOW_INFO* GetInfoByItem(int ItemIndex);
        bool CheckCustomBow(int ItemIndex);
        bool CheckCustomCross(int ItemIndex);
    public:
        CUSTOM_BOW_INFO m_CustomBowInfo[MAX_CUSTOM_BOW];
    };
    
    extern CCustomBow gCustomBow;
    CustomBow.cpp
    Código:
    #include "stdafx.h"
    #include "CustomBow.h"
    
    CCustomBow gCustomBow;
    //////////////////////////////////////////////////////////////////////
    // Construction/Destruction
    //////////////////////////////////////////////////////////////////////
    
    CCustomBow::CCustomBow() // OK
    {
        this->Init();
    }
    
    CCustomBow::~CCustomBow() // OK
    {
    
    }
    
    void CCustomBow::Init() // OK
    {
        for(int n=0;n < MAX_CUSTOM_BOW;n++)
        {
            this->m_CustomBowInfo[n].Index = -1;
        }
    }
    
    void CCustomBow::Load(CUSTOM_BOW_INFO* info) // OK
    {
        for(int n=0;n < MAX_CUSTOM_BOW;n++)
        {
            this->SetInfo(info[n]);
        }
    }
    
    void CCustomBow::SetInfo(CUSTOM_BOW_INFO info) // OK
    {
        if(info.Index < 0 || info.Index >= MAX_CUSTOM_BOW)
        {
            return;
        }
    
        this->m_CustomBowInfo[info.Index] = info;
    }
    
    CUSTOM_BOW_INFO* CCustomBow::GetInfo(int index) // OK
    {
        if(index < 0 || index >= MAX_CUSTOM_BOW)
        {
            return 0;
        }
    
        if(this->m_CustomBowInfo[index].Index != index)
        {
            return 0;
        }
    
        return &this->m_CustomBowInfo[index];
    }
    
    CUSTOM_BOW_INFO* CCustomBow::GetInfoByItem(int ItemIndex) // OK
    {
        for(int n=0;n < MAX_CUSTOM_BOW;n++)
        {
            CUSTOM_BOW_INFO* lpInfo = this->GetInfo(n);
    
            if(lpInfo == 0)
            {
                continue;
            }
    
            if(lpInfo->ItemIndex == ItemIndex)
            {
                return lpInfo;
            }
        }
    
        return 0;
    }
    
    bool CCustomBow::CheckCustomBow(int ItemIndex) // OK
    {
        for (int i=0;i<MAX_CUSTOM_BOW; i++)
        {
            if (ItemIndex == this->m_CustomBowInfo[i].ItemIndex)
            {
                if(this->m_CustomBowInfo[i].ItemType == 0){
                    return true;
                }else{
                    return false;
                }
            }
        }
        return false;
    }
    
    bool CCustomBow::CheckCustomCross(int ItemIndex) // OK
    {
        for (int i=0;i<MAX_CUSTOM_BOW; i++)
        {
            if (ItemIndex == this->m_CustomBowInfo[i].ItemIndex)
            {
                if(this->m_CustomBowInfo[i].ItemType == 1){
                    return true;
                }else{
                    return false;
                }
            }
        }
        return false;
    }
    ItemAsm.h
    Código:
    #define iBowAddSkillEffect 0x0074A128
    #define iBowAddInventoryPos 0x005CC8E4
    #define iBowAddPlayerDimension 0x00566178
    #define iCrossAddSkillEffect 0x00749DCC
    #define iCrossBowAddPlayerDimension 0x0056595E 
    
    void InitBows();
    ItemAsm.cpp
    Código:
    #include "stdafx.h"
    #include "Offset.h"
    #include "Util.h"
    #include "TMemory.h"
    #include "ItemAsm.h"
    #include "Import.h"
    #include "Defines.h"
    #include "CustomBow.h"
    #include "Offset.h"
    #include "Object.h"
    
    DWORD IsBowItem = 0;
    DWORD IsCrossItem = 0;
    DWORD BowValue = 0x09C;
    DWORD MaxBoneCount = 0x108;
    DWORD WorldPosition = 0x0FC;
    DWORD CrossBowskill = 298;
    //-------------------------------------------------------------------
    DWORD oCreateEffect = 0x006D9070; // 1.04D ENG
    DWORD ReturnBowCode = 0x0074A12E; // 1.04D ENG
    DWORD BowPosition = 0x005CC8ED; // 1.04D ENG
    DWORD NextBowPosition = 0x005CC92E; // 1.04D ENG
    DWORD BowAddPlayerDimension_Offset = 0x0056617F; // 1.04D ENG
    DWORD ReturnCrossCode    = 0x00749DD2;
    //-------------------------------------------------------------------
    void __declspec(naked) cBowAddSkillEffect()
    {
        _asm
        {
            mov ecx, dword ptr ss : [ebp - 0x04]
            mov dword ptr ss : [ebp - 0x14], ecx
            mov IsBowItem, ecx
        }
        // ---
        if(gCustomBow.CheckCustomBow(IsBowItem-ITEM_INTER)) // Devil Crossbow
        {
            CUSTOM_BOW_INFO* lpInfo = gCustomBow.GetInfoByItem(IsBowItem - ITEM_INTER);
            CrossBowskill = lpInfo->SkillShot;
    
            _asm
            {
                push - 1
                push 0
                push 0
                mov dx, word ptr ss : [ebp + 0x18]
                push edx
                mov ax, word ptr ss : [ebp + 0x14]
                push eax
                mov ecx, dword ptr ss : [ebp + 0x0C]
                mov dx, word ptr ds : [ecx + 0x2C]
                push edx
                mov eax, dword ptr ss : [ebp + 0x0C]
                push eax
                mov ecx, dword ptr ss : [ebp - 0x8]
                push ecx
                mov edx, dword ptr ss : [ebp + 0x0C]
                add edx, BowValue
                push edx
                mov eax, dword ptr ss : [ebp + 0x0C]
                add eax, MaxBoneCount
                push eax
                mov ecx, dword ptr ss : [ebp + 0x0C]
                add ecx, WorldPosition
                push ecx
                push CrossBowskill
                call oCreateEffect
            }
        }
        _asm
        {
            jmp ReturnBowCode
        }
    }
    
    void __declspec(naked) cCrossAddSkillEffect()
    {
        _asm
        {
            mov ecx, dword ptr ss : [ebp - 0x0C]
            mov dword ptr ss : [ebp - 0x10], ecx
            mov IsCrossItem, ecx
        }
        // ---
        if(gCustomBow.CheckCustomCross(IsCrossItem-ITEM_INTER)) // Devil Crossbow
        {
            CUSTOM_BOW_INFO* lpInfo = gCustomBow.GetInfoByItem(IsCrossItem - ITEM_INTER);
            CrossBowskill = lpInfo->SkillShot;
            _asm
            {
                push - 1
                push 0
                push 0
                mov dx, word ptr ss : [ebp + 0x18]
                push edx
                mov ax, word ptr ss : [ebp + 0x14]
                push eax
                mov ecx, dword ptr ss : [ebp + 0x0C]
                mov dx, word ptr ds : [ecx + 0x2C]
                push edx
                mov eax, dword ptr ss : [ebp + 0x0C]
                push eax
                mov ecx, dword ptr ss : [ebp - 0x8]
                push ecx
                mov edx, dword ptr ss : [ebp + 0x0C]
                add edx, BowValue
                push edx
                mov eax, dword ptr ss : [ebp + 0x0C]
                add eax, MaxBoneCount
                push eax
                mov ecx, dword ptr ss : [ebp + 0x0C]
                add ecx, WorldPosition
                push ecx
                push CrossBowskill
                call oCreateEffect
            }
        }
        // ---
        _asm
        {
            jmp ReturnCrossCode
        }
    }
    //-------------------------------------------------------------------
    void __declspec(naked) cBowAddPlayerDimension()
    {
        _asm
        {
            mov ecx, dword ptr ss : [ebp - 0x04]
            mov dword ptr ss : [ebp - 0x14], ecx
            mov IsBowItem, ecx
        }
        if(IsBowItem == 0x0CA7){
            
            _asm{
    
                je ReturnLoad
            }
    
        } else if(gCustomBow.CheckCustomBow(IsBowItem - ITEM_INTER)){
            
            _asm{
    
                je ReturnLoad
            }
    
        }
        _asm
        {
            ReturnLoad :
            // ---
            jmp BowAddPlayerDimension_Offset
        }
    }
    
    void __declspec(naked) cCrossBowAddPlayerDimension()
    {
        static DWORD Address1 = 0x00565994;
        static DWORD Address2 = 0x005659E7;  
    
        _asm
        {
           Mov Ecx, Dword ptr ss : [ebp + 0x1C]
           Mov Dword ptr ss : [ebp + 0x1C],Ecx
           Mov IsCrossItem, Ecx
        }
    
        if(gCustomBow.CheckCustomCross(IsCrossItem - ITEM_INTER))
        {
            _asm{jmp Address1}
        }
        else
        {
            _asm{jmp Address2}
        }
    }
    //-------------------------------------------------------------------
    void __declspec(naked) cBowAddInventoryPos()
    {
        _asm
        {
            mov ecx, dword ptr ss : [ebp + 0x8]
            mov dword ptr ss : [ebp + 0x8], ecx
            mov IsBowItem, ecx
        }
        // ---
        if (IsBowItem == 0x0CAB)
        {
            _asm{jmp BowPosition}
        }
        else if(gCustomBow.CheckCustomBow(IsBowItem - ITEM_INTER)){
            _asm{jmp BowPosition}
        }
        else
        {
            _asm{jmp NextBowPosition}
        }
    }
    
    #define sub_599F10_Addr            ((signed int(*)()) 0x599F10)
    signed int __cdecl FixBowArrow(WORD *a1)
    {
        signed int result; // [email protected]
        if ((int)(*a1/512) != 4 || *a1 == 2055 || *a1 == 2063)
        {
            return 0;
        }
        ItemBmdStruct* ItemInfo = pGetItemBmdStruct(*a1);
        if (ItemInfo == 0 || (*a1/512) != 4)
        {
            return 0;
        }
        if (ItemInfo->Slot == 0)
        {
            return 2;
        }
        if (ItemInfo->Slot == 1)
        {
            return 1;
        }
        return 0;
    }
    
    void __declspec(naked) cBowCheckPositionOnMap()
    {
        static DWORD ret_continue = 0x005659EE;
        static DWORD ret_succes = 0x00565994;
    
        static DWORD IsCrossItem;
    
        __asm
        {
            mov EAX, DWORD PTR SS:[EBP+0x1C]
            mov IsCrossItem, EAX
        }
    
        if (gCustomBow.CheckCustomCross(IsCrossItem - ITEM_INTER))
        {
            __asm
            {
                jmp ret_succes
            }
        }
        else
        {
            __asm
            {
                CMP DWORD PTR SS:[EBP+0x1C],0x22C
                jmp ret_continue;
            }
        }
    }
    //-------------------------------------------------------------------
    void InitBows()
    {
        SetCompleteHook(0xE8,0x5913D0+0xDB ,&FixBowArrow);
        SetCompleteHook(0xE8,0x5913D0+0xF7 ,&FixBowArrow);
        SetCompleteHook(0xE8,0x5A05C0+0x92 ,&FixBowArrow);
        SetCompleteHook(0xE8,0x5A05C0+0x1B5,&FixBowArrow);
        SetCompleteHook(0xE8,0x5B5FC0+0xD34,&FixBowArrow);
        SetCompleteHook(0xE8,0x7E04B0+0xF8 ,&FixBowArrow);
    
        MemorySet(0x005659E7,0x90,7);
        SetCompleteHook(0xE9,0x005659E7,&cBowCheckPositionOnMap);
    
        SetRange((LPVOID)iBowAddSkillEffect, 6, ASM::NOP);
        SetJmp((LPVOID)iBowAddSkillEffect, cBowAddSkillEffect);
        // ----
        SetRange((LPVOID)iBowAddInventoryPos, 6, ASM::NOP);
        SetJmp((LPVOID)iBowAddInventoryPos, cBowAddInventoryPos);
        // ----
        SetRange((LPVOID)iBowAddPlayerDimension, 7, ASM::NOP);
        SetJmp((LPVOID)iBowAddPlayerDimension, cBowAddPlayerDimension);
        // ----
        SetRange((LPVOID)iCrossAddSkillEffect, 6, ASM::NOP);
        SetJmp((LPVOID)iCrossAddSkillEffect, cCrossAddSkillEffect);
        // ----
        SetRange((LPVOID)iCrossBowAddPlayerDimension, 6, ASM::NOP);
        SetJmp((LPVOID)iCrossBowAddPlayerDimension, cCrossBowAddPlayerDimension);
        // ----
    }
    item.cpp
    Código:
    void ItemModelLoad() // OK
    {
    for (int i=0;i<MAX_CUSTOM_BOW; i++)
        {
            if (gCustomBow.m_CustomBowInfo[i].Index != -1)
            {
                LoadItemModel(gCustomBow.m_CustomBowInfo[i].ItemIndex+ITEM_BASE_MODEL,"Item\\",gCustomBow.m_CustomBowInfo[i].ModelName,-1);
            }
    
        }
    }
    
    void ItemTextureLoad() // OK
    {
    for (int i=0;i<MAX_CUSTOM_BOW; i++)
        {
            if (gCustomBow.m_CustomBowInfo[i].Index != -1)
            {
                LoadItemTexture(gCustomBow.m_CustomBowInfo[i].ItemIndex+ITEM_BASE_MODEL,"Item\\",gCustomBow.m_CustomBowInfo[i].ModelName,-1);
            }
    
        }
    }
    customitem.cpp
    Código:
    BOOL CCustomItem::GetCustomItemColor(int ItemIndex,float* ItemColor) // OK
    {
        CUSTOM_ITEM_INFO* lpInfo = this->GetInfoByItem(ItemIndex);
        //------------------------------------------------------------------
        // color de custom bow
        CUSTOM_BOW_INFO* lpInfo2 = gCustomBow.GetInfoByItem(ItemIndex);
        //------------------------------------------------------------------
        if(lpInfo == 0 && lpInfo2 == 0 )
        {
            return 0;
        }
    
        if(lpInfo != 0)
        {
            ItemColor[0] = (float)(lpInfo->ColorR/255.0f);
            ItemColor[1] = (float)(lpInfo->ColorG/255.0f);
            ItemColor[2] = (float)(lpInfo->ColorB/255.0f);
        } 
        //------------------------------------------------------------------
        else if(lpInfo2 != 0){
            ItemColor[0] = (float)(lpInfo2->ColorR/255.0f);
            ItemColor[1] = (float)(lpInfo2->ColorG/255.0f);
            ItemColor[2] = (float)(lpInfo2->ColorB/255.0f);
        }
        //------------------------------------------------------------------
        return 1;
    }
    main.cpp
    Código:
    #include "ItemAsm.h"
    #include "CustomBow.h"
    extern "C" _declspec(dllexport) void EntryProc() // OK
    {
    gCustomBow.Load(gProtect.m_MainInfo.CustomBowInfo);
    InitBows();
    }
    Informação
    Ejemplo de CustomCrossbow.txt


    Código HTML:
    //                     FILES PREMIUN SYSTEM CUSTOM BOW [200 MAX]
    //=============================================================================
    // MasterCodex Season 6 - Mu Online
    // Developer: MasterCodex
    // Last review: 02.20.2020
    //==============================================================================
    // Custom Bows & Crossbows Config File
    //==============================================================================
    // Valid EffecID: 266,267,268,269,270,271,272,273,274,294,
    //                295,296,297,298,321,324,335,365,509
    //-------------------------------------------------------------------------------
    // Type: Crossbows -> 1; Bows -> 0;
    //================================================================================
    //ItemID        Model                   Type    EffecID     ColorR  ColorG  ColorB
    2076            bloodangel_bow          0       270         205        192        176
    2078            absolute_gunbow         1       298         253     255     119
    2079            Darkangel_Bow              0       270         255     226     115
    2084            HolyAngelBow            0       298         255     197     57
    2086           hs_soularcherbow_s      0       270         239     154     70
    2088            blue_eyebow_stand       0       509         122     139     168
    end

    Créditos:
    takumi12
    Last edited by Goten; 03-21-2020 at 10:28 AM.

  2. #2
    Membro cleniojr's Avatar
    Data de Ingresso
    Feb 2018
    Posts
    36
    Post Thanks / Like
    Mencionado
    2 Post(s)
    País
    Brazil
    Vou testar, obrigado!

    No meu, ao compilar o Main, deu que: " ItemBmdStruct* ItemInfo = pGetItemBmdStruct(*a1);" esses três itens são undeclared e indefined
    Last edited by cleniojr; 03-21-2020 at 11:04 PM. Razão: Acrescentar

  3. #3
    Membro Avançado Linkzr's Avatar
    Data de Ingresso
    Dec 2015
    Posts
    120
    Post Thanks / Like
    Mencionado
    12 Post(s)
    MEU HUMOR
    Yeehaw
    País
    Brazil
    Funciona somente na season6 ? vi algumas config com as chamadas 1.04D ENG
    [Somente membros podem ver os links. ]

  4. #4
    Membro Goten's Avatar
    Data de Ingresso
    Feb 2020
    Posts
    21
    Post Thanks / Like
    Mencionado
    2 Post(s)
    País
    Brazil
    @[Somente membros podem ver os links. ] veja se na sua source tem esses defines:
    #define pItemBmdStruct *(ItemBmdStruct*)0x8128AC0
    #define pGetItemBmdStruct(ItemId) (ItemBmdStruct*)(*(DWORD*)0x8128AC0 + sizeof(ItemBmdStruct) * ItemId)

    @[Somente membros podem ver os links. ] esses offsets é para S6

  5. #5
    Membro cleniojr's Avatar
    Data de Ingresso
    Feb 2018
    Posts
    36
    Post Thanks / Like
    Mencionado
    2 Post(s)
    País
    Brazil
    Citação Originally Posted by Goten Ver Post
    @[Somente membros podem ver os links. ] veja se na sua source tem esses defines:
    #define pItemBmdStruct *(ItemBmdStruct*)0x8128AC0
    #define pGetItemBmdStruct(ItemId) (ItemBmdStruct*)(*(DWORD*)0x8128AC0 + sizeof(ItemBmdStruct) * ItemId)

    @[Somente membros podem ver os links. ] esses offsets é para S6
    Obrigado, @[Somente membros podem ver os links. ]. Eu coloquei essas duas linhas, achei elas no Main do Season 6. Mas como o meu é season 4, n pegou para mim. Você n teria para s4 não? please?

  6. #6
    Membro Goten's Avatar
    Data de Ingresso
    Feb 2020
    Posts
    21
    Post Thanks / Like
    Mencionado
    2 Post(s)
    País
    Brazil
    @[Somente membros podem ver os links. ]
    não tenho os offsets para outras season6, o que postei é somente para season6. sorry

Permissões de Postagem

  • Você não pode iniciar novos tópicos
  • You may not post Resposta(s)
  • Você não pode enviar anexos
  • Você não pode editar suas mensagens
  •  
Sobre nós
Somos uma comunidade em atividade a 6 anos que aborda assuntos relacionados a games em geral, principalmente games MMORPG. e que busca sempre ajudar os membros através de conteúdos, tutoriais e suporte...
Rede Sociais