private void EarnLootFromDamage(LootComponent lootComp, HealthComponent healthComp, int healthDelta) { int num = 0; int i = 0; int num2 = 6; while (i < num2) { int num3 = lootComp.LootQuantities[i]; if (num3 != 0) { int num4 = GameUtils.CalculateDamagePercentage(healthComp.Health - healthDelta, healthComp.MaxHealth); int num5 = GameUtils.CalculateDamagePercentage(healthComp); int damagePercent = num5 - num4; int num6 = this.CalculateLootFromDamagePercentage(damagePercent, num3); this.lootEarned[i] += num6; Service.CurrencyEffects.PlayEffect(lootComp.Entity, (CurrencyType)i, num6); lootComp.IncParticleCount(); num++; } i++; } Service.EventManager.SendEvent(EventId.LootEarnedUpdated, healthComp.Entity); }