Equipment Slots

Content and general development discussion, including quest scripts and server code. TMW Classic is a project comprising the Legacy tmwAthena server & the designated improved engine server based on evolHercules.


Forum rules

This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.

Its current use is for the continued development of the server and game it has always served: TMW Classic.

Post Reply
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 17:39

Equipment Slots

Post by allenmoatallen »

Hey guys! I have a question, if I want to determine which equip slot an item should be put into, how would I go about that? I am attempting to get equipment to show on the character screen, but have no way of figuring out which slot to set the sprite to. My code so far looks like this:

Code: Select all

void
PlayerBox::draw(gcn::Graphics *graphics)
{
    if (mPlayer)
    {
        // Draw character
        int x, y, bs;
        bs = getFrameSize();
        x = getWidth() / 2 - 16 + bs;
        y = getHeight() / 2 + bs;
        mPlayer->draw(static_cast<Graphics*>(graphics), x, y);
		
		for (int i = 0; i < EQUIPMENT_SIZE; i++)
		{
			Item *item = mEquipment->getEquipment(i);
			ItemInfo const *info = &item->getInfo();
			
			if (item->getId() > 2)
			{
				mPlayer->setSprite(6, item->getId());
			}
		}
    }
}
Post Reply