Jump to content

Admin Commands - More Useful Attributes


Recommended Posts

Hi devs, I focused this easy topic on extra managing attributes by GMs (testing new bonus stuff etc)

 

Here we go:

 

open cmd_gm.cpp and find

ACMD(do_change_attr)

next replace whole function with

ACMD(do_change_attr)
{
	char cArg1[256];
	one_argument(argument, cArg1, sizeof(cArg1));

	if (!*cArg1)
	{
		ch->ChatPacket(CHAT_TYPE_INFO, "Syntax: /change_attr <EWearPositions>");
		return;
	}

	BYTE byType = 0;
	str_to_number(byType, cArg1);
	BYTE byFlags = WEAR_BODY | WEAR_HEAD | WEAR_FOOTS | WEAR_WRIST | WEAR_WEAPON | WEAR_NECK | WEAR_EAR | WEAR_SHIELD;
	assert(byFlags & ~(WEAR_MAX-1) == 0);

	if (byFlags & byType)
	{
		LPITEM item = ch->GetWear(byType);
		if (item)
			item->ChangeAttribute();
	}
}

That's it. Usage /change_attr and one argument based on EWearPositions enum in length.h (from 0 to 10 excluding 7,8,9)

As you can see this function could be easily adapted to your needs. Try add more arguments and set sth. In this form you can also enable particular wear flags to be opened to if statement or.. disable some :) Do it similarly with add attribute function (or rare attr), just remember to change last function to thier equivalents.

 

Post feedback and have nice day.

  • Love 2
Link to comment
https://metin2.dev/topic/3320-admin-commands-more-useful-attributes/
Share on other sites

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.