예제 #1
0
        public void EquipDequipItemFromSet(WorldObject item, List <Spell> spells, List <Spell> prevSpells)
        {
            // compare these 2 spell sets -
            // see which spells are being added, and which are being removed
            var addSpells    = spells.Except(prevSpells);
            var removeSpells = prevSpells.Except(spells);

            // set spells are not affected by mana
            // if it's equipped, it's active.

            foreach (var spell in removeSpells)
            {
                EnchantmentManager.Dispel(EnchantmentManager.GetEnchantment(spell.Id, item.EquipmentSetId.Value));
            }

            foreach (var spell in addSpells)
            {
                CreateItemSpell(item, spell.Id);
            }
        }