Пример #1
0
        public async Task <SimcSpell> GenerateSpellAsync(SimcSpellOptions options)
        {
            SimcSpell spell;

            if (options.ItemLevel != 0)
            {
                // TODO: Remove this await once the rest of the library chain supports async better
                spell = await _simcSpellCreationService.GenerateItemSpellAsync(options);
            }
            else
            {
                // TODO: Remove this await once the rest of the library chain supports async better
                spell = await _simcSpellCreationService.GeneratePlayerSpellAsync(options);
            }

            return(spell);
        }
Пример #2
0
        private async Task AddSpellEffectAsync(SimcItem item, SimcRawItemEffect effect)
        {
            // Note: there is a similar process inside this method:
            // double spelleffect_data_t::average( const player_t* p, unsigned level ) const
            // That is done to get scale values for non-item effects based instead on player level
            // This is for things like racial abilities and uses a simpler formula
            // It does use the spell scaling array values, which we already have.

            var effectSpell = await _simcSpellCreationService.GenerateItemSpellAsync(item, effect.SpellId);

            var newEffect = new SimcItemEffect
            {
                EffectId              = effect.Id,
                CooldownDuration      = effect.CooldownDuration,
                CooldownGroup         = effect.CooldownGroup,
                CooldownGroupDuration = effect.CooldownGroupDuration,
                Spell = effectSpell
            };

            item.Effects.Add(newEffect);
        }