Difference between revisions of "EVENT TYPE COMMAND PENDING"

From Dragon Age Toolset Wiki
Jump to: navigation, search
(formatting)
m (found a bit on command subtypes in rules_core)
Line 16: Line 16:
 
|int2desc= set in [[ability_core]]
 
|int2desc= set in [[ability_core]]
 
}}
 
}}
 +
 +
The command subtype:
 +
* COMMAND_TYPE_ATTACK  - # of attacks
 +
* COMMAND_TYPE_ABILITY - ABILITY_TYPE constant *
  
 
[[Category:Event types|COMMAND_PENDING]]
 
[[Category:Event types|COMMAND_PENDING]]

Revision as of 20:52, 24 July 2009

Source:
[Undocumented]
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

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

// insert event-handling code here

break;
}

The command subtype:

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