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

Armor quest


diosmx9

Question

Hi, I have a question, how could I make an amm armor example request 20000 of align to be used? Could you do it for quest?

For example I have an armor of lvl 200 for the 4 races and you are lvl 200 but you do not have the rank of 20000 so you can not use it

Link to comment
Share on other sites

  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

2 answers to this question

Recommended Posts

  • 0

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.