• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Is it Poosible to do it?

EvilSkillz

Back
Joined
Jul 12, 2012
Messages
1,811
Solutions
2
Reaction score
390
Location
Egypt - Cairo
guys I have a new idea
I wanna ask about new thing and I don't think that any one has done it before

if I want to make a vocation can wear a weapon and shield - and other one can wear only weapon with 2 handed <-- the 2 first methods are really fixed in source

but the new thing that I wanna ask about
can it be ? to make a vocation wear two weapons?

or it's impossible ..
there is nothing impossible I believe on it
so it can be done

please tell me if its' required edit in source or the game?
 
i think it has to be possible but it will require some source editing i think, not sure ,not really that great with that aspect of ots ^^
 
you may put vocation restriction on every weapon so first part can be done in items.xml
second part: if you want to make someone wear two weapons you need to replace this restriction for vocation checking in source, in older clients to wear two weapons you may set them as type: shield and add atk to them.
 
so the problem will be in player.cpp ? in this code
Code:
Item* Player::getEquippedItem(slots_t slot) const
{
	Item* item = getInventoryItem(slot);
	if(!item)
		return NULL;

	switch(slot)
	{
		case SLOT_LEFT:
		case SLOT_RIGHT:
			return item->getWieldPosition() == SLOT_HAND ? item : NULL;

		default:
			break;
	}

	return item->getWieldPosition() == slot ? item : NULL;
}

or this code

Code:
void Player::getShieldAndWeapon(const Item* &shield, const Item* &weapon) const
{
	shield = weapon = NULL;

	Item* item = NULL;
	for(uint32_t slot = SLOT_RIGHT; slot <= SLOT_LEFT; slot++)
	{
		item = getInventoryItem((slots_t)slot);
		if(!item)
			continue;

		switch(item->getWeaponType())
		{
			case WEAPON_NONE:
				break;

			case WEAPON_SHIELD:
			{
				if(!shield || (shield && item->getDefense() > shield->getDefense()))
					shield = item;

				break;
			}

			default: //weapons that are not shields
			{
				weapon = item;
				break;
			}
		}
	}
}
 
Back
Top