All pastes #744533 Raw Edit

Something

public cpp v1 · immutable
·published 2007-10-21 16:04 UTC
rendered paste body
dwList["GetItemGUIDByName"] = dwFindPattern( (PBYTE)"\x55\x8B\xEC\x81\xEC\xC8\x00\x00\x00\x56", "xxxxxxxxxx" );dwList["UseItemByGUID"]	= dwFindPattern( (PBYTE)"\x55\x8B\xEC\x81\xEC\xB0\x06\x00\x00", "xxxxxxxxx" );// !PALADIN SKILL EXAMPLE!DWORD dwDevineShield = GetSpellIdByName( "Divine Shield" );if( dwDevineShield )	CastSpellById( dwDevineShield );DWORD dwHearthStone = GetItemGUIDByName( "Hearthstone" );if( dwHearthStone )	UseItemByGUID( dwHearthStone );DWORD GetItemGUIDByName( const char * pszKeyword ){	DWORD dwRet = 0, dwCall = dwList["GetItemGUIDByName"];	CGObject_C * pLocal = CurMgr->GetLocalPlayer();		if( pLocal )	{		_asm		{			push pszKeyword			mov ecx, pLocal			lea ecx, [ecx + 0x2418] // pLocal->ContainerBase			call dwCall			mov dwRet, eax		}		return dwRet;	}	return 0;}void UseItemByGUID( DWORD dwGUID, const char * pszTarget ){	DWORD dwCall = dwList["UseItemByGUID"];	_asm	{		push 0		lea ecx, pszTarget		push ecx		mov ecx, dwGUID		call dwCall	}}