[Development] Item Smoke Effect

Thanks for the idea! work great on 1.04d with some modification!!
Brain - [Development] Item Smoke Effect - RaGEZONE Forums
 
Last edited:
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

can you share identifier, struct . I have a problem when building :

1>ItemSmokeEffect.cpp(135): error C2065: 'Tokenizer' : undeclared identifier
1>ItemSmokeEffect.cpp(135): error C2146: syntax error : missing ';' before identifier 'token'
1>ItemSmokeEffect.cpp(135): error C2065: 'token' : undeclared identifier
1>ItemSmokeEffect.cpp(136): error C2065: 'TokenizerGroup' : undeclared identifier
1>ItemSmokeEffect.cpp(136): error C2146: syntax error : missing ';' before identifier 'group'
1>ItemSmokeEffect.cpp(136): error C2065: 'group' : undeclared identifier
1>ItemSmokeEffect.cpp(137): error C2065: 'TokenizerSection' : undeclared identifier
1>ItemSmokeEffect.cpp(137): error C2146: syntax error : missing ';' before identifier 'section'
1>ItemSmokeEffect.cpp(137): error C2065: 'section' : undeclared identifier
1>ItemSmokeEffect.cpp(139): error C2065: 'token' : undeclared identifier
1>ItemSmokeEffect.cpp(139): error C2228: left of '.ParseFile' must have class/struct/union
1> type is ''unknown-type''
1>ItemSmokeEffect.cpp(139): error C2065: 'group' : undeclared identifier
1>ItemSmokeEffect.cpp(141): error C2065: 'group' : undeclared identifier
1>ItemSmokeEffect.cpp(141): error C2228: left of '.GetSection' must have class/struct/union
1> type is ''unknown-type''
1>ItemSmokeEffect.cpp(141): error C2065: 'section' : undeclared identifier
1>ItemSmokeEffect.cpp(143): error C2065: 'section' : undeclared identifier
1>ItemSmokeEffect.cpp(143): error C2228: left of '.RowCount' must have class/struct/union
1> type is ''unknown-type''
1>ItemSmokeEffect.cpp(145): error C2065: 'section' : undeclared identifier
1>ItemSmokeEffect.cpp(145): error C2228: left of '.Rows' must have class/struct/union
1> type is ''unknown-type''
1>ItemSmokeEffect.cpp(145): error C2228: left of '.GetInt' must have class/struct/union
1>ItemSmokeEffect.cpp(146): error C2065: 'section' : undeclared identifier
1>ItemSmokeEffect.cpp(146): error C2228: left of '.Rows' must have class/struct/union
1> type is ''unknown-type''
1>ItemSmokeEffect.cpp(146): error C2228: left of '.GetFloat' must have class/struct/union
1>ItemSmokeEffect.cpp(147): error C2065: 'section' : undeclared identifier
1>ItemSmokeEffect.cpp(147): error C2228: left of '.Rows' must have class/struct/union
1> type is ''unknown-type''
1>ItemSmokeEffect.cpp(147): error C2228: left of '.GetFloat' must have class/struct/union
1>ItemSmokeEffect.cpp(148): error C2065: 'section' : undeclared identifier
1>ItemSmokeEffect.cpp(148): error C2228: left of '.Rows' must have class/struct/union
1> type is ''unknown-type''
1>ItemSmokeEffect.cpp(148): error C2228: left of '.GetFloat' must have class/struct/union
 
how to find offset of an item as the main example of the King Mace in 97 main

to find some functions refereted to: Mace of King on main.exe 0.97d, you can make this:

- Search by ItemId -> for this you must calc this (ItemType * MaxIndex + ItemIndex)
- Search by ObjectId -> for this you must calc ItemId + ItemOffsetInArray (this is different for every main.exe version on 0.97d is: 0x400 in decimal value -> in hexadecimal is: 0x190)

then: for Mace of King you must be this:

Mace of King ObjectId = 2 (maces types) * 32 (max index on 97 & 99 versions) + 7 (I think that this is the: Index for this mace in: Item(XXX).txt of server side) + 400 (ItemOffsetInArray of 0.97d main.exe)

Result is: 471 but this is in: decimal value you must pass this to hexadecimal value -> (0x1D7)

then open your main.exe 0.97d on ollydbg (I use 2.00 version) and right click -> Search for -> All constants... and search: "1D7"

lYP8SOW - [Development] Item Smoke Effect - RaGEZONE Forums


PS: to find -> Item Offset in Array you must make this -> Search for all referenced strings -> search: "Sword" (Without "") and when you can see: "Data\Item" & "Sword" then ENTER here

and:

I8ffA1z - [Development] Item Smoke Effect - RaGEZONE Forums
 
Last edited:
good who can help me transfer the effect of the Crystal Sword (category mace) trasferir for other weapons. main version 97 +99?

 
Last edited:
Smoke effect dont work on main 1.04.10(1.04j) s3 ep1
who can help me make smoke effect?
offsets i have. post here pls i give main, offsets.
thanks.
 
Sorry for my bad English!
Thread who can help me with the search
offsets to main 1.02c?

Code:
#define HDK_SET_ITEM_EFFECT 0x[COLOR="#FF0000"]0057AD82[/COLOR] 
#define HDK_SET_COLOR_EFFECT 0x[COLOR="#FF0000"]0057ADC8[/COLOR]
#define HDK_ITEM_EFFECT_ALLOW 0x[COLOR="#FF0000"]0057AD8D[/COLOR]
#define HDK_ITEM_EFFECT_NOT_ALLOW 0x[COLOR="#FF0000"]0057B73B[/COLOR]
#define HDK_NEXT_ITEM_COLOR 0x[COLOR="#FF0000"]0057ADFD[/COLOR]
Or tell me how to find them
 
Last edited:
for main 1.02c ENG

Code:
#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
 
Back