onewave1
Member
- Joined
- May 26, 2021
- Messages
- 90
- Reaction score
- 15
Life leech gives give more life when I attack more than one monsters with area rune
For example:
attack one monster then give me average 200hp
attack four monsters then give average 350hp
I would like it to give as much regardless of how many monsters it attack at once
I found this in game.cpp
TFS 1.3 otservbr
For example:
attack one monster then give me average 200hp
attack four monsters then give average 350hp
I would like it to give as much regardless of how many monsters it attack at once
I found this in game.cpp
TFS 1.3 otservbr
Lua:
//life leech
uint16_t lifeChance = attackerPlayer->getSkillLevel(SKILL_LIFE_LEECH_CHANCE);
uint16_t lifeSkill = attackerPlayer->getSkillLevel(SKILL_LIFE_LEECH_AMOUNT);
if (normal_random(0, 100) < lifeChance) {
// Vampiric charm rune
if (target && target->getMonster()) {
uint16_t playerCharmRaceidVamp = attackerPlayer->parseRacebyCharm(CHARM_VAMP, false, 0);
if (playerCharmRaceidVamp != 0) {
MonsterType* mType = g_monsters.getMonsterType(target->getName());
if (mType && playerCharmRaceidVamp == mType->info.raceid) {
IOBestiary g_bestiary;
Charm* lifec = g_bestiary.getBestiaryCharm(CHARM_VAMP);
if (lifec) {
lifeSkill += lifec->percent;
}
}
}
}
CombatParams tmpParams;
CombatDamage tmpDamage;
int affected = damage.affected;
tmpDamage.origin = ORIGIN_SPELL;
tmpDamage.primary.type = COMBAT_HEALING;
tmpDamage.primary.value = std::round(realDamage * (lifeSkill / 100.) * (0.2 * affected + 0.9)) / affected;
Combat::doCombatHealth(nullptr, attackerPlayer, tmpDamage, 2);