Jump to content

Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You can y going at char_item.cpp in server source.

search for bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)

and after long limitValue = item->GetProto()->aLimits.lValue;

Add this

Spoiler

                if(item->GetVnum() == 11800 && GetAlignment() <= 1999999)
                {
                    ChatPacket(CHAT_TYPE_INFO, "You need 20.000 alingment for this armor.");
                    return true;
                }

 

11800  = is item id.

Now the problem will be after the player has the armor on him if is losing rank points the armor will still be there.I will fix it later ^^ and show u code.

EDIT:

Ok so her is rest of code go to char_battle.cpp and search for 

Spoiler

void CHARACTER::UpdateAlignment(int iAmount)

And after 

Spoiler

m_iRealAlignment = MINMAX((max_rank_points*-10), m_iRealAlignment + iAmount, (max_rank_points*10));

add this

Spoiler

if(m_iRealAlignment <= 199999 &&  GetWear(WEAR_BODY)->GetVnum() == 11800)
        {
            int pos = GetEmptyInventory(GetWear(WEAR_BODY)->GetSize());
            if (-1 == pos)
        {
                ChatPacket(CHAT_TYPE_INFO, "Dropping on ground no space in inventory.");
                LPITEM item = GetWear(WEAR_BODY);
                SyncQuickslot(QUICKSLOT_TYPE_ITEM, WEAR_BODY, 255);
        item->RemoveFromCharacter();
        item->AddToGround(GetMapIndex(), GetXYZ(), true);
        item->StartDestroyEvent();
                item->SetOwnership (this, item_ownership_time);
        }
            else
            {
                ChatPacket(CHAT_TYPE_INFO, "Removing armor because you lost rank.");
                UnequipItem(GetWear(WEAR_BODY));
            }
        }

same id 11800 is armor id so u change with what armor u want or create a local list 

You can use like this if u have more armors

Spoiler

int Special_armors[] = {11800, 11801 , 11802, 11803, 11804, 11805};

So it will be like this 
  if(m_iRealAlignment <= 199999 &&  GetWear(WEAR_BODY)->GetVnum() == Special_armors[id])

 

 

Edited by Root
To complete answer.
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.