• Tutorials

  • Home
  • CanChangeToClass

    These hooks are each called once for each class in the class database when a character chooses 'Change Class' in the training hall. The hooks is provided with the character context and the class context (the class name). The hook should return the string 'Y' if the change is allowed. Any other return value will allow the class to be listed.

    If multiple scripts are provided (via multiple Special Abilities) then it is the job of the scripts to work out a plan of coordination. Hook Parameter[0] is initially set to the empty string and is set to the return value of each script that executes. Other hook parameters are initially set to empty strings and are not modified by the engine between multiple script executions. Multiple scripts within a single class will not be executed in any particular order.

    In the future, the search order for these scripts might be expanded to include, for example, the character. This would allow the designer to modify class changing abilities to a character during play.

    Search Order:

    Parameters

    Parameter [5] = class to which the character wants to change.

    (These parameters may be fetched using the $GET_HOOK_PARAM(n) , where n is 5 or 6.)

    Result

    A return value of anything except “Y” will remove the possibility of making this change.

    Context

    Combatant - $CombatantContext()
    Class - the searcher's current class - $ClassContext()

    Example

    To allow a fighter to change classes if his strength is greater than 12 you might attach a Special Ability named 'CCFighter' to the class 'Fighter'. Then you would provide the following script to the Special Ability 'CCFighter':
    script: “CanChangeFromClass”

    $IF (GET_CHAR_LIMITED_STR($IndexOf($CharacterContext())) ># 12)
    	{
    		$RETURN "Y";
    	};