Skip to content

Commit

Permalink
fix mining, only remain issue is on cyclopedia
Browse files Browse the repository at this point in the history
  • Loading branch information
vllworldbuilding committed Nov 1, 2024
1 parent 0527c24 commit 9b7fb33
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions data/scripts/talkactions/god/add_skill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ local function getSkillId(skillName)
return SKILL_CLUB
elseif skillName == "sword" then
return SKILL_SWORD
elseif skillName == "magic" then
return SKILL_MAGLEVEL
elseif skillName == "axe" then
return SKILL_AXE
elseif skillName:sub(1, 4) == "dist" then
return SKILL_DISTANCE
elseif skillName:sub(1, 6) == "shield" then
return SKILL_SHIELD
elseif skillName:sub(1, 4) == "mining" then
return SKILL_MINING
elseif skillName:sub(1, 4) == "fish" then
return SKILL_FISHING
elseif skillName:sub(1, 4) == "mining" then
return SKILL_MINING
else
return SKILL_FIST
end
Expand Down Expand Up @@ -69,4 +71,4 @@ end

addSkill:separator(" ")
addSkill:groupType("god")
addSkill:register()
addSkill:register()
2 changes: 1 addition & 1 deletion src/creatures/players/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ uint16_t Player::getLoyaltySkill(skills_t skill) const {
}
return level;
}

/*XXXXX*/
void Player::addSkillAdvance(skills_t skill, uint64_t count) {
uint64_t currReqTries = vocation->getReqSkillTries(skill, skills[skill].level);
uint64_t nextReqTries = vocation->getReqSkillTries(skill, skills[skill].level + 1);
Expand Down
2 changes: 1 addition & 1 deletion src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3505,7 +3505,7 @@ void ProtocolGame::sendCyclopediaCharacterGeneralStats() {
msg.add<uint16_t>(player->getMagicLevelPercent() * 100);
/*HARDCODED? the values are right?*/
for (uint8_t i = SKILL_FIRST; i < SKILL_CRITICAL_HIT_CHANCE; ++i) {
static const uint8_t HardcodedSkillIds[] = { 9, 8, 10, 12, 14, 15, 16, 17 };
static const uint8_t HardcodedSkillIds[] = { 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 };
const auto skill = static_cast<skills_t>(i);
msg.addByte(HardcodedSkillIds[i]);
msg.add<uint16_t>(std::min<int32_t>(player->getSkillLevel(skill), std::numeric_limits<uint16_t>::max()));
Expand Down

0 comments on commit 9b7fb33

Please sign in to comment.