12 using st = RE::MagicSystem::SpellType;
13 using av = RE::ActorValue;
15 const auto type = spell->GetSpellType();
16 const auto skill = spell->GetAssociatedSkill();
20 case st::kStaffEnchantment:
23 case st::kLeveledSpell:
25 case st::kLesserPower:
35 case av::kDestruction:
36 case av::kConjuration:
38 case av::kRestoration:
51 switch (item->GetSpellType())
53 case RE::MagicSystem::SpellType::kDisease:
54 case RE::MagicSystem::SpellType::kAbility:
55 case RE::MagicSystem::SpellType::kAddiction:
66 static void ApplySpell(RE::Actor *caster, RE::Actor *target, RE::SpellItem *spell)
70 target->AddSpell(spell);
74 caster->GetMagicCaster(RE::MagicSystem::CastingSource::kInstant)
75 ->CastSpellImmediate(spell,
false, target, 1.0F,
false, 0.0F,
nullptr);
static bool IsSpellPlayable(const RE::SpellItem *spell)
Check if a spell is playable, as in, able to be cast.
Definition st-magic.h:10
static bool IsPermanent(RE::MagicItem *item)
Check if a magic item is permanent.
Definition st-magic.h:49
static void ApplySpell(RE::Actor *caster, RE::Actor *target, RE::SpellItem *spell)
Casts Spell from caster to actor. If the spell is permanent (MagicUtil::IsPermanent) it adds the spel...
Definition st-magic.h:66