Lua API
On this page

Spell

Inherits from

Fields:

Align DispelType

read only

The type of spells to dispel 0 = all spells 1 = positive 2 = negative

BaseIntensity number

read only

The base amount of damage for this spell

BaseMana number

read only

Mana cost

BaseRangeMod number

read only

Boost number

read only

The minimum amount of vital boost from a life spell

BoostVariance number

read only

Boost + BoostVariance = the maximum amount of vital boost from a life spell

CasterEffect PlayScript

read only

The scripting effect to play on the caster

Category SpellCategory

read only

Spell category

ComponentLoss number

read only

Components SpellComponent[]

read only

List of SpellComponents this spell requires. This looks at your character's inventory and chooses between foci / oldschool formulas depending on if you have the required foci / infused magic augmentation.

CreateOffset Vector3

read only

The offset to apply to the spawn position

CritFrequency number

read only

The critical chance frequency for this spell

CritMultiplier number

read only

The critical damage multiplier for this spell

DamageRatio number

read only

The percentage of DrainPercentage to damage a target for life projectiles

DamageType DamageType

read only

The damage type for this spell

DefaultLaunchAngle number

read only

The default angle to launch this spell (relative to player, or global?)

DegradeLimit number

read only

DegradeModifier number

read only

Description string

read only

Spell description

Destination Vital

read only

The destination vital for a life spell

DestinationLandcell number

read only

The destination landcell for a spell

DestinationOrientation Quaternion

read only

The destination orientation for a spell

DestinationOrigin Vector3

read only

The destination origin for a spell

Dims Vector3

read only

The dimensions of the origin, used for Volley spells?

DispelSchool MagicSchool

read only

The magic school to dispel, or undefined for all schools

DisplayOrder number

read only

DotDuration number

read only

Damage over Time Duration?

DrainPercentage number

read only

The amount of source vital to drain for a life spell

Duration number

read only

ElementalModifier number

read only

The elemental damage multiplier for this spell

FizzleEffect PlayScript

read only

The scripting effect to play on the caster when the spell fizzles

Flags SpellFlags

read only

Spell flags

FociComponents SpellComponent[]

read only

List of spell components this spell requires assuming the current character has the required foci / infused magic augmentation.

Formula number[]

read only

A list of component ids for the spell formula. This is the old non-Foci formula.

FormulaVersion number

read only

What formula version to use when calculating spell components

Icon number

read only

Icon id

Id number

read only

Spell Id

IgnoreMagicResist boolean

read only

If TRUE, ignores magic resistance

ImbuedEffect number

read only

The imbued effect for this spell

Index number

read only

Unknown index?

Level number

read only

Uses the client spell level formula, which is used for things like spell filtering a 'rough heuristic' based on the first component of the spell, which is expected to be a scarab

read only

For SpellType.PortalSummon spells, Link is set to either 1 for LinkedPortalOneDID or 2 for LinkedPortalTwoDID

LossPercent number

read only

The percent of source vital loss for a life magic transfer spell

ManaMod number

read only

MaxBoostAllowed number

read only

The maximum destination vital boost for a life magic transfer spell? Unused / unknown?

MaxPower number

read only

The maximum spell power to dispel

MetaSpellId number

read only

MinPower number

read only

The minimum spell power to dispel (unused?)

Name string

read only

Spell name

NonTracking boolean

read only

If this is on then projectile spells won't lead a target. Arc spells have this set to true.

Number number

read only

The maximum # of spells to dispel

NumberVariance number

read only

Number * NumberVariance = the minimum # of spells to dispel

NumProjectiles number

read only

The total # of projectiles launched for this spell

NumProjectilesVariance number

read only

The maximum # of additional projectiles possibly launched

OldSchoolComponents SpellComponent[]

read only

List of old school (non-foci) spell components this spell requires

Padding Vector3

read only

The minimum amount of padding to ensure for the spell to spawn

Peturbation Vector3

read only

The maximum variation for spawn position

PortalLifetime number

read only

Portal duration for spells of type SpellType.PortalSummon

Power number

read only

Spell power / difficulty

PowerVariance number

read only

Possible RNG for spell power to dispel (unused?)

Proportion number

read only

The propotion of source vital to transfer to destination vital

RecoveryAmount number

read only

School MagicSchool

read only

The school of magic this spell belongs to

SlayerCreatureType CreatureType

read only

The creature class for a slayer spell

SlayerDamageBonus number

read only

The amount of additional damage for a slayer spell

Source Vital

read only

The source vital for a life spell

SourceLoss number

read only

A static amount of source vital loss for a life magic transfer spell? Unused / unknown?

SpellEconomyMod number

read only

SpreadAngle number

read only

The total angle for multi-projectile spells, ie. 90 degrees for 3-5 projectiles, or 360 degrees for ring spells

StatModAttribute AttributeId

read only

The attribute this StatMod is for, if any.

StatModFloatProp FloatId

read only

The float property this StatMod is for, if any.

StatModIntProp IntId

read only

The int property this StatMod is for, if any.

StatModKey number

read only

The stat modifier key, used for lookup in the enchantment registry

StatModSkill SkillId

read only

The skill this StatMod is for, if any.

StatModType EnchantmentFlags

read only

The stat modifier type, usually EnchantmentTypeFlags

StatModVal number

read only

The amount to modify a stat

StatModVital Vital

read only

The vital this StatMod is for, if any.

TargetEffect PlayScript

read only

The scripting effect to play on the target

TransferCap number

read only

The maximum amount of vital transferred by a life magic spell

TransferFlags TransferFlags

read only

Indicates the source and destination for life magic transfer spells

Variance number

read only

The maximum additional daamage for this spell

VerticalAngle number

read only

The vertical angle to launch this spell

VitalDamageType DamageType

read only

DamageType used by LifeMagic spells that specifies Health, Mana, or Stamina for the Boost type spells

WeenieClassId number

read only

The weenie class ID associated for this spell, ie. the projectile weenie class id

Methods:

GetPropertyKeys() : string[]

Returns a list of strings of all public property / field names. Useful for reflection on UserData in lua scripts

Returns:string[]

HasComponents() : boolean, SpellComponent[]

Check if the current character has the required spell components to cast this spell. It automatically chooses between OldSchoolComponents and FociComponents depending on if the current character has the required foci / infused magic augmentation.

Returns:
TypeSummary
boolean

true if the current character has the required components, false otherwise

SpellComponent[]

A list of missing SpellComponents

HasComponents() : boolean

Check if the current character has the required spell components to cast this spell. It automatically chooses between OldSchoolComponents and FociComponents depending on if the current character has the required foci / infused magic augmentation.

Returns:boolean

HasFociOrInfusedAugmentation() : boolean

Check if the current character has the needed foci or infused magic augmentation

Returns:boolean

HasSkill(spellDifficultyModifier?: number = 20) : boolean

Checks if the current character has the skill required to cast this spell successfully.

Parameters:
NameTypeDefaultSummary
spellDifficultyModifiernumber20

The number of skill points above the spell's difficulty that you must have in order for this check to pass

Returns:boolean

IsKnown()

ToString()