EVENT TYPE COMMAND PENDING

From Dragon Age Toolset Wiki
Jump to: navigation, search
Source:
script.ldf
Sent when:
Fires at the beginning of the attack part of the attack command OR at the beginning of an ability execution. The attack command includes walk->orient->attack - this event fires right before the attack part. When this event is received, the script is supposed to check if we need to disable a modal talent, verify mana/stamina values, verify valid target, calculate an attack roll (hit/miss/critical) and then calculate damage and inform the engine of the results.
Sent from:
Engine
Sent to:
Creatures, players
Parameters:
  • Creator: attacking creature
  • Integer 0: command ID of the pending command
  • Integer 1: command sub-type, if applicable - used mostly for ability ID for CommandUseAbility.
  • Integer 2: set in ability_core
  • Object 0: creature triggering the command
  • Object 1: target creature, if applicable
  • Location 0: [Undocumented]

Usage

case EVENT_TYPE_COMMAND_PENDING:
{
object oAttacker = GetEventCreator(ev); // attacking creature
int nPendingCommand = GetEventInteger(ev, 0); // command ID of the pending command
int nCommandSubtype = GetEventInteger(ev, 1); // command sub-type, if applicable - used mostly for ability ID for CommandUseAbility.
int nResistenceCheckResult = GetEventInteger(ev, 2); // set in ability_core
object oTriggeringCreature = GetEventObject(ev, 0); // creature triggering the command
object oTarget = GetEventObject(ev, 1); // target creature, if applicable
location lTargetPos = GetEventLocation(ev, 0); //

// insert event-handling code here

break;
}

The command subtype:

  • COMMAND_TYPE_ATTACK - # of attacks
  • COMMAND_TYPE_ABILITY - ABILITY_TYPE constant *

In saisubaction.cpp location0 is set with "SetVector".