예제 #1
0
            private static IReadOnlyList <NwSpell> LoadSpells(CNWSpellArray spellArray)
            {
                NwSpell[] retVal = new NwSpell[spellArray.m_nNumSpells];
                for (int i = 0; i < retVal.Length; i++)
                {
                    retVal[i] = new NwSpell(i, spellArray.GetSpell(i));
                }

                return(retVal);
            }
예제 #2
0
        /// <summary>
        /// Gets this creature's known spells for the specified spell level.
        /// </summary>
        /// <param name="spellLevel">The spell level to query.</param>
        /// <returns>A list containing the creatures known spells.</returns>
        public IReadOnlyList <NwSpell> GetKnownSpells(byte spellLevel)
        {
            int spellCount = GetKnownSpellCountByLevel(spellLevel);

            NwSpell[] retVal = new NwSpell[spellCount];

            for (byte i = 0; i < spellCount; i++)
            {
                retVal[i] = NwSpell.FromSpellId((int)classInfo.GetKnownSpell(spellLevel, i)) !;
            }

            return(retVal);
        }
예제 #3
0
 /// <summary>
 /// Adds the specified spell as a known spell at the specified spell level.
 /// </summary>
 /// <param name="spell">The spell to be added.</param>
 /// <param name="spellLevel">The spell level for the spell to be added.</param>
 public void AddKnownSpell(NwSpell spell, byte spellLevel)
 {
     classInfo.AddKnownSpell(spellLevel, spell.Id.AsUInt());
 }
예제 #4
0
 /// <summary>
 /// Clears the specified spell from the creature's spellbook.
 /// </summary>
 /// <param name="spell">The spell to clear.</param>
 public void ClearMemorizedKnownSpells(NwSpell spell)
 {
     classInfo.ClearMemorizedKnownSpells(spell.Id.AsUInt());
 }
예제 #5
0
 /// <summary>
 /// Removes the known spell at the specified level with the specified index, as returned by <see cref="GetKnownSpells"/>.
 /// </summary>
 /// <param name="spellLevel">The spell level to query.</param>
 /// <param name="spell">The spell to remove.</param>
 public void RemoveKnownSpell(byte spellLevel, NwSpell spell)
 {
     classInfo.RemoveKnownSpell(spellLevel, spell.Id.AsUInt());
 }