Jump to content

Wear (use) item only on specific map


Recommended Posts

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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]

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

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



  • Similar Content

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.