Jump to content
×
×
  • Create New...

Full_Set Command with New Items


Recommended Posts

Hello community,

 

I want to share my "ACMD (do_item_full_set)" with you, so you have the actual Items set.

I know, that this is not even a great work or something, but it safes time. ^^


Btw : I added the "shoes of wind+ (tradeable)" to every class. :)

 

cmd_gm.cpp

ACMD (do_item_full_set)
{
	BYTE job = ch->GetJob();
	LPITEM item;
	for (int i = 0; i < 6; i++)
	{
		item = ch->GetWear(i);
		if (item != NULL)
			ch->UnequipItem(item);
	}
	item = ch->GetWear(WEAR_SHIELD);
	if (item != NULL)
		ch->UnequipItem(item);

	switch (job)
	{
	case JOB_SURA:
		{
			
			item = ITEM_MANAGER::instance().CreateItem(20509);
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(13149);
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(15379 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(479 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(12549 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(14209 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(17509 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(16549 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(72702 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
		}
		break;
	case JOB_WARRIOR:
		{
			
			item = ITEM_MANAGER::instance().CreateItem(20009);
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(13149);
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(15419 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(469 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(12289 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(14209 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(17549 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(16569 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(72702 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
		}
		break;
	case JOB_SHAMAN:
		{
			
			item = ITEM_MANAGER::instance().CreateItem(20759);
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(13149);
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(15379 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(7379 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(12689 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(14209 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(17509 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(16549 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(72702 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
		}
		break;
	case JOB_ASSASSIN:
		{
			
			item = ITEM_MANAGER::instance().CreateItem(20259);
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(13149);
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(15419 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(1349 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(12409 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(14209 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(17529 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(16509 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
			item = ITEM_MANAGER::instance().CreateItem(72702 );
			if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
				M2_DESTROY_ITEM(item);
		}
		break;
	}
}

 

Greetz, d3s4st3r

Edited by d3s4st3r
  • Love 4
Link to comment
  • 4 months later...
  • Moon
ACMD (do_item_full_set)
{
	BYTE job = ch->GetJob();
	LPITEM item;
	for (int i = 0; i < 6; i++)
	{
		item = ch->GetWear(i);
		if (item != NULL)
			ch->UnequipItem(item);
	}
	item = ch->GetWear(WEAR_SHIELD);
	if (item != NULL)
		ch->UnequipItem(item);
	
	
	
	switch (job)
	{
	case JOB_SURA:
		{
			int sura_item_list[9] = {20509, 13149, 15379, 479, 12549, 14209 , 17509, 16549, 72702};
			
			for(size_t i = 0; i <= ((sizeof(sura_item_list)/sizeof(int))-1); i++)
			{
				item = ITEM_MANAGER:instance().CreateItem(sura_item_list[i]);
				if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
					M2_DESTROY_ITEM(item);
			}
		}
		break;
	case JOB_WARRIOR:
		{
			int worrior_item_list[9] = {20009, 13149, 15419, 469, 12289, 14209 , 17549, 16569, 72702};
			
			for(size_t i = 0; i <= ((sizeof(worrior_item_list)/sizeof(int))-1); i++)
			{
				item = ITEM_MANAGER:instance().CreateItem(worrior_item_list[i]);
				if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
					M2_DESTROY_ITEM(item);
			}
		}
		break;
	case JOB_SHAMAN:
		{
			int shami_item_list[9] = {20759, 13149, 15379, 7379, 12689, 14209 , 17509, 16549, 72702};
			
			for(size_t i = 0; i <= ((sizeof(shami_item_list)/sizeof(int))-1); i++)
			{
				item = ITEM_MANAGER:instance().CreateItem(shami_item_list[i]);
				if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
					M2_DESTROY_ITEM(item);
			}
		}
		break;
	case JOB_ASSASSIN:
		{
			int ninja_item_list[9] = {20259, 13149, 15419, 1349, 12409, 14209 , 17529, 16509, 72702};
			
			for(size_t i = 0; i <= ((sizeof(ninja_item_list)/sizeof(int))-1); i++)
			{
				item = ITEM_MANAGER:instance().CreateItem(ninja_item_list[i]);
				if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
					M2_DESTROY_ITEM(item);
			}
		}
		break;
#ifdef ENABLE_WOLFMAN_CHARACTER
		case JOB_WOLFMAN :
			int lycan_item_list[9] = {20509, 15419, 13149, 479, 12549, 14209 , 17509, 16549, 72702}; // a list of random items change it
			for(size_t i = 0; i <= ((sizeof(lycan_item_list)/sizeof(int))-1); i++)
			{
				item = ITEM_MANAGER:instance().CreateItem(lycan_item_list[i]);
				if (!item || !item->EquipTo(ch, item->FindEquipCell(ch)))
					M2_DESTROY_ITEM(item);
			}
		break;
#endif
	}
}

here is a smaller version using loops (you can also do it using a nested loop but that would be a (eh) hassle.

  • Love 1
Link to comment
  • Moon
ACMD (do_item_full_set)
{
    LPITEM pItem;
    for (BYTE i = 0; i < WEAR_MAX_NUM; i++)
    {
        if (!(pItem = ch->GetWear(i)))
            continue;
        
        ch->UnequipItem(pItem);
    }
    
    int arItemList[JOB_MAX][9] =
    {
        [0] = {20009, 13149, 15419, 469, 12289, 14209 , 17549, 16569, 72702},
        [1] = {20509, 13149, 15739, 479, 12549, 14209, 17509, 16549, 72702},
        [2] = {20259, 13149, 15419, 1349, 12409, 14209 , 17529, 16509, 72702},
        [3] = {20759, 13149, 15379, 7379, 12689, 14209 , 17509, 16549, 72702},
#ifdef ENABLE_WOLFMAN_CHARACTER
        [4] = {20509, 15419, 13149, 479, 12549, 14209 , 17509, 16549, 72702},
#endif
    };
    
    for (size_t i = 0; i < sizeof(arItemList[0]) / sizeof(arItemList[0][0]); i++)
        if (!(pItem = ITEM_MANAGER::instance().CreateItem(arItemList[ch->GetJob()][i])) || !pItem->EquipTo(ch, pItem->FindEquipCell(ch)))
            M2_DESTROY_ITEM(pItem);
}

Kind Regards ~ Ken

Edited by Ken
  • Love 7

Do not be sorry, be better.

Link to comment
  • 8 months later...
  • 2 years later...
Dnia 20.10.2015 o 00:35, Ken napisał:
ACMD (do_item_full_set)
{
    LPITEM pItem;
    for (BYTE i = 0; i < WEAR_MAX_NUM; i++)
    {
        if (!(pItem = ch->GetWear(i)))
            continue;
        
        ch->UnequipItem(pItem);
    }
    
    int arItemList[JOB_MAX][9] =
    {
        [0] = {20009, 13149, 15419, 469, 12289, 14209 , 17549, 16569, 72702},
        [1] = {20509, 13149, 15739, 479, 12549, 14209, 17509, 16549, 72702},
        [2] = {20259, 13149, 15419, 1349, 12409, 14209 , 17529, 16509, 72702},
        [3] = {20759, 13149, 15379, 7379, 12689, 14209 , 17509, 16549, 72702},
#ifdef ENABLE_WOLFMAN_CHARACTER
        [4] = {20509, 15419, 13149, 479, 12549, 14209 , 17509, 16549, 72702},
#endif
    };
    
    for (size_t i = 0; i < sizeof(arItemList[0]) / sizeof(arItemList[0][0]); i++)
        if (!(pItem = ITEM_MANAGER::instance().CreateItem(arItemList[ch->GetJob()][i])) || !pItem->EquipTo(ch, pItem->FindEquipCell(ch)))
            M2_DESTROY_ITEM(pItem);
}

Kind Regards ~ Ken

cmd_gm.cpp: In function 'void do_set_stat(CHARACTER*, const char*, int, int)':
cmd_gm.cpp:3946: warning: NULL used in arithmetic
cmd_gm.cpp: In function 'void do_item_full_set(CHARACTER*, const char*, int, int)':
cmd_gm.cpp:4134: error: 'JOB_MAX' was not declared in this scope
cmd_gm.cpp:4136: error: expected primary-expression before '[' token
cmd_gm.cpp:4136: error: expected primary-expression before '{' token
cmd_gm.cpp:4136: error: expected `}' before '{' token
cmd_gm.cpp:4136: error: expected primary-expression before ',' token
cmd_gm.cpp:4137: error: expected primary-expression before '[' token
cmd_gm.cpp:4137: error: expected primary-expression before '{' token
cmd_gm.cpp:4137: error: expected `;' before '{' token
cmd_gm.cpp:4137: error: expected primary-expression before ',' token
cmd_gm.cpp:4138: error: expected primary-expression before '[' token
cmd_gm.cpp:4138: error: expected primary-expression before '{' token
cmd_gm.cpp:4138: error: expected `;' before '{' token
cmd_gm.cpp:4138: error: expected primary-expression before ',' token
cmd_gm.cpp:4139: error: expected primary-expression before '[' token
cmd_gm.cpp:4139: error: expected primary-expression before '{' token
cmd_gm.cpp:4139: error: expected `;' before '{' token
cmd_gm.cpp:4139: error: expected primary-expression before ',' token
cmd_gm.cpp:4140: error: expected primary-expression before '}' token
cmd_gm.cpp:4140: error: expected `;' before '}' token
cmd_gm.cpp: At global scope:
cmd_gm.cpp:4142: error: expected unqualified-id before 'for'
cmd_gm.cpp:4142: error: expected constructor, destructor, or type conversion before '<' token
cmd_gm.cpp:4142: error: expected constructor, destructor, or type conversion before '++' token
cmd_gm.cpp:4142: error: expected unqualified-id before ')' token
cmd_gm.cpp:4145: error: expected declaration before '}' token

 

Link to comment
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.