added related messages, added skillcheck for spells (cast)

This commit is contained in:
2021-04-27 18:11:47 +02:00
parent 1b67dcb4e6
commit f5c485fdcc
12 changed files with 798 additions and 1184 deletions

View File

@ -30,15 +30,14 @@ const getSpell = ({ Character: Character = [], spell_name: spell_name = '' } = {
let Level = 0; // This is the minimum attributes value.
let Spell = Character.spells.find(spell => spell.id === spell_entry.id) || {}; //?+
if (Spell) {
if (Spell && Spell.hasOwnProperty('level')) {
Level = Spell.level || 0;
}
let Name = spell_entry.name;
let ModifiedBy = spell_entry.modified_by;
let Attributes = getAttributeLevels(spell_entry.attributes, Character);
return {
Name: Name,
Name: spell_entry.name,
Level: Level,
Attributes: Attributes,
ModifiedBy: ModifiedBy,