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); }
/// <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); }
/// <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()); }
/// <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()); }
/// <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()); }