Togu
Advanced OT User
I have these functions in player.h:
But I couldn't make it work through config.lua, just for functions located in player.cpp.
Is it possible to do this?
player.cpp (working):
Tried include lua module, configmanager module, transfer functions to .cpp... but didnt work
C++:
void updateBaseSpeed() {//CHANGED!
if (!hasFlag(PlayerFlag_SetMaxSpeed)) {
//baseSpeed = vocation->getBaseSpeed() + (2 * (level - 1));
baseSpeed = vocation->getBaseSpeed() + (2 * (level - 1) + 2 * (skills[SKILL_DEXTERITY].level - 8));
//baseSpeed = vocation->getBaseSpeed() + (2 * (level - 1) + (g_config.getNumber(ConfigManager::DEXTERITY_WALKSPEEDFACTOR) * (skills[SKILL_DEXTERITY].level - (g_config.getNumber(ConfigManager::DEXTERITY_INITIALDEXTERITY))));
}
else {
baseSpeed = PLAYER_MAX_SPEED;
}
}
uint32_t getAttackSpeed() const {//CHANGED!
//return vocation->getAttackSpeed
return 2000 + 8 * 10 - skills[SKILL_DEXTERITY].level * 10;
}
But I couldn't make it work through config.lua, just for functions located in player.cpp.
Is it possible to do this?
player.cpp (working):
C++:
if (skill == SKILL_VITALITY) {
healthMax += g_config.getNumber(ConfigManager::VITALITY_HEALTHGAIN);
health += g_config.getNumber(ConfigManager::VITALITY_HEALTHGAIN);
g_game.addCreatureHealth(this);
}
Tried include lua module, configmanager module, transfer functions to .cpp... but didnt work