Difference between revisions of "EVENT TYPE COMMAND PENDING"
From Dragon Age Toolset Wiki
BryanDerksen (Talk | contribs) m (found a bit on command subtypes in rules_core) |
BryanDerksen (Talk | contribs) m (|sourcefile=script.ldf) |
||
Line 1: | Line 1: | ||
{{event | {{event | ||
+ | |sourcefile=script.ldf | ||
|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. | |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]] | |from= [[Engine]] |
Revision as of 20:39, 30 July 2009
- 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
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;
}
{
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 *