Smoke Effect 1.05D

Results 1 to 3 of 3
  1. #1
    Enthusiast JB Lima is offline
    MemberRank
    Nov 2013 Join Date
    44Posts

    config Smoke Effect 1.05D

    help-me Smoke effect 1.05 D MuEmu not work

    .cpp
    Code:
    #include "StdAfx.h"
    #include "ToolKit.h"
    
    DWORD pItemType = 0;
    
    float R = 0.0f;
    float G = 0.0f;
    float B = 0.0f;
    
    int g_iItemCount = 0;
    
    cSmokeEffect::sEffect eColor[256];
    
    cSmokeEffect gSmokeEffect;
    
    cSmokeEffect::cSmokeEffect()
    {
        /**/
    }
    
    cSmokeEffect::~cSmokeEffect()
    {
        /**/
    }
    
    INT cSmokeEffect::GetLineId(DWORD ItemType)
    {
        for(int i = 0;i < g_iItemCount;i++)
        {
            if(pItemType == OBJ_ID(11,eColor[i].Id)) // Boots type (11)
            {
                return i;
            }
        }
    
        return -1;
    }
    
    __declspec(naked) void SetItemEffect()
    {
        _asm
        {
            MOV pItemType, ECX
        }
    
        if(gSmokeEffect.GetLineId(pItemType) > -1)
        {
            _asm
            {
                MOV ESI, HDK_ITEM_EFFECT_ALLOW
                    JMP ESI
            }
        }
    
        _asm
        {
            MOV ESI, HDK_ITEM_EFFECT_NOT_ALLOW 
                JMP ESI
        }
    }
    
    __declspec(naked) void SetColorEffect()
    {
        _asm
        {
            MOV pItemType, ECX
        }
    
        int i;
        i = gSmokeEffect.GetLineId(pItemType);
    
        for(int i = 0; i < g_iItemCount; i++)
        {
            if(pItemType == OBJ_ID(11,eColor[i].Id))
            {
                R = eColor[i].R;
                G = eColor[i].G;
                B = eColor[i].B;
    
                _asm
                {
                    // R
                    MOV ECX,DWORD PTR SS:[EBP+0xC] // struct RGB
                    MOV EDX, R
                    MOV DWORD PTR DS:[ECX+0x9C],EDX // float =D
                    // G
                    MOV EDX,DWORD PTR SS:[EBP+0xC]  // struct RGB
                    MOV EAX, G
                    MOV DWORD PTR DS:[EDX+0xA0],EAX // float =D
                    // B
                    MOV EAX,DWORD PTR SS:[EBP+0xC]  // struct RGB
                    MOV ECX, B
                    MOV DWORD PTR DS:[EAX+0xA4],ECX
                }
            }
        }
    
        _asm
        {
            MOV ESI, HDK_NEXT_ITEM_COLOR
            JMP ESI
        }
    }
    
    void cSmokeEffect::Load()
    {
        if(!SmokeEffectIni) return;
    
        fopen_s(&SMDFile,SmokeEffectIni,"r");
    
        if(SMDFile != NULL)
        {
            SMDToken Token;
            Token = GetToken();
    
            if((Token == END) || (TokenNumber != 0))
            {
                MessageBox(NULL,"Invalid file, the Section 0 should be the first Section.",SmokeEffectIni,MB_OK|MB_ICONERROR);
                ::ExitProcess(0);
            }
    
            g_iItemCount = 0;
            memset(eColor,-1,sizeof(eColor));
    
            while(true)
            {
                Token = GetToken();
    
                if((Token == END) || (lstrcmpi(TokenString,"end") == 0)) break;
    
                eColor[g_iItemCount].Id        = (int)TokenNumber; Token = GetToken();
                eColor[g_iItemCount].R        = TokenNumber; Token = GetToken();
                eColor[g_iItemCount].G        = TokenNumber; Token = GetToken();
                eColor[g_iItemCount].B        = TokenNumber;
    
                g_iItemCount++;
            }
    
            if(g_iItemCount > 0)
            {
                ToolKit.SetNop(HDK_SET_ITEM_EFFECT,12);
                ToolKit.WriteJmp(HDK_SET_ITEM_EFFECT, (DWORD)&SetItemEffect);
    
                ToolKit.SetNop(HDK_SET_COLOR_EFFECT,46);
                ToolKit.WriteJmp(HDK_SET_COLOR_EFFECT,(DWORD)&SetColorEffect);
            }
        }
        else
        {
            MessageBox(NULL,"Unable to open file",SmokeEffectIni,MB_OK|MB_ICONERROR);
            ::ExitProcess(0);
        }
    
        fclose(SMDFile);
    }
    .h

    Code:
    #ifndef _SmokeEffect_H_
    #define _SmokeEffect_H_
    
    #define MAX_ITEM_TYPE    512
    #define ITEM_ID            819 // 0x333 / 819
    #define GET_ITEM(x, y)    ((x * MAX_ITEM_TYPE) + y)
    #define OBJ_ID(x, y)    (x * MAX_ITEM_TYPE + y) + ITEM_ID
    
    // - Smoke Effect
    
    #define HDK_SET_ITEM_EFFECT           
    #define HDK_SET_COLOR_EFFECT       
    #define HDK_ITEM_EFFECT_ALLOW     
    #define HDK_ITEM_EFFECT_NOT_ALLOW  
    #define HDK_NEXT_ITEM_COLOR 
    
    class cSmokeEffect
    {
        public:
            cSmokeEffect();
            virtual ~cSmokeEffect();
    
            void Load();
            INT GetLineId(DWORD ItemType);
    
            struct sEffect
            {
                int Id;
    
                float R;
                float G;
                float B;
            };
    };
    
    extern cSmokeEffect gSmokeEffect;
    
    extern cSmokeEffect::sEffect eColor[256];
    
    #endif


  2. #2
    (づ。◕‿‿◕。) Natzugen is offline
    MemberRank
    Jun 2014 Join Date
    ElbelandLocation
    1,858Posts

    Re: Smoke Effect 1.05D

    of course it wont work if you dont research and add your offsets

  3. #3
    Enthusiast JB Lima is offline
    MemberRank
    Nov 2013 Join Date
    44Posts

    Re: Smoke Effect 1.05D

    hi bro it is my offsets
    #define MAX_ITEM_TYPE 512
    #define ITEM_ID 819 // 0x333 / 819
    #define GET_ITEM(x, y) ((x * MAX_ITEM_TYPE) + y)
    #define OBJ_ID(x, y) (x * MAX_ITEM_TYPE + y) + ITEM_ID

    // - Smoke Effect

    #define HDK_SET_ITEM_EFFECT 0x004F3200 // OK
    #define HDK_SET_COLOR_EFFECT 0x004F3265 // OK
    #define HDK_ITEM_EFFECT_ALLOW 0x004F322A // OK
    #define HDK_ITEM_EFFECT_NOT_ALLOW 0x004F38C9 // OK
    #define HDK_NEXT_ITEM_COLOR 0x004F329D // OK



Advertisement