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

Advancing in shielding without a shield

leonmagmo

New Member
Joined
Mar 17, 2009
Messages
82
Reaction score
3
Hello guys, I'm making a server that don't have shields(just weapons) but I want to do something that the players advance in shielding skill as if they were using a shield because the advantage of some vocations is the def.
Anyone know if is possible to do it doing a source edit? I really don't know what to do :s
Thanks!
 
I believe it would require source edit, considering your shielding skill isn't any good unless you have a shield equipped, you could probably make the weapon as a shield and add it to weapons.xml to work as a weapon...
 
I believe it would require source edit, considering your shielding skill isn't any good unless you have a shield equipped, you could probably make the weapon as a shield and add it to weapons.xml to work as a weapon...

I tried that but it didn't work, I really think that will need a source edit ;s
 
But cbrm gave me the answer for make the skill grow up without a shield,BUT the skill shielding don't work without a shield, so I need to make other edit for the skill work, right?
(I'm Sorry if I have not understood)
 
bad luck then, checking player weapons on hands
LUA:
function onUseWeapon(cid, var)


    local pid = getCreatureTarget(cid)


    if isPlayer(pid) or isMonster(pid) then
        doPlayerAddSkillTry(cid, SKILL_SHIELD, 1)
    end
    --etc
 
Ye this work, but in Tibia if a player use a two handed sword and have a skill shielding 100 the skill don't change anything in the time to defence, right?
In my server the players will use just a sword, so I'll need to make a source edit for the skill shielding work with weapons( I don't know what to edit)
Thanks!
 
player.cpp
Code:
void Player::onBlockHit(BlockType_t)
{
	if(shieldBlockCount > 0)
	{
		--shieldBlockCount;
		if(hasShield())
			addSkillAdvance(SKILL_SHIELD, 1);
	}
}

to:
Code:
void Player::onBlockHit(BlockType_t)
{
	if(shieldBlockCount > 0)
	{
		--shieldBlockCount;
		addSkillAdvance(SKILL_SHIELD, 1);
	}
}


kind regards, Evil Hero.
 
bad luck then, checking player weapons on hands
LUA:
function onUseWeapon(cid, var)


    local pid = getCreatureTarget(cid)


    if isPlayer(pid) or isMonster(pid) then
        doPlayerAddSkillTry(cid, SKILL_SHIELD, 1)
    end
    --etc

That will only work if the player is targeting whoever is attacking him ;p.
 
player.cpp
Code:
void Player::onBlockHit(BlockType_t)
{
	if(shieldBlockCount > 0)
	{
		--shieldBlockCount;
		if(hasShield())
			addSkillAdvance(SKILL_SHIELD, 1);
	}
}

to:
Code:
void Player::onBlockHit(BlockType_t)
{
	if(shieldBlockCount > 0)
	{
		--shieldBlockCount;
		addSkillAdvance(SKILL_SHIELD, 1);
	}
}


kind regards, Evil Hero.
Thanks!
It worked, but the server is not counting the shielding skill to avoid damage. Shielding 1 or Shielding 200 takes the same damage.
 
Maybe need some changes here, at player.cpp

Code:
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;
			}

and here
Code:
getShieldAndWeapon(shield, weapon);
	if(weapon)
	{
		extraDefense = weapon->getExtraDefense();
		defenseValue = baseDefense + weapon->getDefense();
		defenseSkill = getWeaponSkill(weapon);
	}

	if(shield && shield->getDefense() > defenseValue)
	{
		if(shield->getExtraDefense() > extraDefense)
			extraDefense = shield->getExtraDefense();

		defenseValue = baseDefense + shield->getDefense();
		defenseSkill = getSkill(SKILL_SHIELD, SKILL_LEVEL);
	}

	if(!defenseSkill)
		return 0;

But i don't know what to change :s
 
Maybe need some changes here, at player.cpp

Code:
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;
			}

and here
Code:
getShieldAndWeapon(shield, weapon);
	if(weapon)
	{
		extraDefense = weapon->getExtraDefense();
		defenseValue = baseDefense + weapon->getDefense();
		defenseSkill = getWeaponSkill(weapon);
	}

	if(shield && shield->getDefense() > defenseValue)
	{
		if(shield->getExtraDefense() > extraDefense)
			extraDefense = shield->getExtraDefense();

		defenseValue = baseDefense + shield->getDefense();
		defenseSkill = getSkill(SKILL_SHIELD, SKILL_LEVEL);
	}

	if(!defenseSkill)
		return 0;

But i don't know what to change :s

The first tagged part is apparently a function that tells if an item is a weapon or a shield.
The second tagged part is apparently a function that is used to determine the total defense/attack on a weapon/shield. But don't get me wrong, I'm pretty newbish with CPP.
 
Back
Top