Jump to content

Block 2 items with type 33


Recommended Posts

open ur locale > inventorywindow.py

 

                                        {"index":item.EQUIPMENT_RING1, "x":2, "y":106, "width":32, "height":32},
                                        {"index":item.EQUIPMENT_RING2, "x":75, "y":106, "width":32, "height":32},
                ## Equipment Slot
                {
                    "name" : "Equipment_Base",
                    "type" : "image",


                    "x" : 10,
                    "y" : 33,


                    "image" : "d:/ymir work/ui/equipment_bg_with_ring.tga",

 

Link to comment
Share on other sites

1. Open char_item.cpp and after

if (item->GetWearFlag() & WEARABLE_UNIQUE)
	{
		if ((GetWear(WEAR_UNIQUE1) && GetWear(WEAR_UNIQUE1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_UNIQUE2) && GetWear(WEAR_UNIQUE2)->IsSameSpecialGroup(item)))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("같은 종류의 유니크 아이템 두 개를 동시에 장착할 수 없습니다."));
			return false;
		}

		if (marriage::CManager::instance().IsMarriageUniqueItem(item->GetVnum()) && 
			!marriage::CManager::instance().IsMarried(GetPlayerID()))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("결혼하지 않은 상태에서 예물을 착용할 수 없습니다."));
			return false;
		}
	}

put this:

if (item->GetType() & ITEM_RING)
	{
		if ((GetWear(WEAR_RING1) && GetWear(WEAR_RING1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_RING2) && GetWear(WEAR_RING2)->IsSameSpecialGroup(item)))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't put two same items in the same time."));
			return false;
		}
	}

Try it. :D

"Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch"

Link to comment
Share on other sites

  • 3 months later...
On 25/8/2015, 9:20:23, AlexxD said:

1. Open char_item.cpp and after


if (item->GetWearFlag() & WEARABLE_UNIQUE)
	{
		if ((GetWear(WEAR_UNIQUE1) && GetWear(WEAR_UNIQUE1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_UNIQUE2) && GetWear(WEAR_UNIQUE2)->IsSameSpecialGroup(item)))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("같은 종류의 유니크 아이템 두 개를 동시에 장착할 수 없습니다."));
			return false;
		}

		if (marriage::CManager::instance().IsMarriageUniqueItem(item->GetVnum()) && 
			!marriage::CManager::instance().IsMarried(GetPlayerID()))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("결혼하지 않은 상태에서 예물을 착용할 수 없습니다."));
			return false;
		}
	}

put this:


if (item->GetType() & ITEM_RING)
	{
		if ((GetWear(WEAR_RING1) && GetWear(WEAR_RING1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_RING2) && GetWear(WEAR_RING2)->IsSameSpecialGroup(item)))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't put two same items in the same time."));
			return false;
		}
	}

Try it. :D

Thanks :D you just saved me... Do you have any tips about making the remaining time visible at the ITEM_RING like the ITEM_UNIQUE?

EDIT: Talked too soon :P Your function blocks 2 items of the same type not the same vnum. Can you give a function that works for 2 same vnums please?

Link to comment
Share on other sites

8 hours ago, Veneno said:

Thanks :D you just saved me... Do you have any tips about making the remaining time visible at the ITEM_RING like the ITEM_UNIQUE?

EDIT: Talked too soon :P Your function blocks 2 items of the same type not the same vnum. Can you give a function that works for 2 same vnums please?

I'll edit this function, first I saw that people need to block 2 items for the same type, and after I saw in client that 2 same vnums doesn't works. 

"Don't be a scammer. Don't be a hacker. Don't be a motherfucker. Karma is a bitch"

Link to comment
Share on other sites

  • Premium
48 minutes ago, AlexxD said:

I'll edit this function, first I saw that people need to block 2 items for the same type, and after I saw in client that 2 same vnums doesn't works. 

Go open special_item_group in your server and try to find a vnum of your item. What i mean is that you need to find this:

Group 스폐셜
{
    Vnum    10050
    type    special
    1    71148    100000    1
    2    71149    100001    1
    3    71158    100002    1
    4    71135    100003    1
    5    71136    100003    1
    6    71143    100004    1
    7    71145    100005    1
}   

All item in this group can't be used in same time... and if you want change bonus that this item give, you need to find, by third value, the group. For example... i want edit bonus of item 71148, Ring of Will Power... if we look in above group...

 1    71148    100000    1

Now you need to find group with vnum 100000...voilà

Group 속성                
{                
    Vnum    100000        
    type    ATTR        
    1    66    30    
    2    78    20    
    3    79    20    
    4    63    30    
    5    69    10    
    6    70    10    
    effect    "d:\ymir work\effect\etc\buff\buff_item5.mse"
}

Here you can see all bonus of this ring... 30% bonus exp, 20% def warrior, 20% def ninja, 30% strong vs monster, 10% max hp, 10% max mp (in official server this item have also 20% def lycan... i have remove this bonus now because i don't know if you have it).

Let me know if you solved ;)

Link to comment
Share on other sites

On 25/8/2015, 9:20:23, AlexxD said:

1. Open char_item.cpp and after


if (item->GetWearFlag() & WEARABLE_UNIQUE)
	{
		if ((GetWear(WEAR_UNIQUE1) && GetWear(WEAR_UNIQUE1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_UNIQUE2) && GetWear(WEAR_UNIQUE2)->IsSameSpecialGroup(item)))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("같은 종류의 유니크 아이템 두 개를 동시에 장착할 수 없습니다."));
			return false;
		}

		if (marriage::CManager::instance().IsMarriageUniqueItem(item->GetVnum()) && 
			!marriage::CManager::instance().IsMarried(GetPlayerID()))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("결혼하지 않은 상태에서 예물을 착용할 수 없습니다."));
			return false;
		}
	}

put this:


if (item->GetType() & ITEM_RING)
	{
		if ((GetWear(WEAR_RING1) && GetWear(WEAR_RING1)->IsSameSpecialGroup(item)) || (GetWear(WEAR_RING2) && GetWear(WEAR_RING2)->IsSameSpecialGroup(item)))
		{
			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't put two same items in the same time."));
			return false;
		}
	}

Try it. :D

change this:

 ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't put two same items in the same time."));


to this:

[code] ch->ChatPacket(CHAT_TYPE_INFO, "You can't put two same items in the same time");

  • Love 1
Link to comment
Share on other sites

  • 2 years later...
  • 2 years later...

its too late but if someone need here is 100% works 

chat_item.cpp

Quote

    if (item->GetType() == ITEM_RING)
    {
        LPITEM ringItems[2] = { GetWear(WEAR_RING1), GetWear(WEAR_RING2) };
        for (int i = 0; i < 2; i++)
        {
            if (ringItems[i])
            {
                if (ringItems[i]->GetVnum() == item->GetVnum())
                {
                    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("YOUR TEXT HERE"));
                    return false;
                }
            }
        }
    }


 

  • Love 1
Link to comment
Share on other sites

  • 2 years later...

My new fix 100% work:

	if (item->GetType() == ITEM_RING)
	{
		std::vector<LPITEM> FixByMuchomor = { GetWear(WEAR_RING1), GetWear(WEAR_RING2) };
		const int FixByMuchomorSize = FixByMuchomor.size();

		for (int i = 0; i < FixByMuchomorSize; i++)
		{
			if (FixByMuchomor[i])
			{
				if (FixByMuchomor[i]->GetVnum() == item->GetVnum() || FixByMuchomor[i]->GetSubType() == item->GetSubType())
				{
					ChatPacket(CHAT_TYPE_INFO, "Nie możesz założyć tego przedmiotu dwa razy!");
					return false;
				}
			}
		}
	}

 

Edited by Grzyb
  • Not Good 1
  • Good 1

Grzyb.ovh

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



×
×
  • 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.