Identify
This hook is called when a character 'Identifies' an item as a result of the 'CanIdentify' hook's returning a “Y”. It will not be called when “ID ITEM” is displayed automatically. It will only be called when the hook “CanIdentify” returns a “Y” for a particular item.
Search Order
- The Character
Parameters
Parameter[5] = the value that the 'CanIdentify' hook set before returning “Y”.
Context
Character
Item
Return Value
If the hook returns a value starting with 'Y' then the item will be marked as 'identified'. The hook might enforce some sort of probability of success, for example.
A Bit of Discussion
These hooks (and the function “$IsIdentified (item, bool)” were provided to allow a character to identify items by casting a spell. Here is an example of how it might work:
- An “Identify Liquids” spell is cast upon Pluto the Plutarch.
- The spell results in Pluto receiving a Special Ability named “Liquid Expert”.
- Pluto receives treasure, including a bottle of Jack Daniels whiskey but it is not yet identified and is listed simply as “Bottle of Brown Liquid”. The “Bottle of Brown Liquid” has a special ability named “is_Liquid”.
- The player examines Pluto's items and highlights the “Bottle of Brown Liquid”.
- The Special Ability 'Liquid Expert”, which the spell attached to Pluto, has a script named “CanIdentify”. We run the script.
- The script examines the “Bottle of Brown Liquid”, sees that it has the Special Ability named “is_Liquid”, and returns the value “Yes”.
- The Menu option “ID ITEM” appears and the player selects it.
- The Special Ability 'Liquid Expert”, which the spell attached to Pluto, has a script named “CanIdentify”. We run the script.
- The script deletes the Special Ability “Liquid Expert” from Pluto ( so that he gets only one identify opportunity per spell....you could set the Special Ability's parameter to some number when the spell is cast and decrement it here) and returns “Yes”.
- Suddenly the “Bottle of Brown Liquid” becomes “80 Proof Tennessee Nectar”.