else if(_dietMode)
{
setIsOverloaded(false);
_curWeightPenalty = 0;
super.removeSkill(getKnownSkill(4270));
sendPacket(new EtcStatusUpdate(this));
Broadcast.toKnownPlayers(this, new CharInfo(this));
}
else
{
int maxLoad = getMaxLoad();
if(maxLoad > 0)
{
//setIsOverloaded(getCurrentLoad() > maxLoad);
//int weightproc = getCurrentLoad() * 1000 / maxLoad;
long weightproc = (long) ((getCurrentLoad() - calcStat(Stats.WEIGHT_PENALTY, 1, this, null)) * 1000 / maxLoad);
int newWeightPenalty;
if(weightproc < 500)
{
newWeightPenalty = 0;
}
else if(weightproc < 666)
{
newWeightPenalty = 1;
}
else if(weightproc < 800)
{
newWeightPenalty = 2;
}
else if(weightproc < 1000)
{
newWeightPenalty = 3;
}
else
{
newWeightPenalty = 4;
}
if(_curWeightPenalty != newWeightPenalty)
{
_curWeightPenalty = newWeightPenalty;
if(newWeightPenalty > 0)
{
super.addSkill(SkillTable.getInstance().getInfo(4270, newWeightPenalty));
sendSkillList(); // Fix visual bug
}
else
{
super.removeSkill(getKnownSkill(4270));
sendSkillList(); // Fix visual bug
}
sendPacket(new EtcStatusUpdate(this));
Broadcast.toKnownPlayers(this, new CharInfo(this));
}
}
}