Jump to content

Esthetic Ghost System


Recommended Posts

  • Contributor

M2 Download Center

This is the hidden content, please
( Internal )

This is the hidden content, please
( GitHub )

072618Ghost.png

Maybe it's not a great thing now, but I think that it can be intersting so i post it.

 

Spoiler

 




Client/UserInterface/Locale_inc.h

#define ENABLE_GHOST_MODE

 



Client/GameLib/ActorInstanceRender.cpp

//search 

void CActorInstance::BeginDiffuseRender()

//add above

#ifdef ENABLE_GHOST_MODE

BOOL CActorInstance::IsGhostWeapon()
{
	DWORD ghost = GetPartItemID(CRaceData::PART_WEAPON);
	switch (ghost)
	{
		case 299:
		case 19:
			return TRUE;
	}
	return FALSE;
}
#endif

//search 

void CActorInstance::BeginDiffuseRender()
{
	STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG1,	D3DTA_TEXTURE);
	STATEMANAGER.SetTextureStageState(0, D3DTSS_COLORARG2,	D3DTA_DIFFUSE);
	STATEMANAGER.SetTextureStageState(0, D3DTSS_COLOROP,	D3DTOP_MODULATE);
	STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG1,	D3DTA_TEXTURE);
	STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAARG2,	D3DTA_DIFFUSE);
	STATEMANAGER.SetTextureStageState(0, D3DTSS_ALPHAOP,	D3DTOP_MODULATE);

	STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
	
//modify last line with

#ifdef ENABLE_GHOST_MODE

	if (IsGhostWeapon())
	{

		(STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, TRUE));
	}
	else
	{
		STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
	}
#else
	STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
#endif
}

 




Client/GameLib/ActorInstance.h

//Search

		// Rendering
		int						m_iRenderMode;
		D3DXCOLOR					m_AddColor;
		float						m_fAlphaValue;

//Add under

#ifdef ENABLE_GHOST_MODE
		BOOL						IsGhostWeapon();
#endif

 

 

Special thanks to @Finnis

 

 

  • Metin2 Dev 8
  • Scream 1
  • Love 6
Link to comment
Share on other sites

  • Management

Ghost like this

Halloween Disney GIF by filmeditor

Edited by Metin2 Dev
Core X - External 2 Internal
  • Lmao 5
  • Love 1
Link to comment
Share on other sites

  • Forum Moderator

Thanks for release.

		case 19:
			return TRUE;
			break;

Just to know, that this it's called "dead code".

The break is not called anymore since you made a return... also some compilers will show "Unreachable code" warnings.

  • Love 1
Link to comment
Share on other sites

  • Contributor
2 minutes ago, VegaS™ said:

Thanks for release.



		case 19:
			return TRUE;
			break;

Just to know, that this it's called "dead code".

The break is not called anymore since you made a return... also some compilers will show "Unreachable code" warnings.

Thanks. Yes I've fix it on my files but not on github and m2dev :V

 

Fixed now.

Edited by TokiSan
Link to comment
Share on other sites

  • Forum Moderator
1 minute ago, TokiSan said:

#ifdef ENABLE_GHOST_MODE
	if (IsGhostWeapon())
	{
		(STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, TRUE));
	}
	else
	{
		STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
	}
#else
	STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
#endif

 

Also instead of that, you can simplify it:

#ifdef ENABLE_GHOST_MODE
	STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, IsGhostWeapon());
#else
	STATEMANAGER.SaveRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
#endif

 

  • Good 1
  • Love 2
Link to comment
Share on other sites

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.