The level up script pretty much explains. You can level up with more strength, health, and defense (to block the damage)
Here is the script for the damage.
package LevelUpDamageMain
{
function Armor::damage(%this, %obj, %sourceObject, %position, %damage, %damageType)
{
%damage = %damage + %sourceObject.client.LUStrength;
if(%damage > %obj.client.LUHealth)
{
%obj.kill();
}
else if(%damage < %obj.client.LUHealth)
{
%obj.client.LUHealth = %obj.client.LUHealth - %sourceObject.client.LUStrength;
}
if(%obj.client.LUDefense > %damage)
{
%obj.client.LUHealth = %obj.client.LUHealth - getRandom(1,5);
}
else if(%obj.client.LUDefense < %damage)
{
%obj.client.LUHealth = %obj.client.LUHealth - (%obj.client.LUDefense - %sourceObject.client.LUStrength);
}
%sourceObject.client.LUExp = mFloor(%sourceObject.client.LUExp + getRandom(5,%sourceObject.client.LUStrength));
%sourceObject.client.checkExp();
%sourceObject.client.setLUPrint();
%obj.client.setLUPrint();
Parent::Damage(%this, %obj, %sourceObject, %position, %damage, %damageType);
}
};
ActivatePackage(LevelUpDamageMain);
I am not sure about the crashing issue yet but I know it is in here since this is the most complicated code in this whole script.