I have made a RPG Mod, here is my script of making the person's damage stronger
package LevelUpDamageMain
{
function Armor::Damage( %this, %obj, %src, %pos, %dmg, %type )
{
if(%obj.client.LUDefense >= 0 && !%obj.client.LUInvincibility) //Just checking if the variable exists
{
if(%obj.client.LUDefense > (%dmg + %src.client.LUStrength)) //If the damage is more, their level must be too high
{
%obj.client.LUHealth = %obj.client.LUHealth - getRandom(1,5);
}
else if(%obj.client.LUDefense < (%dmg + %src.client.LUStrength))
{
%obj.LUExpData = %obj.LUExp;
%obj.client.LUHealth = %obj.client.LUHealth - mFloor((%dmg + %src.client.LUStrength) - %obj.client.LUDefense); //Damage is normal if the defense is lower than the damage
if((%src.client == %obj.client || %obj == 0 || %src == 0 ) && %type != $DamageType::Self Delete)
{
%src.client.LUExp = %src.client.LUExp + mFloor(%dmg); //They are assigned exp from the damage / 2
}
}
}
Parent::Damage( %this, %obj, %src, %pos, %dmg, %type );
}
};
ActivatePackage(LevelUpDamageMain);
Works fine. All it does it adds the strength to the damage while it is subtracted by the defense