Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Development] Item Smoke Effect

Experienced Elementalist
Joined
Nov 26, 2013
Messages
270
Reaction score
90
effects 1.02c, I base this function makes the other a little time ... (sorry my english is bad)

.h
Code:
#include "stdafx.h"

//struct
struct _effect
{
    int  Boots;
    float R;
    float G;
    float B;
};

//extern
extern _effect e[255];

//função refeita
__declspec() void DTset_effect();

//arquivo de leitura
void _loadfile_effect(char* filename);

.cpp
Code:
#include "stdafx.h"

//variavel global
int variavelE;

//struct
_effect e[255];

//variaveis
int pItemID_boots = 0;
float R       = 0.0f;
float G       = 0.0f;
float B       = 0.0f;

void _loadfile_effect(char* filename)
{
    Tokenizer          token;
    TokenizerGroup     group;
    TokenizerSection   section;

    token.ParseFile(std::string(filename), group);

    if(group.GetSection(0, section))
    {
        for(int i = 0; i < section.RowCount; i++)
        {
            e[variavelE].Boots         = section.Rows[i].GetInt(0);
            e[variavelE].R             = section.Rows[i].GetFloat(1);
            e[variavelE].G             = section.Rows[i].GetFloat(2);
            e[variavelE].B             = section.Rows[i].GetFloat(3);
            variavelE++;
        }
    }
}

//função refeita
__declspec(naked) void DTset_effect()
{
    __asm
    {
        // set:: boots
        MOV EAX,DWORD PTR SS:[EBP+8]
        MOVSX ECX,WORD PTR DS:[EAX+0x2D8]
        MOV pItemID_boots, ECX
    }

    for(int i = 0; i < variavelE; i++)
    {
        if(pItemID_boots == ITEM_GET(11, e[i].Boots))
        {
            R = e[i].R;
            G = e[i].G;
            B = e[i].B;
            _asm
           {
           // R
           MOV ECX,DWORD PTR SS:[EBP+0xC] // struct RGB
           MOV EDX, R
           MOV DWORD PTR DS:[ECX+0x128],EDX // float =D
           // G
           MOV EDX,DWORD PTR SS:[EBP+0xC]  // struct RGB
           MOV EAX, G
           MOV DWORD PTR DS:[EDX+0x12C],EAX // float =D
           // B
           MOV EAX,DWORD PTR SS:[EBP+0xC]  // struct RGB
           MOV ECX, B
           MOV DWORD PTR DS:[EAX+0x130],ECX
           MOV ESI, 0x0052F273
           JMP ESI
           }
        }
    }

    _asm
    {
        MOV EDI, 0x0052F76D
        JMP EDI
    }
}

.cpp hook
Code:
     //effect item
     //leitura do arquivo
     //_loadfile_effect(".\\DTserver\\scripts\\effects.dat");
     //retira a verificação dos items
     //*(BYTE*)(0x0052F0FC)    = 0xEB;
     //*(BYTE*)(0x0052F0FC+1)  = 0x29;
     //WriteMemoryNop(0x0052F0FE, 41);
     //da hook do sistema
     //HookProc(0x0052F158,                (DWORD)(&DTset_effect));
     //WriteMemoryNop(0x0052F158+5, 278);

base .dat

Code:
0

      11   0.000008f    0.1888877f   1.8555555f
      //add others items and float colors
end

Someone have main of this, please? I search in google, but can't find it:(
 
Newbie Spellweaver
Joined
Jun 4, 2012
Messages
87
Reaction score
12
Algun video tutorial para agregar efecto de humo y colores

tutorial video to add some effect of smoke and colors
 
Newbie Spellweaver
Joined
Oct 7, 2012
Messages
5
Reaction score
0
Sorry for my bad English.
Tell me that I is not true in the source code! Why does not want to be added to the effect it? For their help and hint would be very grateful!
main 1.02C
Effect.cpp
#include "StdAfx.h"
#include "Effect.h"
#include "ToolKit.h"

DWORD pItemType = 0;

__declspec(naked) void SetItemEffect()
{
__asm
{
Mov pItemType, Ecx
}

switch (pItemType)
{
// Aura Boots, Dragon Boots
case ITEM_GET(11, 43): case ITEM_GET(11, 29):
{
__asm
{
Mov Esi, HDK_ITEM_EFFECT_ALLOW
JMP Esi
}
}
break;
}

__asm
{
Mov Esi, HDK_ITEM_EFFECT_NOT_ALLOW
JMP Esi
}
}

__declspec(naked) void SetColorEffect()
{
__asm
{
Mov pItemType, Eax
}

switch (pItemType)
{
// Dragon Knight Boots
case ITEM_GET(11, 29):
__asm
{
MOV EDX,DWORD PTR SS:[EBP+0xC]
MOV DWORD PTR DS:[EDX+0x128], 0x3F266666
MOV EAX,DWORD PTR SS:[EBP+0xC]
MOV DWORD PTR DS:[EAX+0x12C], 0x3E99999A
MOV ECX,DWORD PTR SS:[EBP+0xC]
MOV DWORD PTR DS:[ECX+0x130], 0x3DCCCCCD

}
break;

// Dragon Boots
case ITEM_GET(11, 1):
__asm
{
MOV EDX,DWORD PTR SS:[EBP+0xC]
MOV DWORD PTR DS:[EDX+0x128], 0x3F800000
MOV EAX,DWORD PTR SS:[EBP+0xC]
MOV DWORD PTR DS:[EAX+0x12C], 0
MOV ECX,DWORD PTR SS:[EBP+0xC]
MOV DWORD PTR DS:[ECX+0x130], 0


}
break;
}

__asm
{
Mov Esi, HDK_NEXT_ITEM_COLOR
JMP Esi
}
}

void AttachNewEffect()
{
DWORD dwPotect;

dwPotect = ToolKit.UnProtect(HDK_SET_ITEM_EFFECT, 12);
ToolKit.SetNop(HDK_SET_ITEM_EFFECT, 12);
ToolKit.WriteJmp(HDK_SET_ITEM_EFFECT, (DWORD)&SetItemEffect);
ToolKit.Protect(HDK_SET_ITEM_EFFECT, 22, dwPotect);

dwPotect = ToolKit.UnProtect(HDK_SET_COLOR_EFFECT, 46);
ToolKit.SetNop(HDK_SET_COLOR_EFFECT, 46);
ToolKit.WriteJmp(HDK_SET_COLOR_EFFECT, (DWORD)&SetColorEffect);
ToolKit.Protect(HDK_SET_COLOR_EFFECT, 56, dwPotect);
}

Effect.h
#pragma once
const int ITEM_ID = 0x246;
#define ITEM_GET(x, y) (x * 512 + y) + ITEM_ID
#define HDK_SET_ITEM_EFFECT 0x0052F11B
#define HDK_SET_COLOR_EFFECT 0x0052F162
#define HDK_ITEM_EFFECT_ALLOW 0x0052F127
#define HDK_ITEM_EFFECT_NOT_ALLOW 0x0052F76D
#define HDK_NEXT_ITEM_COLOR 0x0052F191

void AttachNewEffect();
 
Newbie Spellweaver
Joined
Feb 12, 2012
Messages
60
Reaction score
2
UJu9m3L - [Development] Item Smoke Effect - RaGEZONE Forums


Brian, how would this main?
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Mar 18, 2014
Messages
30
Reaction score
5
I adapted it to work in 1.02C main.
Feel free to use.

.h
Code:
#ifndef __CUSTOM_H__
#define __CUSTOM_H__


const int ITEM_ID = 0x246;
#define GET_ITEM(x, y) (x * 512 + y) + ITEM_ID


class cCustom
{
public:
    void Init();
    static __declspec() void SetItensColorEffect();
    static __declspec() void AllowItemEffect();


    //Set Effects
    const int HDK_ALLOW_ITEM_EFFECT = 0x0052F106;
    const int HDK_SET_COLOR_EFFECT = 0x0052F162;
    const int HDK_ITEM_EFFECT_ALLOW = 0x0052F127;
    const int HDK_ITEM_EFFECT_NOT_ALLOW = 0x0052F76D;
    const int HDK_NEXT_ITEM_COLOR = 0x0052F191;


private:
    const BYTE CustomEffects = 1;
};




extern cCustom gCustom;
#endif
.cpp
Code:
#include "StdAfx.h"
#include "Custom.h"


cCustom gCustom;




void cCustom::Init()
{
    if (this->CustomEffects)
    {
        SetOp(reinterpret_cast<LPVOID>(gCustom.HDK_ALLOW_ITEM_EFFECT), reinterpret_cast<LPVOID>(this->AllowItemEffect), ASM::JMP);
        SetNop(0x0052F10B, 28);
        SetOp(reinterpret_cast<LPVOID>(gCustom.HDK_SET_COLOR_EFFECT), reinterpret_cast<LPVOID>(this->SetItensColorEffect), ASM::JMP);
        SetNop(0x0052F167, 42);
    }
}


__declspec(naked) void cCustom::AllowItemEffect()
{
    DWORD pItemType;


    _asm MOV pItemType, EAX;


    switch (pItemType)
    {
        //Dark Phoenix
        case GET_ITEM(11, 17):
        {
            __asm
            {
                MOV ESI, gCustom.HDK_ITEM_EFFECT_ALLOW;
                JMP ESI;
            }
            break;
        }
        //Great Dragon
        case GET_ITEM(11, 21):
        {
            __asm
            {
                MOV ESI, gCustom.HDK_ITEM_EFFECT_ALLOW;
                JMP ESI;
            }
        break;
        }
    }
    _asm
    {
        CMP EAX, 0x1863;
        JL NOT_ALLOW;
        CMP EAX, 0x1867;
        JG NOT_ALLOW;
        JMP ALLOW;


        NOT_ALLOW:
        MOV ESI, gCustom.HDK_ITEM_EFFECT_NOT_ALLOW;
        JMP ESI;


        ALLOW:
        MOV ESI, gCustom.HDK_ITEM_EFFECT_ALLOW;
        JMP ESI;
    }
}


__declspec(naked) void cCustom::SetItensColorEffect()
{
    DWORD pItemType;


    _asm MOV pItemType, ECX;
    
    switch (pItemType)
    {
        //Dragon Knight Original
        case GET_ITEM(11, 29):
        {
            __asm
            {
                MOV EDX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EDX + 0x128], 0x3F266666;
                MOV EAX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EAX + 0x12C], 0x3E99999A;
                MOV ECX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [ECX + 0x130], 0x3DCCCCCD;
            }
            break;
        }
        //Dark Phoenix
        case GET_ITEM(11, 17):
        {
            _asm
            {
                MOV EDX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EDX + 0x128], 0x0;
                MOV EAX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EAX + 0x12C], 0x3F800000;
                MOV ECX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [ECX + 0x130], 0x3F800000;
            }
            break;
        }
        //Great Dragon
        case GET_ITEM(11, 21):
        {
            _asm
            {
                MOV EDX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EDX + 0x128], 0x3F800000;
                MOV EAX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EAX + 0x12C], 0x0;
                MOV ECX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [ECX + 0x130], 0x0;
            }
            break;
        }
    }


    __asm
    {
        MOV ESI, gCustom.HDK_NEXT_ITEM_COLOR;
        JMP ESI;
    }
}
 
Banned
Banned
Joined
Nov 9, 2015
Messages
307
Reaction score
40
I adapted it to work in 1.02C main.
Feel free to use.

.h
Code:
#ifndef __CUSTOM_H__
#define __CUSTOM_H__


const int ITEM_ID = 0x246;
#define GET_ITEM(x, y) (x * 512 + y) + ITEM_ID


class cCustom
{
public:
    void Init();
    static __declspec() void SetItensColorEffect();
    static __declspec() void AllowItemEffect();


    //Set Effects
    const int HDK_ALLOW_ITEM_EFFECT = 0x0052F106;
    const int HDK_SET_COLOR_EFFECT = 0x0052F162;
    const int HDK_ITEM_EFFECT_ALLOW = 0x0052F127;
    const int HDK_ITEM_EFFECT_NOT_ALLOW = 0x0052F76D;
    const int HDK_NEXT_ITEM_COLOR = 0x0052F191;


private:
    const BYTE CustomEffects = 1;
};




extern cCustom gCustom;
#endif
.cpp
Code:
#include "StdAfx.h"
#include "Custom.h"


cCustom gCustom;




void cCustom::Init()
{
    if (this->CustomEffects)
    {
        SetOp(reinterpret_cast<LPVOID>(gCustom.HDK_ALLOW_ITEM_EFFECT), reinterpret_cast<LPVOID>(this->AllowItemEffect), ASM::JMP);
        SetNop(0x0052F10B, 28);
        SetOp(reinterpret_cast<LPVOID>(gCustom.HDK_SET_COLOR_EFFECT), reinterpret_cast<LPVOID>(this->SetItensColorEffect), ASM::JMP);
        SetNop(0x0052F167, 42);
    }
}


__declspec(naked) void cCustom::AllowItemEffect()
{
    DWORD pItemType;


    _asm MOV pItemType, EAX;


    switch (pItemType)
    {
        //Dark Phoenix
        case GET_ITEM(11, 17):
        {
            __asm
            {
                MOV ESI, gCustom.HDK_ITEM_EFFECT_ALLOW;
                JMP ESI;
            }
            break;
        }
        //Great Dragon
        case GET_ITEM(11, 21):
        {
            __asm
            {
                MOV ESI, gCustom.HDK_ITEM_EFFECT_ALLOW;
                JMP ESI;
            }
        break;
        }
    }
    _asm
    {
        CMP EAX, 0x1863;
        JL NOT_ALLOW;
        CMP EAX, 0x1867;
        JG NOT_ALLOW;
        JMP ALLOW;


        NOT_ALLOW:
        MOV ESI, gCustom.HDK_ITEM_EFFECT_NOT_ALLOW;
        JMP ESI;


        ALLOW:
        MOV ESI, gCustom.HDK_ITEM_EFFECT_ALLOW;
        JMP ESI;
    }
}


__declspec(naked) void cCustom::SetItensColorEffect()
{
    DWORD pItemType;


    _asm MOV pItemType, ECX;
    
    switch (pItemType)
    {
        //Dragon Knight Original
        case GET_ITEM(11, 29):
        {
            __asm
            {
                MOV EDX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EDX + 0x128], 0x3F266666;
                MOV EAX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EAX + 0x12C], 0x3E99999A;
                MOV ECX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [ECX + 0x130], 0x3DCCCCCD;
            }
            break;
        }
        //Dark Phoenix
        case GET_ITEM(11, 17):
        {
            _asm
            {
                MOV EDX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EDX + 0x128], 0x0;
                MOV EAX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EAX + 0x12C], 0x3F800000;
                MOV ECX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [ECX + 0x130], 0x3F800000;
            }
            break;
        }
        //Great Dragon
        case GET_ITEM(11, 21):
        {
            _asm
            {
                MOV EDX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EDX + 0x128], 0x3F800000;
                MOV EAX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [EAX + 0x12C], 0x0;
                MOV ECX, DWORD PTR SS : [EBP + 0xC];
                MOV DWORD PTR DS : [ECX + 0x130], 0x0;
            }
            break;
        }
    }


    __asm
    {
        MOV ESI, gCustom.HDK_NEXT_ITEM_COLOR;
        JMP ESI;
    }
}

It works smoothly. Thanks.
 
Banned
Banned
Joined
Feb 8, 2015
Messages
108
Reaction score
19
Brain, when i ask you to take a look i thought you have client 1.04D (you published for this version SetItemEffect and SetColorEffect :p:)...
So, this piece of code:


and this piece:


from your main:


does not have correspondent in 1.04D version.
I need you to help me to rewrite this 2 piece of code for 1.04D.
Thank you
you can share souce code add smoke in zclient thanks



Well the effect works in any main (1.04D) works ok and not has problem with effect or others:

Brain - [Development] Item Smoke Effect - RaGEZONE Forums


i don't know for what u need "camera clip aux" :S effect works just with items no more.
you share for me souce code
 
Experienced Elementalist
Joined
Mar 18, 2012
Messages
255
Reaction score
20
Hello guys im using IGC files season 9 and i really love this smoke how can i do that can some one help me please ? i can share main or IGC.DLL
 
Back
Top