Paulix
Active Member
- Joined
- Sep 13, 2012
- Messages
- 151
- Solutions
- 8
- Reaction score
- 36
When I use the function onGetPlayerMinMaxValues, the attackValue param is returning only the attack of the left weapon equipped. My server has dual wield working, but I think I would need to chance this block to make it returns right + left attack.
does anyone know how i can add the right weapon validation and sum to the attackValue return?
I tried a few things with IA, but didn't work
LUA:
case COMBAT_FORMULA_SKILL: {
//onGetPlayerMinMaxValues(player, level, attackSkill, attackValue, attackFactor)
Item* tool = player->getWeapon();
const Weapon* weapon = g_weapons->getWeapon(tool);
Item* item = nullptr;
int32_t attackValue = 7;
if (weapon) {
attackValue = tool->getAttack();
if (tool->getWeaponType() == WEAPON_AMMO) {
item = player->getWeapon(true);
if (item) {
attackValue += item->getAttack();
}
}
damage.secondary.type = weapon->getElementType();
damage.secondary.value = weapon->getElementDamage(player, nullptr, tool);
}
lua_pushnumber(L, player->getLevel());
lua_pushnumber(L, player->getWeaponSkill(item ? item : tool));
lua_pushnumber(L, attackValue);
lua_pushnumber(L, player->getAttackFactor());
parameters += 4;
break;
}
does anyone know how i can add the right weapon validation and sum to the attackValue return?
I tried a few things with IA, but didn't work