OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
CastSpellInfo.h File Reference
#include <cstdint>
#include "Engine/Objects/CombinedSkillValue.h"
#include "Engine/Pid.h"
#include "Utility/Flags.h"
#include "SpellEnums.h"

Classes

struct  CastSpellInfo
 

Namespaces

namespace  CastSpellInfoHelpers
 

Enumerations

enum class  SpellCastFlag : uint16_t {
  ON_CAST_CastViaScroll = 0x0001 , ON_CAST_TargetedCharacter = 0x0002 , ON_CAST_TargetedActor = 0x0008 , ON_CAST_TargetIsParty = 0x0010 ,
  ON_CAST_NoRecoverySpell = 0x0020 , ON_CAST_TargetedTelekinesis = 0x0040 , ON_CAST_TargetedEnchantment = 0x0080 , ON_CAST_TargetedActorOrCharacter = 0x0100 ,
  ON_CAST_TargetedHireling = 0x0200 , ON_CAST_CastingInProgress
}
 

Functions

void CastSpellInfoHelpers::castSpell ()
 
void CastSpellInfoHelpers::cancelSpellCastInProgress ()
 
static const CombinedSkillValue SCROLL_OR_NPC_SPELL_SKILL_VALUE (5, CHARACTER_SKILL_MASTERY_MASTER)
 
static const CombinedSkillValue WANDS_SKILL_VALUE (8, CHARACTER_SKILL_MASTERY_NOVICE)
 
void pushSpellOrRangedAttack (SpellId spell, int casterIndex, CombinedSkillValue skill_value, SpellCastFlags flags, int overrideSoundId)
 
void pushTempleSpell (SpellId spell)
 
void pushNPCSpell (SpellId spell)
 
void pushScrollSpell (SpellId spell, int casterIndex)
 
void spellTargetPicked (Pid targetPid, int targetCharacterIndex)
 

Enumeration Type Documentation

◆ SpellCastFlag

enum class SpellCastFlag : uint16_t
strong
Enumerator
ON_CAST_CastViaScroll 
ON_CAST_TargetedCharacter 
ON_CAST_TargetedActor 
ON_CAST_TargetIsParty 
ON_CAST_NoRecoverySpell 
ON_CAST_TargetedTelekinesis 
ON_CAST_TargetedEnchantment 
ON_CAST_TargetedActorOrCharacter 
ON_CAST_TargetedHireling 
ON_CAST_CastingInProgress 

Function Documentation

◆ pushNPCSpell()

void pushNPCSpell ( SpellId  spell)

Register spell cast by NPC companions.

Parameters
spellSpell id.

◆ pushScrollSpell()

void pushScrollSpell ( SpellId  spell,
int  casterIndex 
)

Register spell cast through scroll.

Parameters
spellSpell id.
casterIndex0-based index of the character casting the spell.

◆ pushSpellOrRangedAttack()

void pushSpellOrRangedAttack ( SpellId  spell,
int  casterIndex,
CombinedSkillValue  skill_value,
SpellCastFlags  flags,
int  overrideSoundId 
)

General function that registers spell or skill implemented through spell casting mechanism to be cast/performed later.

Actual casting will be performed with event queue processing.

If spell is targeted then corresponding target mode is entered and actual casting will be performed after target is picked. Registered targeted spells will have one of the flags listed in ON_CAST_CastingInProgress and this flag will be removed in event queue if correct target is picked.

Original binary offset:
0x0042777D
Parameters
spellSpell id.
casterIndexZero-based index of a character casting the spell.
skill_valueSkill value that the spell is cast with.
flagsSpell flags. Can be empty or have several flags.
overrideSoundId???

◆ pushTempleSpell()

void pushTempleSpell ( SpellId  spell)

Register spell cast on party with temple donation. Temple spells are cast with MASTER mastery of skill level equal to the day of week.

Parameters
spellSpell id.

◆ SCROLL_OR_NPC_SPELL_SKILL_VALUE()

static const CombinedSkillValue SCROLL_OR_NPC_SPELL_SKILL_VALUE ( ,
CHARACTER_SKILL_MASTERY_MASTER   
)
static

◆ spellTargetPicked()

void spellTargetPicked ( Pid  targetPid,
int  targetCharacterIndex 
)

Process successful picking target for spell.

Parameters
targetPidPid of the target.
targetCharacterIndex0-based index of the character being targeted by the spell.

◆ WANDS_SKILL_VALUE()

static const CombinedSkillValue WANDS_SKILL_VALUE ( ,
CHARACTER_SKILL_MASTERY_NOVICE   
)
static