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

TFS 1.X+ Player.cpp shielding skill

Lopaskurwa

Active Member
Joined
Oct 6, 2017
Messages
873
Solutions
2
Reaction score
49
Hi
So i changed one part in the player.cpp that i could skill my shielding without items so original part was like this
Code:
void Player::onBlockHit()
{
    if (shieldBlockCount > 0) {
        --shieldBlockCount;
        if (hasShield()){
            addSkillAdvance(SKILL_SHIELD, 1);
        }
    }
}
And i found in google that if i want to skill my shielding without items i have to keep only this part
Code:
void Player::onBlockHit()
{
    addSkillAdvance(SKILL_SHIELD, 1);
}
So yea it worked but now i cant skill my shielding if i add item example helmet, armor, legs, boots. So how to modifie this part that i could skill my shielding without items and with items? :D thanks.
 
Solution
Hello Lopaskurwa,

the reason why you didn't get any shield is because the function onBlockHit doesn't know what is "blocking". You firstly had it checking for a shield block, now it's checking for nothing. If you want to gain shielding skill without using one you need to edit the function onAttackedCreatureBlockHit, which you can find here: otland/tfs-old-svn.

Think before you type or remove anything into / from it, the terms in that function are way too clear for you to not understand, just take your time to understand what happens in there.

A hint: If you block any hit without a shield it's either a miss hit or you blocked with your armor.

You might also have to make another check on onBlockHit, :)

Happy Coding, as Codex...
I guess you are not getting shielding because the armor is blocking the hit and you are not going into that function. Try to debug the code
 
Hello Lopaskurwa,

the reason why you didn't get any shield is because the function onBlockHit doesn't know what is "blocking". You firstly had it checking for a shield block, now it's checking for nothing. If you want to gain shielding skill without using one you need to edit the function onAttackedCreatureBlockHit, which you can find here: otland/tfs-old-svn.

Think before you type or remove anything into / from it, the terms in that function are way too clear for you to not understand, just take your time to understand what happens in there.

A hint: If you block any hit without a shield it's either a miss hit or you blocked with your armor.

You might also have to make another check on onBlockHit, :)

Happy Coding, as Codex would say.

Best Wishes,
Okke
 
Solution
Back
Top