Projectile

EEex_Projectile_CastUserType

Aliases: EEex_Projectile_CastUT

Summary

Takes the given projectile and returns a cast userdata that represents projectile’s true type.

Most EEex functions will call this function before passing a projectile to the modder API.

Parameters:

Name

Type

Default Value

Description

projectile

CProjectile

The projectile to cast.

Return Values:

Type

Description

 CProjectile                    | CProjectileAmbiant             | CProjectileArea                | 
CProjectileBAM | CProjectileCallLightning | CProjectileCastingGlow |
CProjectileChain | CProjectileColorSpray | CProjectileConeOfCold |
CProjectileFall | CProjectileFireHands | CProjectileInstant |
CProjectileInvisibleTravelling | CProjectileLightningBolt | CProjectileLightningBoltGround |
CProjectileLightningBounce | CProjectileLightningStorm | CProjectileMagicMissileMulti |
CProjectileMulti | CProjectileMushroom | CProjectileNewScorcher |
CProjectileScorcher | CProjectileSegment | CProjectileSkyStrike |
CProjectileSkyStrikeBAM | CProjectileSpellHit | CProjectileTravelDoor | nil

See summary.

EEex_Projectile_GetType

Instance Name: getType

Summary

Returns the EEex_Projectile_Type of the given projectile.

Parameters:

Name

Type

Default Value

Description

projectile

CProjectile

The projectile whose type is being fetched.

Return Values:

Type

Description

EEex_Projectile_Type

See summary.


EEex_Projectile_Type

Name

Description

Unknown

CProjectile

CProjectileAmbiant

CProjectileArea

CProjectileBAM

CProjectileChain

CProjectileColorSpray

CProjectileConeOfCold

CProjectileFall

CProjectileFireHands

CProjectileInstant

CProjectileMulti

CProjectileMushroom

CProjectileNewScorcher

CProjectileScorcher

CProjectileSegment

CProjectileSkyStrike

CProjectileSkyStrikeBAM

CProjectileSpellHit

CProjectileTravelDoor

EEex_Projectile_IsOfType

Instance Name: isOfType

Summary

Returns true if projectile has the type checkType or is a derivative thereof.

This is useful to ensure that a projectile is of a certain type before accessing members it may or may not have.

Parameters:

Name

Type

Default Value

Description

projectile

CProjectile

The projectile whose type is being checked.

checkType

EEex_Projectile_Type

The type to check against.

Return Values:

Type

Description

boolean

See summary.

EEex_Projectile_RegisterGlobalMutator

Summary

Registers a global Lua table as a global (always processed) projectile mutator.

Parameters:

Name

Type

Default Value

Description

mutatorTableName

string

The name of the table to register.


The Mutator Table

A mutator table can contain three optional keys, each of which should be assigned a respective mutator function.

The valid function keys are: typeMutator, projectileMutator, and effectMutator:


typeMutator

Parameters:

Name

Type

Description

context

table

A table containing the context of the hook.

context keys:

Context Key

Value Type

Description

decodeSource

EEex_Projectile_DecodeSource

The source of the hook, such as EEex_Projectile_DecodeSource.CGameSprite_Spell
for the Spell() action, EEex_Projectile_DecodeSource.CGameSprite_SpellPoint
for the SpellPoint() action, etc.

originatingEffect

CGameEffect | nil

The op408 (ProjectileMutator) effect that registered the containing mutator table.

This is always nil for global mutator tables registered via EEex_Projectile_RegisterGlobalMutator().

originatingSprite

CGameSprite | nil

The sprite that is decoding (creating) the projectile.

Global mutator tables registered via EEex_Projectile_RegisterGlobalMutator()
also run for non-sprite decode sources; in these cases this is nil.

projectileType

number

The projectile type about to be decoded.

This is equivalent to the value at .SPL->Ability Header->[+0x26].

Subtract one from this value to get the corresponding PROJECTL.IDS index.

Return Values:

Type

Description

number | nil

The new projectile type, or nil if the type should not be overridden.

This is equivalent to the value at .SPL->Ability Header->[+0x26].

Subtract one from this value to get the corresponding PROJECTL.IDS index.


projectileMutator

Parameters:

Name

Type

Description

context

table

A table containing the context of the hook.

context keys:

Context Key

Value Type

Description

decodeSource

EEex_Projectile_DecodeSource

The source of the hook, such as EEex_Projectile_DecodeSource.CGameSprite_Spell
for the Spell() action, EEex_Projectile_DecodeSource.CGameSprite_SpellPoint
for the SpellPoint() action, etc.

originatingEffect

CGameEffect | nil

The op408 (ProjectileMutator) effect that registered the containing mutator table.

This is always nil for global mutator tables registered via EEex_Projectile_RegisterGlobalMutator().

originatingSprite

CGameSprite | nil

The sprite that is decoding (creating) the projectile.

Global mutator tables registered via EEex_Projectile_RegisterGlobalMutator()
also run for non-sprite decode sources; in these cases this is nil.

projectile

CProjectile

The projectile about to be returned from the decoding process.


effectMutator

Parameters:

Name

Type

Description

context

table

A table containing the context of the hook.

context keys:

Context Key

Value Type

Description

addEffectSource

EEex_Projectile_AddEffectSource

The source of the hook, such as EEex_Projectile_AddEffectSource.CGameSprite_Spell
for the Spell() action, EEex_Projectile_AddEffectSource.CGameSprite_SpellPoint
for the SpellPoint() action, etc.

effect

CGameEffect

The effect that is being added to projectile.

originatingEffect

CGameEffect | nil

The op408 (ProjectileMutator) effect that registered the containing mutator table.

This is always nil for global mutator tables registered via EEex_Projectile_RegisterGlobalMutator().

originatingSprite

CGameSprite | nil

The sprite that decoded (created) the projectile.

Global mutator tables registered via EEex_Projectile_RegisterGlobalMutator()
also run for non-sprite sources; in these cases this is nil.

projectile

CProjectile

The projectile that effect is being added to.


EEex_Projectile_DecodeSource

Name

Description

CBounceList_Add

CGameAIBase_FireItem

CGameAIBase_FireItemPoint

CGameAIBase_FireSpell

CGameAIBase_FireSpellPoint

CGameAIBase_ForceSpell

CGameAIBase_ForceSpellPoint

CGameEffect_FireSpell

CGameEffectCastingGlow_ApplyEffect

CGameEffectChangeStatic_ApplyEffect

CGameEffectSummon_ApplyVisualEffect

CGameEffectVisualSpellHitIWD_ApplyEffect

CGameSprite_Spell

CGameSprite_SpellPoint

CGameSprite_Swing

CGameSprite_UpdateAOE

CGameSprite_UseItem

CGameSprite_UseItemPoint

CMessageFireProjectile_Run

CProjectile_DecodeProjectile_MultiMagicMissile

CProjectile_DecodeProjectile_ChainCallLightning

CProjectile_DecodeProjectile_MultiProjectile

CProjectileArea_CreateSecondary

CProjectileArea_Explode

CProjectileChain_AIUpdate

CProjectileChain_Fire

CProjectileFall_AIUpdate

EEex_Projectile_AddEffectSource

Name

Description

CBounceList_Add

CGameAIBase_FireItem

CGameAIBase_FireItemPoint

CGameAIBase_FireSpell

CGameAIBase_FireSpellPoint

CGameAIBase_ForceSpell

CGameAIBase_ForceSpellPoint

CGameEffect_FireSpell

CGameSprite_LoadProjectile

CGameSprite_Spell

CGameSprite_SpellPoint

CGameSprite_Swing

CGameSprite_UseItem

CGameSprite_UseItemPoint