Jump to content
×
×
  • Create New...
  • 0

[C++]Searching sash c++ part


Aurora

Question

2 answers to this question

Recommended Posts

  • 0
  • 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

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.