diff --git a/src/DataModel/Configuration/DropItemGroup.cs b/src/DataModel/Configuration/DropItemGroup.cs
index 35ec995ea..bb9bbcccd 100644
--- a/src/DataModel/Configuration/DropItemGroup.cs
+++ b/src/DataModel/Configuration/DropItemGroup.cs
@@ -41,6 +41,11 @@ public enum SpecialItemType
/// The money special item type.
///
Money,
+
+ ///
+ /// The jewel special item type.
+ ///
+ Jewel,
}
///
diff --git a/src/GameLogic/DefaultDropGenerator.cs b/src/GameLogic/DefaultDropGenerator.cs
index f0d80bf52..aa232982e 100644
--- a/src/GameLogic/DefaultDropGenerator.cs
+++ b/src/GameLogic/DefaultDropGenerator.cs
@@ -433,7 +433,23 @@ private void AddRandomExcOptions(Item item)
else
{
var monsterLevel = (int)monster[Stats.Level];
- var filteredPossibleItems = selectedGroup.PossibleItems.Where(it => it.DropLevel == 0 || ((it.DropLevel <= monsterLevel) && (it.DropLevel > monsterLevel - 12))).ToArray();
+ List filteredPossibleItems;
+
+ if (selectedGroup.ItemType == SpecialItemType.Jewel)
+ {
+ filteredPossibleItems = [.. selectedGroup.PossibleItems.Where(it => it.DropLevel <= monsterLevel)];
+
+ if (monsterLevel > 66)
+ {
+ // Jewel of Chaos doesn't drop after a certain monster level
+ filteredPossibleItems.RemoveAll(it => it.Group == 12 && it.Number == 15);
+ }
+ }
+ else
+ {
+ filteredPossibleItems = [.. selectedGroup.PossibleItems.Where(it => it.DropLevel == 0 || (it.DropLevel <= monsterLevel && it.DropLevel > monsterLevel - 12))];
+ }
+
return this.GenerateItemDrop(selectedGroup, filteredPossibleItems);
}
}
diff --git a/src/Persistence/Initialization/GameConfigurationInitializerBase.cs b/src/Persistence/Initialization/GameConfigurationInitializerBase.cs
index 6c384066c..f62343be1 100644
--- a/src/Persistence/Initialization/GameConfigurationInitializerBase.cs
+++ b/src/Persistence/Initialization/GameConfigurationInitializerBase.cs
@@ -167,7 +167,7 @@ private void AddItemDropGroups()
var jewelsDropItemGroup = this.Context.CreateNew();
jewelsDropItemGroup.SetGuid(4);
jewelsDropItemGroup.Chance = 0.001;
- jewelsDropItemGroup.ItemType = SpecialItemType.RandomItem;
+ jewelsDropItemGroup.ItemType = SpecialItemType.Jewel;
jewelsDropItemGroup.Description = "The jewels drop item group (0.1 % drop chance)";
this.GameConfiguration.DropItemGroups.Add(jewelsDropItemGroup);
BaseMapInitializer.RegisterDefaultDropItemGroup(jewelsDropItemGroup);
diff --git a/src/Persistence/Initialization/Version075/Items/Pets.cs b/src/Persistence/Initialization/Version075/Items/Pets.cs
index e814c4775..bcddbb961 100644
--- a/src/Persistence/Initialization/Version075/Items/Pets.cs
+++ b/src/Persistence/Initialization/Version075/Items/Pets.cs
@@ -14,7 +14,7 @@ namespace MUnique.OpenMU.Persistence.Initialization.Version075.Items;
///
/// Initializer for pets.
///
-public class Pets : InitializerBase
+public class Pets : Jewels
{
///
/// Initializes a new instance of the class.
@@ -29,9 +29,12 @@ public Pets(IContext context, GameConfiguration gameConfiguration)
///
public override void Initialize()
{
- this.CreatePet(0, "Guardian Angel", 23, (Stats.DamageReceiveDecrement, 0.8f, AggregateType.Multiplicate), (Stats.MaximumHealth, 50f, AggregateType.AddRaw));
- this.CreatePet(1, "Imp", 28, (Stats.AttackDamageIncrease, 1.3f, AggregateType.Multiplicate));
- this.CreatePet(2, "Horn of Uniria", 25);
+ var angel = this.CreatePet(0, "Guardian Angel", 23, (Stats.DamageReceiveDecrement, 0.8f, AggregateType.Multiplicate), (Stats.MaximumHealth, 50f, AggregateType.AddRaw));
+ this.AddItemToJewelItemDrop(angel);
+ var imp = this.CreatePet(1, "Imp", 28, (Stats.AttackDamageIncrease, 1.3f, AggregateType.Multiplicate));
+ this.AddItemToJewelItemDrop(imp);
+ var uniria = this.CreatePet(2, "Horn of Uniria", 25);
+ this.AddItemToJewelItemDrop(uniria);
}
private ItemDefinition CreatePet(byte number, string name, int dropLevelAndLevelRequirement, params (AttributeDefinition, float, AggregateType)[] basePowerUps)
diff --git a/src/Persistence/Initialization/Version075/Items/Potions.cs b/src/Persistence/Initialization/Version075/Items/Potions.cs
index fb5f0e090..de721c266 100644
--- a/src/Persistence/Initialization/Version075/Items/Potions.cs
+++ b/src/Persistence/Initialization/Version075/Items/Potions.cs
@@ -11,7 +11,7 @@ namespace MUnique.OpenMU.Persistence.Initialization.Version075.Items;
///
/// Class which contains item definitions for jewels.
///
-public class Potions : InitializerBase
+public class Potions : Jewels
{
///
/// Initializes a new instance of the class.
@@ -54,6 +54,7 @@ private ItemDefinition CreateAlcohol()
alcohol.Height = 2;
alcohol.SetGuid(alcohol.Group, alcohol.Number);
alcohol.ConsumeEffect = this.GameConfiguration.MagicEffects.First(effect => effect.Number == (short)MagicEffectNumber.Alcohol);
+ this.AddItemToJewelItemDrop(alcohol);
return alcohol;
}
@@ -230,6 +231,7 @@ private ItemDefinition CreateTownPortalScroll()
definition.Width = 1;
definition.Height = 2;
definition.SetGuid(definition.Group, definition.Number);
+ this.AddItemToJewelItemDrop(definition);
return definition;
}
}
\ No newline at end of file
diff --git a/src/Persistence/Initialization/Version095d/Items/Pets.cs b/src/Persistence/Initialization/Version095d/Items/Pets.cs
index 00650045c..4da38cfc2 100644
--- a/src/Persistence/Initialization/Version095d/Items/Pets.cs
+++ b/src/Persistence/Initialization/Version095d/Items/Pets.cs
@@ -15,7 +15,7 @@ namespace MUnique.OpenMU.Persistence.Initialization.Version095d.Items;
///
/// Initializer for pets.
///
-public class Pets : InitializerBase
+public class Pets : Jewels
{
///
/// Initializes a new instance of the class.
@@ -30,9 +30,12 @@ public Pets(IContext context, GameConfiguration gameConfiguration)
///
public override void Initialize()
{
- this.CreatePet(0, 0, "Guardian Angel", 23, true, (Stats.DamageReceiveDecrement, 0.8f, AggregateType.Multiplicate), (Stats.MaximumHealth, 50f, AggregateType.AddRaw));
- this.CreatePet(1, 0, "Imp", 28, true, (Stats.AttackDamageIncrease, 1.3f, AggregateType.Multiplicate));
- this.CreatePet(2, 0, "Horn of Uniria", 25, true);
+ var angel = this.CreatePet(0, 0, "Guardian Angel", 23, true, (Stats.DamageReceiveDecrement, 0.8f, AggregateType.Multiplicate), (Stats.MaximumHealth, 50f, AggregateType.AddRaw));
+ this.AddItemToJewelItemDrop(angel);
+ var imp = this.CreatePet(1, 0, "Imp", 28, true, (Stats.AttackDamageIncrease, 1.3f, AggregateType.Multiplicate));
+ this.AddItemToJewelItemDrop(imp);
+ var uniria = this.CreatePet(2, 0, "Horn of Uniria", 25, true);
+ this.AddItemToJewelItemDrop(uniria);
var dinorant = this.CreatePet(3, SkillNumber.FireBreath, "Horn of Dinorant", 110, false, (Stats.IsDinorantEquipped, 1, AggregateType.AddRaw), (Stats.DamageReceiveDecrement, 0.9f, AggregateType.Multiplicate), (Stats.AttackDamageIncrease, 1.15f, AggregateType.Multiplicate));
this.AddDinorantOptions(dinorant);
diff --git a/src/Persistence/Initialization/VersionSeasonSix/Items/Pets.cs b/src/Persistence/Initialization/VersionSeasonSix/Items/Pets.cs
index facdc13d2..074763154 100644
--- a/src/Persistence/Initialization/VersionSeasonSix/Items/Pets.cs
+++ b/src/Persistence/Initialization/VersionSeasonSix/Items/Pets.cs
@@ -19,7 +19,7 @@ namespace MUnique.OpenMU.Persistence.Initialization.VersionSeasonSix.Items;
/// Initializer for pets.
///
/// Pet system changed in Season 9. Reference: https://muonline.webzen.com/en/gameinfo/guide/detail/76 .
-public class Pets : InitializerBase
+public class Pets : Jewels
{
private const string PetExperienceFormula = "level * level * level * 100 * (level + 10)";
@@ -37,12 +37,15 @@ public Pets(IContext context, GameConfiguration gameConfiguration)
public override void Initialize()
{
#pragma warning disable SA1117 // Parameters should be on same line or separete lines
- this.CreatePet(0, 0, 1, 1, "Guardian Angel", 23, true, true,
+ var angel = this.CreatePet(0, 0, 1, 1, "Guardian Angel", 23, true, true,
(Stats.DamageReceiveDecrement, 0.8f, AggregateType.Multiplicate),
(Stats.MaximumHealth, 50f, AggregateType.AddRaw));
- this.CreatePet(1, 0, 1, 1, "Imp", 28, true, true,
+ this.AddItemToJewelItemDrop(angel);
+ var imp = this.CreatePet(1, 0, 1, 1, "Imp", 28, true, true,
(Stats.AttackDamageIncrease, 1.3f, AggregateType.Multiplicate));
- this.CreatePet(2, 0, 1, 1, "Horn of Uniria", 25, true, true);
+ this.AddItemToJewelItemDrop(imp);
+ var uniria = this.CreatePet(2, 0, 1, 1, "Horn of Uniria", 25, true, true);
+ this.AddItemToJewelItemDrop(uniria);
var dinorant = this.CreatePet(3, SkillNumber.FireBreath, 1, 1, "Horn of Dinorant", 110, false, true,
(Stats.IsDinorantEquipped, 1, AggregateType.AddRaw),
diff --git a/src/Persistence/Initialization/VersionSeasonSix/Items/Potions.cs b/src/Persistence/Initialization/VersionSeasonSix/Items/Potions.cs
index 771d54f66..73a5fa8f5 100644
--- a/src/Persistence/Initialization/VersionSeasonSix/Items/Potions.cs
+++ b/src/Persistence/Initialization/VersionSeasonSix/Items/Potions.cs
@@ -14,7 +14,7 @@ namespace MUnique.OpenMU.Persistence.Initialization.VersionSeasonSix.Items;
///
/// Class which contains item definitions for jewels.
///
-public class Potions : InitializerBase
+public class Potions : Jewels
{
///
/// Initializes a new instance of the class.
@@ -75,6 +75,7 @@ private ItemDefinition CreateAlcohol()
alcohol.Height = 2;
alcohol.SetGuid(alcohol.Group, alcohol.Number);
alcohol.ConsumeEffect = this.GameConfiguration.MagicEffects.First(effect => effect.Number == (short)MagicEffectNumber.Alcohol);
+ this.AddItemToJewelItemDrop(alcohol);
return alcohol;
}
@@ -375,6 +376,7 @@ private ItemDefinition CreateTownPortalScroll()
definition.Width = 1;
definition.Height = 2;
definition.SetGuid(definition.Group, definition.Number);
+ this.AddItemToJewelItemDrop(definition);
return definition;
}
diff --git a/src/Persistence/Initialization/VersionSeasonSix/Maps/LandOfTrials.cs b/src/Persistence/Initialization/VersionSeasonSix/Maps/LandOfTrials.cs
index e36603364..cf058611e 100644
--- a/src/Persistence/Initialization/VersionSeasonSix/Maps/LandOfTrials.cs
+++ b/src/Persistence/Initialization/VersionSeasonSix/Maps/LandOfTrials.cs
@@ -457,7 +457,7 @@ protected override void InitializeDropItemGroups()
var jewelsDropItemGroup = this.Context.CreateNew();
jewelsDropItemGroup.SetGuid(this.MapNumber, 1);
jewelsDropItemGroup.Chance = 0.001;
- jewelsDropItemGroup.ItemType = SpecialItemType.RandomItem;
+ jewelsDropItemGroup.ItemType = SpecialItemType.Jewel;
jewelsDropItemGroup.Description = "Jewel of Guardian";
var jewelOfGuardian = this.GameConfiguration.Items.First(y => y.Group == 14 && y.Number == 31);