Jump to content

Recommended Posts

Hello everyone,

In PythonItem.cpp, there is function for original effect for items on the ground.

void CPythonItem::Create()
{
	CEffectManager::Instance().RegisterEffect2("d:/ymir work/effect/etc/dropitem/dropitem.mse", &m_dwDropItemEffectID);
}

I want to add effects for different item IDs separately. For example: for item ID 71084, 71085 I want to use effect dropitem_rare.mse and for all other items I want to use original dropitem.mse,

Can somebody help me with this please?

Thank you for all your advices.

Link to comment
Share on other sites

  • Forum Moderator
  • PythonItem.cpp

This is the hidden content, please

  • PythonItem.h

This is the hidden content, please

Edited by VegaS™
  • Metin2 Dev 37
  • kekw 1
  • Dislove 1
  • Good 6
  • Love 1
  • Love 12
Link to comment
Share on other sites

17 minutes ago, VegaS™ said:
  • PythonItem.cpp

Hidden Content

 

// Search for:
	CEffectManager::Instance().RegisterEffect2("d:/ymir work/effect/etc/dropitem/dropitem.mse", &m_dwDropItemEffectID);
// Add after:
	CEffectManager::Instance().RegisterEffect2("d:/ymir work/effect/etc/dropitem/dropitem_rare.mse", &m_dwDropItemRareEffectID);

// Search for:
		CEffectManager & rem =CEffectManager::Instance();
		pGroundItemInstance->dwEffectInstanceIndex =
		rem.CreateEffect(m_dwDropItemEffectID, D3DXVECTOR3(x, -y, z), D3DXVECTOR3(0,0,0));
// Replace with:
		static const auto s_rare_items = { 71084, 71085 };
		auto effectID = m_dwDropItemEffectID;
		if (std::find(s_rare_items.begin(), s_rare_items.end(), dwVirtualNumber) != s_rare_items.end())
			effectID = m_dwDropItemRareEffectID;

		pGroundItemInstance->dwEffectInstanceIndex = CEffectManager::Instance().CreateEffect(effectID, D3DXVECTOR3(x, -y, z), D3DXVECTOR3(0, 0, 0));

 

 

  • PythonItem.h

Hidden Content

 

// Search for:
		DWORD m_dwDropItemEffectID;
// Add after:
		DWORD m_dwDropItemRareEffectID;

 

 

Thank you very much! It is awesome.

Here is image

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.