• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Reduce damage PVP

yoiker

Member
Joined
Jan 21, 2012
Messages
194
Solutions
1
Reaction score
9
Hi, I want someone to help me make this script I think it's a creature script ...

I explain in PVP; the attack between two players is reduced according to the level ie if a level 100 attacks a level 200 level difference is 50%, that means that if a level 100 removes 10 to a level 100, level 100 will take off 5 to level 200, but the attack level 200 will not increase. Only it is reduced attack lower level.
I hope I explained
 
You need to make an onHealthChange or onStatsChange script depending on your TFS version, you should read the board rules before asking for help.
 
Tfs 1.2 and 0.3.7
If I recall correctly, you can modify sources for it (The formula halves the damage if it's a pvp combat), you can change the formula for whatever you wish.
Don't remember where it is exactly as I did it a looong time ago. (I erased the "/2" so damage in pvp will be exactly the same as PvE)

Good luck!
 
If I recall correctly, you can modify sources for it (The formula halves the damage if it's a pvp combat), you can change the formula for whatever you wish.
Don't remember where it is exactly as I did it a looong time ago. (I erased the "/2" so damage in pvp will be exactly the same as PvE)

Good luck!

I do not quite understand you mean I really do not know much about it so I asked for help or something more complex as it could but based

Bump :D
 
Last edited by a moderator:
Hi, I want someone to help me make this script I think it's a creature script ...

I explain in PVP; the attack between two players is reduced according to the level ie if a level 100 attacks a level 200 level difference is 50%, that means that if a level 100 removes 10 to a level 100, level 100 will take off 5 to level 200, but the attack level 200 will not increase. Only it is reduced attack lower level.
I hope I explained
onStatsChange with a table with the levels and damage reduction.
I'd try to make it for you, but I couldn't understand how you want it since your English isn't the best.
 
onStatsChange with a table with the levels and damage reduction.
I'd try to make it for you, but I couldn't understand how you want it since your English isn't the best.

Haha sorry I am I'm Spanish and use a translator. I'll put it simpler if a player is less than 100 or more levels to play another damage will be reduced by 50 % or less each 100 levels.

Bump :D

Bump
 
Last edited by a moderator:
I think what he wants is make a variable X that affect the dmg of the low level character against a character with more level

X will be lowerLvl/higherLvl
Example if there is a lvl100 attacking a lvl200 then X = 1/2
And the damage of the lvl100 to the lvl200 will be multiplied by X, and the dmg result will be the 50% only by this case...
Lvl100 vs lvl300, lvl100 will do only 33.3%
Etc...

Is it ok @yoiker ?
 
I think what he wants is make a variable X that affect the dmg of the low level character against a character with more level

X will be lowerLvl/higherLvl
Example if there is a lvl100 attacking a lvl200 then X = 1/2
And the damage of the lvl100 to the lvl200 will be multiplied by X, and the dmg result will be the 50% only by this case...
Lvl100 vs lvl300, lvl100 will do only 33.3%
Etc...

Is it ok @yoiker ?

Yess!
 
I actually don't think I can even help here
I have no idea how to get the damage prior to the reduction, then reduce it
 
I actually don't think I can even help here
I have no idea how to get the damage prior to the reduction, then reduce it

It is a custom server can do configurable and modified it (If you do of course...)

Bump help

Bump
 
Last edited by a moderator:
if(combatType == COMBAT_PHYSICALDAMAGE && target && target->getPlayer())
{
double absorbPower = 0, damageChange = 0;
int32_t hape = target->getPlayer()->getHealth();
//hape = 10

int32_t skillShield = target->getPlayer()->getSkill(SKILL_SHIELD, SKILL_LEVEL);
// 60~ skill for 10% dmg redu?

//if(damage < hape) not need
if(skillShield >= 10)
{
absorbPower = (std::floor(skillShield / 5) - 2); // why * 1?
//abosrdPower = 10


damageChange = std::ceil((damage * absorbPower) / 100);
//damageChange = 5
}
 
Back
Top