• Tutorials

  • Home
  • Can Turn

    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?

    This hook answers the first question. It should return an answer starting with 'Y' of it wants the “TURN” option to be 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

    Parameter [5] = will be “Y” if and only if 'Turning' is a possibility. That is if the character has a turning ability that has the capability of turning one or more monster types currently in the combat. Otherwise it will contain an empty string.
    Parameter [6] = Delimited String containing the Monster Types that can be turned.

    Context

    COMBATANT context. Ie: $CombatantContext(). The COMBATANT whose combat options are to be displayed.

    Result

    The script should return “Y” if the “TURN” option should be displayed. The simplest script that will accomplish normal 'Turning' capabilities is:
    $RETURN $GET_HOOK_PARAM(5);


    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. At the time of failure, we will remove the Special Ability. This Special ability will contain a list of the 'Undead Types' already turned during this combat and should therefore start out empty. Each time he succeeds in turning an 'Undead Type', we will add the name of that 'Undead Type' to the list. This Special Ability will also have a script named “Turn Attempt” which will handle the character's attempts to turn. Let us call this Special Ability “Have Already Turned These Undead”. You can probably think of a shorter name.

    When the “Turn Attempt” script runs and parameter 6 indicates failure, it will:

    Remove the “Have Already Turned These Undead” Special Ability and thereby prevent the “TURN” option from appearing for this COMBATANT during the rest of this combat.

    Return an empty string, preventing any turning on this move.

    If parameter 6 indicates success then the script will: