/// <inheritdoc/> public override void Initialize() { this.healthRecoverOptionDefinition = this.CreateOption("Health recover for jewellery", Stats.HealthRecoveryMultiplier, 0.01f); this.CreateRing(8, "Ring of Ice", 20, 50, Stats.HealthRecoveryMultiplier, Stats.IceResistance); this.CreateRing(9, "Ring of Poison", 17, 50, Stats.HealthRecoveryMultiplier, Stats.PoisonResistance); this.CreateRing(21, "Ring of Fire", 30, 50, Stats.HealthRecoveryMultiplier, Stats.FireResistance); this.CreateRing(22, "Ring of Earth", 38, 50, Stats.HealthRecoveryMultiplier, Stats.EarthResistance); this.CreateRing(23, "Ring of Wind", 44, 50, Stats.HealthRecoveryMultiplier, Stats.WindResistance); this.CreateRing(24, "Ring of Magic", 47, 50, Stats.MaximumMana, null); this.CreatePendant(12, "Pendant of Lighting", 21, 50, DamageType.Wizardry, Stats.HealthRecoveryMultiplier, Stats.LightningResistance); this.CreatePendant(13, "Pendant of Fire", 13, 50, DamageType.Physical, Stats.HealthRecoveryMultiplier, Stats.FireResistance); this.CreatePendant(25, "Pendant of Ice", 34, 50, DamageType.Wizardry, Stats.HealthRecoveryMultiplier, Stats.IceResistance); this.CreatePendant(26, "Pendant of Wind", 42, 50, DamageType.Physical, Stats.HealthRecoveryMultiplier, Stats.WindResistance); this.CreatePendant(27, "Pendant of Water", 46, 50, DamageType.Wizardry, Stats.HealthRecoveryMultiplier, Stats.WaterResistance); this.CreatePendant(28, "Pendant of Ability", 50, 50, DamageType.Physical, Stats.MaximumAbility, null); // Requirement for Kanturu Event: var moonStonePendant = this.CreateJewelery(38, 10, false, "Moonstone Pendant", 21, 120, null, null, null); { var powerUp = this.Context.CreateNew <ItemBasePowerUpDefinition>(); powerUp.TargetAttribute = Stats.MoonstonePendantEquipped.GetPersistent(this.GameConfiguration); powerUp.BaseValue = 1; moonStonePendant.BasePowerUpAttributes.Add(powerUp); } this.CreateWizardsRing(); /* Cash shop rings * this.CreateJewelery(107, 10, false, "Lethal Wizard's Ring", 0, 100, null, null, null); * this.CreateJewelery(109, 10, false, "Sapphire Ring", 0, 0, null, null, null); * this.CreateJewelery(110, 10, false, "Ruby Ring", 0, 0, null, null, null); * this.CreateJewelery(111, 10, false, "Topaz Ring", 0, 0, null, null, null); * this.CreateJewelery(112, 10, false, "Amethyst Ring", 0, 0, null, null, null); * this.CreateJewelery(113, 9, false, "Ruby Necklace", 0, 0, null, null, null); * this.CreateJewelery(114, 9, false, "Emerald Necklace", 0, 0, null, null, null); * this.CreateJewelery(115, 9, false, "Sapphire Necklace", 0, 0, null, null, null); */ /* TODO: Transformation feature * Idea: There could be an attribute "IsTransformed" which we could handle in the WorldView. These rings here could just add a value to this attribute. * this.CreateJewelery(10, 10, false, "Transformation Ring", 0, 200, null, null, null); * this.CreateJewelery(39, 10, false, "Elite Transfer Skeleton Ring", 10, 255, null, null, null); * this.CreateJewelery(40, 10, false, "Jack Olantern Ring", 10, 100, null, null, null); * this.CreateJewelery(41, 10, false, "Transfer Christmas Ring", 1, 100, null, null, null); * this.CreateJewelery(68, 10, false, "Snowman Transformation Ring", 10, 100, null, null, null); * this.CreateJewelery(122, 10, false, "Skeleton Transformation Ring", 1, 255, null, null, null); */ }
private ItemDefinition CreateJewelery(byte number, int slot, bool dropsFromMonsters, string name, byte level, byte durability, ItemOptionDefinition excellentOptionDefinition, AttributeDefinition optionTargetAttribute, AttributeDefinition resistanceAttribute) { var item = this.Context.CreateNew <ItemDefinition>(); this.GameConfiguration.Items.Add(item); item.Group = 13; item.Number = number; item.ItemSlot = this.GameConfiguration.ItemSlotTypes.FirstOrDefault(slotType => slotType.ItemSlots.Contains(slot)); item.DropsFromMonsters = dropsFromMonsters; item.Name = name; item.DropLevel = level; item.MaximumItemLevel = 4; item.Width = 1; item.Height = 1; //// TODO: Requirement increases with item level this.CreateItemRequirementIfNeeded(item, Stats.Level, level); item.Durability = durability; if (excellentOptionDefinition != null) { item.PossibleItemOptions.Add(excellentOptionDefinition); } if (optionTargetAttribute == Stats.HealthRecoveryMultiplier) { item.PossibleItemOptions.Add(this.healthRecoverOptionDefinition); } else if (optionTargetAttribute != null) { // Then it's either maximum mana or ability increase by 1% for each option level var option = this.CreateOption("Jewellery option " + optionTargetAttribute.Designation, optionTargetAttribute, 1.01f, AggregateType.Multiplicate); item.PossibleItemOptions.Add(option); } else { // we add no option. } if (resistanceAttribute != null) { // TODO: Implement elemental attacks and resistancies. // Not sure how these resistancies work. If I remember correctly, it worked at the original server this way: // - it only considers the maximum resistance of all equipped items // - officially there were only rings/pendant up to level 4 and they worked pretty well // -> one item level means about 20% less chance to get affected by the element (iced, poisoned etc.). // - I'm not sure if they prevent hits or lower the damage. For example, you could miss an attack but still apply ice or poison to an opponent. var powerUp = this.Context.CreateNew <ItemBasePowerUpDefinition>(); item.BasePowerUpAttributes.Add(powerUp); powerUp.BaseValue = 0.2f; powerUp.TargetAttribute = resistanceAttribute.GetPersistent(this.GameConfiguration); for (int i = 1; i <= 4; i++) { var levelBonus = this.Context.CreateNew <LevelBonus>(); levelBonus.Level = i; levelBonus.AdditionalValue = (1 + i) * 0.2f; powerUp.BonusPerLevel.Add(levelBonus); } } foreach (var characterClass in this.GameConfiguration.CharacterClasses) { item.QualifiedCharacters.Add(characterClass); } return(item); }