[Development] Item Smoke Effect

Junior Spellweaver
Joined
Jun 22, 2012
Messages
124
Reaction score
19

How can i define setop funtion .. i cant find it
 
Skilled Illusionist
Joined
Jun 22, 2017
Messages
363
Reaction score
561
How can i define setop funtion .. i cant find it

Code:
DWORD SetOp(const LPVOID dwEnterFunction, const LPVOID dwJMPAddress, const BYTE cmd)
{
    BYTE btBuf[5];
    DWORD dwShift    = (ULONG_PTR)dwJMPAddress - (ULONG_PTR)dwEnterFunction - 5;
    // ----
    btBuf[0]  = cmd;
    memcpy( (LPVOID) & btBuf[1], (LPVOID) & dwShift, sizeof(ULONG_PTR));
    // ----
    return WriteMemory(dwEnterFunction, (LPVOID) btBuf, sizeof(btBuf));
}

or u using muemu file, you can use
Code:
SetCompleteHook(BYTE,Offset,&Function);

Byte: 0xE9 = jmp
0xE8 = call
 
Last edited:
Junior Spellweaver
Joined
Jun 22, 2012
Messages
124
Reaction score
19
Can u share me full source for main 1.02c
But lets me test brunohk source
 
Skilled Illusionist
Joined
Aug 5, 2008
Messages
377
Reaction score
33
I'm trying to use this on 1.03k
Smoke shows fine, but it's always white color, why is the color not changing?

Edit: Working fine now.

 
Last edited:
Newbie Spellweaver
Joined
Dec 1, 2010
Messages
67
Reaction score
5

figaro, the offsets are correct 1.05d s4 ?

There is no effect here.
 
Last edited:
Joined
Nov 4, 2012
Messages
928
Reaction score
545
.H poop
Code:
#pragma once

// Smoke Effect System (Main 1.03.42 GMO Season 5)
#define oFirstItemCheockOffset				0x005289B7+1
#define oLastItemCheockOffset				0x005289C8+2

#define oDrawItemEffectCall1				0x00404668
#define oDrawItemEffectCall2				0x0047FD32
#define oDrawItemEffectCall3				0x0052AD33
#define oDrawItemEffectCall4				0x0052AD47

#define pDrawItemEffect						((void(__cdecl*)(DWORD ItemStruct,DWORD EffectStruct,DWORD a3)) 0x51EFC8) // Test

typedef struct
{
	int		Index;
	float	R;
	float	G;
	float	B;
} pSmokeItem, *lpSmokeItem;

class cSmokeEffect
{
public:
	cSmokeEffect();

	void Init();
	void Load();
	static void DrawItemEffect(DWORD ItemStruct,DWORD EffectStruct,DWORD a3);

	std::vector<pSmokeItem> m_Data;
};

extern cSmokeEffect gSmokeEffect;

.CPP poop
Code:
#include "StdAfx.h"

cSmokeEffect gSmokeEffect;

cSmokeEffect::cSmokeEffect()
{
	this->Init();
}

void cSmokeEffect::Init()
{
	this->m_Data.clear();
}

void cSmokeEffect::Load()
{
	if(gEncode.ReadScript(CONFIG_BMD_SMOKE))
	{
		WZSMDToken Token = gEncode.GetToken();

		if((Token == END) || (gEncode.GetInt() != 0))
		{
			MessageBox(NULL,"Falha, a seção 0 precisa ser a primeira.",CONFIG_BMD_SMOKE,MB_OK|MB_ICONERROR);
			ExitProcess(0);
		}

		this->Init();

		pSmokeItem Info;

		int BootId = -1;

		while(true)
		{
			Token = gEncode.GetToken();
			if(Token == END || lstrcmpi(gEncode.GetString(),"end") == 0)
			{
				break;
			}

			memset(&Info,NULL,sizeof(Info));

			BootId = gEncode.GetInt();

			Info.Index = ObjectId(11,BootId);
			
			Token = gEncode.GetToken();
			Info.R = gEncode.GetFloat();
			
			Token = gEncode.GetToken();
			Info.G = gEncode.GetFloat();
			
			Token = gEncode.GetToken();
			Info.B = gEncode.GetFloat();

			this->m_Data.push_back(Info);
		}

		gEncode.Close();

		if(this->m_Data.size())
		{
			// Change Check limit for default boots
			gToolKit.SetByte((LPVOID)(oFirstItemCheockOffset),0x47);	// Start boot Id from 11,0
			gToolKit.SetByte((LPVOID)(oLastItemCheockOffset),0xAA);		// Finish boot Id to 11,99

			// Hook all the mess
			gToolKit.SetOp((LPVOID)oDrawItemEffectCall1,this->DrawItemEffect,ASM::CALL);
			gToolKit.SetOp((LPVOID)oDrawItemEffectCall2,this->DrawItemEffect,ASM::CALL);
			gToolKit.SetOp((LPVOID)oDrawItemEffectCall3,this->DrawItemEffect,ASM::CALL);
			gToolKit.SetOp((LPVOID)oDrawItemEffectCall4,this->DrawItemEffect,ASM::CALL);
		}
	}
	else
	{
		MessageBox(NULL,CONFIG_BMD_SMOKE,"ERRO",MB_OK|MB_ICONERROR);
		ExitProcess(0);
	}
}

void cSmokeEffect::DrawItemEffect(DWORD ItemStruct,DWORD EffectStruct,DWORD a3)
{
	*(float*)(EffectStruct + 156) = 0.0f; // None
	*(float*)(EffectStruct + 160) = 0.0f; // None
	*(float*)(EffectStruct + 164) = 0.0f; // None

	for(std::vector<pSmokeItem>::iterator it = gSmokeEffect.m_Data.begin();it != gSmokeEffect.m_Data.end();it++)
	{	
		if(*(WORD*)(ItemStruct + 392) == it->Index) // Boots type (11)
		{
			*(float*)(EffectStruct + 156) =  it->R;
			*(float*)(EffectStruct + 160) =  it->G;
			*(float*)(EffectStruct + 164) =  it->B;
			break;
		}
	}

	pDrawItemEffect(ItemStruct,EffectStruct,a3);
}

Ps. For main 1.03.42 but it can be adjust to other mains

THANKS FOR LEECH IT!
 
Newbie Spellweaver
Joined
Sep 16, 2014
Messages
77
Reaction score
8
Very nice idea.
now i understand why your nick name is Brain :tongue:
I just suggets to do it when you doing any heal skill
then the charcter got the ligth on all his body wings and boots too :
But it is only my suggestion.
Good Luck.
 
Skilled Illusionist
Joined
Mar 27, 2013
Messages
305
Reaction score
9


Error, smookeffect work in select character but not work in after that


 

Attachments

You must be registered for see attachments list
Skilled Illusionist
Joined
Mar 27, 2013
Messages
305
Reaction score
9
Hook in all calls from pDrawItemEffect.

Check my post;

Where????, It use main 1.05D

How to find offset drawitemeffect
 
Last edited by a moderator:
Newbie Spellweaver
Joined
Sep 28, 2014
Messages
24
Reaction score
0
Hello y cant do for 1.04j y have the offsets ,anyone can adapte source?
#define ITEM_INTER 289#define HDK_SET_ITEM_EFFECT 0x00528864 // 1.04j#define HDK_SET_COLOR_EFFECT 0x005288BA // 1.04j#define HDK_ITEM_EFFECT_ALLOW 0x0052887F // 1.04j#define HDK_ITEM_EFFECT_NOT_ALLOW 0x00528EC6 // 1.04j#define HDK_NEXT_ITEM_COLOR 0x005288E9 // 1.04j