GOD Half
Member
- Joined
- May 9, 2010
- Messages
- 179
- Reaction score
- 15
Can anyone help me make a system that the character increases the shield skill when using armor instead of shield?
SOLVED:
I just added that code (will receive the skill if it takes damage):
In the part below (player.cpp):
Or change to get skill if take any attack (with damage or no):
SOLVED:
I just added that code (will receive the skill if it takes damage):
C++:
if (damage > 0) {
addSkillAdvance(SKILL_SHIELD, 1);
}
In the part below (player.cpp):
C++:
BlockType_t Player::blockHit(Creature* attacker, CombatType_t combatType, int32_t& damage,
bool checkDefense /* = false*/, bool checkArmor /* = false*/, bool field /* = false*/)
{
BlockType_t blockType = Creature::blockHit(attacker, combatType, damage, checkDefense, checkArmor, field);
if (attacker) {
sendCreatureSquare(attacker, SQ_COLOR_BLACK);
}
if (blockType != BLOCK_NONE) {
return blockType;
}
if (damage <= 0) {
damage = 0;
return BLOCK_ARMOR;
}
if (damage > 0) {
addSkillAdvance(SKILL_SHIELD, 1);
}
Or change to get skill if take any attack (with damage or no):
C++:
if (attacker) {
sendCreatureSquare(attacker, SQ_COLOR_BLACK);
addSkillAdvance(SKILL_SHIELD, 1); // ADD THIS
}
Last edited: