• Tutorials

  • Home
  • Basic Tutorial: Using Event Trigger - Execute GPDL function

    Spell in Effect

    General:

    GPDL scripts offer great flexibility in determining whether an event should fire. Many parameters can be tested in a single script, which may eliminate the need for multiple chained events. It can also improve the game flow by performing tasks without player input.

    For example, here is a script to use to test if a spell is in effect.

    $RETURN $IS_AFFECTED_BY_SPELL( $Myself(), "My Spell" );
    

    Script notes:

    Slightly more complicated, is the introduction of a $WHILE loop to check each party member for the spell effect.

    $VAR index;
    $VAR name;
    index = 0;
    $WHILE (index <# $PARTYSIZE())
     {
      name = $GET_CHAR_NAME(index);
      $IF ($IS_AFFECTED_BY_SPELL($Name(name),"My Spell"))
        {$RETURN 1;};
      index = index +# 1;
     };
    

    Script notes: