Jump to content

Recommended Posts

Hello my friends
I was searching for this mod and found it but it was only for bouns rewards but in this tutorial we will bouns rewards, stones and Transmutation for this purpose using cube window.

I know that this modification was previously released, but it was only to transfer the rewards.

Search in cube.cpp:

else TOKEN("gold")

Add:

#ifdef ENABLE_CUBE_RENEWAL
		else TOKEN("allow_copy_attr")
		{
			cube_data->allowCopyAttr = (value1 == 1 ? true : false);
		}
		else TOKEN("allow_copy_socket")
		{
			cube_data->allowCopySocket = (value1 == 1 ? true : false);
		}
#ifdef ENABLE_CHANGELOOK_SYSTEM
		else TOKEN("allow_copy_transmutation")
		{
			cube_data->allowCopyTransmutation = (value1 == 1 ? true : false);
		}
#endif
#endif

 

Search:

bool Cube_make(LPCHARACTER ch)


Add:

#ifdef ENABLE_CUBE_RENEWAL
	DWORD	copyAttr[ITEM_ATTRIBUTE_MAX_NUM][2];
	memset(copyAttr, 0, sizeof(copyAttr));
	DWORD	copySocket[ITEM_SOCKET_MAX_NUM];
	memset(copySocket, 0, sizeof(copySocket));
#ifdef ENABLE_CHANGELOOK_SYSTEM
	DWORD	copyTransmutation = 0;
#endif
#endif

Search:

CUBE_VALUE* reward_value = cube_proto->reward_value();

add

#ifdef ENABLE_CUBE_RENEWAL
	for (int i = 0; i < CUBE_MAX_NUM; ++i)
	{
		if (NULL == items[i])	continue;

		if (items[i]->GetType() == ITEM_WEAPON || items[i]->GetType() == ITEM_ARMOR || items[i]->GetType() == ITEM_UNIQUE || items[i]->GetType() == ITEM_COSTUME)
		{
			bool hasElement = false;
			for (int j = 0; j < cube_proto->item.size(); ++j)
			{
				if (cube_proto->item[j].vnum == items[i]->GetVnum())
				{
					hasElement = true;
					break;
				}
			}

			if (hasElement == false)
				continue;

			for (int a = 0; a < ITEM_ATTRIBUTE_MAX_NUM; a++)
			{
				copyAttr[a][0] = items[i]->GetAttributeType(a);
				copyAttr[a][1] = items[i]->GetAttributeValue(a);
			}

			for (int a = 0; a < ITEM_SOCKET_MAX_NUM; a++)
				copySocket[a] = items[i]->GetSocket(a);


#ifdef ENABLE_CHANGELOOK_SYSTEM
			copyTransmutation = items[i]->GetTransmutation();
#endif

			break;
		}

		continue;
	}
#endif

Search:

LogManager::instance().CubeLog(ch->GetPlayerID(), ch->GetX(), ch->GetY(), reward_value->vnum, new_item->GetID(), reward_value->count, 1);

Add above:

#ifdef ENABLE_CUBE_RENEWAL
		if (cube_proto->allowCopyAttr == true)
		{
			new_item->ClearAttribute();

			for (int a = 0; a < ITEM_ATTRIBUTE_MAX_NUM; a++)
			{
				new_item->SetForceAttribute(a, copyAttr[a][0], copyAttr[a][1]);
			}
		}

		if (cube_proto->allowCopySocket == true)
		{
			for (int i = 0; i < ITEM_SOCKET_MAX_NUM; i++)
				new_item->SetSocket(i, copySocket[i]);
		}

#ifdef ENABLE_CHANGELOOK_SYSTEM
		if (cube_proto->allowCopyTransmutation == true)
		{
			new_item->SetTransmutation(copyTransmutation);
		}
#endif

#endif

Search:

CUBE_DATA::CUBE_DATA()

Add:

#ifdef ENABLE_CUBE_RENEWAL
	this->allowCopyAttr = false;
	this->allowCopySocket = false;
#ifdef ENABLE_CHANGELOOK_SYSTEM
	this->allowCopyTransmutation = false;
#endif
#endif

in cube.h
search:

unsigned int			gold;

 

add:

#ifdef ENABLE_CUBE_RENEWAL
	bool					allowCopyAttr;
	bool					allowCopySocket;
#ifdef ENABLE_CHANGELOOK_SYSTEM
	bool					allowCopyTransmutation;
#endif
#endif

Good bye

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.