Jump to content

[C++]Searching sash c++ part


Recommended Posts

  • Premium

I don't know how this system works, but I think you can work around by yourself because I don't see anyone to post it for free.

I will give you a few details, but I can't make the code for you right now because I am busy.

This is my own "work around". Is not the right method, but that's all I got.

 

Attention!: This is NOT tested and I don't guarantee that this works. Use with care.

This is just for testing purposes only. NEVER do it in live version.

 

First of all, your item need the type ITEM_USE, and the subtype USE_SPECIAL.

Now open common/length.h and find

enum EWearPositions

and before

WEAR_MAX = 32

add

WEAR_SHOULDER = YOUR_SLOT,

YOUR_SLOT must be the one you have in client.

 

In char_item.cpp, in UseItemEx function find this:

case USE_SPECIAL:
    switch (item->GetVnum())
    {

and right after it put this code:

case CODE1:
case CODE2:
case CODE3:
{
	if (!item->IsEquipped())
	{
		if (!CanEquipNow(item))
		{
			ChatPacket(CHAT_TYPE_INFO, "You can't equip this object.");
			return false;
		}
		else
		{
			return item->EquipTo(this, WEAR_SHOULDER);
		}
	}
	else
	{
		if (!CanUnequipNow(item))
		{
			ChatPacket(CHAT_TYPE_INFO, "You can't unequip this object.");
			return false;
		}
		else
		{
			return UnequipItem(item);
		}
	}
}

Replace CODE1, CODE2, CODE3 with your items code.

  • Love 3
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.