Skip to content

0xD5 — special_effect

Builds special-effect parameters, resolves up to two character abstractions, and calls CSpecialEffectManager::ExecuteSpecialEffect_Main or CSpecialEffectManager::AbortSpecialEffect.

proven— handler traced, and exercised by at least one shipped script.

At a glance

Opcode0xD5 (213)
HandlerCRadiScript::Command_d5
SignatureCRadiScript::Command_d5(int,SCR_DATA*,unsigned int,unsigned int)
Translation unitr_script_rund.cpp
Address— debug build; click for all 3
Handler size0x1CC (460 bytes)
Engine namespecial_effect
FamilyPerson, battle and effects
Command size4 + extra_words * 4 bytes

Handler behaviour

Builds special-effect parameters, resolves up to two character abstractions, and calls CSpecialEffectManager::ExecuteSpecialEffect_Main or CSpecialEffectManager::AbortSpecialEffect.

Encoding

The command header is one 32-bit word, as described in §3 Instruction encoding:

 31            24 23            16 15             8 7              0
+----------------+----------------+----------------+----------------+
|  flags         |  argument byte |  extra words   |  0xD5          |
+----------------+----------------+----------------+----------------+

Bits 8–15 give the number of 32-bit operand words that follow. Bits 16–23 are handed to the handler as a bitfield; on character commands bit 0 normally says whether a character selector word is present. Bit 31 is the keep-going bit.

Operand fields

10 documented fields. input fields are read from the command's operand words; derived fields are computed from other fields rather than stored separately.

FieldRoleMeaning
abortderivedSet when the command calls AbortSpecialEffect instead of ExecuteSpecialEffect_Main.
character0inputFirst character selector word, present when explicit_char0 is set.
character1inputSecond character selector word, present when explicit_char1 is set.
effectinputPacked effect word: low half is effect_id, high half is effect_flags.
effect_flagsderivedBoolean options for effect, packed one per bit.
effect_idderivedIdentifier selecting which effect to use.
executeinputFinal word passed to ExecuteSpecialEffect_Main.
explicit_char0derivedWhether the first character selector word is present.
explicit_char1derivedWhether the second character selector word is present.
yieldderivedPause the script here for one game frame; the next command runs on the following update. Lines without it keep running immediately.

Engine calls

Engine functions this handler was observed calling:

  • CRadiScript::GetAbstractionCharacterNumber(unsigned int&,unsigned int&,const SCR_DATA*)
  • CSpecialEffectManager::AbortSpecialEffect(unsigned int,unsigned int,unsigned int,unsigned int,long)
  • CSpecialEffectManager::ExecuteSpecialEffect_Main(CSEParameter_Base*)
  • SetDefaultMemoryManager(CMemoryManager*)

Bit masks

Masks the handler applies to its argument byte or operand words:

0xFFFF 0x00FF 0x0001 0x0002 0x0080