Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

From Roll20 Wiki

Jump to: navigation, search
 
(132 intermediate revisions by one user not shown)
Line 1: Line 1:
=Script:RoundMaster=
+
<h1>Spell, Power & Magic Item Databases</h1>
{{revdate}}
+
<h2>General Database information</h2>
RoundMaster is an API for the Roll20 RPG-DS.  Its purpose is to extend the functionality of the Turn Order Tracker capability already built in to Roll20.  The USP of this Turn Order Tracker  is the full richness of its functionality, including optionally triggering status effect macros when statuses are applied or removed from tokens, and/or each turn they remain.  It deals with Player page movements automatically with token statuses following the Player page.  It supports multiple Turn Order entries per token, and multiple tokens per Character Sheet.
+
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
RoundMaster is based on the much older TrackerJacker API, and many thanks to Ken L. for creating TrackerJacker.  However, RoundMaster is a considerable fix and extension to TrackerJacker, suited to many different applications in many different RPG scenarios.  RoundMaster is also the first release as part of the wider RPGMaster series of APIs for Roll20, composed of RoundMaster, CommandMaster, InitiativeMaster, AttackMaster, MagicMaster and MoneyMaster - other than RoundMaster (which is generic) and InitiativeMaster (which has wider but not generic applicability) these initially support only the AD&D2e RPG.
+
|
{{script overview
+
|-
|name=RoundMaster
+
|<p>The RPGMaster APIs use a number of Character Sheets as databases to hold Ability Macros defining character classes, attack templates, spells, powers and magic items and their effects.  The API is distributed with many class, attack, spell, power & magic item definitions, and checks for, creates and updates these Character Sheet databases on start-up.  DMs can add their own character classes, attack templates, spells, items, weapons, ammo and armour to additional databases, but the databases provided are totally rewritten when new updates are released so the DM must add their own database sheets.  If the provided databases are accidentally deleted, they will be automatically recreated the next time the Campaign is opened. Additional databases should be named as follows:</p>
|author={{user profile|6497708|Richard E}}
+
|version=3.022
+
|lastmodified=2021-11-25
+
|code=RoundMaster
+
|dependencies=(recommended){{api repository link|ChatSetAttr}}, (recommended){{api repository link|Tokenmod}}
+
|conflicts=None}}
+
 
+
== Syntax ==
+
The roundMaster API is called using !rounds, though it reveals its history in that it can also be called using !tj (the command for the TrackerJacker API roundMaster is based on).
+
<pre>!rounds --start
+
!tj --start</pre>
+
Commands to be sent to the roundMaster API must be preceeded by two hyphens ‘--’ as above for the --start command.  Parameters to these commands are separated by vertical bars ‘|’, for example:
+
<pre>!rounds --addtotracker name|tokenID|3|all|sleeping|sleepy</pre>
+
If optional parameters are not to be included, but subsequent parameters are needed, use two vertical bars together with nothing between them, e.g.
+
<pre>!rounds --addtotracker name|tokenID|3|all||sleepy</pre>
+
Commands can be stacked in the call, for example:
+
<pre>!rounds --start --addtotracker name|tokenID|3|all|sleeping|sleepy --sort</pre>
+
When specifying the commands in this document, parameters enclosed in square brackets [like this] are optional: the square brackets are not included when calling the command with an optional parameter, they are just for description purposes in this document.  Parameters that can be one of a small number of options have those options listed, separated by forward slash ‘/’, meaning at least one of those listed must be provided (unless the parameter is also specified in [] as optional): again, the slash ‘/’ is not part of the command.  Parameters in UPPERCASE are literal, and must be spelt as shown (though their case is actually irrelevant).
+
 
+
== Installation and Configuration ==
+
Copy the script's code, available from the menu on the right and stored at Roll20's [https://github.com/Roll20/roll20-api-scripts API GitHub Repository]. Paste the code into a new script in your campaign's [[API:Use_Guide#The_Script_Editor|API Script Editor]]. Save the new script and it will be available inside your campaign.  It will install several new Character Sheets & Handouts: The handout '''RoundMaster Help''' provides a full manual of how to use RoundMaster.  The handout '''Effects Database Help''' provides information on adding and updating status effects.  The Character Sheet '''Effects-DB''' holds ''Ability Macros'' that deliver the status effects.
+
If you want to use the Effect-DB and status effect macros, it is ''highly recommended'' that you load the APIs '''ChatSetAttr''' amd '''Tokenmod'''.  The pre-loaded Effect macros use these two APIs extensively and will not work without them.  Of course, if you do not want status effect macros to work, then do not load these APIs.
+
 
+
== Script Use ==
+
After installing the script, refer the the handout '''RoundMaster Help''' for full information on use.  Below is a copy of the contents of that handout.
+
 
+
=Command Index=
+
==Tracker commands==
+
<pre>--start
+
--stop
+
--pause
+
--reset [number]
+
--sort
+
--clear
+
--clearonround [OFF/ON]
+
--clearonclose [OFF/ON]
+
--sortorder [NOSORT/ATOZ/ZTOA/DESCENDING/ASCENDING]
+
--addToTracker name|tokenID/-1|priority|[qualifier]|[message]|[detail]
+
--removefromtracker name|tokenID/-1|[retain]</pre>
+
==Token Status Marker commands==
+
<pre>--addstatus status|duration|direction|[message]|[marker]
+
--addtargetstatus tokenID|status|duration|direction|[message]|[marker]
+
--edit
+
--target CASTER|casterID|status|duration|direction|[message]|[marker]
+
--target SINGLE/AREA|casterID|targetID|status|duration|direction|[message]|[marker]
+
--aoe tokenID|[shape]|[units]|[range]|[length]|[width]|[image]|[confirmed]
+
--clean
+
--removestatus status(es)
+
--deletestatus status(es)
+
--deltargetstatus tokenID|status(es)
+
--movestatus
+
--s_marker
+
--disptokenstatus [tokenID]
+
--listfav<br></pre>
+
==Other commands==
+
<pre>–help
+
–hsq from|[command]
+
–handshake from|[command]
+
--debug (ON/OFF)</pre>
+
 
+
=Tracker Command detail=
+
<pre>!rounds --start</pre>
+
This command alternates between starting the automatic functions of the Turn Tracker, and pausing the Tracker.  In its started state, the tracker will follow the current token at the top of the tracker with a highlight graphic, report the token’s turn to all players, and follow the options selected for ‘sortorder’ and ‘clearonround’.  When paused, the Tracker will not highlight the top token, report turns or execute the options.
+
<pre>!rounds --stop</pre>
+
Stops the tracker and removes all statuses and status markers from tokens currently held by roundMaster.  This also dumps the tables held in the campaign status object.  It is useful if you want to start a fresh version of a campaign, or if everything goes wrong.
+
<pre>!rounds --pause</pre>
+
Pauses the Turn Tracker in its current state without deleting any information, and is the same as using the --start command again having already called it once.  The Turn Tracker can still be moved on, cleared, sorted, and reset, but the highlight graphic is paused.  It can be restarted using --start
+
<pre>!rounds --reset [number]</pre>
+
Sets the round in the Turn Order to the number, or to 1 if number is not provided.
+
<pre>!rounds --sort</pre>
+
Sorts the Turn Tracker entries according to the previously set sort order, with the default being ascending numeric priority.
+
<pre>!rounds --clear</pre>
+
Clears all entries in the Turn Tracker without stopping it.
+
<pre>!rounds --clearonround [off/on]</pre>
+
Sets the ‘clear on round’ option.  If set, this option means that when the Tracker is running and reaches the end of the round, all entries in the Turn Tracker are automatically removed ready for players to do initiative for the next round.  Otherwise, the Turn Tracker is not cleared automatically at any point.  Any parameter other than ‘off’ turns clearonround on.  Default on.
+
<pre>!rounds --clearonclose [off/on]</pre>
+
Sets the ‘clear on close’ option.  If set, this option means that when the Tracker window is closed, the Turn Tracker is cleared.  Any parameter other than ‘on’ turns clear on close off.  Default off.
+
<pre>!rounds --sortorder [nosort/atoz/ztoa/descending/ascending]</pre>
+
This command sets the automatic sort order of the entries in the Turn Tracker.  The Turn Tracker is automatically sorted at the beginning of each round as the Turn Tracker is moved on to the first entry, based on the order set by this option.  Descending and Ascending are numeric sorts based on the Priority number of each entry.  AtoZ and ZtoA are alphabetic sorts based on the name of each entry in the Turn Tracker.  Nosort will mean that no sorting takes place, and the order remains the order in which the entries were made.  The default order is Ascending.
+
<pre>!rounds --addToTracker name|tokenID/-1|priority|[qualifier]|[message]|[detail]</pre>
+
This command adds an entry to the TurnTracker.  tokenID can either be the ID of a valid token, or -1 to create a custom entry.  If a custom entry, name is used for the entry in the Turn Tracker with the provided priority, otherwise the token name is used for the entry with the provided priority.  The qualifier can be one of first/last/smallest/largest/all.<br>
+
<ul><li>First keeps only the first entry made for that name (for custom entries) or token and removes any others, but leaves all entries for other tokens and names in the Tracker</li>
+
<li>Last keeps only the latest entry for that token or name (i.e. the one now being set)</li>
+
<li>Smallest keeps only the entry with the lowest numeric priority for that token or name</li>
+
<li>Largest keeps only the entry with the highest numeric priority for that token or name</li>
+
<li>All keeps all entries in the list and adds this one to those for that token or name, meaning that the Turn Tracker can have multiple entries for one or more tokens or names</li></ul>
+
The optional message will be displayed on the turn announcement for this turn when it is reached in the Turn Order.  Generally, the message relates what the player said the character was doing for their initiative.  The optional detail can be the detail of how the initiative priority was calculated or any other additional message you want to show to the Player only when the command is processed.
+
By using the name, tokenID/-1 and qualifier parameters judiciously, group initiative, individual initiative, or any combination of other types can be created.  When used with the InitiativeMaster API, Players get menus of actions they can take (based on their weapons, powers, memorised spells, magic items, thieving skills etc) which manage the calls to RoundMaster for the desired initiative type, and the DM gets menus to control all RoundMaster functions, and to set the type of initiative to undertake..
+
<pre>!rounds --removefromtracker name|tokenID/-1|[retain]</pre>
+
This command removes entries from the Turn Tracker for the specified tokenID or name.  However, if the optional retain number is given, it will retain this number of entries for the specified token or name, and only remove any beyond this number.  The earliest entries made are kept when the retain parameter is set.
+
<pre>!rounds --viewer on/off/all/tokenID</pre>
+
This command controls the viewer mode setting for the Player who calls it.  Rather than showing what that Player’s characters can see when Dynamic Lighting is turned on, viewer mode shows that Player what each player-character (even if not theirs) can see as their token reaches the top of the Turn Tracker and it is their turnQuite often, this can be a Player ID set up just to be a viewer e.g. for a DM view of what players can see, or for a touchscreen playing surface. The current player-character is defined as the token representing a character sheet controlled by any Player at the top of the Turn Tracker.  As each new token comes to the top of the Turn Tracker, if it is a player-character the display changes to only what it can see.  If it is a token representing an NPC, or when the Turn Order reaches the next round and clears, the map for the Player reverts to showing what all player-characters can see (but not what NPCs can see).
+
The on option turns on viewer mode for the Player, and off turns it off.  The all option immediately turns on vision for all player-characters, and passing a tokenID as a parameter shows vision for that token (even if it represents an NPC).  Options off, all and tokenID can be used by any Player or the DM to affect the viewer Player’s screen.
+
 
+
=Token Status Marker commands=
+
<pre>!rounds --addstatus status|duration|direction|[message]|[marker]</pre>
+
Adds a status and a marker for that status to the currently selected token(s).  The status has the name given in the status parameter and will be given the duration specified, which will be changed by direction each round.  Thus setting a duration of 8 and direction of -1 will decrement the duration by 1 each round.  If the duration gets to 0 the status and token marker will be removed automatically.  direction can be any number - including a positive one meaning duration will increase.  Each Turn Announcement for the turn of a token with one or more statuses will display the status, the duration and direction, and the message, if specified.  The specified marker (from the default token marker set) will be applied to the token - if it is not specified the option will be given to pick one from a menu in the chat window (which can be declined).
+
For player-characters, when the duration reaches 9 or less the duration will be counted-down by a number appearing on the marker.  For NPCs this number does not appear (so that Players don’t see the remaining duration for statuses on NPCs), but the remaining duration does appear for DM only on the status message below the Turn Announcement on the NPCs turn.
+
If a Player other than the DM uses this command, the DM will be asked to confirm the setting of the status and marker.  This allows the DM to make any decisions on effectiveness.
+
If an Effects database of effect macros exists within the campaign (a character sheet with the name Effects-DB, with Ability Macros named the same as the status status parameter set for markers) the Effects database will be searched in three ways: when a status marker is set, any Ability Macro with the name status-start (where status is the status name specified in the command) is run.  Each round when it is the turn of a token with the status marker set, the Ability Macro with the name status-turn is run.  And when the status ends (duration reaches 0) or the status is removed using --removestatus, or the token has the Dead marker set or is deleted, an Ability Macro with the name status-end is run.  See the Effects database documentation for full information on effect macros and the options and parameters that can be used in them.
+
<pre>!rounds --addtargetstatus tokenID|status|duration|direction|[message]|[marker]</pre>
+
This command is identical to addstatus, except for the addition of a tokenID.  Instead of using a selected token or tokens to apply the status to, this applies the status to the specified token.
+
<pre>!rounds --edit</pre>
+
This command brings up a menu in the chat window showing the current status(es) set on the selected token(s), with the ability to remove or edit themAgainst each named status, a spanner icon opens another menu to edit the selected status name, duration, direction, message and marker on all the selected token(s), and also allows this status to be set as a favourite.  A bin icon will remove the status from all the selected token(s), and run any status-end macros, if any.
+
<pre>!rounds --target CASTER|casterID|status|duration|direction|[message]|[marker]
+
!rounds --target SINGLE/AREA|casterID|targetID|status|duration|direction|[message]|[marker]</pre>
+
This command targets a status on a token or a series of tokens.  If a version using CASTER is called, it acts identically to the addtargetstatus command, using the casterID as the target token.  If the SINGLE version is called, the targetID is used.  If the AREA version is used, after applying the status to the targetID token, the system asks in the chat window if the status is to be applied to another target and, if confirmed, asks for the next target to be selected, repeating this process after each targeting and application.  In each case, it applies the status, effect macro and marker to the specified token(s) in the same way as addtargetstatus.
+
<pre>!rounds --aoe tokenID|[shape]|[units]|[range]|[length]|[width]|[image]|[confirmed]
+
 
+
shape = [Bolt/Circle/Cone/Ellipse/Rectangle/Square/Wall]
+
units = [Squares/Feet/Yards/Units]
+
image = [Acid/Cold/Dark/Fire/Light/Lightning/Magic/Red/Yellow/Blue/Green/Magenta/Cyan/ White/Black]
+
confirmed = [true / false]
+
range, length & width are numbers specified in whatever unit was specified as [units]</pre>
+
This command displays an Area of Effect for an action that has or is to occur, such as a spell.  This quite often can be used before the --target area command to identify targets.  The system will present lists of options for the Player to select for each parameter that is not specified.  On executing this command, if the range is not zero the Player will be given a crosshair to position the effect, and if the range is zero the effect will be centred on the Token (or at its “finger-tips” for directional effects like cones).  The range of the effect will be centred on the TokenID specified and will be displayed as a coloured circle - the crosshair should be positioned within this area (the system does not check).  The Crosshair (or if range is zero, the Token) can be turned to affect the direction of the effect. The effect ‘direction’ will be the direction the token/crosshair is facing.  If Confirmed is false or omitted, the Player will be asked to confirm the positioning of the token/crosshair with a button in the chat window (setting it to true will apply the effect immediately - good for range zero circular effects (i.e. don’t need placing or direction setting).  The effect can have one of the shapes listed:<br>
+
<ul><li>Bolt is a long rectangle extending away from the crosshair/token for length, and width wide.</li>
+
<li>Circle is a circle centred on the crosshair/token of diameter length.</li>
+
<li>Cone is a cone starting at the crosshair/token of length, with an end width.</li>
+
<li>Ellipse is an ellipse of length extending away, and width wide.</li>
+
<li>Rectangle is a rectangle of length extending away, and width wide.</li>
+
<li>Square is a square of sides length parallel with the direction the crosshair/token.</li>
+
<li>Wall is a rectangle perpendicular to the crosshair or token, i.e. width away and length wide.</li></ul>
+
For the units, Feet & Yards are obvious and are scaled to the map.  Squares are map squares (whatever scale they are set to), and Units are the map scale units and are not scaled. 
+
Images are set with transparency and sent to the back of the Object layer.  Red/ Yellow/ Blue/ Green/ Magenta/ Cyan/ White/ Black colour the effect area the specified colour, and Acid/ Cold/ Dark/ Fire/ Light/ Lightning/ Magic use textured fills.
+
<pre>!rounds --clean</pre>
+
Rebuilds the status markers on the selected token(s), without removing the status(es) from the campaign status object.  Markers that do not have associated statuses (including manually applied ones) are removed.  This deals with situations where token markers have become corrupted for some reason, and should not be needed very often.
+
<pre>!rounds --removestatus status(es) / ALL</pre>
+
Removes the status, or comma-delimited list of statuses, or `all’ for all statuses, and their status marker(s) from the selected token(s), and runs any associated status-end Ability Macros in any existing Effects database in the campaign.  See addstatus command and the Effect database documentation for details on effect macros.  Statuses can be ‘all’ which will remove all statuses from the selected token(s).
+
<pre>!rounds --deletestatus status(es) / ALL</pre>
+
Removes the status, or comma-delimited list of statuses, and status marker(s) from the selected token(s), but does not run any associated status-end Ability Macros in any existing Effects database in the campaign.  Statuses can be ‘all’ which will delete all statuses from the selected token(s).
+
<pre>!rounds --deltargetstatus tokenID|status(es) / ALL</pre>
+
Works the same as deletestatus command, except only on the specified tokenID rather than selected tokens.
+
<pre>!rounds --movestatus</pre>
+
For each of the selected tokens in turn, searches for tokens in the whole campaign with the same name and representing the same character sheet, and moves all existing statuses and markers from all the found tokens to the selected token (removing any duplicates).  This supports Players moving from one Roll20 map to another and, indeed, roundMaster detects page changes and automatically runs this command for all tokens on the new page controlled by the Players who have moved to the new page.
+
<pre>!rounds --disptokenstatus [tokenID]</pre>
+
Shows the statuses on the specified token to the DM using the same display format as used in the Turn Announcement.
+
<pre>!rounds --listmarkers</pre>
+
Shows a display of all markers available in the API to the DM, and also lists which are currently in use.
+
<pre>!rounds --listfav</pre>
+
Shows statuses to the DM that have been defined as favourites (see the edit command), and provides buttons to allow the DM to apply one or more favourite statuses to the selected token(s), and to edit the favourite statuses or remove them as favourites.
+
 
+
=Other commands=
+
<pre>!rounds –help</pre>
+
Displays a listing of RoundMaster commands and their syntax.
+
<pre>!rounds –hsq from|[command]
+
!rounds –handshake from|[command]</pre>
+
Either form performs a handshake with another API, whose call (without the ‘!’) is specified as from in the command parameters.  The command calls the from API command responding with its own command to confirm that RoundMaster is loaded and running: e.g.
+
Received: !rounds –hsq magic
+
Response: !magic –hsr rounds
+
Optionally, a command query can be made to see if the command is supported by RoundMaster if the command string parameter is added, where command is the RoundMaster command (the ‘--’ text without the ‘--‘).  This will respond with a true/false response: e.g.
+
Received: !rounds –hsq init|addtotraker
+
Response: !init –hsr rounds|addtotracker|true
+
<pre>!rounds --debug (ON/OFF)</pre>
+
Takes one mandatory argument which should be ON or OFF.
+
The command turns on a verbose diagnostic mode for the API which will trace what commands are being processed, including internal commands, what attributes are being set and changed, and more detail about any errors that are occurring.  The command can be used by the DM or any Player – so the DM or a technical advisor can play as a Player and see the debugging messages.
+
 
+
=How to use RoundMaster=
+
==Who uses RoundMaster calls?==
+
The vast majority of RoundMaster calls are designed for the DM/GM to use, or to be called from RPGMaster APIs and database macros, rather than being called by the Player directly.  RoundMaster should be hidden from the Players in most circumstances.  It is highly recommended that RoundMaster is used with the other RPGMaster APIs, but especially InitiativeMaster API which uses RoundMaster to create and manage entries in the Roll20 Turn Order Tracker.
+
==Managing the Turn Order Tracker==
+
If the InitiativeMaster API is used, it must be accompanied by RoundMaster – it will not work otherwise.  InitiativeMaster provides many menu-driven and data-driven means of controlling RoundMaster, making it far easier for the DM to run their campaignThe InitiativeMaster --maint command supports the necessary calls to RoundMaster for control of the Turn Order Tracker, and its --menu command uses the data on the Character Sheet to create Turn Order initiative entries with the correct speeds and adjustments.  See the InitiativeMaster API Handout for more information.
+
==Adding and managing Token Statuses==
+
The Token status management functions allow the application and management of status markers with durations in rounds passed to tokens.  The easiest way to use status markers is to use the MagicMaster API which runs spell and magic item macros the Player can initiate, which in turn ally the right status markers and statuses with the appropriate durations to the relevant tokens.  See the MagicMaster API handout for more information.
+
==Status Effects==
+
RoundMaster comes with a number of status ‘effects’: Roll20 Ability Macros that are automatically run when certain matching statuses are applied to, exist on, and/or removed from a token.  These macros can use commands (typically using APIs like ChatSetAttr API and/or Tokenmod API from the Roll20 API Script Library) to temporarily or permanently alter the characteristics of the Token or the represented Character Sheet, thus impacting the state of play.
+
If used with the MagicMaster API, its pre-configured databases of spell and magic item macros work well with the Effect macros provided in the Effects Database provided with this API.
+
For full information on Status Effects, how to use them, and how to add more of your own, see the separate Effects Database handout.
+
==Token Death and Removal==
+
If a token is marked as Dead by using the Dead status marker (either via the Roll20 token emoticon menu or any other means), the system will automatically end all statuses, remove all status markers and run all status-end effect macros (if any) for the token.
+
If a token is deleted on a map and not previously marked as Dead, the API will search for any other token in the Campaign (with a preference to one on the current page) with the same name and representing the same character, and if found the API will transfer all statuses and status markers to the first token found (even if not on the current page).  If no such token is found, all statuses and status markers are removed from the token being deleted, and any corresponding status-end effect macros are run.
+
==Page Change and Adding Tokens==
+
If a Player, or all Players, are moved to another Roll20 page in the campaign (i.e. a different map), the API will automatically migrate all current statuses and status markers from the previous page (and all other pages in the Campaign, to support where tokens have come from different pages) to any token on the new page with the same Token Name and representing the same Character.  These statuses and their effects will then continue to apply on the new page for their set durations.
+
If a token is added to the current map the Players are on, either by dragging a character onto the map or by dragging on a picture and editing its properties to give it a name and optionally a representation, the API will again search for tokens with the same name and representing the same character, and move statuses and markers to the new token.
+
Of course, either before or after each of these situations, the --edit command can be used to change or remove statuses from any token(s).
+
 
+
=Effect Database for RoundMaster API=
+
Effect-DB is a database character sheet created, used and updated by the RoundMaster API.  The database holds macros as Ability Macros that are run when certain matching statuses are placed on or removed from tokens (see Roll20 Help Centre for information on Ability Macros and Character Sheet maintenance).  The macros have certain defined parameters dynamically replaced when run by RoundMaster, providing the token & character IDs and names, and values such as AC, HP and Thac0, available for manipulation.
+
Important Note: all Character Sheet databases must have their ‘ControlledBy’ value (found under the [Edit] button at the top right of each sheet) set to ‘All Players’.  This must be for all databases, both those provided (set by the API) and any user-defined ones.  Otherwise, Players will not be able to run the macros contained in them.
+
Effect macros are primarily intended to act on the Token and its variables, but can also act on the represented Character Sheet.  A single Character Sheet can have multiple Tokens representing it, and each of these are able to do individual actions using the data on the Character Sheet jointly represented.  However, if such multi-token Characters / NPCs / creatures are likely to encounter effects that will affect the Character Sheet they must be split with each Token representing a separate Character Sheet, or else the one effect will affect all tokens associated with the Character Sheet, whether they were targeted or not!  In fact, it is recommended that tokens and character sheets are 1-to-1 to keep things simple.
+
==Setting up a token for use with effects==
+
The recommended Token Bar assignments for all APIs in the Master Series are:
+
 
<table>
 
<table>
<tr><td><b>Bar1 (Green Circle):</b></td><td>Armour Class (AC field) – only current value</td></tr>
+
<tr><th scope="row">Wizard Spells:</th><td>additional databases: MU-Spells-DB-<i>[added name]</i> where <i>[added name]</i> can be replaced with anything you want.</td></tr>
<tr><td><b>Bar2 (Blue Circle):</b></td><td>Base Thac0 (thac0-base field) before adjustments – only current value</td></tr>
+
<tr><th scope="row">Priest Spells:</th><td>additional databases: PR-Spells-DB-<i>[added name]</i> where <i>[added name]</i> can be replaced with anything you want.</td></tr>
<tr><td><b>Bar3 (Red Circle):</b></td><td>Hit Points (HP field) – current & max</td></tr>
+
<tr><th scope="row">Powers:</th><td>additional databases: Powers-DB-<i>[added name]</i> where <i>[added name]</i> can be replaced with anything you want.</td></tr>
 +
<tr><th scope="row">Magic Items:</th><td>additional databases: MI-DB-<i>[added name]</i> where <i>[added name]</i> can be replaced with anything you want.</td></tr>
 +
<tr><th scope="row">Character Classes:</th><td>additional databases: Class-DB-<i>[added name]</i> where <i>[added name]</i> can be replaced with anything you want.</td></tr>
 +
<tr><th scope="row">Attack Templates:</th><td>additional databases: Attacks-DB-<i>[added name]</i> where <i>[added name]</i> can be replaced with anything you want.</td></tr>
 
</table>
 
</table>
It is recommended to use these assignments, and they are the bar assignments set by the CommandMaster API if its facilities are used to set up the tokens. All tokens must be set the same way, whatever way you eventually choose.  
+
<p><b>However:</b> the system will ignore any database with a name that includes a version number of the form "v#.#" where # can be any number or group of numbers e.g. MI-DB v2.13 will be ignored.  This is so that the DM can version control their databases, with only the current one (without a version number) being live.</p>
These assignments can be changed in each API, by changing the fields object near the top of the API scriptSee individual API documentation for details of how to do this.
+
<p>There can be as many additional databases as you want. Other Master series APIs come with additional databases, some of which overlap - this does not cause a problem as version control and merging unique macros is managed by the APIs.</p>
==Adding, deleting and changing status effect macros==
+
<p><b>Important Note:</b> all Character Sheet databases <b><u><i>must</i></u></b> have their <i>'ControlledBy'</i> value (found under the [Edit] button at the top right of each sheet) set to <i>'All Players'</i>.  This must be for all databases, both those provided (set by the API) and any user-defined onesOtherwise, Players will not be able to run the macros contained in them.</p>
If you wish to add your own status effect macros, these '''must''' be added to a different database with the ''root-name'' of "Effect-DB-": for example "Effect-DB-Additions".  The provided database will be overwritten each time a new release is made, so best to not touch it.  However, do look at it for examples.
+
<p>Each database has a similar structure, with:</p>
You can ''amend'' an existing macro by making a copy of it in your own database, altering it there, and deleting it from the Effects-DB database. If the system finds your copy when updating the supplied database it will not recreate it so yours will still work.
+
<ul>
If you want to totally remove a status effect macro, you can only do this by creating a ''blank'' version in your own database - that is a macro with the same name, but an empty macro definitionAs above for amending, delete the original from the supplied Effects-DB and the ''blank'' one will then be used if called, doing nothing.
+
<li>Ability Macros named as the class, attack type, spell, power or magic item specified, and used to describe and provide effects for classes, attacks, spells, powers and magic items using the commands in the RPGMaster APIs;</li>
==Macro Parameter Fields==
+
<li>Custom Attributes with the attribute name "ct-ability-macro-name", one per Ability Macro, which defines the casting time and casting cost for spells & powers, and speed and MI type for magic items (not currently used for Class or Attack definitions, but they still have to exist);</li>
Dynamic parameters are identified in the macros by bracketing them with two carets: ^^parameter^^.  The standard Roll20 syntax of @{selected|…} is not available, as at the time the macros run the targeted token may not be selected, and @{character_name|} will not enable the token to be affected (especially where the Character Sheet is represented by more than one token).  The ^^…^^ parameters always relate to the token on which a status has been set, and the Character Sheet it representsCurrently available parameters are:
+
<li>An entry in a list on the character sheet in the spell book of the relevant Character Sheet tab (Spell Level of the spell defined, Powers tab, or various spell books for different Classes & Magic Items).</li>
 +
</ul>
 +
<p>However, as with all other Databases in the RPGMaster Suite of APIs, if the <i>Ability Macros</i> are correctly set up using the formats detailed in the Help Documentation, the <b>AttackMaster API</b> command <b>!attk --check-db database-name</b> will check the database and set up all other aspects for you, including the correct Custom Attributes and List entries.</p>
 +
<p>Ability Macros can be whatever the DM wants and can be as simple or as complex as desired. Roll Templates are very useful when defining class, spell, power and magic item ability macros, and are an essential part of Attack Templates.  When a Player or an NPC or Monster makes an attack, the AttackMaster API runs the relevant Ability Macro from the databases as if it had been run by the Player from the chat window.  All Roll20 functions for macros are available.</p>
 +
<h3>Replacing Classes, Attacks, Spells & Items</h3>
 +
<p>If you want to replace any Ability Macro provided in any of the databases, you can do so simply by creating an Ability Macro in one of your own databases (a database with the same root name) with the Ability Macro you create having exactly the same name as the provided item to be replacedThe API gives preference to Ability Macros in user-defined databases, so yours will be selected in preference to the one provided with the APIs.</p>
 +
<br>
 +
|}
 +
<h2>Spells and Powers Databases</h2>
 +
<p>Spells/Powers databases are all character sheets that have names that start with</p>
 +
<p> <b>Wizard Spells:</b> MU-Spells-DB-[added name]<br>
 +
<b>Priest Spells:</b> PR-Spells-DB-[added name]<br>
 +
<b>Powers:</b> Powers-DB-[added name]</p>
 +
<p>Those with version numbers of the form v#.# as part of the name will be ignored.</p>
 +
<p>As previously stated in the General Database Information section, each spell or power definition has 3 parts in the database: an Ability Macro with a name that is unique and matches the spell or power, an Attribute with the name of the Ability Macro preceded by "ct-", and a listing in the database character sheet of the ability macro name separated by '|' along with others of the same level in the spell book of the level of the spell or power.  The quickest way to understand these entries is to examine existing entries.  Do go to the root databases and take a look (but be careful not to alter anything unless you know what you're doing!)</p>
 +
<p><b>Note:</b> The DM creating new spells and powers does not need to worry about anything other than the Ability Macro in the database, as running the command <b><i>[[Script:MagicMaster#Check_database_completeness_.26_integrity_.28GM_only.29|--check-db]]</i></b> will update all other aspects of the database appropriately for all databases, as long as the Specs and Data fields are correctly defined. Use the name of the particular database as a parameter to check and update just that database.  Running the command <b><i>--check-db</i></b> with no parameters will check and update all databases.</p>
 +
<p>Ability macros can be added to a database just by using the [+Add] button at the top of the Abilities column in the Attributes and Abilities tab of the Database Character Sheet, and then using the edit "pencil" icon on the new entry to open it for editing.  Ability macros are standard Roll20 functionality and not dependent on the API.  Refer to the Roll20 Help Centre for more information.</p>
 +
<p><b>The Ability Macro</b> for a spell may look something like this:</p>
 +
<h3>Sleep</h3>
 +
<p style="display: inline-block; background-color: lightgrey; border: 1px solid black; padding: 4px; color: dimgrey; font-weight: extra-light;">/w "@{selected|character_name}" <nowiki>&{template:2Espell}{{title=@{selected|casting-name} casts Sleep as a level @{selected|casting-level} caster}}{{splevel=Level 1 Wizard}}{{school=Enchantment/Charm}}</nowiki><span style="color:green">Specs=[Sleep,MUspellL1,1H,Enchantment-Charm]</span><nowiki>{{range=90 ft}}{{components=V, S, M}}{{duration=[[5*({10,@{selected|casting-level}}kl1)]] Rounds}}{{time=1}}{{aoe=[30ft Cube](</nowiki><span style="color:red">!rounds --aoe @{selected|token_id}|square|feet|90|30||dark</span><nowiki>)}}{{save=None}}{{damage=[Sleep them](</nowiki><span style="color:red">!rounds --target area|@{selected|token_id}|&#64;{target|Select who to sleep|token_id}|Sleep|[[5*({10,@{selected|casting-level}}kl1)]]|-1|Snoring away, shake to awaken|sleepy</span>)}}<span style="color:blue">SpellData=[w:Sleep,lv:1,sp:1,gp:0.01,cs:VSM]</span><nowiki>{{effects=Up to [2d4](!\&#13;\&#47;r 2d4) Hit Dice of creatures with 4 HD or less are put to sleep beginning with the lowest HD creatures in the Area of Effect.}}{{materials=a pinch of fine sand, rose petals, or a live cricket.}}</nowiki></p>
 +
<p>The ability specification for this Sleep spell uses a Roll20 Roll Template, in this case defined by the Advanced D&D 2e Character Sheet by Peter B (see the documentation for the Character Sheet on Roll20 for specifications of this Roll Template), but any Roll Template you desire can be used.  The entries in the Roll Template itself can be anything you desire, giving as much or as little information as you want.  However, the important elements for the MagicMaster API are those highlighted.  In red, two API buttons grant the player access to run RoundMaster API commands to show the Area of Effect of the spell, and then to mark affected tokens with a "Sleepy" status.  Each of the elements important to the database are inserted between the elements of the Roll Template, meaning they will not be seen by the player when the macro is run.  Generally spaces, hyphens and underscores in the data elements are ignored, and case is not significantEach element is described below:</p>
 +
<pre>Specs = [Type, Class, Handedness, Spell School]</pre>
 +
<p>The Specs section describes what spell type and school this spell belongs to.  These fields must be in this order.  This format is identical for all database items, whether in these databases or others used by the Master series of APIs. Where there are multiple answers for a field, separate each by '|'. <b>Note:</b>Only A-Z, a-z, 0-9, hyphen/minus(-), plus(+), equals(=) point(.) and vertical bar(|) are allowed.  Replace any forward slash with hyphen.</p>
 
<table>
 
<table>
<tr><td>^^tid^^</td><td>TokenID</td></tr>
+
<tr><th scope="row">Type</th><td>the type of the spell, often the same as the ability macro name.</td></tr>
<tr><td>^^tname^^</td><td>Token_name</td></tr>
+
<tr><th scope="row">Class</th><td>one of MUSpellL#, PRSpellL#, or Power, where # is replaced by the spell level number.</td></tr>
<tr><td>^^cid^^</td><td>CharacterID</td></tr>
+
<tr><th scope="row">Handedness</th><td>#H, where # is the number of hands needed to cast the spell - i.e. does it have a somatic component.</td></tr>
<tr><td>^^cname^^</td><td>Character_name</td></tr>
+
<tr><th scope="row">Spell School</th><td>the group of related spells that the spell belongs to.</td></tr>
<tr></tr>
+
<tr><td>^^ac^^</td><td>Armour Class value (order looked for: a token bar, Character Sheet AC field, MonsterAC)</td></tr>
+
<tr><td>^^ac_max^^</td><td>Maximum value of AC, wherever it is found</td></tr>
+
<tr><td>^^token_ac^^</td><td>The token field name for AC value field, if set as a token bar</td></tr>
+
<tr><td>^^token_ac_max^^</td><td>The token field name for AC max field, if set as a token bar</td></tr>
+
<tr></tr>
+
<tr><td>^^thac0^^</td><td>Thac0 value (order looking: a token bar, Character Sheet Thac0_base field, MonsterThac0)</td></tr>
+
<tr><td>^^thac0_max^^</td><td>Maximum value of Thac0, wherever it is found</td></tr>
+
<tr><td>^^token_thac0^^</td><td>The token field name for Thac0 value field, if set as a token bar</td></tr>
+
<tr><td>^^token_thac0_max^^</td><td>The token field name for Thac0 max field, if set as a token bar</td></tr>
+
<tr></tr>
+
<tr><td>^^hp^^</td><td>HP value (order looked for: a token bar, Character Sheet HP field)</td></tr>
+
<tr><td>^^hp_max^^</td><td>Maximum value of HP, wherever it is found</td></tr>
+
<tr><td>^^token_hp^^</td><td>The token field name for HP value field, if set as a token bar</td></tr>
+
<tr><td>^^token_hp_max^^</td><td>The token field name for HP max field, if set as a token bar</td></tr>
+
<tr></tr>
+
<tr><td>^^bar1_current^^</td><td>Value of the token Bar1_value field</td></tr>
+
<tr><td>^^bar2_current^^</td><td>Value of the token Bar2_value field</td></tr>
+
<tr><td>^^bar3_current^^</td><td>Value of the token Bar3_value field</td></tr>
+
 
</table>
 
</table>
This allows most data on both the token and the character sheet to be accessed.  For example @{^^cname^^|strength} will return the strength value from the represented character sheet.  Of course all loaded RPGMaster series API commands are available.
+
<pre>SpellData=[w:Sleep,lv:1,sp:1,gp:1,cs:VSM]</pre>
Two other APIs from the Roll20 Script Library are extremely useful for these macros, and indeed are used by many of the provided APIs: ChatSetAttr API from joesinghaus allows easy and flexible setting of Character Sheet attributesTokenmod API from The Aaron supports easy setting and modifying of Token attributes.  Combined with the dynamic parameters above, these make for exceptionally powerful real-time effects in game-play.
+
<p>The SpellData section specifies the data relating to the use of the spellThese fields can be in any order.</p>
==Effect Macro qualifiers==
+
Each effect macro runs when a particular status event occurs.  Here is the complete list of effect macro status name qualifiers that can be used. Each of these is appended to the status whenever the status experiences the relevant event, and an effect macro with that name searched for and run if found:
+
 
<table>
 
<table>
<tr><td>statusname-start</td><td>The status is created on a token</td></tr>
+
<tr><th scope="row">w:</th><td>&lt;text&gt;</td><td>the name of the spell</td></tr>
<tr><td>statusname-turn</td><td>Each round the status has a duration that is not zero</td></tr>
+
<tr><th scope="row">sph:</th><td>&lt;text&gt;</td><td>the sphere of a priest spell (not used for wizard spells)</td></tr>
<tr><td>statusname-end</td><td>The status duration reaches zero</td></tr>
+
<tr><th scope="row">lv:</th><td>&lt;#&gt;</td><td>the level of the spell</td></tr>
 +
<tr><th scope="row">sp:</th><td>&lt;[-]# or dice roll spec&gt;</td><td>the casting time in segments for the spell.  Can be >10 e.g. 20 for 2 rounds, or negative, or even a dice roll</td></tr>
 +
<tr><th scope="row">gp:</th><td>&lt;#[.#]&gt;</td><td>the cost of the material components of the spell in GP: fractions converted to SP & CP</td></tr>
 +
<tr><th scope="row">cs:</th><td>&lt;VSM&gt;</td><td>the component of the spell (Verbal, Somatic, Material) - can be any combination</td></tr>
 
</table>
 
</table>
These effect macros are triggered for weapons when certain events take place:
+
<p>The casting time (or speed) <b>sp:</b> can be negative, meaning it gives a negative modifier to individual initiative (if <b>InitMaster API</b> is being used).  It can also be greater than 10 segments, meaning it takes longer than 1 Round to cast.  Multiply the number of Rounds it will take to cast by 10, or the number of Turns it will take to cast by 100 (if using the <b>InitMaster API</b> the rounds will be automatically counted down and the spell actually cast in the appropriate round, unless the casting is interrupted).  It can also be a dice roll specification, which will be rolled at the point that a character selects the spell, power or item to use in a particular round, which means the speed can vary from round to round.  Potions are always of this nature (see the AD&D2e DMG p141).</p>
 +
<p>The cost of material components, <b>gp:</b>, is deducted from the Caster's money on their Character Sheet each time the spell is cast.  The GM is informed of the spell being cast, by whom, and how much money it cost and how much money the Caster has left for each casting.</p>
 +
<p>The components of the spell, <b>cs:</b>, is currently not used and is for future expansion capabilities.</p>
 +
<p><b>The Ability Macro</b> for a Power may look something like this:</p>
 +
<h3>Turn Undead</h3>
 +
<p style="display: inline-block; background-color: lightgrey; border: 1px solid black; padding: 4px; color: dimgrey; font-weight: extra-light;">/w "@{selected|character_name}" <nowiki>&{template:2Espell}{{title=@{selected|token_name} attempts to Turn Undead as a level @{selected|pr-casting-level} @{selected|class3}}} {{splevel=Power}} {{school=Necromancy}}</nowiki><span style="color:green">Specs=[Turn-Undead,Power,1H,Necromancy]</span><nowiki>{{components=V,S}}{{time=[[10]]}}{{range=0}}{{duration=Until broken}}{{aoe=Undead within line of sight}}{{save=See turning table}}{{reference=PHB p103}}{{damage=[Roll 1d20](</nowiki><span style="color:red">!&#13;&#47;r 1d20 check vs. your turning table</span><nowiki>) then if successful [Turn Them](</nowiki><span style="color:red">!rounds --target area|@{selected|token_id}|&#64;{target|Select undead|token_id}|Turned|99|0|Turned undead, flee if free-willed, stand aside if controlled|screaming</span>)}}<span style="color:blue">SpellData=[w:Turn Undead, sp:10, cs:VS]</span><nowiki>{{effects=**Remember that Paladins turn as a Priest of 2 levels lower.**<br>
 +
Attempting to turn counts as an action, requiring one round and occurring during the character's turn in the initiative order (thus, the undead may get to act before the character can turn them). The mere presence of the character is not enough--a touch of drama from the character is important. Speech and gestures are important, so the character must have his hands free and be in a position to speak. However, turning is not like spellcasting and is not interrupted if the character is attacked during the attempt.<br>
 +
To resolve a turning attempt, look on Table 61. Cross-index the Hit Dice or type of the undead with the level of the character (two levels lower for a paladin). If there is a number listed, roll 1d20. If the number rolled is equal to or greater than that listed, the attempt is successful. If the letter "T" (for "turned") appears, the attempt is automatically successful without a die roll. If the letter "D" (for "dispel") is given, the turning utterly destroys the undead. A dash (--) means that a priest or paladin of that level cannot turn that type of undead. A successful turn or dispel affects 2d6 undead. If the undead are a mixed group, the lowest Hit Dice creatures are turned first.<br>
 +
Only one die is rolled regardless of the number of undead the character is attempting to turn in a given round. The result is read individually for each type of undead.}}{{material=The Priest's holy symbol}}</nowiki></p>
 +
<p>Essentially, Powers are just Spells by another name, that can be cast multiple times per day, and are innate to the Character's class, or to a creature.  The specification is, therefore, almost identical to a spell.  In the author's campaigns, Powers do not consume material components and therefore do not cost money to use (except in rare circumstances) hence there being no <b>gp:</b> specification (it defaults to 0gp), but other DMs can add material costs for Powers if desired.  Powers are all 1 level, hence no <b>lv:</b> specification.</p>
 +
<br>
 +
<h2>Magic Item Databases</h2>
 +
<p>Magic Item databases are all character sheets that have names such as</p>
 +
<p> <b>Magic Items:</b> MI-DB-[added name]</p>
 +
<p>And can have anything put at the end, though those with version numbers of the form v#.# as part of the name will be ignored.</p>
 +
<p>As previously stated and as for other magic, each magic item definition has 3 parts in the database (see Section 1): an Ability Macro with a name that is unique and identifies the magic item, an Attribute with the name of the Ability Macro preceded by "ct-", and a listing in the database character sheet of the ability macro name separated by '|' along with others of the same magic item type, which is one of: Potion, Scroll, Rod/Stave/Wand, Weapon & Ammo, Armour, Ring, Miscellaneous, and also DM Only magic items.  The quickest way to understand these entries is to examine existing entries.  Do go to the root database and take a look (but be careful not to alter anything unless you know what you're doing!)</p>
 +
<p><b>Note:</b> The DM creating new magic items does not need to worry about anything other than the Ability Macro in the database, as running the command <b><i>[[Script:MagicMaster#Check_database_completeness_.26_integrity_.28GM_only.29|--check-db]]</i></b> will update all other aspects of the database appropriately for all databases, as long as the Specs and Data fields are correctly defined. Use the name of the particular database as a parameter to check and update just that database.</p>
 +
<p>Ability macros can be added to a database just by using the [+Add] button at the top of the Abilities column in the Attributes and Abilities tab of the Database Character Sheet, and then using the edit "pencil" icon on the new entry to open it for editing.  Ability macros are standard Roll20 functionality and not dependent on the API.  Refer to the Roll20 Help Centre for more information.</p>
 +
<p><b>The Ability Macro</b> may look something like this:</p>
 +
<h3>Oil-of-Etherealness</h3>
 +
<p style="display: inline-block; background-color: lightgrey; border: 1px solid black; padding: 4px; color: dimgrey; font-weight: extra-light;">/w "@{selected|character_name}" <nowiki>&{template:2Espell}{{title=Oil of Etherealness}} {{splevel=Oil}} {{school=Alteration}}</nowiki><span style="color:green">Specs=[Oil of Etherealness,Potion,1H,Alteration]</span><nowiki>{{components=M}}{{time=[[3]] rounds after application}} </nowiki><span style="color:blue">PotionData=[sp:30,rc:charged]</span><nowiki>{{range=User}}{{duration=4+1d4 turns}} {{aoe=User}} {{save=None}} {{healing=[Become Ethereal](</nowiki><span style="color:red">!rounds --target single|@{selected|token_id}|&#64;{target|Select a target|token_id}|Oil-of-Etherealness|&#91;[10*(4+1d4)]&#93;|-1|Ethereal|Ninja-mask</span><nowiki>)}}{{effects=This potion is actually a light oil that is applied externally to clothes and exposed flesh, conferring etherealness. In the ethereal state, the individual can pass through solid objects in any direction - sideways, upward, downward - or to different planes. The individual cannot touch non-ethereal objects.<br>
 +
The oil takes effect three rounds after application, and it lasts for 4+1d4 turns unless removed with a weak acidic solution prior to the expiration of its normal effective duration. It can be applied to objects as well as creatures. One potion is sufficient to anoint a normal human and such gear as he typically carries (two or three weapons, garments, armor, shield, and miscellaneous gear). Ethereal individuals are invisible.}}{{materials=Oil}}</nowiki></p>
 +
<p>You might notice that the structure of this macro is extremely similar to that of a spell: indeed, it uses the same Roll Template.  As this is an Oil that achieves the same effect as a spell, this is not surprising.</p>
 +
<p>However, there is one new field in the data section (in this case called the PotionData section):</p>
 
<table>
 
<table>
<tr><td>weaponname-inhand</td><td>A weapon is taken in-hand (triggered by AttackMaster API --weapon command)</td></tr>
+
<tr><th scope="row">rc:</th><td>&lt;MI-type&gt;</td><td>the recharging/curse type of the magic item.</td></tr>
<tr><td>weaponname-dancing</td><td>A weapon starts dancing (triggered by AttackMaster API --dance command)</td></tr>
+
<tr><td>weaponname-sheathed</td><td>A weapon  is sheathed (out of hand - triggered by AttackMaster --weapon cmd)</td></tr>
+
 
</table>
 
</table>
==Examples of Effect Macros==
+
<p>All magic items have a recharging/curse type: for details, see the <b>[[Script:MagicMaster#DM.2FGM_version_of_Magic_Item_management|--gm-edit-mi]]</b> command in the MagicMaster API help documentation.  If not supplied for a magic item definition, it defaults to unchargedGenerally, items in the database are not cursed-, but can have their type changed to cursed or some recharging cursed type when the DM stores them in a container or gives them to a Character using the <b>--gm-edit-mi</b> command.</p>
Here is an example of an effect macro that runs when a Faerie fire (twilight form) status is placed on a tokenThe following --target command might be run to set this status, with the caster token selected:
+
<p>Other magic items might use different structures, and be more complex:</p>
<pre>!rounds --target area|@{selected|token_id}|&{target|Select first target|token_id}|Faerie-Fire-twilight|[[4*@{selected|Casting-Level}]]|-1|Outlined in dim Faerie Fire, 1 penalty to AC|aura</pre>
+
<h3>Bead-of-Force</h3>
This will result in the following effect macro being run when the first token is targeted:<br>
+
<p style="display: inline-block; background-color: lightgrey; border: 1px solid black; padding: 4px; color: dimgrey; font-weight: extra-light;">/w "@{selected|character_name}" <nowiki>&{template:'+fields.defaultTemplate+'}{{name=Bead of Force}}{{subtitle=Magic Item}}</nowiki><span style="color:green">Specs=[Bead of Force,Miscellaneous,1H,Evocation]</span><nowiki>{{Speed=[[0]]}}</nowiki><span style="color:blue">MiscData=[w:Bead of Force,sp:0,rc:charged]</span><nowiki>{{Size=Tiny}}{{Range=[Up to 30yds](</nowiki><span style="color:red">!rounds --aoe @{selected|token_id}|circle|yards|0|60||dark|true</span><nowiki>)}}{{damage=[5d4](!&#13;&#47;gmroll 5d4 damage from Bead of Force in 10ft redius) damage in 10ft radius}}{{duration=3d4 rounds}}{{Save=[To escape sphere](!&#13;&#47;gmroll 1d20 Save vs. spell or captured in *Sphere of Force*)}}{{Effect=[Trapped in Sphere](</nowiki><span style="color:red">!rounds --target area|@{selected|token_id}|Bead-of-Force|8|-1|'Held in Sphere of Force'|fishing-net</span><nowiki>)}}{{desc=These small, black spheres might be mistaken for common beads, marbles, or unusually black but lusterless pearls. From 5-8 of these beads are usually found at one time. Each is about three-quarters of an inch in diameter and quite heavy, weighing almost an ounce. One can be hurled up to 30 yards.<br>
<br>'''Faerie-fire-twilight-start'''
+
Upon impact, the bead sends forth a burst of force that inflicts 5d4 points of damage upon all creatures within a 10-foot radius of its center. Each victim is allowed a saving throw vs. spell. Those who save will be thrown out of the blast area, but those who fail to save will be encapsulated by a sphere of force after taking damage.<br>
<pre>!token-mod --ignore-selected --ids ^^tid^^ --set ^^token_ac^^|+1
+
The sphere will form around any and all such creatures in the 10-foot-radius area, even those of large size, and will persist for 3d4 rounds. Victims will be unable to escape except by the same means and used to bring down a wall of force spell.}}</nowiki></p>
^^tname^^ is surrounded by Faerie Fire, and becomes easier to hit</pre>
+
<p>The Bead of Force ability macro uses a Default Roll Template, which means the only mandatory field is the {{name=}} field, and the DM can define any other fields they want to describe and enact the magic itemHere, an API button exists to do a saving throw with documented outcomes, and another API button can target an area with multiple tokens in to entrap them (if the DM rejects or confirms as they make or fail each saving throw).</p>
This uses the Tokenmod API to increase the AC number of the targeted token by 1 (making it 1 worse), and then display a message to all Players stating the name of the targeted token, and the effect on itThis will be run for each token targeted, and will be individual to each. Note: the tokens are not ‘selected’ in Roll20 terms, and so @{selected|…} will not work
+
<br>
When the Faerie Fire status counts down to zero, the following effect macro will be run on each of the tokens it was applied to:<br>
+
<h2>Magic Items with Powers or Spell-Storing</h2>
<br>'''Faerie-fire-twilight-end'''
+
<p>Some magic items, especially artefacts and sentient items, can store spells and/or have powers similar to characters.  MagicMaster supports magic items of this type to a degree, although there are inevitably exceptions that the DM will have to get creative in their development!  These items use API buttons that call various MagicMaster commands to deliver their capabilities.</p>
<pre>!token-mod --ignore-selected --ids ^^tid^^ --set ^^token_ac^^|-1
+
<p>First to note is that <b>items that have powers and spells use spell slots in the owning character's character sheet</b>.  These spell slots should not be used by characters in your campaign.  If they are, errors might occur.  By default, on the AD&D2E character sheet the system uses Wizard Level 14 spell slots for magic item powers, and Wizard Level 15 spell slots for spell-storing magic items.  As standard AD&D2E only has spells up to level 9 this generally works without causing problems.</p>
^^tname^^ has lost that glow and is now harder to aim at</pre>
+
<p>Next, in addition to the three standard elements of the Ability Macro, the 'ct-' attribute and the listing, these items require a 4th element which specifies their powers and spells.  These are:</p>
Again, the Tokenmod API is used to decrease the token AC and a message issued confirming what has happened. If messages should only be sent to the Player(s) controlling the character represented by the token, use /w “^^cname^^” before the message. If the message is only for the gm, use /w gm.
+
<table>
A more complex example is a Quarterstaff of Dancing, that uses the complete suite of possible effect macros and certain aspects of the AttackMaster API functionality triggered by Weapon table field settingsThe first macro is triggered by AttackMaster API when a Character takes a Quarterstaff-of-Dancing in hand to use as a weapon:<br>
+
<tr><th scope="row">mi-muspells-[item-name]:</th><td>Wizard spells able to be stored in the magic item</td></tr>
<br>'''Quarterstaff-of-Dancing-inhand'''
+
<tr><th scope="row">mi-prspells-[item-name]:</th><td>Priest spells able to be stored in the magic item</td></tr>
<pre>!rounds --addtargetstatus ^^tid^^|Quarterstaff-of-Dancing|4|-1|Quarterstaff not yet dancing so keep using it|stopwatch</pre>
+
<tr><th scope="row">mi-powers-[item-name]:</th><td>Powers able to be used by the magic item</td></tr>
This command sets a status marker on the Token of the Character taking the Quarterstaff in hand, and sets a countdown of 4 rounds, running the next effect macro in each of those rounds:<br>
+
</table>
<br>'''Quarterstaff-of-Dancing-turn'''
+
<p>In each case the <i>[item-name]</i> is replaced by the Ability macro name (which is not case sensitive).</p>
<pre>!attk --quiet-modweap ^^tid^^|quarterstaff-of-dancing|melee|+:+1 --quiet-modweap ^^tid^^|quarterstaff-of-dancing|dmg|+:+1
+
<p><b>Note:</b> The DM creating new spell storing or power wielding magic items does not need to worry about anything other than the Ability Macro in the database, as running the command <b><i>[[Script:MagicMaster#Check_database_completeness_.26_integrity_.28GM_only.29|--check-db]]</i></b> will update all other aspects of the database appropriately for all databases, as long as the Specs and Data fields are correctly defined. Use the name of the particular database as a parameter to check and update just that database.  Running the command <b><i>--check-db</i></b> with no parameters will check and update all databases.</p>
/w “^^cname^^” Updating the quarterstaff +1 to attk & dmg</pre>
+
<p>When a spell-storing or power wielding magic item is added to a magic item bag or container using [[Script:MagicMaster#Edit_a_Magic_Item_bag|!magic --edit-mi]] or [[Script:MagicMaster#DM.2FGM_version_of_Magic_Item_management|!magic --gm-edit-mi]], these attributes are added to the character sheet and also they are parsed by the system and the spells and/or powers are created in the relevant spell books automaticallyWhen such an item is found in a container by a character, or passed from character to character, all of the stored spells & powers are deleted from the old character and created in the new character.  A character gaining such an item can use its spells and powers immediately.</p>
This command then runs each round as the Quarterstaff-of-Dancing status counts down, and uses the !attk --quiet-modweap command to gradually increment the magical to-hit and dmg plus, round by round. Once the countdown reaches zero, the next effect macro is run:<br>
+
<p>Here is an example of a power wielding magic item:</p>
<br>'''Quarterstaff-of-Dancing-end'''
+
<h3>Ring-of-Shooting-Stars</h3>
<pre>!attk --dance ^^tid^^|Quarterstaff-of-Dancing</pre>
+
<p style="display: inline-block; background-color: lightgrey; border: 1px solid black; padding: 4px; color: dimgrey; font-weight: extra-light;"><span style="color:red">!setattr --silent --sel --casting-level|1 --casting-name|@{selected|token_name}'s Ring of Shooting Stars</span><br>
This calls an AttackMaster API command to start the weapon dancing, resets the weapon to its specs that it starts dancing with, and calls the next effect macro:<br>
+
/w "@{selected|character_name}" <nowiki>&{template:'+fields.defaultTemplate+'}{{name=Ring of Shooting Stars}}{{subtitle=Ring}}</nowiki><span style="color:green">Specs=[Ring of Shooting Stars,Ring,1H,Evocation]</span><nowiki>{{Speed=[[5]]}}</nowiki><span style="color:blue">RingData=[w:Ring of Shooting Stars,sp:5,rc:charged,ns:6], [cl:PW,w:RoSS-Dancing-Lights,sp:5,pd:12], [cl:PW,w:RoSS-Light,sp:5,pd:2], [cl:PW,w:RoSS-Ball-Lightning,sp:5,pd:1], [cl:PW,w:RoSS-Shooting-Stars,sp:5,pd:3], [cl:PW,w:RoSS-Faerie-Fire,sp:5,pd:2], [cl:PW,w:RoSS-Spark-Shower,sp:5,pd:1]</span><nowiki> {{Size=Tiny}} {{Immunity=None}} {{Resistance=None}} {{Saves=None}} {{desc=This ring has two modes of operation - at night and underground - both of which work only in relative darkness.<br>
<br>'''Quarterstaff-of-Dancing-dancing'''
+
***During night hours, under the open sky***, the shooting stars ring will perform the following functions:<br>
<pre>!rounds --addtargetstatus ^^tid^^|Dancing-Quarterstaff|4|-1|The Quarterstaff is Dancing by itself. Use this time wisely!|all-for-one
+
- [*Dancing lights*](</nowiki><span style="color:red">!magic --mi-power @{selected|token_id}|RoSS-Dancing-Lights|Ring-of-Shooting-Stars|1</span><nowiki>) as spell (once per hour).<br>
!attk --quiet-modweap ^^tid^^|quarterstaff-of-dancing|melee|sb:0 --quiet-modweap ^^tid^^|quarterstaff-of-dancing|dmg|sb:0</pre>
+
- [*Light*](</nowiki><span style="color:red">!magic --mi-power @{selected|token_id}|RoSS-Light|Ring-of-Shooting-Stars|1</span><nowiki>), as spell (twice per night), 120-foot range.<br>
This places a new status marker on the token representing the Character with the dancing weapon (note the new status name Dancing-Quarterstaff), and resets the Strength Bonus flags for the weapon - a dancing weapon can’t have the Strength Bonus of the wielderAs each round now passes, the following different status effect macro is run:<br>
+
- [*Ball lightning*](</nowiki><span style="color:red">!magic --mi-power @{selected|token_id}|RoSS-Ball-Lightning|Ring-of-Shooting-Stars|1</span><nowiki>), as power (once per night).<br>
<br>'''Dancing-Quarterstaff-turn'''
+
- [*Shooting stars*](</nowiki><span style="color:red">!magic --mi-power @{selected|token_id}|RoSS-Shooting-Stars|Ring-of-Shooting-Stars|1</span><nowiki>), as power (special).<br>
<pre>!attk --quiet-modweap ^^tid^^|quarterstaff-of-dancing|melee|+:+1 --quiet-modweap ^^tid^^|quarterstaff-of-dancing|dmg|+:+1</pre>
+
***Indoors at night, or underground***, the ring of shooting stars has the following properties:<br>
As per the previous -turn effect macro, this increments the magical plusses on To-Hit and Dmg, round by roundIt has to have a different name, as the -end effect macro does different actions:<br>
+
[*Faerie fire*](</nowiki><span style="color:red">!magic --mi-power @{selected|token_id}|RoSS-Faerie-Fire|Ring-of-Shooting-Stars|1</span><nowiki>) (twice per day) as spell<br>
<br>'''Dancing-Quarterstaff-end'''
+
[*Spark shower*](</nowiki><span style="color:red">!magic --mi-power @{selected|token_id}|RoSS-Spark-Shower|Ring-of-Shooting-Stars|1</span><nowiki>) (once per day) as power<br>
<pre>!attk --dance ^^tid^^|Quarterstaff-of-Dancing|stop</pre>
+
Range, duration, and area of effect of functions are the minimum for the comparable spell unless otherwise stated. Casting time is 5}}</nowiki></p>
This uses the AttackMaster API command to stop the Quarterstaff from dancingAs can be seen from the above, quite complex sequences of effect macros can be created.
+
<p>Note that the ability macro starts with a call to the <b>ChatSetAttr API</b> to set the <i>casting-level</i> to 1 and the name of the caster to be <i><Character-name>'s Ring of Shooting Stars</i>.  Not strictly necessary, but a nice cosmetic.</p>
 
+
<p>The data section now includes repeating data sets, one for each of the powers that the item has:</p>
= Changelog =
+
<pre>RingData=[w:Ring of Shooting Stars,sp:5,rc:charged,ns:6], [cl:PW,w:RoSS-Dancing-Lights,sp:5,pd:12], … </pre>
{{changelog version|3.022|2021-11-24|* First release to the Roll20 community}}
+
<p>The first data set is very similar to the standard magic item data, with the addition of the <b>ns:</b> field, and is then followed by a number of repeated data sets specifying each of the powers:</p>
{{changelog version|3.001|2021-01-02|* Major release for multi-page support}}
+
<table>
{{changelog version|2.001|2020-10-31|* First stable version used in gaming}}
+
<tr><th scope="row">ns:</th><td>&lt;#&gt;</td><td>The number of powers (or spells) that the item can wield or store</td></tr>
{{changelog version|1.201|2020-07-24|* Initial split from TrackerJacker}}
+
<tr><th scope="row">cl:</th><td>&lt;MU/PR/PW&gt;</td><td>The type of the power/spell specification: PW=power, MU=wizard spell, PR=priest spell</td></tr>
 +
<tr><th scope="row">w:</th><td>&lt;text&gt;</td><td>The name of the power/spell - must be exactly the same as the database name (case ignored)</td></tr>
 +
<tr><th scope="row">sp:</th><td>&lt;[-/+]# / dice roll spec&gt;</td><td>The speed or casting time of the power/spell in segments</td></tr>
 +
<tr><th scope="row">pd:</th><td>&lt;-1/#&gt;</td><td>The available casts per day, or -1 for <i>'at will'</i></td></tr>
 +
</table>
 +
<p>By running the <b>--check-db</b> command (see the note above) these data sets are used to correctly set up the database with the powers wielded, so that when a Character receives this item, the Character also gains the powers to use through the item.</p>
 +
<p><b>Note:</b> if a Character picks up two Power-wielding items with exactly the same item name (i.e. two copies of the same item) the results are unpredictable.  This is best avoided.</p>
 +
<p>Feel free to just copy the specification for a Ring-of-Shooting-Stars in the Rings database and save it to a new Ability Macro with a different name, and then alter the power names, speeds, and uses per day, as well as the API Button <b>--mi-power</b> commands and the other text, to form new power-wielding magic itemsAlso, the Ring does not have to have 6 powers - just remove or add one or more repeating data sets to reduce or increase the number of powers.</p>
 +
<p>Here is an example of a spell-storing magic item:</p>
 +
<h3>Ring-of-Spell-Storing-HHSLS</h3>
 +
<p style="display: inline-block; background-color: lightgrey; border: 1px solid black; padding: 4px; color: dimgrey; font-weight: extra-light;">/w "@{selected|character_name}" <nowiki>&{template:'+fields.defaultTemplate+'}{{name=Ring of Spell Storing with Haste x2, Slow, Light & Sleep}}{{subtitle=Ring}}</nowiki><span style="color:green">Specs=[Ring of Spell Storing,Ring,1H,Conjuration-Summoning]</span><nowiki>{{Speed=[[5]] regardless of spell}}</nowiki><span style="color:blue">RingData=[w:Ring of Spell Storing HHSLS,sp:5,rc:uncharged,ns:5], [cl:MU,w:Haste,sp:5,lv:6], [cl:MU,w:Haste,sp:5,lv:6], [cl:MU,w:Slow,sp:5,lv:7], [cl:MU,w:Light,sp:5,lv:3], [cl:MU,w:Sleep,sp:5,lv:3]</span><nowiki> {{Size=Tiny}}{{Store spell=[Store Priest Spell](</nowiki><span style="color:red">!magic --mem-spell MI-PR|@{selected|token_id}</span><nowiki>)<br>
 +
[Store Wizard Spell](</nowiki><span style="color:red">!magic --mem-spell MI-MU|@{selected|token_id}</span><nowiki>)}}{{Cast spell=[View](</nowiki><span style="color:red">!magic --view-spell mi-muspells|@{selected|token_id}</span><nowiki>) or [Cast](</nowiki><span style="color:red">!magic --cast-spell MI|@{selected|token_id}</span><nowiki>) spells}}{{desc=A ring of spell storing contains 1d4+1 spells which the wearer can employ as if he were a spellcaster of the level required to use the stored spells. The class of spells contained within the ring is determined in the same fashion as the spells on scrolls (see "Scrolls"). The level of each spell is determined by rolling 1d6 (for priests) or 1d8 (for wizards). The number rolled is the level of the spell, as follows:<br>
 +
Priest: 1d6, if 6 is rolled, roll 1d4 instead.<br>
 +
Wizard: 1d8, if 8 is rolled, roll 1d6 instead.<br>
 +
Which spell type of any given level is contained by the ring is also randomly determined.<br>
 +
The ring empathically imparts to the wearer the names of its spells. Once spell class, level, and type are determined, the properties of the ring are fixed and unchangeable. Once a spell is cast from the ring, it can be restored only by a character of appropriate class and level of experience (i.e., a 12th-level wizard is needed to restore a 6th-level magical spell to the ring). Stored spells have a casting time of [[5]].}}</nowiki></p>
 +
<p>This is a specific version of a Ring of Spell Storing.  As the spells stored are specified in the macro, if you want there to be multiple rings of spell storing in your campaign they each need to be individually programmed (easy cut & paste job) & named differently.</p>
 +
<p>The only new field in these data sets is:</p>
 +
<table>
 +
<tr><th scope="row">lv:</th><td>&lt;#&gt;</td><td>The level of the caster who cast the spell into the ring.  The spell will have effects as if cast at this level when cast from the ring.</td></tr>
 +
</table>
 +
<p>The <b>lv:</b> field only specifies the level of the initial spell caster when the item is first found.  Once owned and used, the level of the spell caster is recorded each time a spell is refreshed by casting into the itemAs the item is then passed from one Character to another, or stored in a container and recovered later, the levels at which the spells were cast is retained.  However, if the item is reloaded from the databases, or a duplicate of the item is placed by the DM and found by another character, that version of the item will have the spell caster levels from the database definitions.  Note that if a single Character picks up two versions of exactly the same spell storing item (i.e. with the same item name) the results are unpredicable...</p>
 +
<p>Feel free to just copy the specification for a Ring-of-Spell-Storing in the Rings database and save it to a new Ability Macro with a different name, and then alter the spell names and casting levels as desired, to form new Rings of Spell Storing or other magic items.  Also, the Ring does not have to have 5 spells - just remove or add one or more repeating data sets to reduce or increase the number of stored spells (though the official definition of a Ring of Spell Storing states a maximum of 5 spells).</p>
 +
<p>The key command in the Spell-Storing item that supports it casting the defined spells is <b>!magic --cast-spell MI</b>, called in this case via an API button.  Any item specified with this command somewhere in the definition can store spells which can be specified, added or changed by the DM/Game Creator using the <b>[[Script:MagicMaster#Define_the_spells_a_spell-storing_Item_can_store|!magic --store-spell]]</b> command.</p>
 +
<br>
 +
<h2>Weapons (if using AttackMaster API)</h2>
 +
<p>Weapons, magical or not, are special types of items in the Magic Items databases.  If coded properly (in the same way as those in the MI-DB-Weapons database), they can be used with the <b>[[Script:AttackMaster|AttackMaster API]]</b> to implement fully automatic weapon management, the ability to hold weapons "in-hand" or sheathed, to have automatic ammo and range management for ranged weapons, automatic entry of weapons into the melee and/or ranged weapons tables, ready to make attacks with magical plusses and other specifications all set up, and support for dancing weapons (ones that can attack without being held by the Character), creatures with more than 2 hands, and 1-handed weapons, 2-handed weapons, and even weapons that need more than 2 hands!</p>
 +
<p>See the <b>[[API:RPGMaster-WeaponsArmorDB|Weapon & Armour Database Help]]</b> handout and wiki for how Weapon definitions should be structured for use with the <b>AttackMaster API</b>, which are just a few additions to the standard definition of an item.</p>
 +
<br>
 +
<h2>Armour & Shields</h2>
 +
<p>Like weapons, armour and shields of all types (including magical armour like magical Bracers and Rings of Protection) can be coded to be used with the <b>[[Script:AttackMaster|AttackMaster API]]</b> to automatically calculate the appropriate AC for various scenarios (such as with & without Shield, from the back, if surprised, etc)This will take into account if the armour is valid for the character class, determine which is the best armour combination that the character has, if various armour elements can or can't work together, and add in Dexterity bonuses or impairments.  It will also allow magical effects cast on the character to take effect or be adjusted via the token "circles" and highlight when such an effect is in place by showing the relevant token bar (only when there is a difference between the token AC and calculated AC).</p>
 +
<p>See the <b>[[API:RPGMaster-WeaponsArmorDB|Weapon & Armour Database Help]]</b> handout and wiki page for how Armour & Shield definitions should be structured for use with the <b>AttackMaster API</b>, which are just a few additions to the standard definition of an item.</p>
 +
<p>Also, see the <b>RoundMaster API</b> documentation for how magical effects can be placed on and affect tokens and characters.</p>
 +
<br>
 +
<h2>Specs & Data field values</h2>
 +
<p>Below are lists of the current possible values for the item database Ability macro sections.</p>
 +
<h3>Specs sections</h3>
 +
<pre>Specs=[Type, Item-Class, Handedness, Group-Type]</pre>
 +
<p>There are no default settings for any of the Specs data fields. All must be explicitly specified.</p>
 +
<h4>Spell Types</h4>
 +
<p>There is an infinite list of spell types: generally the type is the spell name.</p>
 +
<h4>Spell Item-Classes</h4>
 +
<table>
 +
<tr><th scope="row">MUSpellL\<1-9\></th><td>A Wizard spell with the Level specified as a number from 1 to 9</td></tr>
 +
<tr><th scope="row">PRSpellL\<1-9\></th><td>A Priest spell with the Level specified as a number from 1 to 9</td></tr>
 +
<tr><th scope="row">Power</th><td>A Power</td></tr>
 +
</table>
 +
<h4>Spell Handedness</h4>
 +
<p><b>0H</b> A spell/power that does not take a hand (there is no Somatic component)<br>
 +
<b>1H</b> A spell/power that requires only 1 hand to cast (most spells are like this)<br>
 +
<b>2H</b> A spell/power that requires 2 hands to cast (perhaps a scroll must be held)<br>
 +
<b>3H</b> A spell/power that takes 3 hands... perhaps more than 1 caster together?<br>
 +
<b>4H</b> Etc  No currently programmed spells use more than 2 hands<br>
 +
<b>...</b> ...</p>
 +
<h4>Spell/Power Schools</h4>
 +
<p>From MagicMaster v2.048 onwards, Spell Schools are specified by Class in the Class-DB definitions and, depending on the API configuration set with the <b>--config</b> command, will be checked by the system or otherwise.  Those implemented so far for the Spells databases are:</p>
 +
<p><i>Abjuration, Alteration, Conjuration-Summoning, Enchantment-Charm, Divination, Illusion-Phantasm, Invocation-Evocation, Necromancy.</i></p>
 +
<p>Note that the '/' in School names in the AD&D2e PHB have been replaced by hyphens.  It is also allowed to use just one half of any hyphenated school name where appropriate. If a spell or power is of more than one school, separate each with a vertical bar character '|'</p>
 +
<br>
 +
<h4>Magic Item Types</h4>
 +
<p>There is an infinite list of magic item types: generally the type is the magic item name. A magic item can have more than one type, with each separated by a vertical bar character '|'</p>
 +
<h4>Magic Item Classes</h4>
 +
<table>
 +
<tr><th scope="row">Weapon</th><td>Weapons that are not Melee or Ranged weapons or any other class</td></tr>
 +
<tr><th scope="row">Melee</th><td>Melee weapons that are used in hand-to-hand combat</td></tr>
 +
<tr><th scope="row">Ranged</th><td>Ranged weapons that are either thrown or fire ammunition</td></tr>
 +
<tr><th scope="row">Ammo</th><td>All types of ammunition that is used by Ranged weapons</td></tr>
 +
<tr><th scope="row">Armour</th><td>Any type of armour that does not need to be held to work</td></tr>
 +
<tr><th scope="row">Shield</th><td>A barrier that is held in hand(s) and defends against one or more attacks from the front</td></tr>
 +
<tr><th scope="row">Potion</th><td>Any type of potion, oil, pill or similar that is consumed or rubbed on</td></tr>
 +
<tr><th scope="row">Scroll</th><td>Scrolls and spell books, that contain one or multiple spells</td></tr>
 +
<tr><th scope="row">Wand</th><td>Wands that cast spells or spell-like effects when wielded in the hand</td></tr>
 +
<tr><th scope="row">Staff</th><td>Quarterstaffs and similar large bludgeoning items that can also have spell-like abilities</td></tr>
 +
<tr><th scope="row">Rod</th><td>Walking-stick sized rods that can do spell-like effects, especially when used to attack</td></tr>
 +
<tr><th scope="row">Ring</th><td>Rings that are worn on a finger, one to each hand, that protect, have powers or spells</td></tr>
 +
<tr><th scope="row">Light</th><td>All types of lantern, torch, and other illumination</td></tr>
 +
<tr><th scope="row">Miscellaneous</th><td>Anything that does not fit in one of the other categories</td></tr>
 +
<tr><th scope="row"><i>Unspecified</i></th><td>Items without any Specs section or an empty Class definition are listed under DM-Only</td></tr>
 +
</table>
 +
<h4>Armour Handedness</h4>
 +
<p><b>0H</b> Items that do not require to be held to work (e.g. a Ring, Buckler or a Helm)<br>
 +
<b>1H</b> An item that must be held in one hand to work, such as a Wand<br>
 +
<b>2H</b> Items that need two hands to wield, like a Staff<br>
 +
<b>3H</b> Items that need three hands to use, perhaps by two characters... (not yet implemented)<br>
 +
<b>...</b> etc.</p>
 +
<h4>Item Schools</h4>
 +
<p>Currently, all Magic Items other than Weapons and Armour use the same set of magical schools as for Spells & Powers, as they mostly perform spell-like effects.  See section 7.1(d) for the list.</p>
 +
<h4>Data Sections</h4>
 +
<p>Definitions for Data Section field types for Weapons & Armour can be found in the [[API:RPGMaster-WeaponsArmorDB#Specs_.26_Data_field_values|Weapons & Armour Database help]] handout & wiki page.  Below are the definitions for Spell, Power & other Magical Item types.</p>
 +
<p><b>Note:</b> Always refer to the database specification definitions in other sections above for detailed information on the use of these Field specifiers.  Not all specifiers have an obvious use.</p>
 +
<table>
 +
                <tr>
 +
<th scope="col" rowspan="2">Field</th>
 +
<th scope="col" rowspan="2">Format</th>
 +
<th scope="col" rowspan="2">Default Value</th>
 +
<th scope="col" rowspan="2">Description</th>
 +
<th scope="col" colspan="8">Can be used in</th>
 +
</tr>
 +
<tr>
 +
<th scope="col">Spell<br>Data</th>
 +
<th scope="col">Potion<br>Data</th>
 +
<th scope="col">Scroll<br>Data</th>
 +
<th scope="col">Wand<br>Data</th>
 +
<th scope="col">Staff<br>Data</th>
 +
<th scope="col">Rod<br>Data</th>
 +
<th scope="col">Ring<br>Data</th>
 +
<th scope="col">Misc<br>Data</th>
 +
</tr>
 +
<tr><th scope="row">w:</th><td>< text ></td><td>'-'</td><td>Name to be displayed</td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">w:</th><td>< text ></td><td>''</td><td>Name of spell or power (Not case sensitive)</td><td>X</td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr>
 +
<tr><th scope="row">+:</th><td>[ + / - ] #</td><td>0</td><td>Magical adjustment</td><td> </td><td> </td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">n:</th><td># [ / # ]</td><td>1</td><td>Attacks per round</td><td> </td><td> </td><td> </td><td>X</td><td>X</td><td>X</td><td> </td><td>X</td></tr>
 +
<tr><th scope="row">sz:</th><td>[ t / s / m / l / h ]</td><td>''</td><td>Size of item</td><td> </td><td> </td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">sp:</th><td>[-]# or Dice Roll spec</td><td>0</td><td>Speed in segments (1/10 round)</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">wt:</th><td>#</td><td>1</td><td>Weight of item in lbs</td><td> </td><td>X</td><td> </td><td>X</td><td>X</td><td>X</td><td> </td><td>X</td></tr>
 +
<tr><th scope="row">ns:</th><td>#</td><td>0</td><td>Number of stored spells & powers defined for item</td><td> </td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">w:</th><td>< text ></td><td>'-'</td><td>Name of stored spell or power (Not case sensitive)</td><td>X</td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">cl:</th><td>MU / PR / PW</td><td>''</td><td>Type of stored spell or power</td><td> </td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">lv:</th><td>#</td><td>1</td><td>Level at which spell/power is cast</td><td> </td><td> </td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">pd:</th><td>-1 / #</td><td>1</td><td>Number per day (power only)</td><td> </td><td> </td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
<tr><th scope="row">rc:</th><td>Charged / Uncharged / Rechargeable / Recharging / Self-chargeable / Cursed / Charged-Cursed / Recharging-Cursed / Self-chargeable-Cursed</td><td>Uncharged</td><td>Initial charged and Cursed status of item when found (Can be changed by DM using -gm-only-mi command once added to Character Sheet) Not case sensitive</td><td> </td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td><td>X</td></tr>
 +
</table>
 +
<br>
 +
<h3>Character Sheet data fields</h3>
 +
<p>The Character Sheet field mapping to the API script can be altered using the definition of the fields object, the definition for which can be found at the top of each API.  You can find the complete mapping for all APIs in the RPGMaster series, with an explanation of each, in a separate document - as the Author for a copy.</p>

Latest revision as of 11:03, 5 April 2022

Contents

Spell, Power & Magic Item Databases

General Database information

The RPGMaster APIs use a number of Character Sheets as databases to hold Ability Macros defining character classes, attack templates, spells, powers and magic items and their effects. The API is distributed with many class, attack, spell, power & magic item definitions, and checks for, creates and updates these Character Sheet databases on start-up. DMs can add their own character classes, attack templates, spells, items, weapons, ammo and armour to additional databases, but the databases provided are totally rewritten when new updates are released so the DM must add their own database sheets. If the provided databases are accidentally deleted, they will be automatically recreated the next time the Campaign is opened. Additional databases should be named as follows:

Wizard Spells:additional databases: MU-Spells-DB-[added name] where [added name] can be replaced with anything you want.
Priest Spells:additional databases: PR-Spells-DB-[added name] where [added name] can be replaced with anything you want.
Powers:additional databases: Powers-DB-[added name] where [added name] can be replaced with anything you want.
Magic Items:additional databases: MI-DB-[added name] where [added name] can be replaced with anything you want.
Character Classes:additional databases: Class-DB-[added name] where [added name] can be replaced with anything you want.
Attack Templates:additional databases: Attacks-DB-[added name] where [added name] can be replaced with anything you want.

However: the system will ignore any database with a name that includes a version number of the form "v#.#" where # can be any number or group of numbers e.g. MI-DB v2.13 will be ignored. This is so that the DM can version control their databases, with only the current one (without a version number) being live.

There can be as many additional databases as you want. Other Master series APIs come with additional databases, some of which overlap - this does not cause a problem as version control and merging unique macros is managed by the APIs.

Important Note: all Character Sheet databases must have their 'ControlledBy' value (found under the [Edit] button at the top right of each sheet) set to 'All Players'. This must be for all databases, both those provided (set by the API) and any user-defined ones. Otherwise, Players will not be able to run the macros contained in them.

Each database has a similar structure, with:

  • Ability Macros named as the class, attack type, spell, power or magic item specified, and used to describe and provide effects for classes, attacks, spells, powers and magic items using the commands in the RPGMaster APIs;
  • Custom Attributes with the attribute name "ct-ability-macro-name", one per Ability Macro, which defines the casting time and casting cost for spells & powers, and speed and MI type for magic items (not currently used for Class or Attack definitions, but they still have to exist);
  • An entry in a list on the character sheet in the spell book of the relevant Character Sheet tab (Spell Level of the spell defined, Powers tab, or various spell books for different Classes & Magic Items).

However, as with all other Databases in the RPGMaster Suite of APIs, if the Ability Macros are correctly set up using the formats detailed in the Help Documentation, the AttackMaster API command !attk --check-db database-name will check the database and set up all other aspects for you, including the correct Custom Attributes and List entries.

Ability Macros can be whatever the DM wants and can be as simple or as complex as desired. Roll Templates are very useful when defining class, spell, power and magic item ability macros, and are an essential part of Attack Templates. When a Player or an NPC or Monster makes an attack, the AttackMaster API runs the relevant Ability Macro from the databases as if it had been run by the Player from the chat window. All Roll20 functions for macros are available.

Replacing Classes, Attacks, Spells & Items

If you want to replace any Ability Macro provided in any of the databases, you can do so simply by creating an Ability Macro in one of your own databases (a database with the same root name) with the Ability Macro you create having exactly the same name as the provided item to be replaced. The API gives preference to Ability Macros in user-defined databases, so yours will be selected in preference to the one provided with the APIs.


Spells and Powers Databases

Spells/Powers databases are all character sheets that have names that start with

Wizard Spells: MU-Spells-DB-[added name]
Priest Spells: PR-Spells-DB-[added name]
Powers: Powers-DB-[added name]

Those with version numbers of the form v#.# as part of the name will be ignored.

As previously stated in the General Database Information section, each spell or power definition has 3 parts in the database: an Ability Macro with a name that is unique and matches the spell or power, an Attribute with the name of the Ability Macro preceded by "ct-", and a listing in the database character sheet of the ability macro name separated by '|' along with others of the same level in the spell book of the level of the spell or power. The quickest way to understand these entries is to examine existing entries. Do go to the root databases and take a look (but be careful not to alter anything unless you know what you're doing!)

Note: The DM creating new spells and powers does not need to worry about anything other than the Ability Macro in the database, as running the command --check-db will update all other aspects of the database appropriately for all databases, as long as the Specs and Data fields are correctly defined. Use the name of the particular database as a parameter to check and update just that database. Running the command --check-db with no parameters will check and update all databases.

Ability macros can be added to a database just by using the [+Add] button at the top of the Abilities column in the Attributes and Abilities tab of the Database Character Sheet, and then using the edit "pencil" icon on the new entry to open it for editing. Ability macros are standard Roll20 functionality and not dependent on the API. Refer to the Roll20 Help Centre for more information.

The Ability Macro for a spell may look something like this:

Sleep

/w "@{selected|character_name}" &{template:2Espell}{{title=@{selected|casting-name} casts Sleep as a level @{selected|casting-level} caster}}{{splevel=Level 1 Wizard}}{{school=Enchantment/Charm}}Specs=[Sleep,MUspellL1,1H,Enchantment-Charm]{{range=90 ft}}{{components=V, S, M}}{{duration=[[5*({10,@{selected|casting-level}}kl1)]] Rounds}}{{time=1}}{{aoe=[30ft Cube](!rounds --aoe @{selected|token_id}|square|feet|90|30||dark)}}{{save=None}}{{damage=[Sleep them](!rounds --target area|@{selected|token_id}|@{target|Select who to sleep|token_id}|Sleep|[[5*({10,@{selected|casting-level}}kl1)]]|-1|Snoring away, shake to awaken|sleepy)}}SpellData=[w:Sleep,lv:1,sp:1,gp:0.01,cs:VSM]{{effects=Up to [2d4](!\ \/r 2d4) Hit Dice of creatures with 4 HD or less are put to sleep beginning with the lowest HD creatures in the Area of Effect.}}{{materials=a pinch of fine sand, rose petals, or a live cricket.}}

The ability specification for this Sleep spell uses a Roll20 Roll Template, in this case defined by the Advanced D&D 2e Character Sheet by Peter B (see the documentation for the Character Sheet on Roll20 for specifications of this Roll Template), but any Roll Template you desire can be used. The entries in the Roll Template itself can be anything you desire, giving as much or as little information as you want. However, the important elements for the MagicMaster API are those highlighted. In red, two API buttons grant the player access to run RoundMaster API commands to show the Area of Effect of the spell, and then to mark affected tokens with a "Sleepy" status. Each of the elements important to the database are inserted between the elements of the Roll Template, meaning they will not be seen by the player when the macro is run. Generally spaces, hyphens and underscores in the data elements are ignored, and case is not significant. Each element is described below:

Specs = [Type, Class, Handedness, Spell School]

The Specs section describes what spell type and school this spell belongs to. These fields must be in this order. This format is identical for all database items, whether in these databases or others used by the Master series of APIs. Where there are multiple answers for a field, separate each by '|'. Note:Only A-Z, a-z, 0-9, hyphen/minus(-), plus(+), equals(=) point(.) and vertical bar(|) are allowed. Replace any forward slash with hyphen.

Typethe type of the spell, often the same as the ability macro name.
Classone of MUSpellL#, PRSpellL#, or Power, where # is replaced by the spell level number.
Handedness#H, where # is the number of hands needed to cast the spell - i.e. does it have a somatic component.
Spell Schoolthe group of related spells that the spell belongs to.
SpellData=[w:Sleep,lv:1,sp:1,gp:1,cs:VSM]

The SpellData section specifies the data relating to the use of the spell. These fields can be in any order.

w:<text>the name of the spell
sph:<text>the sphere of a priest spell (not used for wizard spells)
lv:<#>the level of the spell
sp:<[-]# or dice roll spec>the casting time in segments for the spell. Can be >10 e.g. 20 for 2 rounds, or negative, or even a dice roll
gp:<#[.#]>the cost of the material components of the spell in GP: fractions converted to SP & CP
cs:<VSM>the component of the spell (Verbal, Somatic, Material) - can be any combination

The casting time (or speed) sp: can be negative, meaning it gives a negative modifier to individual initiative (if InitMaster API is being used). It can also be greater than 10 segments, meaning it takes longer than 1 Round to cast. Multiply the number of Rounds it will take to cast by 10, or the number of Turns it will take to cast by 100 (if using the InitMaster API the rounds will be automatically counted down and the spell actually cast in the appropriate round, unless the casting is interrupted). It can also be a dice roll specification, which will be rolled at the point that a character selects the spell, power or item to use in a particular round, which means the speed can vary from round to round. Potions are always of this nature (see the AD&D2e DMG p141).

The cost of material components, gp:, is deducted from the Caster's money on their Character Sheet each time the spell is cast. The GM is informed of the spell being cast, by whom, and how much money it cost and how much money the Caster has left for each casting.

The components of the spell, cs:, is currently not used and is for future expansion capabilities.

The Ability Macro for a Power may look something like this:

Turn Undead

/w "@{selected|character_name}" &{template:2Espell}{{title=@{selected|token_name} attempts to Turn Undead as a level @{selected|pr-casting-level} @{selected|class3}}} {{splevel=Power}} {{school=Necromancy}}Specs=[Turn-Undead,Power,1H,Necromancy]{{components=V,S}}{{time=[[10]]}}{{range=0}}{{duration=Until broken}}{{aoe=Undead within line of sight}}{{save=See turning table}}{{reference=PHB p103}}{{damage=[Roll 1d20](! /r 1d20 check vs. your turning table) then if successful [Turn Them](!rounds --target area|@{selected|token_id}|@{target|Select undead|token_id}|Turned|99|0|Turned undead, flee if free-willed, stand aside if controlled|screaming)}}SpellData=[w:Turn Undead, sp:10, cs:VS]{{effects=**Remember that Paladins turn as a Priest of 2 levels lower.**<br> Attempting to turn counts as an action, requiring one round and occurring during the character's turn in the initiative order (thus, the undead may get to act before the character can turn them). The mere presence of the character is not enough--a touch of drama from the character is important. Speech and gestures are important, so the character must have his hands free and be in a position to speak. However, turning is not like spellcasting and is not interrupted if the character is attacked during the attempt.<br> To resolve a turning attempt, look on Table 61. Cross-index the Hit Dice or type of the undead with the level of the character (two levels lower for a paladin). If there is a number listed, roll 1d20. If the number rolled is equal to or greater than that listed, the attempt is successful. If the letter "T" (for "turned") appears, the attempt is automatically successful without a die roll. If the letter "D" (for "dispel") is given, the turning utterly destroys the undead. A dash (--) means that a priest or paladin of that level cannot turn that type of undead. A successful turn or dispel affects 2d6 undead. If the undead are a mixed group, the lowest Hit Dice creatures are turned first.<br> Only one die is rolled regardless of the number of undead the character is attempting to turn in a given round. The result is read individually for each type of undead.}}{{material=The Priest's holy symbol}}

Essentially, Powers are just Spells by another name, that can be cast multiple times per day, and are innate to the Character's class, or to a creature. The specification is, therefore, almost identical to a spell. In the author's campaigns, Powers do not consume material components and therefore do not cost money to use (except in rare circumstances) hence there being no gp: specification (it defaults to 0gp), but other DMs can add material costs for Powers if desired. Powers are all 1 level, hence no lv: specification.


Magic Item Databases

Magic Item databases are all character sheets that have names such as

Magic Items: MI-DB-[added name]

And can have anything put at the end, though those with version numbers of the form v#.# as part of the name will be ignored.

As previously stated and as for other magic, each magic item definition has 3 parts in the database (see Section 1): an Ability Macro with a name that is unique and identifies the magic item, an Attribute with the name of the Ability Macro preceded by "ct-", and a listing in the database character sheet of the ability macro name separated by '|' along with others of the same magic item type, which is one of: Potion, Scroll, Rod/Stave/Wand, Weapon & Ammo, Armour, Ring, Miscellaneous, and also DM Only magic items. The quickest way to understand these entries is to examine existing entries. Do go to the root database and take a look (but be careful not to alter anything unless you know what you're doing!)

Note: The DM creating new magic items does not need to worry about anything other than the Ability Macro in the database, as running the command --check-db will update all other aspects of the database appropriately for all databases, as long as the Specs and Data fields are correctly defined. Use the name of the particular database as a parameter to check and update just that database.

Ability macros can be added to a database just by using the [+Add] button at the top of the Abilities column in the Attributes and Abilities tab of the Database Character Sheet, and then using the edit "pencil" icon on the new entry to open it for editing. Ability macros are standard Roll20 functionality and not dependent on the API. Refer to the Roll20 Help Centre for more information.

The Ability Macro may look something like this:

Oil-of-Etherealness

/w "@{selected|character_name}" &{template:2Espell}{{title=Oil of Etherealness}} {{splevel=Oil}} {{school=Alteration}}Specs=[Oil of Etherealness,Potion,1H,Alteration]{{components=M}}{{time=[[3]] rounds after application}} PotionData=[sp:30,rc:charged]{{range=User}}{{duration=4+1d4 turns}} {{aoe=User}} {{save=None}} {{healing=[Become Ethereal](!rounds --target single|@{selected|token_id}|@{target|Select a target|token_id}|Oil-of-Etherealness|[[10*(4+1d4)]]|-1|Ethereal|Ninja-mask)}}{{effects=This potion is actually a light oil that is applied externally to clothes and exposed flesh, conferring etherealness. In the ethereal state, the individual can pass through solid objects in any direction - sideways, upward, downward - or to different planes. The individual cannot touch non-ethereal objects.<br> The oil takes effect three rounds after application, and it lasts for 4+1d4 turns unless removed with a weak acidic solution prior to the expiration of its normal effective duration. It can be applied to objects as well as creatures. One potion is sufficient to anoint a normal human and such gear as he typically carries (two or three weapons, garments, armor, shield, and miscellaneous gear). Ethereal individuals are invisible.}}{{materials=Oil}}

You might notice that the structure of this macro is extremely similar to that of a spell: indeed, it uses the same Roll Template. As this is an Oil that achieves the same effect as a spell, this is not surprising.

However, there is one new field in the data section (in this case called the PotionData section):

rc:<MI-type>the recharging/curse type of the magic item.

All magic items have a recharging/curse type: for details, see the --gm-edit-mi command in the MagicMaster API help documentation. If not supplied for a magic item definition, it defaults to uncharged. Generally, items in the database are not cursed-, but can have their type changed to cursed or some recharging cursed type when the DM stores them in a container or gives them to a Character using the --gm-edit-mi command.

Other magic items might use different structures, and be more complex:

Bead-of-Force

/w "@{selected|character_name}" &{template:'+fields.defaultTemplate+'}{{name=Bead of Force}}{{subtitle=Magic Item}}Specs=[Bead of Force,Miscellaneous,1H,Evocation]{{Speed=[[0]]}}MiscData=[w:Bead of Force,sp:0,rc:charged]{{Size=Tiny}}{{Range=[Up to 30yds](!rounds --aoe @{selected|token_id}|circle|yards|0|60||dark|true)}}{{damage=[5d4](! /gmroll 5d4 damage from Bead of Force in 10ft redius) damage in 10ft radius}}{{duration=3d4 rounds}}{{Save=[To escape sphere](! /gmroll 1d20 Save vs. spell or captured in *Sphere of Force*)}}{{Effect=[Trapped in Sphere](!rounds --target area|@{selected|token_id}|Bead-of-Force|8|-1|'Held in Sphere of Force'|fishing-net)}}{{desc=These small, black spheres might be mistaken for common beads, marbles, or unusually black but lusterless pearls. From 5-8 of these beads are usually found at one time. Each is about three-quarters of an inch in diameter and quite heavy, weighing almost an ounce. One can be hurled up to 30 yards.<br> Upon impact, the bead sends forth a burst of force that inflicts 5d4 points of damage upon all creatures within a 10-foot radius of its center. Each victim is allowed a saving throw vs. spell. Those who save will be thrown out of the blast area, but those who fail to save will be encapsulated by a sphere of force after taking damage.<br> The sphere will form around any and all such creatures in the 10-foot-radius area, even those of large size, and will persist for 3d4 rounds. Victims will be unable to escape except by the same means and used to bring down a wall of force spell.}}

The Bead of Force ability macro uses a Default Roll Template, which means the only mandatory field is the Template:Name= field, and the DM can define any other fields they want to describe and enact the magic item. Here, an API button exists to do a saving throw with documented outcomes, and another API button can target an area with multiple tokens in to entrap them (if the DM rejects or confirms as they make or fail each saving throw).


Magic Items with Powers or Spell-Storing

Some magic items, especially artefacts and sentient items, can store spells and/or have powers similar to characters. MagicMaster supports magic items of this type to a degree, although there are inevitably exceptions that the DM will have to get creative in their development! These items use API buttons that call various MagicMaster commands to deliver their capabilities.

First to note is that items that have powers and spells use spell slots in the owning character's character sheet. These spell slots should not be used by characters in your campaign. If they are, errors might occur. By default, on the AD&D2E character sheet the system uses Wizard Level 14 spell slots for magic item powers, and Wizard Level 15 spell slots for spell-storing magic items. As standard AD&D2E only has spells up to level 9 this generally works without causing problems.

Next, in addition to the three standard elements of the Ability Macro, the 'ct-' attribute and the listing, these items require a 4th element which specifies their powers and spells. These are:

mi-muspells-[item-name]:Wizard spells able to be stored in the magic item
mi-prspells-[item-name]:Priest spells able to be stored in the magic item
mi-powers-[item-name]:Powers able to be used by the magic item

In each case the [item-name] is replaced by the Ability macro name (which is not case sensitive).

Note: The DM creating new spell storing or power wielding magic items does not need to worry about anything other than the Ability Macro in the database, as running the command --check-db will update all other aspects of the database appropriately for all databases, as long as the Specs and Data fields are correctly defined. Use the name of the particular database as a parameter to check and update just that database. Running the command --check-db with no parameters will check and update all databases.

When a spell-storing or power wielding magic item is added to a magic item bag or container using !magic --edit-mi or !magic --gm-edit-mi, these attributes are added to the character sheet and also they are parsed by the system and the spells and/or powers are created in the relevant spell books automatically. When such an item is found in a container by a character, or passed from character to character, all of the stored spells & powers are deleted from the old character and created in the new character. A character gaining such an item can use its spells and powers immediately.

Here is an example of a power wielding magic item:

Ring-of-Shooting-Stars

!setattr --silent --sel --casting-level|1 --casting-name|@{selected|token_name}'s Ring of Shooting Stars
/w "@{selected|character_name}" &{template:'+fields.defaultTemplate+'}{{name=Ring of Shooting Stars}}{{subtitle=Ring}}Specs=[Ring of Shooting Stars,Ring,1H,Evocation]{{Speed=[[5]]}}RingData=[w:Ring of Shooting Stars,sp:5,rc:charged,ns:6], [cl:PW,w:RoSS-Dancing-Lights,sp:5,pd:12], [cl:PW,w:RoSS-Light,sp:5,pd:2], [cl:PW,w:RoSS-Ball-Lightning,sp:5,pd:1], [cl:PW,w:RoSS-Shooting-Stars,sp:5,pd:3], [cl:PW,w:RoSS-Faerie-Fire,sp:5,pd:2], [cl:PW,w:RoSS-Spark-Shower,sp:5,pd:1] {{Size=Tiny}} {{Immunity=None}} {{Resistance=None}} {{Saves=None}} {{desc=This ring has two modes of operation - at night and underground - both of which work only in relative darkness.<br> ***During night hours, under the open sky***, the shooting stars ring will perform the following functions:<br> - [*Dancing lights*](!magic --mi-power @{selected|token_id}|RoSS-Dancing-Lights|Ring-of-Shooting-Stars|1) as spell (once per hour).<br> - [*Light*](!magic --mi-power @{selected|token_id}|RoSS-Light|Ring-of-Shooting-Stars|1), as spell (twice per night), 120-foot range.<br> - [*Ball lightning*](!magic --mi-power @{selected|token_id}|RoSS-Ball-Lightning|Ring-of-Shooting-Stars|1), as power (once per night).<br> - [*Shooting stars*](!magic --mi-power @{selected|token_id}|RoSS-Shooting-Stars|Ring-of-Shooting-Stars|1), as power (special).<br> ***Indoors at night, or underground***, the ring of shooting stars has the following properties:<br> [*Faerie fire*](!magic --mi-power @{selected|token_id}|RoSS-Faerie-Fire|Ring-of-Shooting-Stars|1) (twice per day) as spell<br> [*Spark shower*](!magic --mi-power @{selected|token_id}|RoSS-Spark-Shower|Ring-of-Shooting-Stars|1) (once per day) as power<br> Range, duration, and area of effect of functions are the minimum for the comparable spell unless otherwise stated. Casting time is 5}}

Note that the ability macro starts with a call to the ChatSetAttr API to set the casting-level to 1 and the name of the caster to be <Character-name>'s Ring of Shooting Stars. Not strictly necessary, but a nice cosmetic.

The data section now includes repeating data sets, one for each of the powers that the item has:

RingData=[w:Ring of Shooting Stars,sp:5,rc:charged,ns:6], [cl:PW,w:RoSS-Dancing-Lights,sp:5,pd:12], … 

The first data set is very similar to the standard magic item data, with the addition of the ns: field, and is then followed by a number of repeated data sets specifying each of the powers:

ns:<#>The number of powers (or spells) that the item can wield or store
cl:<MU/PR/PW>The type of the power/spell specification: PW=power, MU=wizard spell, PR=priest spell
w:<text>The name of the power/spell - must be exactly the same as the database name (case ignored)
sp:<[-/+]# / dice roll spec>The speed or casting time of the power/spell in segments
pd:<-1/#>The available casts per day, or -1 for 'at will'

By running the --check-db command (see the note above) these data sets are used to correctly set up the database with the powers wielded, so that when a Character receives this item, the Character also gains the powers to use through the item.

Note: if a Character picks up two Power-wielding items with exactly the same item name (i.e. two copies of the same item) the results are unpredictable. This is best avoided.

Feel free to just copy the specification for a Ring-of-Shooting-Stars in the Rings database and save it to a new Ability Macro with a different name, and then alter the power names, speeds, and uses per day, as well as the API Button --mi-power commands and the other text, to form new power-wielding magic items. Also, the Ring does not have to have 6 powers - just remove or add one or more repeating data sets to reduce or increase the number of powers.

Here is an example of a spell-storing magic item:

Ring-of-Spell-Storing-HHSLS

/w "@{selected|character_name}" &{template:'+fields.defaultTemplate+'}{{name=Ring of Spell Storing with Haste x2, Slow, Light & Sleep}}{{subtitle=Ring}}Specs=[Ring of Spell Storing,Ring,1H,Conjuration-Summoning]{{Speed=[[5]] regardless of spell}}RingData=[w:Ring of Spell Storing HHSLS,sp:5,rc:uncharged,ns:5], [cl:MU,w:Haste,sp:5,lv:6], [cl:MU,w:Haste,sp:5,lv:6], [cl:MU,w:Slow,sp:5,lv:7], [cl:MU,w:Light,sp:5,lv:3], [cl:MU,w:Sleep,sp:5,lv:3] {{Size=Tiny}}{{Store spell=[Store Priest Spell](!magic --mem-spell MI-PR|@{selected|token_id})<br> [Store Wizard Spell](!magic --mem-spell MI-MU|@{selected|token_id})}}{{Cast spell=[View](!magic --view-spell mi-muspells|@{selected|token_id}) or [Cast](!magic --cast-spell MI|@{selected|token_id}) spells}}{{desc=A ring of spell storing contains 1d4+1 spells which the wearer can employ as if he were a spellcaster of the level required to use the stored spells. The class of spells contained within the ring is determined in the same fashion as the spells on scrolls (see "Scrolls"). The level of each spell is determined by rolling 1d6 (for priests) or 1d8 (for wizards). The number rolled is the level of the spell, as follows:<br> Priest: 1d6, if 6 is rolled, roll 1d4 instead.<br> Wizard: 1d8, if 8 is rolled, roll 1d6 instead.<br> Which spell type of any given level is contained by the ring is also randomly determined.<br> The ring empathically imparts to the wearer the names of its spells. Once spell class, level, and type are determined, the properties of the ring are fixed and unchangeable. Once a spell is cast from the ring, it can be restored only by a character of appropriate class and level of experience (i.e., a 12th-level wizard is needed to restore a 6th-level magical spell to the ring). Stored spells have a casting time of [[5]].}}

This is a specific version of a Ring of Spell Storing. As the spells stored are specified in the macro, if you want there to be multiple rings of spell storing in your campaign they each need to be individually programmed (easy cut & paste job) & named differently.

The only new field in these data sets is:

lv:<#>The level of the caster who cast the spell into the ring. The spell will have effects as if cast at this level when cast from the ring.

The lv: field only specifies the level of the initial spell caster when the item is first found. Once owned and used, the level of the spell caster is recorded each time a spell is refreshed by casting into the item. As the item is then passed from one Character to another, or stored in a container and recovered later, the levels at which the spells were cast is retained. However, if the item is reloaded from the databases, or a duplicate of the item is placed by the DM and found by another character, that version of the item will have the spell caster levels from the database definitions. Note that if a single Character picks up two versions of exactly the same spell storing item (i.e. with the same item name) the results are unpredicable...

Feel free to just copy the specification for a Ring-of-Spell-Storing in the Rings database and save it to a new Ability Macro with a different name, and then alter the spell names and casting levels as desired, to form new Rings of Spell Storing or other magic items. Also, the Ring does not have to have 5 spells - just remove or add one or more repeating data sets to reduce or increase the number of stored spells (though the official definition of a Ring of Spell Storing states a maximum of 5 spells).

The key command in the Spell-Storing item that supports it casting the defined spells is !magic --cast-spell MI, called in this case via an API button. Any item specified with this command somewhere in the definition can store spells which can be specified, added or changed by the DM/Game Creator using the !magic --store-spell command.


Weapons (if using AttackMaster API)

Weapons, magical or not, are special types of items in the Magic Items databases. If coded properly (in the same way as those in the MI-DB-Weapons database), they can be used with the AttackMaster API to implement fully automatic weapon management, the ability to hold weapons "in-hand" or sheathed, to have automatic ammo and range management for ranged weapons, automatic entry of weapons into the melee and/or ranged weapons tables, ready to make attacks with magical plusses and other specifications all set up, and support for dancing weapons (ones that can attack without being held by the Character), creatures with more than 2 hands, and 1-handed weapons, 2-handed weapons, and even weapons that need more than 2 hands!

See the Weapon & Armour Database Help handout and wiki for how Weapon definitions should be structured for use with the AttackMaster API, which are just a few additions to the standard definition of an item.


Armour & Shields

Like weapons, armour and shields of all types (including magical armour like magical Bracers and Rings of Protection) can be coded to be used with the AttackMaster API to automatically calculate the appropriate AC for various scenarios (such as with & without Shield, from the back, if surprised, etc). This will take into account if the armour is valid for the character class, determine which is the best armour combination that the character has, if various armour elements can or can't work together, and add in Dexterity bonuses or impairments. It will also allow magical effects cast on the character to take effect or be adjusted via the token "circles" and highlight when such an effect is in place by showing the relevant token bar (only when there is a difference between the token AC and calculated AC).

See the Weapon & Armour Database Help handout and wiki page for how Armour & Shield definitions should be structured for use with the AttackMaster API, which are just a few additions to the standard definition of an item.

Also, see the RoundMaster API documentation for how magical effects can be placed on and affect tokens and characters.


Specs & Data field values

Below are lists of the current possible values for the item database Ability macro sections.

Specs sections

Specs=[Type, Item-Class, Handedness, Group-Type]

There are no default settings for any of the Specs data fields. All must be explicitly specified.

Spell Types

There is an infinite list of spell types: generally the type is the spell name.

Spell Item-Classes

MUSpellL\<1-9\>A Wizard spell with the Level specified as a number from 1 to 9
PRSpellL\<1-9\>A Priest spell with the Level specified as a number from 1 to 9
PowerA Power

Spell Handedness

0H A spell/power that does not take a hand (there is no Somatic component)
1H A spell/power that requires only 1 hand to cast (most spells are like this)
2H A spell/power that requires 2 hands to cast (perhaps a scroll must be held)
3H A spell/power that takes 3 hands... perhaps more than 1 caster together?
4H Etc No currently programmed spells use more than 2 hands
... ...

Spell/Power Schools

From MagicMaster v2.048 onwards, Spell Schools are specified by Class in the Class-DB definitions and, depending on the API configuration set with the --config command, will be checked by the system or otherwise. Those implemented so far for the Spells databases are:

Abjuration, Alteration, Conjuration-Summoning, Enchantment-Charm, Divination, Illusion-Phantasm, Invocation-Evocation, Necromancy.

Note that the '/' in School names in the AD&D2e PHB have been replaced by hyphens. It is also allowed to use just one half of any hyphenated school name where appropriate. If a spell or power is of more than one school, separate each with a vertical bar character '|'


Magic Item Types

There is an infinite list of magic item types: generally the type is the magic item name. A magic item can have more than one type, with each separated by a vertical bar character '|'

Magic Item Classes

WeaponWeapons that are not Melee or Ranged weapons or any other class
MeleeMelee weapons that are used in hand-to-hand combat
RangedRanged weapons that are either thrown or fire ammunition
AmmoAll types of ammunition that is used by Ranged weapons
ArmourAny type of armour that does not need to be held to work
ShieldA barrier that is held in hand(s) and defends against one or more attacks from the front
PotionAny type of potion, oil, pill or similar that is consumed or rubbed on
ScrollScrolls and spell books, that contain one or multiple spells
WandWands that cast spells or spell-like effects when wielded in the hand
StaffQuarterstaffs and similar large bludgeoning items that can also have spell-like abilities
RodWalking-stick sized rods that can do spell-like effects, especially when used to attack
RingRings that are worn on a finger, one to each hand, that protect, have powers or spells
LightAll types of lantern, torch, and other illumination
MiscellaneousAnything that does not fit in one of the other categories
UnspecifiedItems without any Specs section or an empty Class definition are listed under DM-Only

Armour Handedness

0H Items that do not require to be held to work (e.g. a Ring, Buckler or a Helm)
1H An item that must be held in one hand to work, such as a Wand
2H Items that need two hands to wield, like a Staff
3H Items that need three hands to use, perhaps by two characters... (not yet implemented)
... etc.

Item Schools

Currently, all Magic Items other than Weapons and Armour use the same set of magical schools as for Spells & Powers, as they mostly perform spell-like effects. See section 7.1(d) for the list.

Data Sections

Definitions for Data Section field types for Weapons & Armour can be found in the Weapons & Armour Database help handout & wiki page. Below are the definitions for Spell, Power & other Magical Item types.

Note: Always refer to the database specification definitions in other sections above for detailed information on the use of these Field specifiers. Not all specifiers have an obvious use.

Field Format Default Value Description Can be used in
Spell
Data
Potion
Data
Scroll
Data
Wand
Data
Staff
Data
Rod
Data
Ring
Data
Misc
Data
w:< text >'-'Name to be displayed XXXXXXX
w:< text >Name of spell or power (Not case sensitive)X
+:[ + / - ] #0Magical adjustment XXXX
n:# [ / # ]1Attacks per round XXX X
sz:[ t / s / m / l / h ]Size of item XXXXX
sp:[-]# or Dice Roll spec0Speed in segments (1/10 round)XXXXXXXX
wt:#1Weight of item in lbs X XXX X
ns:#0Number of stored spells & powers defined for item XXXXXX
w:< text >'-'Name of stored spell or power (Not case sensitive)X XXXXXX
cl:MU / PR / PWType of stored spell or power XXXXXX
lv:#1Level at which spell/power is cast XXXXX
pd:-1 / #1Number per day (power only) XXXXX
rc:Charged / Uncharged / Rechargeable / Recharging / Self-chargeable / Cursed / Charged-Cursed / Recharging-Cursed / Self-chargeable-CursedUnchargedInitial charged and Cursed status of item when found (Can be changed by DM using -gm-only-mi command once added to Character Sheet) Not case sensitive XXXXXXX


Character Sheet data fields

The Character Sheet field mapping to the API script can be altered using the definition of the fields object, the definition for which can be found at the top of each API. You can find the complete mapping for all APIs in the RPGMaster series, with an explanation of each, in a separate document - as the Author for a copy.