Stanos
Veteran OT User
TFS 1.2 8.60
[8.60] The Forgotten Server 1.2
Problem: I deal to monster around 20k, but to player i deal only 500 even when multiplier is 2.6
damage.primary.value /= 2.6;
So from 20k i should hit around 7-8k which is what i want
Tried:
1. Printing damage.primary.value result was 500dmg and 2000dmg(again i dont know why it printed 2000 when i saw only 500)
2. Printed damage to monster result was 20k and 2k(dunno from where it was 2k again, because in game i only saw ~20k)
My idea is that it has multiple pvp multipliers which works like this,so from 20k it multiplies to 2000 and then void Combat::CombatHealthFunc multiplies it to 500 which makes sense because 2000/2.6 its around 700 but i had two items so it decreased to 500 But .
[8.60] The Forgotten Server 1.2
Problem: I deal to monster around 20k, but to player i deal only 500 even when multiplier is 2.6
damage.primary.value /= 2.6;
So from 20k i should hit around 7-8k which is what i want
Tried:
1. Printing damage.primary.value result was 500dmg and 2000dmg(again i dont know why it printed 2000 when i saw only 500)
2. Printed damage to monster result was 20k and 2k(dunno from where it was 2k again, because in game i only saw ~20k)
My idea is that it has multiple pvp multipliers which works like this,so from 20k it multiplies to 2000 and then void Combat::CombatHealthFunc multiplies it to 500 which makes sense because 2000/2.6 its around 700 but i had two items so it decreased to 500 But .
C++:
void Combat::CombatHealthFunc(Creature* caster, Creature* target, const CombatParams& params, CombatDamage* data)
{
assert(data);
CombatDamage damage = *data;
if (g_game.combatBlockHit(damage, caster, target, params.blockedByShield, params.blockedByArmor, params.itemId != 0)) {
return;
}
if ((damage.primary.value < 0 || damage.secondary.value < 0) && caster) {
Player* targetPlayer = target->getPlayer();
if (targetPlayer && caster->getPlayer() && targetPlayer->getSkull() != SKULL_BLACK) {
switch (damage.primary.type) {
case COMBAT_ENERGYDAMAGE: {
damage.primary.value /= (float)2.5f;
break;
}
case COMBAT_PHYSICALDAMAGE: {
damage.primary.value /= (float)2.6f;
break;
}
default: {
damage.primary.value /= 2;
break;
}
}
switch (damage.secondary.type) {
case COMBAT_ENERGYDAMAGE: {
damage.secondary.value /= (float)2.5f;
break;
}
case COMBAT_PHYSICALDAMAGE: {
damage.secondary.value /= (float)2.6f;
break;
}
default: {
damage.secondary.value /= 2;
break;
}
}
}
}
if (g_game.combatChangeHealth(caster, target, damage)) {
CombatConditionFunc(caster, target, params, nullptr);
CombatDispelFunc(caster, target, params, nullptr);
}
}