Can Turn

Turn Attempt


These hooks are called to control a character's attempts to 'Turn Undead' in combat.

There are two questions that need to be answered:

  1. Should the “TURN” option be displayed when the character becomes the active character in combat?

  2. When the player selects the “TURN” option, which monsters should be turned?




CanTurn

This hook answers the first question. It should return an answer starting with 'Y' of it wants the “TURN” option to b displayed. This hook will only be called whether or not the character has the 'Turn' skill and there are monsters that could be turned if the attempt to turn were successful. But the script can simply return parameter[5] and then the option will be displayed only if turning is actually a possibility. Nevertheless, the script could test the player's alertness and allow him to select “TURN” as an impossibility, thereby wasting a move.

Parameters

Result

The “TURN” will appear as a menu item only if this script exists and it returns a value starting with the letter 'Y'. The simplest script that will accomplish normal 'Turning' capabilities is:



$RETURN $GET_HOOK_PARAM(5);

Context




TurnAttempt



This hook is called when the player select the “TURN” option from the combat menu. I should return a list of the 'Undead' types that should be 'Turned'.

Parameters


Result

The script should return a delimited string with then names of the 'Undead Types' that should be turned. Normally this would be one of the 'Undead Types' in the Parameter[5] list (or an empty string).

Context






Example of use


Let us say that the character should be able to turn one 'Undead Type' each time he takes combat action, until he fails to roll successful 'Turning Dice'.


At the start of combat we should give the COMBATANT a Special Ability which allows him to turn until he fails. This Special Ability will have two scripts.


  1. “CanTurn” - This script enables the “TURN” option on the player's menu. This script will simply return hook parameter [5]. When turning fails, the “TurnAttempt” hook will remove the special ability from the combatant and “TURN” will no longer appear as a menu option.

  2. “TurnAttempt” - This script keeps track of which 'Undead Types' have already been turned and decides which 'Undead Types' should be turned on each attempt. When a “TURN' attempt fails, this script will remove the Special Ability from the combatant, preventing “TURN” from appearing a s menu option.



When the “Turn Attempt” script runs and parameter 5 is empty (indicates failure), it will:



If parameter 5 is non-empty (indicates turn success) then the script will: