Jump to content

Recommended Posts

Hello community.
I'm searching a way to make an item to be able to use it only on PvP Map. For example, I want talisman (79800 vnum) to be able to wear it ONLY at PvP map.ย 
Any ideas how to do it?

Thanks in advance.

โ€œ๐“๐“ต๐“ต ๐”€๐“ฎ ๐“ฑ๐“ช๐“ฟ๐“ฎ ๐“ฝ๐“ธ ๐“ญ๐“ฎ๐“ฌ๐“ฒ๐“ญ๐“ฎ ๐“ฒ๐“ผ ๐”€๐“ฑ๐“ช๐“ฝ ๐“ฝ๐“ธ ๐“ญ๐“ธ ๐”€๐“ฒ๐“ฝ๐“ฑ ๐“ฝ๐“ฑ๐“ฎ ๐“ฝ๐“ฒ๐“ถ๐“ฎ ๐“ฝ๐“ฑ๐“ช๐“ฝ ๐“ฒ๐“ผ ๐“ฐ๐“ฒ๐“ฟ๐“ฎ๐“ท ๐“พ๐“ผ.โ€ ~ ๐“–๐“ช๐“ท๐“ญ๐“ช๐“ต๐“ฏ ๐“ฝ๐“ฑ๐“ฎ ๐“–๐“ป๐“ฎ๐”‚

Link to comment
https://metin2.dev/topic/29646-wear-use-item-only-on-specific-map/
Share on other sites

char_item.cpp open and search:

ย 

	if (CArenaManager::instance().IsLimitedItem(GetMapIndex(), item->GetVnum()) == true)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ยดรซยทรƒ รรŸยฟยกยดร‚ ร€รŒยฟรซร‡ร’ ยผรถ ยพรธยดร‚ ยนยฐร‡ยฐร€ร”ยดรยดร™."));
		return false;
	}

ย 

before add:

	if (item->GetVnum() == 71018 && GetMapIndex() != 41)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Only Arena Map"));
		return false;
	}

71018 item code
41 map codes

edit it yourself.

8 hours ago, BadGrecee said:

char_item.cpp open and search:

ย 

	if (CArenaManager::instance().IsLimitedItem(GetMapIndex(), item->GetVnum()) == true)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ยดรซยทรƒ รรŸยฟยกยดร‚ ร€รŒยฟรซร‡ร’ ยผรถ ยพรธยดร‚ ยนยฐร‡ยฐร€ร”ยดรยดร™."));
		return false;
	}

ย 

before add:

	if (item->GetVnum() == 71018 && GetMapIndex() != 41)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Only Arena Map"));
		return false;
	}

71018 item code
41 map codes

edit it yourself.

Thanks for your answer. But when the player goes to 41 map and wear the item, if he goes after to the other maps he keeps wearing the item. How i can unquip it ? (here there must be a check to check if the inventory is full too. If its full it should not unequip the item)

โ€œ๐“๐“ต๐“ต ๐”€๐“ฎ ๐“ฑ๐“ช๐“ฟ๐“ฎ ๐“ฝ๐“ธ ๐“ญ๐“ฎ๐“ฌ๐“ฒ๐“ญ๐“ฎ ๐“ฒ๐“ผ ๐”€๐“ฑ๐“ช๐“ฝ ๐“ฝ๐“ธ ๐“ญ๐“ธ ๐”€๐“ฒ๐“ฝ๐“ฑ ๐“ฝ๐“ฑ๐“ฎ ๐“ฝ๐“ฒ๐“ถ๐“ฎ ๐“ฝ๐“ฑ๐“ช๐“ฝ ๐“ฒ๐“ผ ๐“ฐ๐“ฒ๐“ฟ๐“ฎ๐“ท ๐“พ๐“ผ.โ€ ~ ๐“–๐“ช๐“ท๐“ญ๐“ช๐“ต๐“ฏ ๐“ฝ๐“ฑ๐“ฎ ๐“–๐“ป๐“ฎ๐”‚

9 hours ago, Jimmermania said:

Thanks for your answer. But when the player goes to 41 map and wear the item, if he goes after to the other maps he keeps wearing the item. How i can unquip it ? (here there must be a check to check if the inventory is full too. If its full it should not unequip the item)

input_login.cpp open and search (Inside the Entergame function)

Search:

	// Adding a character to the map
	ch->Show(ch->GetMapIndex(), pos.x, pos.y, pos.z);
	SECTREE_MANAGER::instance().SendNPCPosition(ch);

	ch->ReviveInvisible(REVIVEINVISIBLE_TIME);

	d->SetPhase(PHASE_GAME);

ย 

Add after:

	if (ch->GetMapIndex() != 41)
		ch->UnequipItem(71018);

ย 

Edited by BadGrecee
3 hours ago, BadGrecee said:

input_login.cpp open and search (Inside the Entergame function)

Search:

	// Adding a character to the map
	ch->Show(ch->GetMapIndex(), pos.x, pos.y, pos.z);
	SECTREE_MANAGER::instance().SendNPCPosition(ch);

	ch->ReviveInvisible(REVIVEINVISIBLE_TIME);

	d->SetPhase(PHASE_GAME);

ย 

Add after:

	if (ch->GetMapIndex() != 41)
		ch->UnequipItem(71018);

ย 

And how to check if inventory is full not to unequip ?

3 hours ago, BadGrecee said:

input_login.cpp open and search (Inside the Entergame function)

Search:

	// Adding a character to the map
	ch->Show(ch->GetMapIndex(), pos.x, pos.y, pos.z);
	SECTREE_MANAGER::instance().SendNPCPosition(ch);

	ch->ReviveInvisible(REVIVEINVISIBLE_TIME);

	d->SetPhase(PHASE_GAME);

ย 

Add after:

	if (ch->GetMapIndex() != 41)
		ch->UnequipItem(71018);

ย 

Also, i have this error :
ย 

 error: invalid conversion from 'int' to 'LPITEM' {aka 'CItem*'} [-fpermissive]

ย 

โ€œ๐“๐“ต๐“ต ๐”€๐“ฎ ๐“ฑ๐“ช๐“ฟ๐“ฎ ๐“ฝ๐“ธ ๐“ญ๐“ฎ๐“ฌ๐“ฒ๐“ญ๐“ฎ ๐“ฒ๐“ผ ๐”€๐“ฑ๐“ช๐“ฝ ๐“ฝ๐“ธ ๐“ญ๐“ธ ๐”€๐“ฒ๐“ฝ๐“ฑ ๐“ฝ๐“ฑ๐“ฎ ๐“ฝ๐“ฒ๐“ถ๐“ฎ ๐“ฝ๐“ฑ๐“ช๐“ฝ ๐“ฒ๐“ผ ๐“ฐ๐“ฒ๐“ฟ๐“ฎ๐“ท ๐“พ๐“ผ.โ€ ~ ๐“–๐“ช๐“ท๐“ญ๐“ช๐“ต๐“ฏ ๐“ฝ๐“ฑ๐“ฎ ๐“–๐“ป๐“ฎ๐”‚

10 hours ago, Jimmermania said:

And how to check if inventory is full not to unequip ?

Also, i have this error :
ย 

 error: invalid conversion from 'int' to 'LPITEM' {aka 'CItem*'} [-fpermissive]

ย 

Ah soryy LPITEM ?

ย 

ย 

		if (ch->GetMapIndex() != 41) {
			LPITEM onlyMapItem = ch->GetVnum() == ITEM CODE; ////ITEM_CODE you item code
			if (onlyMapItem)
				ch->UnequipItem(onlyMapItem);
		}

ย 

Add them to the line I call input_login.cpp. Delete my old codes.

ย 

NOTE :ย LPITEM onlyMapItem = ch->GetVnum() == ITEM CODE;ย  //ITEM_CODE you item code

Edited by BadGrecee
  • Love 1
28 minutes ago, BadGrecee said:

Ah soryy LPITEM ?

ย 

ย 

		if (ch->GetMapIndex() != 41) {
			LPITEM onlyMapItem = ch->GetVnum() == ITEM CODE; ////ITEM_CODE you item code
			if (onlyMapItem)
				ch->UnequipItem(onlyMapItem);
		}

ย 

Add them to the line I call input_login.cpp. Delete my old codes.

ย 

NOTE :ย LPITEM onlyMapItem = ch->GetVnum() == ITEM CODE;ย  //ITEM_CODE you item code

Thanks for your answer dude, but if the inventory is full , it should not unequip it because the player will be bugged.ย 

โ€œ๐“๐“ต๐“ต ๐”€๐“ฎ ๐“ฑ๐“ช๐“ฟ๐“ฎ ๐“ฝ๐“ธ ๐“ญ๐“ฎ๐“ฌ๐“ฒ๐“ญ๐“ฎ ๐“ฒ๐“ผ ๐”€๐“ฑ๐“ช๐“ฝ ๐“ฝ๐“ธ ๐“ญ๐“ธ ๐”€๐“ฒ๐“ฝ๐“ฑ ๐“ฝ๐“ฑ๐“ฎ ๐“ฝ๐“ฒ๐“ถ๐“ฎ ๐“ฝ๐“ฑ๐“ช๐“ฝ ๐“ฒ๐“ผ ๐“ฐ๐“ฒ๐“ฟ๐“ฎ๐“ท ๐“พ๐“ผ.โ€ ~ ๐“–๐“ช๐“ท๐“ญ๐“ช๐“ต๐“ฏ ๐“ฝ๐“ฑ๐“ฎ ๐“–๐“ป๐“ฎ๐”‚

8 hours ago, Jimmermania said:

Thanks for your answer dude, but if the inventory is full , it should not unequip it because the player will be bugged.ย 

If the inventory is full, it will not remove the item anyway. I know like this. Does your game take out the item if the inventory is full?

ย 

I'm sorry for my bad english.

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.