private void CreateOrb(byte number, SkillNumber skillNumber, byte height, string name, byte dropLevel, int levelRequirement, int energyRequirement, int strengthRequirement, int agilityRequirement, int leadershipRequirement, int money, int darkWizardClassLevel, int darkKnightClassLevel, int elfClassLevel, int magicGladiatorClassLevel, int darkLordClassLevel, int summonerClassLevel, int ragefighterClassLevel) { var orb = this.Context.CreateNew <ItemDefinition>(); this.GameConfiguration.Items.Add(orb); orb.Group = 12; orb.Number = number; orb.Skill = this.GameConfiguration.Skills.First(skill => skill.Number == (short)skillNumber); orb.Width = 1; orb.Height = height; orb.Name = name; orb.DropLevel = dropLevel; orb.DropsFromMonsters = true; orb.Durability = 1; orb.ConsumeHandlerClass = typeof(OpenMU.GameLogic.PlayerActions.ItemConsumeActions.LearnablesConsumeHandler).FullName; if (skillNumber == SkillNumber.SummonGoblin) { orb.ConsumeHandlerClass = typeof(OpenMU.GameLogic.PlayerActions.ItemConsumeActions.SummoningOrbConsumeHandler).FullName; } this.CreateItemRequirementIfNeeded(orb, Stats.Level, levelRequirement); this.CreateItemRequirementIfNeeded(orb, Stats.TotalEnergy, energyRequirement); this.CreateItemRequirementIfNeeded(orb, Stats.TotalStrength, strengthRequirement); this.CreateItemRequirementIfNeeded(orb, Stats.TotalAgility, agilityRequirement); this.CreateItemRequirementIfNeeded(orb, Stats.TotalLeadership, leadershipRequirement); orb.Value = money; var classes = this.GameConfiguration.DetermineCharacterClasses(darkWizardClassLevel, darkKnightClassLevel, elfClassLevel, magicGladiatorClassLevel, darkLordClassLevel, summonerClassLevel, ragefighterClassLevel); foreach (var characterClass in classes) { orb.QualifiedCharacters.Add(characterClass); } }
/// <summary> /// Creates the skill. /// </summary> /// <param name="number">The number.</param> /// <param name="name">The name of the skill.</param> /// <param name="characterClasses">The character classes.</param> /// <param name="damageType">Type of the damage.</param> /// <param name="damage">The damage.</param> /// <param name="distance">The distance.</param> /// <param name="abilityConsumption">The ability consumption.</param> /// <param name="manaConsumption">The mana consumption.</param> /// <param name="levelRequirement">The level requirement.</param> /// <param name="energyRequirement">The energy requirement.</param> /// <param name="leadershipRequirement">The leadership requirement.</param> /// <param name="elementalModifier">The elemental modifier.</param> /// <param name="skillType">Type of the skill.</param> /// <param name="skillTarget">The skill target.</param> /// <param name="implicitTargetRange">The implicit target range.</param> /// <param name="targetRestriction">The target restriction.</param> /// <param name="movesToTarget">If set to <c>true</c>, the skill moves the player to the target.</param> /// <param name="movesTarget">If set to <c>true</c>, it moves target randomly.</param> /// <param name="cooldownMinutes">The cooldown minutes.</param> protected void CreateSkill( SkillNumber number, string name, CharacterClasses characterClasses = CharacterClasses.None, DamageType damageType = DamageType.None, int damage = 0, short distance = 0, int abilityConsumption = 0, int manaConsumption = 0, int levelRequirement = 0, int energyRequirement = 0, int leadershipRequirement = 0, ElementalType elementalModifier = ElementalType.Undefined, SkillType skillType = SkillType.DirectHit, SkillTarget skillTarget = SkillTarget.Explicit, short implicitTargetRange = 0, SkillTargetRestriction targetRestriction = SkillTargetRestriction.Undefined, bool movesToTarget = false, bool movesTarget = false, int cooldownMinutes = 0) { var skill = this.Context.CreateNew <Skill>(); this.GameConfiguration.Skills.Add(skill); skill.Number = (short)number; skill.Name = name; skill.MovesToTarget = movesToTarget; skill.MovesTarget = movesTarget; skill.AttackDamage = damage; this.CreateSkillRequirementIfNeeded(skill, Stats.Level, levelRequirement); this.CreateSkillRequirementIfNeeded(skill, Stats.TotalLeadership, leadershipRequirement); this.CreateSkillRequirementIfNeeded(skill, Stats.TotalEnergy, energyRequirement); this.CreateSkillConsumeRequirementIfNeeded(skill, Stats.CurrentMana, manaConsumption); this.CreateSkillConsumeRequirementIfNeeded(skill, Stats.CurrentAbility, abilityConsumption); skill.Range = distance; skill.DamageType = damageType; skill.SkillType = skillType; skill.ImplicitTargetRange = implicitTargetRange; skill.Target = skillTarget; skill.TargetRestriction = targetRestriction; var classes = this.GameConfiguration.DetermineCharacterClasses(characterClasses); foreach (var characterClass in classes) { skill.QualifiedCharacters.Add(characterClass); } if (elementalModifier != ElementalType.Undefined) { this.ApplyElementalModifier(elementalModifier, skill); } }
private ItemDefinition CreatePet(byte number, SkillNumber skillNumber, byte width, byte height, string name, int dropLevelAndLevelRequirement, bool dropsFromMonsters, bool addAllCharacterClasses, params (AttributeDefinition, float)[] basePowerUps)