frak lohn dynamisch (3000 / anzahl ränge) * rang

This commit is contained in:
hydrant
2021-04-11 00:05:45 +02:00
parent b594cda373
commit 8c0e440d2e

View File

@@ -85,12 +85,17 @@ namespace ReallifeGamemode.Server.Finance
if (user.Faction != null && user.FactionRank != null) if (user.Faction != null && user.FactionRank != null)
{ {
int factioWage = user.FactionRank.Order * 300; using var dbContext = new DatabaseContext();
int factionRankCount = dbContext.FactionRanks.Where(r => r.FactionId == user.FactionId).Count();
int factionWage = (3000 / factionRankCount) * user.FactionRank.Order;
if (wage > 2500) if (wage > 2500)
factioWage /= 2; {
else factionWage /= 2;
factionMoney = factioWage; }
factionMoney = factionWage;
} }
int otheramount = user.otheramount; int otheramount = user.otheramount;
int amount = wage - (int)(wage * financialInterest) - vehicleTaxation - (int)propertyTax + (int)financialHelp - rentalFees - healthInsurance + (factionMoney ?? 0) + otheramount; int amount = wage - (int)(wage * financialInterest) - vehicleTaxation - (int)propertyTax + (int)financialHelp - rentalFees - healthInsurance + (factionMoney ?? 0) + otheramount;