Difference between revisions of "EVENT TYPE COMMAND PENDING"

From Dragon Age Toolset Wiki
Jump to: navigation, search
m (sort key)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
*<b>Sent When:</b> 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.
+
{{event
*<b>Sent From:</b> Engine
+
|sourcefile=script.ldf
*<b>Sent To:</b> creatures, players
+
|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.
 +
|from= [[Engine]]
 +
|to= [[Creature]]s, players
 +
|tocategory1=creature
 +
|sortkey=COMMAND_PENDING
 +
|creatorname= oAttacker
 +
|creatordesc= attacking creature
 +
|object0name= oTriggeringCreature
 +
|object0desc= creature triggering the command
 +
|object1name= oTarget
 +
|object1desc= target creature, if applicable
 +
|int0name= nPendingCommand
 +
|int0desc= command ID of the pending command
 +
|int1name= nCommandSubtype
 +
|int1desc= command sub-type, if applicable - used mostly for ability ID for CommandUseAbility.
 +
|int2name= nResistenceCheckResult
 +
|int2desc= set in [[ability_core]]
 +
|location0name= lTargetPos
 +
}}
  
Parameters:
+
The command subtype:
*<b>Creator:</b> attacking creature
+
* COMMAND_TYPE_ATTACK  - # of attacks
*<b>Object 0:</b> creature triggering the command
+
* COMMAND_TYPE_ABILITY - ABILITY_TYPE constant *
*<b>Object 1:</b> target creature, if applicable
+
 
*<b>Int 0:</b> command ID of the pending command
+
In saisubaction.cpp location0 is set with "SetVector".
*<b>Int 1:</b> command sub-type, if applicable - used mostly for ability ID for CommandUseAbility.
+
*<b>Int 2:</b> ResistenceCheckResult (set in ability_core.nss)
+
  
 
[[Category:Event types|COMMAND_PENDING]]
 
[[Category:Event types|COMMAND_PENDING]]
 +
[[Category:Creature events|COMMAND_PENDING]]

Latest revision as of 20:17, 3 January 2010

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".