!scriptcards {{ --/|{& skip} --/| ========================================================================== --/| Spell Book Manager --/| Version: v1.0.0 --/| Author: Timothy Beasley --/| Requested by: Gauss --/| Special thanks: Gauss for feature guidance and testing --/| GitHub: https://github.com/VirulentArc/ScriptCards/tree/main/Spell%20Book%20Manager --/| ========================================================================== --#Whisper|self --#emoteState|0 --#Debug|0 --#reentrant|SBM [&SendingPlayerID] --#hidetitlecard|1 --&SDHN|Spell Book Manager [&SendingPlayerID] --~|array;objects:handout;HandoutID;[&SDHN] --?"[@HandoutID(maxindex)]" -eq "-1"|[ --!oh:SDHID|name:"[&SDHN]"|notes:"Click the 🕮 Button to See Spell Description"|inplayerjournals:"[&SendingPlayerID]"|archived:true --]| --?"[@HandoutID(maxindex)]" -ne "-1"|&SDHID;[@HandoutID(0)] --&SBMHN|Spell Book Manager Settings --~|array;objects:handout;SBMSettingsHandoutIDs;[&SBMHN] --?"[@SBMSettingsHandoutIDs(maxindex)]" -eq "-1"|[ --!oh:SBMHID|name:"[&SBMHN]"|gmnotes:""|archived:true --]| --?"[@SBMSettingsHandoutIDs(maxindex)]" -ne "-1"|&SBMHID;[@SBMSettingsHandoutIDs(0)] --&SBMBHN|Spell Book Manager Settings Backups --~|array;define;SBMThemeList;2014;2024 Core;R20 2024;AD&D 2E;2E Revised;D&D 3E;Arcane;Brasswork;Eldritch;Prismatic;Radiant;Verdant --~|array;define;SBMClassList;artificer;barbarian;bard;cleric;druid;fighter;monk;paladin;ranger;rogue;sorcerer;warlock;wizard -->LoadSBMSettings| -->ParseSBMSettings| -->LoadSBMPlayerTheme| -->ApplySBMTheme| -->EnsureSBMDocumentationHandout| --:CharacterSelect| --&IMCM|0 --&IPSB|0 --&ChP|[&reentryval] --?"[&ChP]" -eq "" -or "[&ChP]" -eq "undefined" -or "[&ChP]" -eq "START" -or "[&ChP]" -eq "BACK"|&ChP;0 --&ChPageValid|0 --?"[&ChP]" -match "^[0-9]+$"|&ChPageValid;1 --?"[&ChPageValid]" -ne "1"|&ChP;0 --&BackButton|  --&SettingsButton|[&SettingsBtn]CharacterSelect[/rbutton] -->OpenSBMCard|Choose a Character --~|array;fromcontrolledcharacters;PlayerArray;[&SendingPlayerID] --?"[&SendingPlayerIsGM]" -eq "1"|[ --~|array;fromcontrolledcharacters;PlayerArray; --]| --~|array;define;SBMValidPCList;dummy --~|array;removeat;SBMValidPCList;0 --=PCCount|0 --&SinglePC| --%PlayerLoop|foreach;PlayerArray --&ChName|[*[&PlayerLoop]:character_name] --?"[&ChName]" -imatch "^SBM_" -or "[&ChName]" -imatch "^ScriptCards"|% --?"[*O:[&PlayerLoop]:character:archived]" -eq "true"|% --?"[*O:[&PlayerLoop]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|% --?"[*[&PlayerLoop]:npc]" -eq "1"|% --&ChClassCheck|[*[&PlayerLoop]:class] [*[&PlayerLoop]:custom_class] [*[&PlayerLoop]:cust_classname] --~ChClassCheck|string;replaceall;undefined;;[&ChClassCheck] --~ChClassCheck|string;trim;[&ChClassCheck] --?"[&ChClassCheck]" -eq ""|% --~ChSortKey|string;tolowercase;[&ChName] --&SBMValidPCList(99999)|[&ChSortKey]!@![&ChName]!@![&PlayerLoop] --&SinglePC|[&PlayerLoop] --=PCCount|[$PCCount.Raw] + 1 --%| --?"[$PCCount.Raw]" -eq "1" -and "[&SendingPlayerIsGM]" -ne "1" -and "[&reentryval]" -ne "BACK"|[ --&ChosenChar|[&SinglePC] --^SelectCharacterReady| --]| --?"[$PCCount.Raw]" -eq "0"|[ --&CardHTML|+[&CTR]No controlled player characters were found.[/td][/tr] --]| --?"[$PCCount.Raw]" -gt "0"|[ --?[$PCCount.Raw] -gt 1|[ --~|array;sort;SBMValidPCList --]| --=ChPageSize|10 --=ChStartIndex|[&ChP] * [$ChPageSize.Raw] --?[$ChStartIndex.Raw] -ge [$PCCount.Raw]|[ --&ChP|0 --=ChStartIndex|0 --]| --&ChOut|[t style='width:100%; [&B0] [&TF] background-color:transparent;'] --=ChEntryIndex|-1 --=ChPageCount|0 --%PlayerLoop|foreach;SBMValidPCList --?"[&PlayerLoop]" -eq "" -or "[&PlayerLoop]" -eq "undefined"|% --=ChEntryIndex|[$ChEntryIndex.Raw] + 1 --?[$ChEntryIndex.Raw] -lt [$ChStartIndex.Raw]|% --?[$ChPageCount.Raw] -ge [$ChPageSize.Raw]|% --~ChEntry|string;split;!@!;[&PlayerLoop] --&ChName|[&ChEntry2] --&ChID|[&ChEntry3] --?"[&ChName]" -eq "" -or "[&ChName]" -eq "undefined" -or "[&ChID]" -eq "" -or "[&ChID]" -eq "undefined"|% --&ChBG|[&OddRowBG] --?"[= [$ChPageCount.Raw] % 2 ]" -eq "1"|&ChBG;[&EvenRowBG] --&ChOut|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&ChBG];'][rbutton][&ChName]::SelectCharacter;[&ChID][/rbutton][/td][/tr] --=ChPageCount|[$ChPageCount.Raw] + 1 --%| --&ChOut|+[/t] --&CardHTML|+[&CCR][&ChOut][/td][/tr] --?[$PCCount.Raw] -le [$ChPageSize.Raw]|AfterCharacterPageNav --=ChDisplayPage|[&ChP] + 1 --=ChPrevPage|[&ChP] - 1 --=ChNextPage|[&ChP] + 1 --&ChNav|[t [>]][tr] --?[$ChPrevPage.Raw] -ge 0|[ --&ChNav|+[td style='[&GCS] background-color:[&OddRowBG];'][rbutton][&BackIcon] Prev::CharacterSelect;[$ChPrevPage.Raw][/rbutton][/td] --]|[ --&ChNav|+[td style='[&GCS] background-color:[&OddRowBG];'] [/td] --]| --&ChNav|+[td style='[&GCS] background-color:[&OddRowBG];']Page [$ChDisplayPage.Raw][/td] --?[= [$ChStartIndex.Raw] + [$ChPageSize.Raw] ] -lt [$PCCount.Raw]|[ --&ChNav|+[td style='[&GCS] background-color:[&OddRowBG];'][rbutton]Next ⮞::CharacterSelect;[$ChNextPage.Raw][/rbutton][/td] --]|[ --&ChNav|+[td style='[&GCS] background-color:[&OddRowBG];'] [/td] --]| --&ChNav|+[/tr][/t] --&CardHTML|+[&CCR][&ChNav][/td][/tr] --:AfterCharacterPageNav| --]| --?"[&SendingPlayerIsGM]" -eq "1"|[ --&CardHTML|+[&CSR]GM Tools[/td][/tr] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&OddRowBG];'][rbutton]NPC Spell Manager::NPCSpellManager;START[/rbutton][/td][/tr] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&EvenRowBG];'][rbutton]Copy Between Mules::MCCD;START[/rbutton][/td][/tr] --]| -->ShowSBMCard| --X| --:OpenSBMCard|Subtitle --#hidecard|0 --&CardTitleBar|[&CTBO][&BackButton][&CTBM][&CardAppTitle][&CTBR][&HomeButton][&TBD][&SettingsButton][&CTBC] --&CardHTML|[&CardOpen] --&CardHTML|+[&CTiR][&CardTitleBar][&RowEnd] --&CardHTML|+[tr][td style='[&B0] padding:0 0 2px;'][t style='width:100%; [&B0] [&TF]'][tr][td [&CSH]][%1%][/td][/tr][/t][/td][/tr] --<| --:ShowSBMCard| --#hidecard|0 --&CardHTML|+[&CardClose] --+|[&CardHTML] --<| --:SBMSettings| --#hidecard|0 --&SBMRet|[&reentryval] --?",CharacterSelect,SelectCharacterReady,SpellMuleSelect,SpellList,NoAssignedSpellMules,SBMClassMules,SBMCharacterSelectMules,SBMCharacterMules,SBMCharacterSpellBook,NPCSpellManager,NPCSpellSourceSelect,MCCD,MCCS,PSBCD,PSBCS,SBMPermissionsReport,SBMSettingsBackup," -ninc ",[&SBMRet],"|&SBMRet;CharacterSelect --&SBMTCnt|0 --&SBMTO|[t [>]][tr] --%SBMThemeLoop|foreach;SBMThemeList --?"[= [&SBMTCnt] % 3 ]" -eq "0" -and "[&SBMTCnt]" -ne "0"|&SBMTO;+[/tr][tr] --&SBMTBG|[&OddRowBG] --?"[= [&SBMTCnt] \ 3 % 2 ]" -eq "1"|&SBMTBG;[&EvenRowBG] --&SBMTO|+[td style='[&GCS] background-color:[&SBMTBG];'][rbutton][&SBMThemeLoop]::SBMSetTheme;[&SBMThemeLoop][/rbutton][/td] --&SBMTCnt|[= [&SBMTCnt] + 1] --%| --&SBMTO|+[/tr][/t] --&SettingsTitle|Player Settings --?[&SendingPlayerIsGM] -eq 1|&SettingsTitle;DM Settings --&BackButton|[&BackBtn][&SBMRet];BACK[/rbutton] --&SettingsButton|[&SettingsBtn][&SBMRet][/rbutton] -->OpenSBMCard|[&SettingsTitle] --?[&SendingPlayerIsGM] -ne 1|SkipSettingsClassMules --&SelClass| --&CardHTML|+[&CSR]Class Spell Mules[/td][/tr] --&ClCnt|0 --&ClOut|[t style='width:100%; [&B0] [&TF] background-color:transparent;'][tr] --%SBMClassLoop|foreach;SBMClassList --?"[= [&ClCnt] % 3 ]" -eq "0" -and "[&ClCnt]" -ne "0"|&ClOut;+[/tr][tr] --&CBG|[&OddRowBG] --?"[= [&ClCnt] \ 3 % 2 ]" -eq "1"|&CBG;[&EvenRowBG] --&ClOut|+[td style='[&GCS] background-color:[&CBG];'][rbutton][&SBMClassLoop(totitlecase)]::SBMClassMules;[&SBMClassLoop][/rbutton][/td] --&ClCnt|[= [&ClCnt] + 1] --%| --?"[= [&ClCnt] % 3 ]" -eq "0" -and "[&ClCnt]" -ne "0"|&ClOut;+[/tr][tr] --&CBG|[&OddRowBG] --?"[= [&ClCnt] \ 3 % 2 ]" -eq "1"|&CBG;[&EvenRowBG] --&ClOut|+[td style='[&GCS] background-color:[&CBG];'][rbutton][b][F::14]+[/F][/b]::SBMAddCustomClassPrompt;[&SBMRet][/rbutton][/td] --&ClOut|+[/tr][/t] --&CardHTML|+[&CCR][&ClOut][/td][/tr] --&SBMCC|[:SBMSettings("customclasses")] --&RCCOut|[t [>]][tr] --=RemoveCustomClassCount|0 --~|array;fromstring;SBMRemoveCustomClassList;,;[&SBMCC] --%SBMRCL|foreach;SBMRemoveCustomClassList --&RCName|[&SBMRCL] --~RCName|string;trim;[&RCName] --~RCName|string;tolowercase;[&RCName] --?"[&RCName]" -eq "" -or "[&RCName]" -eq "undefined"|% --&CBG|[&OddRowBG] --?"[= [$RemoveCustomClassCount.Raw] \ 3 % 2 ]" -eq "1"|&CBG;[&EvenRowBG] --?"[= [$RemoveCustomClassCount.Raw] % 3 ]" -eq "0" -and "[$RemoveCustomClassCount.Raw]" -ne "0"|&RCCOut;+[/tr][tr] --&RCCOut|+[td style='[&GCS] background-color:[&CBG];'][rbutton]✕ [&RCName(totitlecase)]::SBMRemoveCustomClass;[&RCName][/rbutton][/td] --=RemoveCustomClassCount|[$RemoveCustomClassCount.Raw] + 1 --%| --&RCCOut|+[/tr][/t] --?[$RemoveCustomClassCount.Raw] -gt 0|[ --&CardHTML|+[&CSR]Remove Custom Classes[/td][/tr] --&CardHTML|+[&CCR][&RCCOut][/td][/tr] --]| --&CardHTML|+[&CSR]Character Spell Mules[/td][/tr] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&OddRowBG];'][rbutton]Character Assignments::SBMCharacterSelectMules;START[/rbutton][/td][/tr] --&CardHTML|+[&CSR]Diagnostics[/td][/tr] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&OddRowBG];'][rbutton]Assignments Overview::SBMPermissionsReport;START[/rbutton][/td][/tr] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&EvenRowBG];'][rbutton]Settings Backup / Restore::SBMSettingsBackup;START[/rbutton][/td][/tr] --:SkipSettingsClassMules| --&CardHTML|+[&CSR]Theme[/td][/tr] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] background-color:[&OddRowBG];']Current:  [&SBMTheme][/td][/tr] --&CardHTML|+[&CCR][&SBMTO][/td][/tr] -->ShowSBMCard| --X| --:SBMPermissionsReport| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect --&BackButton|[&BackBtn]SBMSettings;CharacterSelect[/rbutton] --&SettingsButton|[&SettingsBtn]SBMPermissionsReport[/rbutton] -->OpenSBMCard|Permissions Report --=PRRemovedMissingCount|0 --&PRRemovedMissingReport| --~|array;objects:character;SBMReportCharacters; --&CardHTML|+[&CSR]Assigned Spell Books[/td][/tr] --=PRSBCount|0 --%PRSpellBookOwnerLoop|foreach;SBMReportCharacters --&PRCSB|[:SBMSettings("char_[&PRSpellBookOwnerLoop]_spellbook")] --?"[&PRCSB]" -eq "" -or "[&PRCSB]" -eq "undefined"|% --~PRSpellBookID|string;before;,;[&PRCSB] --?"[&PRSpellBookID]" -eq "" -or "[&PRSpellBookID]" -eq "undefined"|% -->BuildPermissionOwnerInfo|[&PRSpellBookOwnerLoop] --&PRRepairKey|char_[&PRSpellBookOwnerLoop]_spellbook --&PRCleanupContext|[&PROwnerName]: assigned spell book -->BuildPermissionMuleInfo|[&PRSpellBookID] --?"[&PRMuleDisplay]" -eq ""|% --&PRRowBG|[&OddRowBG] --?"[= [$PRSBCount.Raw] % 2 ]" -eq "1"|&PRRowBG;[&EvenRowBG] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] background-color:[&PRRowBG];'][b][&PROwnerName][/b][&PROwnerFlags] → [&PRMuleDisplay][&PRMuleFlags][/td][/tr] --=PRSBCount|[$PRSBCount.Raw] + 1 --%| --?[$PRSBCount.Raw] -eq 0|[ --&CardHTML|+[&CTR][i]No assigned spell books found.[/i][/td][/tr] --]| --&CardHTML|+[&CSR]Class Spell Mules[/td][/tr] --=PRClassCount|0 --%PRClassLoop|foreach;SBMClassList --&PRClass|[&PRClassLoop] --&PRClassMules|[:SBMSettings("[&PRClass]")] --?"[&PRClassMules]" -eq "" -or "[&PRClassMules]" -eq "undefined"|% --&PRClassMuleList| --=PRClassMuleCount|0 --~|array;fromstring;SBMReportClassMuleIDs;,;[&PRClassMules] --~|array;define;PRSortedMuleRows;dummy --~|array;removeat;PRSortedMuleRows;0 --%PRClassMuleLoop|foreach;SBMReportClassMuleIDs --?"[&PRClassMuleLoop]" -eq "" -or "[&PRClassMuleLoop]" -eq "undefined"|% --&PRRepairKey|[&PRClass] --&PRCleanupContext|[&PRClass(totitlecase)]: class spell mule -->BuildPermissionMuleInfo|[&PRClassMuleLoop] --?"[&PRMuleDisplay]" -eq ""|% --&PRSortedMuleRows(99999)|[&PRMuleDisplay][&PRMuleFlags] --%| --~|array;sort;PRSortedMuleRows --%PRSortedMuleLoop|foreach;PRSortedMuleRows --?[$PRClassMuleCount.Raw] -gt 0|[ --&PRClassMuleList|+, --]| --&PRClassMuleList|+[&PRSortedMuleLoop] --=PRClassMuleCount|[$PRClassMuleCount.Raw] + 1 --%| --?[$PRClassMuleCount.Raw] -eq 0|% --&PRRowBG|[&OddRowBG] --?"[= [$PRClassCount.Raw] % 2 ]" -eq "1"|&PRRowBG;[&EvenRowBG] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] background-color:[&PRRowBG];'][b][&PRClass(totitlecase)][/b] → [&PRClassMuleList][/td][/tr] --=PRClassCount|[$PRClassCount.Raw] + 1 --%| --?[$PRClassCount.Raw] -eq 0|[ --&CardHTML|+[&CTR][i]No class spell mule assignments found.[/i][/td][/tr] --]| --&CardHTML|+[&CSR]Character Overrides[/td][/tr] --=PROverrideCount|0 --%PROwnerLoop|foreach;SBMReportCharacters -->BuildPermissionOwnerInfo|[&PROwnerLoop] --&PRInclude|[:SBMSettings("char_[&PROwnerLoop]_include")] --&PRIncludeMuleList| --=PRIncludeMuleCount|0 --~|array;fromstring;SBMReportIncludeMuleIDs;,;[&PRInclude] --~|array;define;PRSortedMuleRows;dummy --~|array;removeat;PRSortedMuleRows;0 --%PRIncludeMuleLoop|foreach;SBMReportIncludeMuleIDs --?"[&PRIncludeMuleLoop]" -eq "" -or "[&PRIncludeMuleLoop]" -eq "undefined"|% --&PRRepairKey|char_[&PROwnerLoop]_include --&PRCleanupContext|[&PROwnerName]: added character mule -->BuildPermissionMuleInfo|[&PRIncludeMuleLoop] --?"[&PRMuleDisplay]" -eq ""|% --&PRSortedMuleRows(99999)|[&PRMuleDisplay][&PRMuleFlags] --%| --~|array;sort;PRSortedMuleRows --%PRSortedMuleLoop|foreach;PRSortedMuleRows --?[$PRIncludeMuleCount.Raw] -gt 0|[ --&PRIncludeMuleList|+, --]| --&PRIncludeMuleList|+[&PRSortedMuleLoop] --=PRIncludeMuleCount|[$PRIncludeMuleCount.Raw] + 1 --%| --?[$PRIncludeMuleCount.Raw] -gt 0|[ --&PRRowBG|[&OddRowBG] --?"[= [$PROverrideCount.Raw] % 2 ]" -eq "1"|&PRRowBG;[&EvenRowBG] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] background-color:[&PRRowBG];'][b][&PROwnerName][/b][&PROwnerFlags] Added → [&PRIncludeMuleList][/td][/tr] --=PROverrideCount|[$PROverrideCount.Raw] + 1 --]| --&PRExclude|[:SBMSettings("char_[&PROwnerLoop]_exclude")] --&PRExcludeMuleList| --=PRExcludeMuleCount|0 --~|array;fromstring;SBMReportExcludeMuleIDs;,;[&PRExclude] --~|array;define;PRSortedMuleRows;dummy --~|array;removeat;PRSortedMuleRows;0 --%PRExcludeMuleLoop|foreach;SBMReportExcludeMuleIDs --?"[&PRExcludeMuleLoop]" -eq "" -or "[&PRExcludeMuleLoop]" -eq "undefined"|% --&PRRepairKey|char_[&PROwnerLoop]_exclude --&PRCleanupContext|[&PROwnerName]: blocked character mule -->BuildPermissionMuleInfo|[&PRExcludeMuleLoop] --?"[&PRMuleDisplay]" -eq ""|% --&PRSortedMuleRows(99999)|[&PRMuleDisplay][&PRMuleFlags] --%| --~|array;sort;PRSortedMuleRows --%PRSortedMuleLoop|foreach;PRSortedMuleRows --?[$PRExcludeMuleCount.Raw] -gt 0|[ --&PRExcludeMuleList|+, --]| --&PRExcludeMuleList|+[&PRSortedMuleLoop] --=PRExcludeMuleCount|[$PRExcludeMuleCount.Raw] + 1 --%| --?[$PRExcludeMuleCount.Raw] -gt 0|[ --&PRRowBG|[&OddRowBG] --?"[= [$PROverrideCount.Raw] % 2 ]" -eq "1"|&PRRowBG;[&EvenRowBG] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] background-color:[&PRRowBG];'][b][&PROwnerName][/b][&PROwnerFlags] Blocked → [&PRExcludeMuleList][/td][/tr] --=PROverrideCount|[$PROverrideCount.Raw] + 1 --]| --%| --?[$PROverrideCount.Raw] -eq 0|[ --&CardHTML|+[&CTR][i]No character-specific added or blocked mules found.[/i][/td][/tr] --]| --?[$PRRemovedMissingCount.Raw] -gt 0|[ -->WriteSBMSettings|AUTO --&CardHTML|+[&CTR][i][$PRRemovedMissingCount.Raw] missing mule ID(s) removed. The most likely cause is that a mule was deleted before being unassigned.[/i][&PRRemovedMissingReport][/td][/tr] --]| -->ShowSBMCard| --X| --:BuildPermissionOwnerInfo|CharacterID --&PROwnerID|[%1%] --&PROwnerFlags| --&PROwnerName|[*O:[&PROwnerID]:character:name] --?"[&PROwnerName]" -eq "" -or "[&PROwnerName]" -eq "undefined"|[ --&PROwnerName|Missing character --&PROwnerFlags|+ (missing character ID [&PROwnerID]) --]| --?"[*O:[&PROwnerID]:character:archived]" -eq "true"|&PROwnerFlags;+ (archived character) --?"[*O:[&PROwnerID]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|&PROwnerFlags;+ (2024 sheet) --<| --:BuildPermissionMuleInfo|MuleID --&PRMuleID|[%1%] --&PRMuleFlags| --&PRMuleName|[*O:[&PRMuleID]:character:name] --?"[&PRMuleName]" -eq "" -or "[&PRMuleName]" -eq "undefined"|BuildMissingPermissionMuleInfo --?"[*O:[&PRMuleID]:character:archived]" -eq "true"|&PRMuleFlags;+ (archived mule) --?"[*O:[&PRMuleID]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|&PRMuleFlags;+ (2024 sheet) --&PRIsSBM|0 --?"[&PRMuleName]" -imatch "^SBM_"|&PRIsSBM;1 --?"[&PRIsSBM]" -ne "1"|&PRMuleFlags;+ (not SBM_) --&PRMuleDisplay|[&PRMuleName] --~PRMuleDisplay|string;replaceall;SBM_;;[&PRMuleDisplay] --<| --:BuildMissingPermissionMuleInfo| --&PRMuleDisplay| --&PRMuleFlags| --?"[&PRRepairKey]" -eq "" -or "[&PRRepairKey]" -eq "undefined"|< -->CleanMissingPermissionMuleID|[&PRRepairKey];[&PRMuleID] --<| --:CleanMissingPermissionMuleID|SettingsKey;MuleID --&RMKey|[%1%] --&RMID|[%2%] --~RMKey|string;trim;[&RMKey] --~RMID|string;trim;[&RMID] --?"[&RMKey]" -eq "" -or "[&RMKey]" -eq "undefined" -or "[&RMID]" -eq "" -or "[&RMID]" -eq "undefined"|< --&RMString1|[&SBMR] --&RMNeedle|!q![&RMKey]!q!:!q! --?"[&RMString1]" -ninc "[&RMNeedle]"|< --~RMString2|string;after;[&RMNeedle];[&RMString1] --?"[&RMString2]" -eq ""|< --~RMString3|string;before;[&RMString2];[&RMString1] --~RMData|string;before;!q!;[&RMString2] --~RMStringTail|string;after;!q!;[&RMString2] --&RMEntry|[&RMID], --?"[&RMData]" -ninc "[&RMEntry]"|< --~RMNewData|string;replaceall;[&RMEntry];;[&RMData] --&SBMR|[&RMString3][&RMNewData]!q![&RMStringTail] --h:SBMSettings("[&RMKey]")|[&RMNewData] --=PRRemovedMissingCount|[$PRRemovedMissingCount.Raw] + 1 --&PRRemovedMissingReport|+[br]• [&PRCleanupContext] --<| --:EnsureSBMBackupHandout| --?"[&SBMBHID]" -ne "" -and "[&SBMBHID]" -ne "undefined"|< --~|array;objects:handout;SBMBackupHandoutIDs;[&SBMBHN] --?"[@SBMBackupHandoutIDs(maxindex)]" -eq "-1"|[ --!oh:SBMBHID|name:"[&SBMBHN]"|gmnotes:""|notes:"Spell Book Manager manual and automatic settings backups."|archived:true --]| --?"[@SBMBackupHandoutIDs(maxindex)]" -ne "-1"|&SBMBHID;[@SBMBackupHandoutIDs(0)] --<| --:LoadSBMBackupStore| -->EnsureSBMBackupHandout| --&SBMBRaw|[*O:[&SBMBHID]:handout:gmnotes] --?"[&SBMBRaw]" -eq "undefined"|&SBMBRaw; --&SBMBManualDate| --&SBMBManualData| --&SBMBAutoList| --?"[&SBMBRaw]" -ninc "!SBMB_MANUAL_START!" -or "[&SBMBRaw]" -ninc "!SBMB_MANUAL_DATA!" -or "[&SBMBRaw]" -ninc "!SBMB_MANUAL_END!"|SkipSBMBManualLoad --~SBMBWork|string;after;!SBMB_MANUAL_START!;[&SBMBRaw] --~SBMBManualDate|string;before;!SBMB_MANUAL_DATA!;[&SBMBWork] --~SBMBWork|string;after;!SBMB_MANUAL_DATA!;[&SBMBWork] --~SBMBManualData|string;before;!SBMB_MANUAL_END!;[&SBMBWork] --:SkipSBMBManualLoad| --?"[&SBMBRaw]" -ninc "!SBMB_AUTO_START!" -or "[&SBMBRaw]" -ninc "!SBMB_AUTO_END!"|SkipSBMBAutoLoad --~SBMBAutoWork|string;after;!SBMB_AUTO_START!;[&SBMBRaw] --~SBMBAutoList|string;before;!SBMB_AUTO_END!;[&SBMBAutoWork] --:SkipSBMBAutoLoad| --<| --:WriteSBMBackupStore| --&SBMBOut| --?"[&SBMBManualData]" -ne "" -and "[&SBMBManualData]" -ne "undefined"|[ --&SBMBOut|+!SBMB_MANUAL_START![&SBMBManualDate]!SBMB_MANUAL_DATA![&SBMBManualData]!SBMB_MANUAL_END! --]| --&SBMBOut|+!SBMB_AUTO_START![&SBMBAutoList]!SBMB_AUTO_END! --!h:[&SBMBHID]|gmnotes:"[&SBMBOut]" --<| --:CreateSBMManualBackup| -->LoadSBMBackupStore| --~SBMBStamp|system;date;getdatetime --&SBMBManualDate|[&SBMBStamp] --&SBMBManualData|[*O:[&SBMHID]:handout:gmnotes] --?"[&SBMBManualData]" -eq "" -or "[&SBMBManualData]" -eq "undefined"|[ --&SBMBManualData|[&SBMR] --]| -->WriteSBMBackupStore| --<| --:CreateSBMAutoBackup| --?"[&SBMAutoSource]" -eq "" -or "[&SBMAutoSource]" -eq "undefined"|< --?"[&SBMAutoSource]" -ninc "!$!" -or "[&SBMAutoSource]" -ninc "!%!"|< -->LoadSBMBackupStore| --~SBMBStamp|system;date;getdatetime --&SBMBNewAutoList|!SBMB_ENTRY![&SBMBStamp]!SBMB_DATA![&SBMAutoSource] --~|array;fromstring;SBMOldAutoEntries;!SBMB_ENTRY!;[&SBMBAutoList] --=SBMBAutoKeep|0 --%SBMBKeepAutoLoop|foreach;SBMOldAutoEntries --&SBMOldAutoEntry|[&SBMBKeepAutoLoop] --?"[&SBMOldAutoEntry]" -eq "" -or "[&SBMOldAutoEntry]" -eq "undefined"|% --?"[&SBMOldAutoEntry]" -ninc "!SBMB_DATA!"|% --?[$SBMBAutoKeep.Raw] -ge 9|% --&SBMBNewAutoList|+!SBMB_ENTRY![&SBMOldAutoEntry] --=SBMBAutoKeep|[$SBMBAutoKeep.Raw] + 1 --%| --&SBMBAutoList|[&SBMBNewAutoList] -->WriteSBMBackupStore| --<| --:WriteSBMSettings|BackupMode --?"[%1%]" -ne "AUTO"|SkipSBMSettingsAutoBackup --&SBMAutoSource|[*O:[&SBMHID]:handout:gmnotes] --?"[&SBMAutoSource]" -eq "" -or "[&SBMAutoSource]" -eq "undefined" -or "[&SBMAutoSource]" -eq "[&SBMR]"|SkipSBMSettingsAutoBackup -->CreateSBMAutoBackup| --:SkipSBMSettingsAutoBackup| --!h:[&SBMHID]|gmnotes:"[&SBMR]" --<| --:SBMSettingsBackup| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect -->LoadSBMBackupStore| --&BackButton|[&BackBtn]SBMSettings;CharacterSelect[/rbutton] --&SettingsButton|[&SettingsBtn]SBMSettingsBackup[/rbutton] -->OpenSBMCard|Settings Backup / Restore --&CardHTML|+[&CTR]Manual backup saves the current GM settings on demand. Auto-backups are created before GM settings changes and keep the last ten settings states. Theme changes are not included.[/td][/tr] --&ManualBackupStatus|No manual backup saved. --?"[&SBMBManualData]" -ne "" -and "[&SBMBManualData]" -ne "undefined"|[ --&ManualBackupStatus|[&SBMBManualDate] --]| --&CardHTML|+[&CSR]Manual Backup[/td][/tr] --&CardHTML|+[&CTR]Current manual backup: [b][&ManualBackupStatus][/b][br][rbutton]Create / Replace Manual Backup::SBMCreateManualBackup;START[/rbutton][/td][/tr] --&CardHTML|+[&CSR]Restore Backup[/td][/tr] --=SBMBackupRestoreCount|0 --?"[&SBMBManualData]" -ne "" -and "[&SBMBManualData]" -ne "undefined"|[ --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&OddRowBG];'][rbutton]Manual Backup - [&SBMBManualDate]::SBMRestoreBackup;MANUAL[/rbutton][/td][/tr] --=SBMBackupRestoreCount|[$SBMBackupRestoreCount.Raw] + 1 --]| --~|array;fromstring;SBMBackupAutoEntries;!SBMB_ENTRY!;[&SBMBAutoList] --=SBMBackupAutoIndex|0 --%SBMBackupDisplayLoop|foreach;SBMBackupAutoEntries --&SBMBackupAutoEntry|[&SBMBackupDisplayLoop] --?"[&SBMBackupAutoEntry]" -eq "" -or "[&SBMBackupAutoEntry]" -eq "undefined"|% --?"[&SBMBackupAutoEntry]" -ninc "!SBMB_DATA!"|% --~SBMBackupAutoDate|string;before;!SBMB_DATA!;[&SBMBackupAutoEntry] --=SBMBackupAutoIndex|[$SBMBackupAutoIndex.Raw] + 1 --?[$SBMBackupAutoIndex.Raw] -gt 10|% --&SBMBackupRowBG|[&OddRowBG] --?"[= [$SBMBackupRestoreCount.Raw] % 2 ]" -eq "1"|&SBMBackupRowBG;[&EvenRowBG] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&SBMBackupRowBG];'][rbutton]Auto Backup [$SBMBackupAutoIndex.Raw] - [&SBMBackupAutoDate]::SBMRestoreBackup;AUTO!@![$SBMBackupAutoIndex.Raw][/rbutton][/td][/tr] --=SBMBackupRestoreCount|[$SBMBackupRestoreCount.Raw] + 1 --%| --?[$SBMBackupRestoreCount.Raw] -eq 0|[ --&CardHTML|+[&CTR]No restorable backups were found.[/td][/tr] --]| -->ShowSBMCard| --X| --:SBMCreateManualBackup| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect -->CreateSBMManualBackup| --&BackButton|[&BackBtn]SBMSettingsBackup;START[/rbutton] --&SettingsButton|[&SettingsBtn]SBMSettingsBackup[/rbutton] -->OpenSBMCard|Settings Backup --&CardHTML|+[&CTR]Manual settings backup created successfully.[/td][/tr] --&CardHTML|+[&CSR]Next Step[/td][/tr] --&CardHTML|+[&CTR][rbutton]Back to Backup / Restore::SBMSettingsBackup;START[/rbutton][/td][/tr] -->ShowSBMCard| --X| --:SBMRestoreBackup| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect -->LoadSBMBackupStore| --&RestoreSlot|[&reentryval] --&RestoreRaw| --&RestoreLabel|Selected backup --?"[&RestoreSlot]" -eq "MANUAL"|[ --&RestoreRaw|[&SBMBManualData] --&RestoreLabel|Manual Backup --]| --?"[&RestoreSlot]" -ninc "AUTO!@!"|AfterRestoreAutoLookup --~RestoreSlotInfo|string;split;!@!;[&RestoreSlot] --=RestoreAutoIndex|0 --~|array;fromstring;SBMRestoreAutoEntries;!SBMB_ENTRY!;[&SBMBAutoList] --%SBMRestoreAutoLoop|foreach;SBMRestoreAutoEntries --&RestoreAutoEntry|[&SBMRestoreAutoLoop] --?"[&RestoreAutoEntry]" -eq "" -or "[&RestoreAutoEntry]" -eq "undefined"|% --?"[&RestoreAutoEntry]" -ninc "!SBMB_DATA!"|% --=RestoreAutoIndex|[$RestoreAutoIndex.Raw] + 1 --?"[$RestoreAutoIndex.Raw]" -ne "[&RestoreSlotInfo2]"|% --~RestoreRaw|string;after;!SBMB_DATA!;[&RestoreAutoEntry] --&RestoreLabel|Auto Backup [&RestoreSlotInfo2] --%| --:AfterRestoreAutoLookup| --?"[&RestoreRaw]" -eq "" -or "[&RestoreRaw]" -eq "undefined" -or "[&RestoreRaw]" -ninc "!$!" -or "[&RestoreRaw]" -ninc "!%!"|SBMRestoreBackupInvalid --?"[&RestoreRaw]" -ninc "!q!customclasses!q!:!q!"|SBMRestoreBackupInvalid --%SBMRestoreClassCheck|foreach;SBMClassList --?"[&RestoreRaw]" -ninc "!q![&SBMRestoreClassCheck]!q!:!q!"|SBMRestoreBackupInvalid --%| --&SBMAutoSource|[*O:[&SBMHID]:handout:gmnotes] -->CreateSBMAutoBackup| --&SBMR|[&RestoreRaw] -->WriteSBMSettings|NOAUTO -->ParseSBMSettings| --&BackButton|[&BackBtn]SBMSettingsBackup;START[/rbutton] --&SettingsButton|[&SettingsBtn]SBMSettingsBackup[/rbutton] -->OpenSBMCard|Settings Restore --&CardHTML|+[&CTR][&RestoreLabel] restored successfully.[br]The previous current settings were saved as the newest auto-backup before restore.[/td][/tr] --&CardHTML|+[&CSR]Next Step[/td][/tr] --&CardHTML|+[&CTR][rbutton]Back to Backup / Restore::SBMSettingsBackup;START[/rbutton][/td][/tr] -->ShowSBMCard| --X| --:SBMRestoreBackupInvalid| --&BackButton|[&BackBtn]SBMSettingsBackup;START[/rbutton] --&SettingsButton|[&SettingsBtn]SBMSettingsBackup[/rbutton] -->OpenSBMCard|Settings Restore Failed --&CardHTML|+[&CTR]The selected backup is missing required settings markers or default class keys, so it was not restored.[/td][/tr] --&CardHTML|+[&CSR]Next Step[/td][/tr] --&CardHTML|+[&CTR][rbutton]Back to Backup / Restore::SBMSettingsBackup;START[/rbutton][/td][/tr] -->ShowSBMCard| --X| --:EnsureSBMDocumentationHandout| --?"[&SendingPlayerIsGM]" -ne "1"|< --&SBMDHN|Spell Book Manager Documentation --~|array;objects:handout;SBMDocHandoutIDs;[&SBMDHN] --?"[@SBMDocHandoutIDs(maxindex)]" -ne "-1"|< --&SBMDocNotes|[t [&SDO]][tr][td [&SDOC]][t [&SDT]][tr][td [&SDTi]]Spell Book Manager Guide[/td][/tr] --&SBMDocNotes|+[tr][td [&SDS]]A compact in-game guide for players and GMs.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]What Spell Book Manager Does[/b][/td][/tr][tr][td [&SDTx]]Spell Book Manager is a ScriptCards utility for Roll20 games using the official D&D 5E 2014 character sheet. It lets the GM maintain approved spell source characters and lets players copy those spells onto their own character sheets.[br]It can also manage assigned spell book characters, copy spells between spell mules, add spells to NPC sheets, move existing leveled spells between spell levels, and display formatted spell descriptions in player handouts.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Required Setup[/b][/td][/tr][tr][td [&SDTx]]The game needs ScriptCards installed, a Roll20 Pro game with Mod/API access, the official D&D 5E 2014 by Roll20 sheet, and one or more spell mule characters whose names begin with SBM_.[br]Spell Book Manager is installed as a Roll20 macro. The GM should paste the full Spell_Book_Manager.scard text into a macro, preferably as plain text.[br]On first run, the script creates the settings handout and the current player's Spell Book Manager handout. Player handouts are used for spell descriptions. The settings handout stores GM configuration.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Spell Mule Characters[/b][/td][/tr][tr][td [&SDTx]]A spell mule is a normal Roll20 character sheet with a name beginning with SBM_. Examples include SBM_Wizard Spells, SBM_Cleric Spells, SBM_Xanathar Spells, or SBM_Gandalf's Spellbook.[br]Put spells on the spell mule as normal spell rows at the correct spell level. Spell Book Manager reads those spell rows and offers them through the menus based on GM assignments.[br]SBM_ spell mules can be class spell mules, character-specific spell mules, assigned spell books, Copy Between Mules sources or destinations, and NPC Spell Manager sources. The SBM_ prefix is only used so the script can identify spell source characters and is removed from most button display names.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Basic Player Use[/b][/td][/tr][tr][td [&SDTx]]Players run the Spell Book Manager macro from the macro bar or collections tab. If the player controls one valid character, that character opens automatically. If the player controls more than one valid character, the player chooses which character to manage.[br]For most characters, the script opens directly to the spell list. Click Copy to Character beside a spell to copy it to the selected character sheet. Click the 🕮 spell description button beside a spell to write that spell's formatted description to the player's Spell Book Manager handout.[br]If a spell with the same name is already on the destination sheet, Spell Book Manager marks it as Already Known instead of offering another copy button. Refreshing the list may be needed after copying.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Spell Lists[/b][/td][/tr][tr][td [&SDTx]]Spell availability normally comes from class spell mules assigned by the GM and character-specific spell mules assigned by the GM. If more than one spell source is available, users can choose All Spells or a specific spell mule.[br]Spells are grouped by spell level and sorted alphabetically. If multiple assigned mules contain a spell with the same name at the same level, the spell is shown only once.[br]When a spell is copied, the script copies the full spell row and preserves important spell text fields such as name, description, and At Higher Levels text.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Assigned Spell Books[/b][/td][/tr][tr][td [&SDTx]]A character can have one assigned spell book. This should be an SBM_ character used as that character's personal spell book, preparation list, research list, or curated collection.[br]When a character has an assigned spell book, Copy to Spell Book copies approved spells into that assigned spell book. Choose Spells then copies from the assigned spell book onto the actual character sheet.[br]This supports wizard-style workflows where a player maintains a separate spell book and only copies prepared or selected spells onto the playable character sheet. Assigned spell books are still character sheets and count toward Roll20 sheet size and performance like any other spell mule.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Move Spells[/b][/td][/tr][tr][td [&SDTx]]Move Spells lets existing leveled spells be moved up or down one spell level on the same character sheet. This is mainly for Warlocks or other cases where a spell needs to live at a different slot level.[br]Cantrips cannot be moved. Level 1 spells cannot move down. Level 9 spells cannot move up. Non-GM players normally see Move Spells only for Warlocks. GMs can access move mode for any valid PC.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]GM Main Card[/b][/td][/tr][tr][td [&SDTx]]The GM main card is the setup hub. From there the GM can manage player characters, open settings, use NPC Spell Manager, and use Copy Between Mules.[br]When the GM clicks a player character, the GM gets the full character management card for that character. This lets the GM use the same Choose Spells, Move Spells, and Copy to Spell Book tools the character can use, with GM permissions.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]GM Settings[/b][/td][/tr][tr][td [&SDTx]]GM Settings controls class spell mule assignments, character-specific spell mule assignments, character spell book assignments, custom classes, themes, diagnostics, and settings backups.[br]Player settings only include theme selection. Only the GM sees class mule, character mule, spell book assignment, custom class management, diagnostics, and backup controls.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Class Spell Mules[/b][/td][/tr][tr][td [&SDTx]]Class Spell Mules are the normal way to give a class access to a spell list. In GM Settings, choose a class, then click an unassigned spell mule to assign it or an assigned spell mule to remove it.[br]Characters inherit spell mules from matching class names and multiclass fields on their sheet. Custom classes can also be used for subclass or homebrew matching.[br]After assigning or removing a class spell mule, use the current card's back button before choosing another class. Do not scroll up and reuse older class menus in chat. Large spell mule lists use 0-9 and A-Z navigation so the GM does not need to scroll every SBM_ character at once.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Character Assignments[/b][/td][/tr][tr][td [&SDTx]]Character Assignments let the GM adjust spell access for one specific player character. The GM can add extra mules, block inherited class mules, remove added mules, unblock blocked mules, or assign one spell book.[br]Only valid player characters are shown. NPCs, SBM_ spell mules, and ScriptCards mule characters are filtered out. Characters controlled by All Players may not appear for character-specific assignment workflows.[br]Assigned spell books are kept out of normal available spell mule lists so they are not accidentally assigned as shared spell sources.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Custom Classes[/b][/td][/tr][tr][td [&SDTx]]Custom classes let the GM add sheet class or subclass names that are not part of the default class list. If a custom class matches a character's class or subclass name, that character can inherit the assigned mules for that custom class.[br]For example, a custom class named Eldritch Knight can be assigned its own spell mule and then match characters with Eldritch Knight as their subclass.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Copy Between Mules[/b][/td][/tr][tr][td [&SDTx]]Copy Between Mules is a GM-only tool that copies selected spells from one active SBM_ spell mule to another. Choose a destination mule, choose a source mule, then click Copy to Mule beside the spells to copy.[br]The source picker excludes the already-selected destination mule so the GM does not accidentally copy a mule into itself. This is useful for building smaller campaign, subclass, sourcebook, or player-specific spell mules from larger ones.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]NPC Spell Manager[/b][/td][/tr][tr][td [&SDTx]]NPC Spell Manager is a GM-only tool that copies spells from active SBM_ spell mules onto NPC sheets. Choose an NPC, choose a spell mule, then click Copy to Character beside spells to add.[br]When a spell is copied to an NPC, Spell Book Manager enables the NPC spellcasting flag if needed so the spell section can appear on the NPC sheet. NPC Spell Manager is separate from player character assignment settings and does not use class assignments.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Settings Backup and Restore[/b][/td][/tr][tr][td [&SDTx]]Settings Backup / Restore is in GM Settings. Manual backup saves the current GM settings on demand. Auto-backups are created before GM settings changes and keep recent settings states.[br]Theme changes are not included in settings backups. Restoring a backup saves the current settings as a new auto-backup before applying the restored settings.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Themes[/b][/td][/tr][tr][td [&SDTx]]Spell Book Manager includes multiple visual themes. Theme selection is stored per user, so players can choose their own display theme without changing the theme for other users.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Performance Notes[/b][/td][/tr][tr][td [&SDTx]]Avoid creating one giant spell mule with every spell in the game. Split large spell libraries into smaller SBM_ spell mules such as class-based, sourcebook-based, subclass-based, campaign-specific, or player-specific mules.[br]Very large character sheets can make Roll20 slower or less reliable. This includes player characters, NPCs, spell mule characters, and assigned spell book characters.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Important Notes[/b][/td][/tr][tr][td [&SDTx]]Only one GM should edit Spell Book Manager settings at a time. Settings are stored in a shared handout, and simultaneous writes can overwrite or confuse each other.[br]Do not manually edit the GM Notes of Spell Book Manager settings handouts unless intentionally repairing or resetting stored data. Do not delete the settings handout unless resetting all settings.[br]Do not reuse old menu cards in chat after changing settings. Use the current card or navigate back through the current menu so the script receives the correct selection. If Roll20 does not jump to the newest menu after a button click, scroll to the bottom of chat manually.[/td][/tr] --&SBMDocNotes|+[tr][td [&SDSe]][b]Troubleshooting[/b][/td][/tr][tr][td [&SDTx]][b]No characters appear:[/b]  Make sure the character is a PC, not an NPC, and that it is controlled by the player. NPCs, SBM_ spell mules, and ScriptCards mule characters are excluded from the normal picker.[br][b]No spell mules are assigned:[/b]  Open Settings as GM and assign one or more SBM_ spell mules to the character's class or directly to the character.[br][b]A spell mule does not appear:[/b]  Make sure its character name begins with SBM_. If it is assigned as a character spell book, it is intentionally removed from normal available mule lists.[br][b]The spell list only shows the assigned spell book:[/b]  This is expected if the character has a spell book assigned. Use Copy to Spell Book to add approved spells into the spell book first.[br][b]Copy to Spell Book does not appear:[/b]  The selected character does not have an assigned spell book. Open Character Assignments in GM Settings and assign one SBM_ character under Spell Book Assignment.[br][b]NPC Spell Manager does not list an NPC:[/b]  Make sure the NPC is using the official D&D 5E 2014 NPC sheet.[br][b]Class selection acts like it chose the wrong class:[/b]  Use the current back button after assigning or removing a class mule. Do not scroll up to an older class list and click from there.[/td][/tr] --&SBMDocNotes|+[/t][/td][/tr][/t] --!oh:SBMDHID|name:"[&SBMDHN]"|notes:"[&SBMDocNotes]"|inplayerjournals:"all" --<| --:LoadSBMSettings| --?"[&SBMHID]" -eq "" -or "[&SBMHID]" -eq "undefined"|[ --~|array;objects:handout;SBMSettingsHandoutIDs;[&SBMHN] --&SBMHID|[@SBMSettingsHandoutIDs(0)] --]| --&SBMDef|!$!!q!customclasses!q!:!q!!q! --%SBMDefaultClassLoop|foreach;SBMClassList --&SBMDef|+,!q![&SBMDefaultClassLoop]!q!:!q!!q! --%| --&SBMDef|+!%! --&SBMR|[*O:[&SBMHID]:handout:gmnotes] --?"[&SBMR]" -eq "" -or "[&SBMR]" -eq "undefined" -or "[&SBMR]" -ninc "!$!" -or "[&SBMR]" -ninc "!%!"|LoadSBMSettingsDefault --?"[&SBMR]" -ninc "!q!customclasses!q!:!q!"|LoadSBMSettingsDefault --%SBMSettingsClassCheck|foreach;SBMClassList --?"[&SBMR]" -ninc "!q![&SBMSettingsClassCheck]!q!:!q!"|LoadSBMSettingsDefault --%| --<| --:LoadSBMSettingsDefault| --&SBMR|[&SBMDef] -->WriteSBMSettings|NOAUTO --<| --:ParseSBMSettings| --&SBMJ|[&SBMR] --~SBMJ|string;replaceall;!$!;;[&SBMJ] --~SBMJ|string;replaceall;!%!;;[&SBMJ] --&DQ|" --~SBMJ|string;replaceall;!q!;[&DQ];[&SBMJ] --&SBMJ|{[&SBMJ]} --~|hash;fromjson;SBMSettings;[&SBMJ] --&SBMCC|[:SBMSettings("customclasses")] --~|array;fromstring;SBMCustomClassList;,;[&SBMCC] --%SBMCustomClassLoop|foreach;SBMCustomClassList --&CCName|[&SBMCustomClassLoop] --~CCName|string;trim;[&CCName] --~CCName|string;tolowercase;[&CCName] --?"[&CCName]" -eq "" -or "[&CCName]" -eq "undefined"|% --~CustomClassIndex|array;indexof;SBMClassList;[&CCName] --?"[&CustomClassIndex]" -eq "ArrayError"|[ --~|array;add;SBMClassList;[&CCName] --]| --%| --<| --:LoadSBMPlayerTheme| --&SBMPTR|[*O:[&SDHID]:handout:gmnotes] --&SBMPTN|!q!theme!q!:!q! --?"[&SBMPTR]" -eq "" -or "[&SBMPTR]" -eq "undefined" -or "[&SBMPTR]" -ninc "[&SBMPTN]"|LoadSBMPlayerThemeDefault --~SBMPlayerThemeData|string;after;[&SBMPTN];[&SBMPTR] --~SBMPT|string;before;!q!;[&SBMPlayerThemeData] --~SBMPlayerThemeIndex|array;indexof;SBMThemeList;[&SBMPT] --?"[&SBMPlayerThemeIndex]" -eq "ArrayError"|LoadSBMPlayerThemeDefault --^LoadSBMPlayerThemeDone| --:LoadSBMPlayerThemeDefault| --&SBMPT|2014 --&SBMPTR|!$!!q!theme!q!:!q!2014!q!!%! --!h:[&SDHID]|gmnotes:"[&SBMPTR]" --:LoadSBMPlayerThemeDone| --h:SBMSettings("theme")|[&SBMPT] --<| --:ApplySBMTheme| --#tableborder|0px solid transparent; --#tableshadow|0px 0px 0px 0px transparent; --#bodyfontsize|14px --#buttonpadding|2px 6px --#buttonwidth|auto --&FHA|Helvetica, Arial, sans-serif --&FCA|Candal, Arial, sans-serif --&FCO|Contrail One, Arial, sans-serif --&FGE|Georgia, serif --h:SBMThemeData("2014")|2014!@!Georgia, Times New Roman, serif!@![&FHA]!@!serif!@!bold!@!0.03em!@!small-caps!@!none!@!#58180D!@!#5B3924!@!#000000!@!transparent!@!#C9AD6A!@!#58180D!@!#FDF1DC!@!transparent!@!#D4DBAE!@!#58180D!@!#FDF1DC!@!#C9AD6A!@!normal!@!18px!@!#C9AD6A!@!#C9AD6A!@!14px!@!14px --h:SBMThemeData("r20 2024")|R20 2024!@!Proxima Nova, Helvetica, sans-serif!@!Proxima Nova, Helvetica, sans-serif!@!modesto-text, [&FGE]!@!normal!@!normal!@!normal!@!uppercase!@!#eb9797!@!#999998!@!#e6e6e6!@!#000000!@!#555555!@!#000000!@!#eb9797!@!#000000!@!#242424!@!#1f1f1f!@!#eb9797!@!#555555!@!normal!@!16px!@!#3A1A1A!@!#3A1A1A!@!14px!@!13px --h:SBMThemeData("2024 core")|2024 Core!@!Georgia, Times New Roman, serif!@![&FHA]!@!Georgia, [&FGE]!@!bold!@!0.04em!@!normal!@!none!@!#421610!@!#6E6252!@!#000000!@!transparent!@!#C5B880!@!#421610!@!#F3F3F7!@!transparent!@!#CDD8DE!@!#E8ECF5!@!#421610!@!#6E6252!@!normal!@!17px!@!#C5B880!@!#DFD1C8!@!14px --h:SBMThemeData("ad&d 2e")|AD&D 2E!@!Arial, Helvetica, sans-serif!@!Arial, Helvetica, sans-serif!@![&FCA]!@!normal!@!0.02em!@!normal!@!none!@!#1C407F!@!#6F6A5A!@!#1B1B16!@!#F5F4EB!@!#1C407F!@!#1C407F!@!#F5F4EB!@!#F5F4EB!@!#B4AEAB!@!#B6C9D7!@!#1B1B16!@!#1C407F!@!normal!@!15px!@!#B6C9D7!@!#B6C9D7!@!14px --h:SBMThemeData("2e revised")|2E Revised!@!Arial, Helvetica, sans-serif!@!Arial, Helvetica, sans-serif!@![&FCA]!@!normal!@!0.02em!@!normal!@!none!@!#E22044!@!#74316D!@!#000000!@!transparent!@!#74316D!@!#E22044!@!#FFFFFF!@!transparent!@!#D8D8DF!@!#74316D!@!#FFFFFF!@!#74316D!@!normal!@!15px!@!#E8E8ED!@!#E8E8ED!@!14px --h:SBMThemeData("d&d 3e")|D&D 3E!@!Times New Roman, Georgia, serif!@!Trebuchet MS, Verdana, Geneva, sans-serif!@!Times New Roman, Georgia, serif!@!bold!@!0.10em!@!normal!@!uppercase!@!#0A386A!@!#5B4631!@!#000000!@!#FFFFFF!@!#642224!@!#0A386A!@!#FFFFFF!@!transparent!@!#FFEFCA!@!#FFEFCA!@!#0A386A!@!#A78340!@!normal!@!12px!@!#D7C18A!@!#642224!@!14px --h:SBMThemeData("verdant")|Verdant!@!Palatino Linotype, Book Antiqua, Palatino, [&FGE]!@![&FHA]!@!Georgia, [&FGE]!@!bold!@!0.04em!@!normal!@!none!@!#1F3A20!@!#6A6B4D!@!#24331F!@!#E7E0C8!@!#7B8A45!@!#2F5A32!@!#F1E8BF!@!#E7E0C8!@!#D2BE96!@!#2F5A32!@!#F1E8BF!@!#7B8A45!@!normal!@!16px!@!#D6C79A!@!#C49B5A!@!14px --h:SBMThemeData("radiant")|Radiant!@!Palatino Linotype, Book Antiqua, Palatino, [&FGE]!@![&FCA]!@!Candal, [&FGE]!@!bold!@!0.04em!@!normal!@!none!@!#5F3B0A!@!#6D7476!@!#2B2415!@!#F7F5EF!@!#D6C08A!@!#C6A24A!@!#2B2415!@!#F7F5EF!@!#E6EBEE!@!#C6A24A!@!#2B2415!@!#8A6A1E!@!normal!@!14px!@!#DDE4E8!@!#B8C8D0!@!12px!@!13px --h:SBMThemeData("arcane")|Arcane!@!Palatino Linotype, Book Antiqua, Palatino, URW Palladio L, Noto Serif, DejaVu Serif, Georgia, serif!@![&FCO]!@!Contrail One, [&FGE]!@!bold!@!0.04em!@!normal!@!none!@!#C7BBFF!@!#B7B2D8!@!#E7E3FF!@!#0D1224!@!#5D5FEF!@!#33246B!@!#E7E3FF!@!#0D1224!@!#211A45!@!#302B63!@!#E7E3FF!@!#C7BBFF!@!normal!@!16px!@!#4A2E6B!@!#5D3A8A!@!14px --h:SBMThemeData("eldritch")|Eldritch!@!Garamond, Georgia, Times New Roman, serif!@![&FCA]!@!Candal, Garamond, [&FGE]!@!bold!@!0.04em!@!normal!@!none!@!#B24A6B!@!#9E7D95!@!#EAD7E7!@!#120812!@!#5A1E48!@!#3A1234!@!#F3DCA2!@!#120812!@!#2A1230!@!#3A1234!@!#F3DCA2!@!#B24A6B!@!normal!@!14px!@!#2E1730!@!#4A1A3D!@!12px --h:SBMThemeData("brasswork")|Brasswork!@!Trebuchet MS, Verdana, Geneva, sans-serif!@![&FCO]!@!Contrail One, Trebuchet MS, sans-serif!@!bold!@!0.05em!@!normal!@!none!@!#7A3F16!@!#667574!@!#1A1A18!@!#E8D8B8!@!#6F7F7F!@!#3D4544!@!#F1D28A!@!#E8D8B8!@!#D6C091!@!#3D4544!@!#F1D28A!@!#B87333!@!normal!@!16px!@!#DCC58F!@!#C29A55!@!14px --h:SBMThemeData("prismatic")|Prismatic!@!Trebuchet MS, Helvetica, sans-serif!@!Trebuchet MS, [&FHA]!@!Patrick Hand, Trebuchet MS, [&FHA]!@!bold!@!0.02em!@!normal!@!none!@!#FF8FA3!@!#C8A7C8!@!#F8E6FF!@!#1A0B24!@!#8E3A8C!@!#4B155D!@!#FFD6E0!@!#1A0B24!@!#3A1F52!@!#4B155D!@!#FFD6E0!@!#FF8FA3!@!normal!@!18px!@!#2D2B72!@!#5B1B75!@!14px!@!16px --&SBMTheme|[:SBMSettings("theme")] --?"[&SBMTheme]" -eq "" -or "[&SBMTheme]" -eq "undefined"|&SBMTheme;2014 --&SBMTC|[&SBMTheme] --~SBMTC|string;tolowercase;[&SBMTC] --?",2014,r20 2024,2024 core,ad&d 2e,2e revised,d&d 3e,verdant,radiant,arcane,eldritch,brasswork,prismatic," -ninc ",[&SBMTC],"|&SBMTC;2014 --&SBMThemePacked|[:SBMThemeData("[&SBMTC]")] --~SBMThemeSplit|string;split;!@!;[&SBMThemePacked] --&SBMTheme|[&SBMThemeSplit1] --&BFF|[&SBMThemeSplit2] --#buttonfontface|[&SBMThemeSplit3] --&TitleFont|font-family:[&SBMThemeSplit4]; font-weight:[&SBMThemeSplit5]; letter-spacing:[&SBMThemeSplit6]; font-variant:[&SBMThemeSplit7]; --&TTT|text-transform:[&SBMThemeSplit8]; --&DescRed|[&SBMThemeSplit9] --&DescGrey|[&SBMThemeSplit10] --&DescWhite|[&SBMThemeSplit11] --&DescBG|[&SBMThemeSplit12] --&DBor|[&SBMThemeSplit13] --&TitleBG|[&SBMThemeSplit14] --&TitleText|[&SBMThemeSplit15] --&OddRowBG|[&SBMThemeSplit16] --&EvenRowBG|[&SBMThemeSplit17] --#buttonfontsize|[&SBMThemeSplit25] --#buttonbackground|[&SBMThemeSplit18]; box-shadow:inset 0 0 0 1px [&SBMThemeSplit20] --#buttontextcolor|[&SBMThemeSplit19] --#buttonbordercolor|[&TitleBG] --#lineheight|[&SBMThemeSplit21] --&TFS|[&SBMThemeSplit22] --?"[&TFS]" -eq "" -or "[&TFS]" -eq "undefined"|&TFS;18px --&SHFS|[&SBMThemeSplit26] --?"[&SHFS]" -eq "" -or "[&SHFS]" -eq "undefined"|&SHFS;14px --&SectionBG|[&SBMThemeSplit23] --&SpellHeaderBG|[&SBMThemeSplit24] --?"[&SectionBG]" -eq "" -or "[&SectionBG]" -eq "undefined"|&SectionBG;[&EvenRowBG] --?"[&SpellHeaderBG]" -eq "" -or "[&SpellHeaderBG]" -eq "undefined"|&SpellHeaderBG;[&TitleBG] --#bodyfontface|[&BFF] --#tablebgcolor|transparent --#oddrowbackground|transparent --#evenrowbackground|transparent --#oddrowfontcolor|[&DescWhite] --#evenrowfontcolor|[&DescWhite] --&CRP|2px 3px --&B0|border:none; --&RP|padding:[&CRP]; --&CW|color:[&DescWhite]; --&CR|color:[&DescRed]; --&TC|text-align:center; --&W6|font-weight:600; --&TF|border-collapse:collapse; table-layout:fixed; --&BGI| --?"[&SBMTC]" -eq "2014"|[ --&BGI|background-image:url("https://files.d20.io/images/105716505/oymO0pnVyLCv-tQDw2vddA/med.png"); background-size:100% 100%; background-position:center center; background-repeat:no-repeat; --]| --?"[&SBMTC]" -eq "2024 core"|[ --&BGI|background-image:radial-gradient(circle at 18% 12%,rgba(255,255,255,0.55) 0%,rgba(255,255,255,0) 38%),radial-gradient(circle at 82% 82%,rgba(224,221,216,0.42) 0%,rgba(224,221,216,0) 44%),linear-gradient(135deg,#F3F3F7 0%,#F1F1F1 34%,#EDEDED 68%,#E0DDD8 100%); background-color:#F1F1F1; background-size:100% 100%; --]| --?"[&SBMTC]" -eq "2e revised"|[ --&BGI|background-image:linear-gradient(135deg,#F6F2C9 0%,#F7E7D9 20%,#F2E4F2 38%,#E1EEF8 56%,#DDF3EB 74%,#F6F0CD 100%); background-color:#F8F6DF; background-size:100% 100%; --]| -->|style='width:100%; [&B0] [&TF]' --&GCS|width:33%; [&B0] [&RP] [&TC] --&MGCS|width:50%; [&B0] [&RP] [&TC] --&CardAppTitle|Spell Book Manager --&HomeButton|[rbutton:[&TitleText]:[&TitleBG]:16px][F:Arial Black:20]⌂[/F]::CharacterSelect;BACK[/rbutton] --&BackIcon|⮜ --&SettingsIcon|⚙ --&BackBtn|[rbutton:[&TitleText]:[&TitleBG]:16px][F:Tahoma:16][&BackIcon][/F]:: --&SettingsBtn|[rbutton:[&TitleText]:[&TitleBG]:16px][F:Tahoma:16][&SettingsIcon][/F]::SBMSettings; --&NSMFText|No spell mule characters found. Create one or more character sheets with names beginning with SBM_ and run this settings page again. --&NoNPCSheetsText|No 2014 NPC sheets were found. --&NoRow|NoRepeatingAttributeLoaded --&TBD|[/td][td style='width:2px; min-width:2px; max-width:2px; height:28px; font-size:1px; line-height:28px; padding:0; vertical-align:middle; background-color:[&DescBG]; color:[&DescBG];'] [/td][td style='[&TC] width:30px; height:28px; font-size:18px; white-space:nowrap; padding:0; vertical-align:middle; background-color:[&TitleBG]; color:[&TitleText];'] --&CTBO|[t style='width:100%; [&TF] vertical-align:middle;'][tr style='height:28px; vertical-align:middle;'][td style='[&TC] width:28px; height:28px; font-size:18px; white-space:nowrap; padding:0; vertical-align:middle; background-color:[&TitleBG]; color:[&TitleText];'] --&CTBM|[/td][td style='width:2px; min-width:2px; max-width:2px; height:28px; font-size:1px; line-height:28px; padding:0; vertical-align:middle; background-color:[&DescBG]; color:[&DescBG];'] [/td][td style='[&TC] width:100%; height:28px; font-size:[&TFS]; border-left:0; border-right:0; padding:0 4px; vertical-align:middle; background-color:[&TitleBG]; color:[&TitleText]; [&TitleFont]; [&TTT]'] --&CTBR|[&TBD] --&CTBC|[/td][/tr][/t] --&CO|style='width:300px; position:relative; left:-30px; border:1px solid [&DBor]; border-radius:8px; border-collapse:separate; border-spacing:0; background-color:[&DescBG]; [&BGI] [&CW] overflow:hidden;' --&COC|style='[&B0] padding:10px 5px 4px 5px; background-color:[&DescBG];' --&CT|style='width:100%; [&B0] [&TF] background-color:[&DescBG]; [&CW]' --&CardOpen|[t [&CO]][tr][td [&COC]][t [&CT]] --&CardClose|[/t][/td][/tr][/t] --&CTi|style='width:100%; border:0; padding:10px 0 3px; [&CR] [&TitleFont]; font-size:20px; [&TTT]' --&CSH|style='border:0; border-radius:5px; padding:3px 4px; [&TC] background-color:[&TitleBG]; color:[&TitleText]; font-weight:bold; font-size:[&SHFS]; [&TitleFont]; [&TTT]' --&CSe|style='border:0; border-radius:5px; [&RP] [&TC] background-color:[&SectionBG]; [&CR] font-weight:bold; font-size:[&SHFS]; [&TitleFont]; [&TTT]' --&CTX|style='[&B0] [&RP] [&CW] [&W6]' --&CCe|style='[&B0] [&RP] [&CW] [&W6] [&TC]' --&RowEnd|[/td][/tr] --&CTiR|[tr][td [&CTi]] --&CSR|[tr][td [&CSe]] --&CTR|[tr][td [&CTX]] --&CCR|[tr][td [&CCe]] --&SHT|style='width:100%; table-layout:fixed; border:0; border-radius:5px; border-collapse:separate; border-spacing:0; background-color:[&SpellHeaderBG]; [&CW] overflow:hidden;' --&SHTd|style='width:25%; [&B0] text-align:left; [&RP] vertical-align:middle; [&CR] font-weight:bold;' --?"[&SBMTC]" -eq "d&d 3e"|[ --&SHT|style='width:100%; table-layout:fixed; border:0; border-radius:5px; border-collapse:separate; border-spacing:0; background-color:[&SpellHeaderBG]; color:#FFEFCA; overflow:hidden;' --&SHTd|style='width:25%; [&B0] text-align:left; [&RP] vertical-align:middle; color:#FFEFCA; font-weight:bold;' --]| --&SITd|style='width:24px; min-width:24px; [&B0] [&TC] white-space:nowrap; [&RP] [&CR]' --&SNTd|style='width:100%; [&B0] text-align:left; [&RP] vertical-align:middle; [&CW] font-weight:bold;' --?"[&SBMTC]" -eq "eldritch"|[ --&SNTd|style='width:100%; [&B0] text-align:left; [&RP] vertical-align:middle; [&CW] font-weight:bold; font-family:[&BFF]; font-size:15px;' --]| --&SATd|style='width:115px; min-width:115px; [&B0] text-align:right; white-space:nowrap; [&RP] [&CR]' --&DLP|6px --&SDO|style='width:100%; border:1px solid [&DBor]; border-radius:8px; border-collapse:separate; border-spacing:0; background-color:[&DescBG]; [&BGI] [&CW] font-family:[&BFF]; font-style:normal; overflow:hidden;' --&SDOC|style='[&B0] padding:10px 15px 4px 15px; background-color:[&DescBG];' --&SDT|[&CT] --&SDTi|style='width:100%; border:0; border-bottom:1px solid [&DBor]; padding:10px 6px 10px [&DLP]; text-align:left; background-color:[&TitleBG]; color:[&TitleText]; [&TitleFont]; font-size:20px; [&TTT]' --&SDF|15px --&SDB|[&B0] padding:0 6px 0 [&DLP]; text-align:left; font-size:[&SDF]; font-weight:normal; --&SDS|style='[&B0] padding:0 6px 0 [&DLP]; text-align:left; color:[&DescGrey]; font-size:[&SDF]; font-style:italic; font-weight:bold;' --&SDL|style='[&SDB] [&CR]' --&SDSe|style='[&B0] padding:4px 6px 0 [&DLP]; text-align:left; [&CR] font-size:[&SDF]; font-weight:normal;' --&SDTx|style='[&SDB] [&CW]' --<| --:SBMAddCustomClassPrompt| --&SBMRet|[&reentryval] --i;Click to Add Custom Class|q;NewCustomClass;Custom class name --^SBMAddCustomClass| --:SBMAddCustomClass| --&CCMode|ADD --&CCName|[&NewCustomClass] --^SBMModifyCustomClass| --:SBMRemoveCustomClass| --&CCMode|REMOVE --&CCName|[&reentryval] --:SBMModifyCustomClass| --~CCName|string;trim;[&CCName] --~CCName|string;tolowercase;[&CCName] --&DQ|" --~CCName|string;replaceall;,;;[&CCName] --~CCName|string;replaceall;!q!;;[&CCName] --~CCName|string;replaceall;!$!;;[&CCName] --~CCName|string;replaceall;!%!;;[&CCName] --~CCName|string;replaceall;[&DQ];;[&CCName] --?"[&CCName]" -eq "" -or "[&CCName]" -eq "undefined"|SBMSettings --&CCs|[:SBMSettings("customclasses")] --&CCEntry|[&CCName], --?"[&CCMode]" -eq "ADD"|[ --~ExistingClassIndex|array;indexof;SBMClassList;[&CCName] --?"[&ExistingClassIndex]" -ne "ArrayError"|SBMSettings --?"[&CCs]" -inc "[&CCEntry]"|SBMSettings --&NewCC|[&CCEntry][&CCs] --]| --?"[&CCMode]" -eq "REMOVE"|[ --~|array;fromstring;SBMRemoveCustomClassList;,;[&CCs] --&NewCC| --=ModifiedCustomClass|0 --%SBMRCL|foreach;SBMRemoveCustomClassList --&RCName|[&SBMRCL] --~RCName|string;trim;[&RCName] --~RCName|string;tolowercase;[&RCName] --?"[&RCName]" -eq "" -or "[&RCName]" -eq "undefined"|% --?"[&RCName]" -eq "[&CCName]"|=ModifiedCustomClass;1|&NewCC;+[&RCName], --%| --?[$ModifiedCustomClass.Raw] -eq 0|SBMSettings --]| --?"[&CCMode]" -ne "ADD" -and "[&CCMode]" -ne "REMOVE"|SBMSettings --&String1|[&SBMR] --&Needle|!q!customclasses!q!:!q! --?"[&String1]" -ninc "[&Needle]"|SBMModifyCustomClassStorageError --~String2|string;after;[&Needle];[&String1] --?"[&String2]" -eq ""|SBMModifyCustomClassStorageError --~String3|string;before;[&String2];[&String1] --~StringTail|string;after;!q!;[&String2] --&SBMR|[&String3][&NewCC]!q![&StringTail] --&ClNeedle|!q![&CCName]!q!:!q! --?"[&CCMode]" -eq "ADD" -and "[&SBMR]" -ninc "[&ClNeedle]"|[ --~StringBase|string;before;!%!;[&SBMR] --&SBMR|[&StringBase],!q![&CCName]!q!:!q!!q!!%! --]| --?"[&CCMode]" -eq "REMOVE" -and "[&SBMR]" -inc "[&ClNeedle]"|[ --~String2|string;after;[&ClNeedle];[&SBMR] --?"[&String2]" -eq ""|SBMModifyCustomClassStorageError --~String3|string;before;[&String2];[&SBMR] --~StringTail|string;after;!q!;[&String2] --&SBMR|[&String3]!q![&StringTail] --]| -->WriteSBMSettings|AUTO --h:SBMSettings("customclasses")|[&NewCC] --h:SBMSettings("[&CCName]")| --?"[&CCMode]" -eq "ADD"|[ --~|array;add;SBMClassList;[&CCName] --]| --?"[&CCMode]" -ne "REMOVE"|AfterRemoveCustomClassFromClassList --~RemoveClassIndex|array;indexof;SBMClassList;[&CCName] --?"[&RemoveClassIndex]" -eq "ArrayError"|AfterRemoveCustomClassFromClassList --~|array;removeat;SBMClassList;[&RemoveClassIndex] --:AfterRemoveCustomClassFromClassList| --^SBMSettings| --:SBMModifyCustomClassStorageError| --#hidecard|0 --&SBMR|[&SBMDef] -->WriteSBMSettings|AUTO --+Spell Book Manager Settings|The custom class settings text was invalid and has been reset. Open Settings again to add custom classes. --X| --:BASB| --&AssignedSpellBooks|, --~|array;objects:character;SBMSpellBookCharacters; --%SBMSpellBookLoop|foreach;SBMSpellBookCharacters --?"[*O:[&SBMSpellBookLoop]:character:archived]" -eq "true"|% --&SpellBookCheck|[:SBMSettings("char_[&SBMSpellBookLoop]_spellbook")] --?"[&SpellBookCheck]" -ne "" -and "[&SpellBookCheck]" -ne "undefined"|[ --~SpellBookCheckID|string;before;,;[&SpellBookCheck] --?"[*O:[&SpellBookCheckID]:character:archived]" -ne "true" -and "[&AssignedSpellBooks]" -ninc "[&SpellBookCheck]"|&AssignedSpellBooks;+[&SpellBookCheck] --]| --%| --<| --:SBMClassMules| --&MALMSM| --&MALL| --?"[&reentryval]" -inc "MAL!@!"|[ --~MALSP|string;split;!@!;[&reentryval] --&MALMSM|[&MALSP2] --&MALL|[&MALSP3] --]| --?"[&reentryval]" -ninc "MAL!@!" -and "[&SelClass]" -eq ""|&SelClass;[&reentryval] --?"[&reentryval]" -ninc "MAL!@!" -and "[&SelClass]" -eq "undefined"|&SelClass;[&reentryval] --&AMules|[:SBMSettings("[&SelClass]")] -->BASB| --~|array;objects:character;SBMAvailableMules;SBM_ --&BackButton|[&BackBtn]SBMSettings;[&SBMRet][/rbutton] --&SettingsButton|[&SettingsBtn]SBMClassMules[/rbutton] -->OpenSBMCard|[&SelClass(totitlecase)] Spell Mules --?"[@SBMAvailableMules(maxindex)]" -lt "0"|NoSBMMules -->AppendMuleSection|Unassigned Spell Mules;UNASSIGNED;class;No unassigned spell mules found. -->AppendMuleSection|Assigned Spell Mules;ASSIGNED;class;No assigned spell mules. --^AfterSBMMules| --:NoSBMMules| --&CardHTML|+[&CTR][&NSMFText][/td][/tr] --:AfterSBMMules| -->ShowSBMCard| --X| --:AppendMuleSection|SectionTitle;SectionMode;TLT;EmptyMessage --&MuleSectionTitle|[%1%] --&MSM|[%2%] --&MSTog|[%3%] --&MSET|[%4%] --?"[&MOM]" -eq "" -or "[&MOM]" -eq "undefined"|&MOM;character --&CardHTML|+[&CSR][&MuleSectionTitle][/td][/tr] --&MSA|0 --?"[&MSTog]" -eq "class" -and "[&MSM]" -eq "UNASSIGNED"|&MSA;1 --?"[&MSTog]" -eq "include" -and "[&MSM]" -eq "AVAILABLE"|&MSA;1 --?"[&MSTog]" -eq "spellbook" -and "[&MSM]" -eq "AVAILABLE"|&MSA;1 --?"[&MSA]" -eq "1"|AppendMuleSectionAlphaPath --=MuleSectionCount|0 --&MSO|[t [>]][tr] --%SBMMuleSectionLoop|foreach;SBMAvailableMules --&ME|[&SBMMuleSectionLoop], --?"[*O:[&SBMMuleSectionLoop]:character:archived]" -eq "true"|% --?"[*O:[&SBMMuleSectionLoop]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|% --&ShowMule|0 --?"[&MSTog]" -eq "class" -and "[&MSM]" -eq "UNASSIGNED" -and "[&AMules]" -ninc "[&ME]" -and "[&AssignedSpellBooks]" -ninc "[&ME]"|&ShowMule;1 --?"[&MSTog]" -eq "class" -and "[&MSM]" -eq "ASSIGNED" -and "[&AMules]" -inc "[&ME]"|&ShowMule;1 --?"[&MSTog]" -ne "class" -and "[&MSTog]" -ne "spellbook" -and "[&MSM]" -eq "AVAILABLE" -and "[&CIM]" -ninc "[&ME]" -and "[&IMules]" -ninc "[&ME]" -and "[&CEM]" -ninc "[&ME]" -and "[&AssignedSpellBooks]" -ninc "[&ME]"|&ShowMule;1 --?"[&MSTog]" -ne "class" -and "[&MSTog]" -ne "spellbook" -and "[&MSM]" -eq "ADDED" -and "[&CIM]" -inc "[&ME]"|&ShowMule;1 --?"[&MSTog]" -ne "class" -and "[&MSTog]" -ne "spellbook" -and "[&MSM]" -eq "INHERITED" -and "[&IMules]" -inc "[&ME]" -and "[&CEM]" -ninc "[&ME]"|&ShowMule;1 --?"[&MSTog]" -ne "class" -and "[&MSTog]" -ne "spellbook" -and "[&MSM]" -eq "BLOCKED" -and "[&CEM]" -inc "[&ME]"|&ShowMule;1 --?"[&MSTog]" -eq "spellbook" -and "[&MSM]" -eq "AVAILABLE" -and "[&CSB]" -eq ""|&ShowMule;1 --?"[&MSTog]" -eq "spellbook" -and "[&MSM]" -eq "ADDED" -and "[&CSB]" -inc "[&ME]"|&ShowMule;1 --?"[&ShowMule]" -eq "1"|[ --?"[= [$MuleSectionCount.Raw] % 2 ]" -eq "0" -and "[$MuleSectionCount.Raw]" -ne "0"|&MSO;+[/tr][tr] --&MBG|[&OddRowBG] --?"[= [$MuleSectionCount.Raw] \ 2 % 2 ]" -eq "1"|&MBG;[&EvenRowBG] --&MuleName|[*O:[&SBMMuleSectionLoop]:character:name] --~MuleName|string;replaceall;SBM_;;[&MuleName] --&MuleRemoveFlag|0 --?"[&MSTog]" -eq "class" -and "[&MSM]" -eq "ASSIGNED"|&MuleRemoveFlag;1 --?"[&MSTog]" -eq "include" -and "[&MSM]" -eq "ADDED"|&MuleRemoveFlag;1 --?"[&MSTog]" -eq "exclude" -and "[&MSM]" -eq "BLOCKED"|&MuleRemoveFlag;1 --?"[&MSTog]" -eq "spellbook" -and "[&MSM]" -eq "ADDED"|&MuleRemoveFlag;1 --?"[&MSTog]" -eq "class"|&MuleToggleData;class!@![&SelClass]!@![&SBMMuleSectionLoop] --?"[&MSTog]" -ne "class"|&MuleToggleData;[&MOM]!@![&SelectedChar]!@![&MSTog]!@![&SBMMuleSectionLoop] --&MSO|+[td style='[&MGCS] background-color:[&MBG];'][rbutton][?"[&MuleRemoveFlag]" -eq "1"|✕ |][&MuleName]::ToggleMule;[&MuleToggleData][/rbutton][/td] --=MuleSectionCount|[$MuleSectionCount.Raw] + 1 --]| --%| --?"[= [$MuleSectionCount.Raw] % 2 ]" -eq "1" -and "[&MSTog]" -ne "spellbook"|[ --&MSO|+[td style='[&MGCS] background-color:[&MBG]; color:[&MBG]; font-size:1px; line-height:1px;']X[/td] --]| --&MSO|+[/tr][/t] --?[$MuleSectionCount.Raw] -eq 0|[ --&CardHTML|+[&CTR][i][&MSET][/i][/td][/tr] --]| --?[$MuleSectionCount.Raw] -gt 0|[ --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&DescBG];'][&MSO][/td][/tr] --]| --^AfterMuleSection| --:AppendMuleSectionAlphaPath| --~|array;define;MASItems;dummy --~|array;removeat;MASItems;0 --&MASLetters|, --%MASLoop|foreach;SBMAvailableMules --&ME|[&MASLoop], --?"[*O:[&MASLoop]:character:archived]" -eq "true"|% --?"[*O:[&MASLoop]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|% --&ShowMule|0 --?"[&MSTog]" -eq "class" -and "[&MSM]" -eq "UNASSIGNED" -and "[&AMules]" -ninc "[&ME]" -and "[&AssignedSpellBooks]" -ninc "[&ME]"|&ShowMule;1 --?"[&MSTog]" -ne "class" -and "[&MSTog]" -ne "spellbook" -and "[&MSM]" -eq "AVAILABLE" -and "[&CIM]" -ninc "[&ME]" -and "[&IMules]" -ninc "[&ME]" -and "[&CEM]" -ninc "[&ME]" -and "[&AssignedSpellBooks]" -ninc "[&ME]"|&ShowMule;1 --?"[&MSTog]" -eq "spellbook" -and "[&MSM]" -eq "AVAILABLE" -and "[&CSB]" -eq ""|&ShowMule;1 --?"[&ShowMule]" -ne "1"|% --&MASName|[*O:[&MASLoop]:character:name] --~MASName|string;replaceall;SBM_;;[&MASName] --&MASL|[&MASName(0,1)] --~MASL|string;touppercase;[&MASL] --&MASItems(99999)|[&MASName]!@![&MASLoop]!@![&MASL] --?"[&MASLetters]" -ninc ",[&MASL],"|&MASLetters;+[&MASL], --%| --?"[@MASItems(maxindex)]" -lt "0"|EmptyMuleSection --~|array;sort;MASItems --~MASFirstSplit|string;split;!@!;[@MASItems(0)] --&MASDefaultLetter|[&MASFirstSplit3] --&MASAL|[&MALL] --?"[&MALMSM]" -ne "[&MSM]"|&MASAL;[&MASDefaultLetter] --?"[&MASAL]" -eq "" -or "[&MASAL]" -eq "undefined" -or "[&MASAL]" -eq "START" -or "[&MASAL]" -eq "BACK"|&MASAL;[&MASDefaultLetter] --~MASAL|string;touppercase;[&MASAL] --?"[&MASLetters]" -ninc ",[&MASAL],"|&MASAL;[&MASDefaultLetter] --=MuleSectionCount|0 --&MSO|[t [>]][tr] --%MASItemLoop|foreach;MASItems --~MASItemSplit|string;split;!@!;[&MASItemLoop] --&MuleName|[&MASItemSplit1] --&MASID|[&MASItemSplit2] --&MASL|[&MASItemSplit3] --?"[&MASL]" -nei "[&MASAL]"|% --?"[= [$MuleSectionCount.Raw] % 2 ]" -eq "0" -and "[$MuleSectionCount.Raw]" -ne "0"|&MSO;+[/tr][tr] --&MBG|[&OddRowBG] --?"[= [$MuleSectionCount.Raw] \ 2 % 2 ]" -eq "1"|&MBG;[&EvenRowBG] --?"[&MSTog]" -eq "class"|&MuleToggleData;class!@![&SelClass]!@![&MASID] --?"[&MSTog]" -ne "class"|&MuleToggleData;[&MOM]!@![&SelectedChar]!@![&MSTog]!@![&MASID] --&MSO|+[td style='[&MGCS] background-color:[&MBG];'][rbutton][&MuleName]::ToggleMule;[&MuleToggleData][/rbutton][/td] --=MuleSectionCount|[$MuleSectionCount.Raw] + 1 --%| --?"[= [$MuleSectionCount.Raw] % 2 ]" -eq "1"|[ --&MSO|+[td style='[&MGCS] background-color:[&MBG]; color:[&MBG]; font-size:1px; line-height:1px;']X[/td] --]| --&MSO|+[/tr][/t] --?[$MuleSectionCount.Raw] -eq 0|[ --&CardHTML|+[&CTR][i][&MSET][/i][/td][/tr] --]| --?[$MuleSectionCount.Raw] -gt 0|[ --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&DescBG];'][&MSO][/td][/tr] --]| --&MASPT|SBMCharacterMules --?"[&MSTog]" -eq "spellbook"|&MASPT;SBMCharacterSpellBook --?"[&MSTog]" -eq "class"|&MASPT;SBMClassMules -->AppendAlphaNav|MULE;[&MASLetters];[&MASAL];[&MASPT];[&MSM] --^AfterMuleSection| --:EmptyMuleSection| --&CardHTML|+[&CTR][i][&MSET][/i][/td][/tr] --:AfterMuleSection| --<| --:AppendAlphaNav|Mode;Letters;ActiveLetter;PageTarget;SectionMode --&ANM|[%1%] --&ANL|[%2%] --&ANA|[%3%] --&ANPT|[%4%] --&ANSM|[%5%] --?"[&ANSM]" -eq "undefined"|&ANSM; --~|array;define;ANAZ;0;1;2;3;4;5;6;7;8;9;A;B;C;D;E;F;G;H;I;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z --&ANCS|width:8.33%; [&B0] padding:1px 0px; [&TC] white-space:nowrap; --&ANO|[t [>]][tr] --=ANC|0 --%ANLoop|foreach;ANAZ --?"[&ANL]" -ninc ",[&ANLoop],"|% --?"[= [$ANC.Raw] % 12 ]" -eq "0" -and "[$ANC.Raw]" -ne "0"|&ANO;+[/tr][tr] --&ANData|[&ANLoop] --?"[&ANM]" -eq "MULE"|&ANData;MAL!@![&ANSM]!@![&ANLoop] --&ANLabel|[F:monospace:11][&ANLoop][/F] --&ANText|[rbutton][&ANLabel]::[&ANPT];[&ANData][/rbutton] --?"[&ANLoop]" -eq "[&ANA]"|&ANText;[b][&ANLabel][/b] --&ANO|+[td style='[&ANCS] background-color:[&OddRowBG];'][&ANText][/td] --=ANC|[$ANC.Raw] + 1 --%| --&ANO|+[/tr][/t] --?[$ANC.Raw] -gt 1|[ --&CardHTML|+[&CCR][&ANO][/td][/tr] --]| --<| --:SBMCharacterSelectMules| --&BackButton|[&BackBtn]SBMSettings;[&SBMRet][/rbutton] --&SettingsButton|[&SettingsBtn]SBMCharacterSelectMules[/rbutton] -->OpenSBMCard|Character Spell Mules --~|array;objects:character;SBMAvailableCharacters; --?"[@SBMAvailableCharacters(maxindex)]" -lt "0"|NoCharactersForMules --&CardHTML|+[&CSR]Choose Character[/td][/tr] --&ChCnt|0 --&ChOut|[t [>]][tr] --%SBMCharacterLoop|foreach;SBMAvailableCharacters --&ChName|[*O:[&SBMCharacterLoop]:character:name] --?"[&ChName]" -imatch "^SBM_" -or "[&ChName]" -imatch "^ScriptCards"|% --?"[*O:[&SBMCharacterLoop]:character:archived]" -eq "true"|% --?"[*O:[&SBMCharacterLoop]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|% --&ChClassCheck|[*[&SBMCharacterLoop]:class] [*[&SBMCharacterLoop]:custom_class] [*[&SBMCharacterLoop]:cust_classname] --~ChClassCheck|string;replaceall;undefined;;[&ChClassCheck] --~ChClassCheck|string;trim;[&ChClassCheck] --?"[&ChClassCheck]" -eq ""|% --?"[*[&SBMCharacterLoop]:npc]" -eq "1"|% --?"[= [&ChCnt] % 3 ]" -eq "0" -and "[&ChCnt]" -ne "0"|&ChOut;+[/tr][tr] --&ChBG|[&OddRowBG] --?"[= [&ChCnt] \ 3 % 2 ]" -eq "1"|&ChBG;[&EvenRowBG] --&ChOut|+[td style='[&GCS] background-color:[&ChBG];'][rbutton][&ChName]::SBMCharacterMules;[&SBMCharacterLoop][/rbutton][/td] --&ChCnt|[= [&ChCnt] + 1] --%| --&ChOut|+[/tr][/t] --&CardHTML|+[&CCR][&ChOut][/td][/tr] --?[$ChCnt.Raw] -eq 0|NoCharactersForMules --^AfterCharacterMuleSelect| --:NoCharactersForMules| --&CardHTML|+[&CTR]No player characters were found.[/td][/tr] --:AfterCharacterMuleSelect| -->ShowSBMCard| --X| --:BuildCharacterMuleLists|Character ID --&CMCID|[%1%] --&CIK|char_[&CMCID]_include --&CEK|char_[&CMCID]_exclude --&CBK|char_[&CMCID]_spellbook --&CIM|[:SBMSettings("[&CIK]")] --&CEM|[:SBMSettings("[&CEK]")] --&CSB|[:SBMSettings("[&CBK]")] --?"[&CIM]" -eq "undefined"|&CIM; --?"[&CEM]" -eq "undefined"|&CEM; --?"[&CSB]" -eq "undefined"|&CSB; --?"[&CSB]" -ne "" -and "[&CSB]" -ne "undefined"|[ --~CSBCheckID|string;before;,;[&CSB] --?"[*O:[&CSBCheckID]:character:archived]" -eq "true"|&CSB; --?"[*O:[&CSBCheckID]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|&CSB; --]| --&IMules|, --&ASMS|, --&CharacterClassText|[*[&CMCID]:class] [*[&CMCID]:subclass] [*[&CMCID]:cust_classname] --?"[*[&CMCID]:multiclass1_flag]" -eq "1"|&CharacterClassText;+ [*[&CMCID]:multiclass1] [*[&CMCID]:multiclass1_subclass] --?"[*[&CMCID]:multiclass2_flag]" -eq "1"|&CharacterClassText;+ [*[&CMCID]:multiclass2] [*[&CMCID]:multiclass2_subclass] --?"[*[&CMCID]:multiclass3_flag]" -eq "1"|&CharacterClassText;+ [*[&CMCID]:multiclass3] [*[&CMCID]:multiclass3_subclass] --~CharacterClassText|string;tolowercase;[&CharacterClassText] --%SBMCCL|foreach;SBMClassList --?"[&CharacterClassText]" -ninc "[&SBMCCL]"|NextCharacterClassLookup --&SBMClassMules|[:SBMSettings("[&SBMCCL]")] --~|array;fromstring;SBMClassMuleIDs;,;[&SBMClassMules] --%SBMCCML|foreach;SBMClassMuleIDs --?"[&SBMCCML]" -eq "" -or "[&SBMCCML]" -eq "undefined"|% --?"[*O:[&SBMCCML]:character:archived]" -eq "true"|% --?"[*O:[&SBMCCML]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|% --&SBMCCMN|[*O:[&SBMCCML]:character:name] --?"[&SBMCCMN]" -imatch "^SBM_" -and "[&IMules]" -ninc ",[&SBMCCML],"|&IMules;+[&SBMCCML], --?"[&SBMCCMN]" -imatch "^SBM_" -and "[&ASMS]" -ninc ",[&SBMCCML],"|&ASMS;+[&SBMCCML], --%| --:NextCharacterClassLookup| --%| --~|array;fromstring;SBMCharacterIncludeMuleIDs;,;[&CIM] --%SBMActiveDirectLoop|foreach;SBMCharacterIncludeMuleIDs --?"[&SBMActiveDirectLoop]" -eq "" -or "[&SBMActiveDirectLoop]" -eq "undefined"|% --?"[*O:[&SBMActiveDirectLoop]:character:archived]" -eq "true"|% --?"[*O:[&SBMActiveDirectLoop]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|% --&SBMActiveDirectMuleName|[*O:[&SBMActiveDirectLoop]:character:name] --?"[&SBMActiveDirectMuleName]" -imatch "^SBM_" -and "[&ASMS]" -ninc ",[&SBMActiveDirectLoop],"|&ASMS;+[&SBMActiveDirectLoop], --%| --~|array;fromstring;SBMCharacterExcludeMuleIDs;,;[&CEM] --%SBMCEL|foreach;SBMCharacterExcludeMuleIDs --&ExcludeEntry|[&SBMCEL], --?"[&SBMCEL]" -ne "" -and "[&SBMCEL]" -ne "undefined"|[ --~ASMS|string;replaceall;[&ExcludeEntry];;[&ASMS] --]| --%| --<| --:SBMCharacterMules| --?"[&reentryval]" -ninc "!@!" -and "[&reentryval]" -ne "BACK" -and "[&reentryval]" -ne "START"|&SelectedChar;[&reentryval] --&MALMSM| --&MALL| --?"[&reentryval]" -inc "MAL!@!"|[ --~MALSP|string;split;!@!;[&reentryval] --&MALMSM|[&MALSP2] --&MALL|[&MALSP3] --]| --?"[&SelectedChar]" -eq "" -or "[&SelectedChar]" -eq "undefined"|SBMCharacterSelectMules --&SelectedCharName|[*O:[&SelectedChar]:character:name] -->BuildCharacterMuleLists|[&SelectedChar] --&MOM|character --~|array;objects:character;SBMAvailableMules;SBM_ -->BASB| --&BackButton|[&BackBtn]SBMCharacterSelectMules;BACK[/rbutton] --&SettingsButton|[&SettingsBtn]SBMCharacterMules[/rbutton] -->OpenSBMCard|[&SelectedCharName] Spell Mules --?"[@SBMAvailableMules(maxindex)]" -lt "0"|NoCharacterSBMMules -->AppendMuleSection|Available Character Mules;AVAILABLE;include;No available character mules. -->AppendMuleSection|Assigned Character Mules;ADDED;include;No character-specific mules assigned. -->AppendMuleSection|Inherited Class Mules;INHERITED;exclude;No unblocked inherited class mules. -->AppendMuleSection|Blocked Class Mules;BLOCKED;exclude;No blocked class mules. --&CardHTML|+[&CSR]Spell Book Assignment[/td][/tr] --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&OddRowBG];'][rbutton]Spell Book Assignment::SBMCharacterSpellBook;START[/rbutton][/td][/tr] --^AfterCharacterSBMMules| --:NoCharacterSBMMules| --&CardHTML|+[&CTR][&NSMFText][/td][/tr] --:AfterCharacterSBMMules| -->ShowSBMCard| --X| --:SBMCharacterSpellBook| --?"[&reentryval]" -ninc "!@!" -and "[&reentryval]" -ne "BACK" -and "[&reentryval]" -ne "START"|&SelectedChar;[&reentryval] --&MALMSM| --&MALL| --?"[&reentryval]" -inc "MAL!@!"|[ --~MALSP|string;split;!@!;[&reentryval] --&MALMSM|[&MALSP2] --&MALL|[&MALSP3] --]| --?"[&SelectedChar]" -eq "" -or "[&SelectedChar]" -eq "undefined"|SBMCharacterSelectMules --&SelectedCharName|[*O:[&SelectedChar]:character:name] -->BuildCharacterMuleLists|[&SelectedChar] --&MOM|character --~|array;objects:character;SBMAvailableMules;SBM_ --&BackButton|[&BackBtn]SBMCharacterMules;BACK[/rbutton] --&SettingsButton|[&SettingsBtn]SBMCharacterSpellBook[/rbutton] -->OpenSBMCard|[&SelectedCharName] Spell Book Assignment --?"[@SBMAvailableMules(maxindex)]" -lt "0"|NoCharacterSpellBookMules --?"[&CSB]" -eq ""|ShowAvailableSpellBooks -->AppendMuleSection|Assigned Spell Book;ADDED;spellbook;No spell book assigned. --^AfterCharacterSpellBookMules| --:ShowAvailableSpellBooks| -->AppendMuleSection|Available Spell Books;AVAILABLE;spellbook;No available spell books. --^AfterCharacterSpellBookMules| --:NoCharacterSpellBookMules| --&CardHTML|+[&CTR][&NSMFText][/td][/tr] --:AfterCharacterSpellBookMules| -->ShowSBMCard| --X| --:ToggleMule| --~ToggleInfo|string;split;!@!;[&reentryval] --&TMode|[&ToggleInfo1] --&TOwner|[&ToggleInfo2] --&TLT|[&ToggleInfo3] --&TMID|[&ToggleInfo4] --?"[&TMode]" -eq "npc"|SBMSettings --?"[&TMode]" -ne "class" -and "[&TMode]" -ne "character"|ToggleMuleStorageError --?"[&TMode]" -eq "class"|[ --&TSK|[&TOwner] --&TMID|[&TLT] --]|[ --&TSK|char_[&TOwner]_[&TLT] --]| --&String1|[&SBMR] --&Needle|!q![&TSK]!q!:!q! --&Entry|[&TMID], --?"[&TMode]" -ne "class" -and "[&String1]" -ninc "[&Needle]"|[ --~StringBase|string;before;!%!;[&String1] --&String1|[&StringBase],!q![&TSK]!q!:!q!!q!!%! --]| --?"[&String1]" -ninc "[&Needle]"|ToggleMuleStorageError --~String2|string;after;[&Needle];[&String1] --?"[&String2]" -eq ""|ToggleMuleStorageError --~String3|string;before;[&String2];[&String1] --~ToggleData|string;before;!q!;[&String2] --~StringTail|string;after;!q!;[&String2] --?"[&ToggleData]" -inc "[&Entry]"|ToggleRemoveMule --:ToggleAddMule| --&NTD|[&Entry][&ToggleData] --?"[&TLT]" -eq "spellbook"|&NTD;[&Entry] --^ToggleWriteSettings| --:ToggleRemoveMule| --~NTD|string;replaceall;[&Entry];;[&ToggleData] --:ToggleWriteSettings| --&SBMR|[&String3][&NTD]!q![&StringTail] -->WriteSBMSettings|AUTO --h:SBMSettings("[&TSK]")|[&NTD] --?"[&TMode]" -eq "class"|[ --&SelClass|[&TOwner] --^SBMClassMules| --]| --&SelectedChar|[&TOwner] --?"[&TLT]" -eq "spellbook"|SBMCharacterSpellBook --^SBMCharacterMules| --:ToggleMuleStorageError| --#hidecard|0 --&SBMR|[&SBMDef] -->WriteSBMSettings|AUTO --+Spell Book Manager Settings|The mule assignment settings text was invalid and has been reset. Open Settings again and re-assign the mule. --X| --:SBMSetTheme| --&NewTheme|[&reentryval] --~ThemeIndex|array;indexof;SBMThemeList;[&NewTheme] --?"[&ThemeIndex]" -eq "ArrayError"|&NewTheme;2014 --&String1|!$!!q!theme!q!:!q![&NewTheme]!q!!%! --!h:[&SDHID]|gmnotes:"[&String1]" --h:SBMSettings("theme")|[&NewTheme] -->ApplySBMTheme| --^SBMSettings| --X| --:BNPL|Mode; Excluded Character ID --&BPLM|[%1%] --&BPLEX|[%2%] --?"[&BPLM]" -eq "" -or "[&BPLM]" -eq "undefined"|&BPLM;NPC --&NLAM|0 --?"[&BPLM]" -eq "MULE"|&NLAM;1 --?"[&BPLEX]" -eq "undefined"|&BPLEX; --?"[&BPLM]" -eq "MULE"|[ -->BASB| --]| --~|array;define;SBMValidNPCList;dummy --~|array;removeat;SBMValidNPCList;0 --=NPCCount|0 --?"[&BPLM]" -eq "MULE"|BPLLoadMules --~|array;objects:character;BPLC; --^BPLStartLoop| --:BPLLoadMules| --~|array;objects:character;BPLC;SBM_ --:BPLStartLoop| --%BPLL|foreach;BPLC --&NPCID|[&BPLL] --&BPLADD|0 --&NPCName|[*O:[&NPCID]:character:name] --?"[&NPCName]" -eq "" -or "[&NPCName]" -eq "undefined"|% --?"[*O:[&NPCID]:character:archived]" -eq "true"|% --?"[&BPLM]" -eq "MULE" -and "[*O:[&NPCID]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|% --?"[&BPLM]" -eq "MULE" -and "[&NPCID]" -eq "[&BPLEX]"|% --?"[&BPLM]" -eq "MULE" -and "[&AssignedSpellBooks]" -inc ",[&NPCID],"|% --?"[&BPLM]" -eq "MULE" -and "[&NPCName]" -imatch "^SBM_"|BPLMuleCandidate --?"[&BPLM]" -eq "MULE"|% --~|array;attributes;SBMNPCAttrs;[&NPCID];npc --?"[@SBMNPCAttrs(maxindex)]" -lt "0"|% --?"[*[&NPCID]:npc]" -ne "1"|% --?"[&NPCName]" -imatch "^SBM_"|% --?"[&NPCName]" -imatch "^ScriptCards"|% --&BPLADD|1 --^BPLAddCandidate| --:BPLMuleCandidate| --~NPCName|string;replaceall;SBM_;;[&NPCName] --&BPLADD|1 --:BPLAddCandidate| --?"[&BPLADD]" -ne "1"|% --&SBMValidNPCList(99999)|[&NPCName]!@![&NPCID] --=NPCCount|[$NPCCount.Raw] + 1 --%| --?[$NPCCount.Raw] -gt 0|[ --~|array;sort;SBMValidNPCList --]| --<| --:BPSBL|Character ID; Mode; Excluded Mule ID --&PSBLM|[%2%] --&PSBSX|[%3%] --&PSBAS|, --?"[&PSBSX]" -eq "undefined"|&PSBSX; --?"[&SendingPlayerIsGM]" -eq "1" -and "[&PSBLM]" -eq "SOURCE"|[ -->BNPL|MULE;[&PSBSX] --?[$NPCCount.Raw] -eq 0|< --%PSBL|foreach;SBMValidNPCList --~PSBSP|string;split;!@!;[&PSBL] --&PSBAS|+[&PSBSP2], --%| --<| --]| -->BuildCharacterMuleLists|[%1%] --?"[&PSBLM]" -eq "DEST"|&PSBSourceIDs;[&CSB] --?"[&PSBLM]" -ne "DEST"|&PSBSourceIDs;[&ASMS] --~|array;fromstring;PSBIDs;,;[&PSBSourceIDs] --~|array;define;SBMValidNPCList;dummy --~|array;removeat;SBMValidNPCList;0 --=NPCCount|0 --?"[@PSBIDs(maxindex)]" -lt "0"|< --%PSBL|foreach;PSBIDs --&NPCID|[&PSBL] --?"[&NPCID]" -eq "" -or "[&NPCID]" -eq "undefined"|% --?"[*O:[&NPCID]:character:archived]" -eq "true"|% --?"[*O:[&NPCID]:character:charactersheetname]" -imatch "^dnd2024byroll20$"|% --?"[&PSBLM]" -eq "SOURCE" -and "[&NPCID]" -eq "[&PSBSX]"|% --&NPCName|[*O:[&NPCID]:character:name] --?"[&NPCName]" -imatch "^SBM_"|[ --~NPCName|string;replaceall;SBM_;;[&NPCName] --&SBMValidNPCList(99999)|[&NPCName]!@![&NPCID] --&PSBAS|+[&NPCID], --=NPCCount|[$NPCCount.Raw] + 1 --]| --%| --?[$NPCCount.Raw] -gt 0|[ --~|array;sort;SBMValidNPCList --]| --<| --:AppendNPCPage| --?"[&NLAM]" -eq "1"|AppendAlphaNPCPage --?"[&NLP]" -eq "" -or "[&NLP]" -eq "undefined" -or "[&NLP]" -eq "START" -or "[&NLP]" -eq "BACK"|&NLP;0 --&NPCPageValid|0 --?"[&NLP]" -match "^[0-9]+$"|&NPCPageValid;1 --?"[&NPCPageValid]" -ne "1"|&NLP;0 --=NPCPageSize|10 --=NPCStartIndex|[&NLP] * [$NPCPageSize.Raw] --?[$NPCStartIndex.Raw] -ge [$NPCCount.Raw]|[ --&NLP|0 --=NPCStartIndex|0 --]| --&CardHTML|+[&CSR][&NLST][/td][/tr] --&NPCOutput|[t [>]][tr] --=NPCEntryIndex|-1 --=NPCPageCount|0 --%SBMNPCPageLoop|foreach;SBMValidNPCList --?"[&SBMNPCPageLoop]" -eq "" -or "[&SBMNPCPageLoop]" -eq "undefined"|% --=NPCEntryIndex|[$NPCEntryIndex.Raw] + 1 --?[$NPCEntryIndex.Raw] -lt [$NPCStartIndex.Raw]|% --?[$NPCPageCount.Raw] -ge [$NPCPageSize.Raw]|% --~NPCEntrySplit|string;split;!@!;[&SBMNPCPageLoop] --&NPCName|[&NPCEntrySplit1] --&NPCID|[&NPCEntrySplit2] --?"[&NPCName]" -eq "" -or "[&NPCName]" -eq "undefined" -or "[&NPCID]" -eq "" -or "[&NPCID]" -eq "undefined"|% --?"[= [$NPCPageCount.Raw] % 3 ]" -eq "0" -and "[$NPCPageCount.Raw]" -ne "0"|&NPCOutput;+[/tr][tr] --&NPCBG|[&OddRowBG] --?"[= [$NPCPageCount.Raw] \ 3 % 2 ]" -eq "1"|&NPCBG;[&EvenRowBG] --&NPCOutput|+[td style='[&GCS] background-color:[&NPCBG];'][rbutton][&NPCName]::[&NLBT];[&NPCID][/rbutton][/td] --=NPCPageCount|[$NPCPageCount.Raw] + 1 --%| --?"[= [$NPCPageCount.Raw] % 3 ]" -eq "1"|[ --&NPCOutput|+[td style='[&GCS] background-color:[&NPCBG]; color:[&NPCBG]; font-size:1px; line-height:1px;']X[/td][td style='[&GCS] background-color:[&NPCBG]; color:[&NPCBG]; font-size:1px; line-height:1px;']X[/td] --]| --?"[= [$NPCPageCount.Raw] % 3 ]" -eq "2"|[ --&NPCOutput|+[td style='[&GCS] background-color:[&NPCBG]; color:[&NPCBG]; font-size:1px; line-height:1px;']X[/td] --]| --&NPCOutput|+[/tr][/t] --&CardHTML|+[&CCR][&NPCOutput][/td][/tr] --?[$NPCCount.Raw] -le [$NPCPageSize.Raw]|AfterNPCPageNav --=NPCDisplayPage|[&NLP] + 1 --=NPCPrevPage|[&NLP] - 1 --=NPCNextPage|[&NLP] + 1 --&NNO|[t [>]][tr] --?[$NPCPrevPage.Raw] -ge 0|[ --&NNO|+[td style='[&GCS] background-color:[&OddRowBG];'][rbutton][&BackIcon] Prev::[&NLPT];[$NPCPrevPage.Raw][/rbutton][/td] --]|[ --&NNO|+[td style='[&GCS] background-color:[&OddRowBG];'] [/td] --]| --&NNO|+[td style='[&GCS] background-color:[&OddRowBG];']Page [$NPCDisplayPage.Raw][/td] --?[= [$NPCStartIndex.Raw] + [$NPCPageSize.Raw] ] -lt [$NPCCount.Raw]|[ --&NNO|+[td style='[&GCS] background-color:[&OddRowBG];'][rbutton]Next ⮞::[&NLPT];[$NPCNextPage.Raw][/rbutton][/td] --]|[ --&NNO|+[td style='[&GCS] background-color:[&OddRowBG];'] [/td] --]| --&NNO|+[/tr][/t] --&CardHTML|+[&CCR][&NNO][/td][/tr] --:AfterNPCPageNav| --<| --:AppendAlphaNPCPage| --&NLLetters|, --%NLScanLoop|foreach;SBMValidNPCList --?"[&NLScanLoop]" -eq "" -or "[&NLScanLoop]" -eq "undefined"|% --~NPCEntrySplit|string;split;!@!;[&NLScanLoop] --&NPCName|[&NPCEntrySplit1] --&NLL|[&NPCName(0,1)] --~NLL|string;touppercase;[&NLL] --?"[&NLLetters]" -ninc ",[&NLL],"|&NLLetters;+[&NLL], --%| --~NPCEntrySplit|string;split;!@!;[@SBMValidNPCList(0)] --&NLDefaultLetter|[&NPCEntrySplit1(0,1)] --~NLDefaultLetter|string;touppercase;[&NLDefaultLetter] --?"[&NLP]" -eq "" -or "[&NLP]" -eq "undefined" -or "[&NLP]" -eq "START" -or "[&NLP]" -eq "BACK"|&NLP;[&NLDefaultLetter] --~NLP|string;touppercase;[&NLP] --?"[&NLLetters]" -ninc ",[&NLP],"|&NLP;[&NLDefaultLetter] --&CardHTML|+[&CSR][&NLST][/td][/tr] --&NPCOutput|[t [>]][tr] --=NPCPageCount|0 --%SBMNPCPageLoop|foreach;SBMValidNPCList --?"[&SBMNPCPageLoop]" -eq "" -or "[&SBMNPCPageLoop]" -eq "undefined"|% --~NPCEntrySplit|string;split;!@!;[&SBMNPCPageLoop] --&NPCName|[&NPCEntrySplit1] --&NPCID|[&NPCEntrySplit2] --?"[&NPCName]" -eq "" -or "[&NPCName]" -eq "undefined" -or "[&NPCID]" -eq "" -or "[&NPCID]" -eq "undefined"|% --&NLL|[&NPCName(0,1)] --~NLL|string;touppercase;[&NLL] --?"[&NLL]" -nei "[&NLP]"|% --?"[= [$NPCPageCount.Raw] % 3 ]" -eq "0" -and "[$NPCPageCount.Raw]" -ne "0"|&NPCOutput;+[/tr][tr] --&NPCBG|[&OddRowBG] --?"[= [$NPCPageCount.Raw] \ 3 % 2 ]" -eq "1"|&NPCBG;[&EvenRowBG] --&NPCOutput|+[td style='[&GCS] background-color:[&NPCBG];'][rbutton][&NPCName]::[&NLBT];[&NPCID][/rbutton][/td] --=NPCPageCount|[$NPCPageCount.Raw] + 1 --%| --?"[= [$NPCPageCount.Raw] % 3 ]" -eq "1"|[ --&NPCOutput|+[td style='[&GCS] background-color:[&NPCBG]; color:[&NPCBG]; font-size:1px; line-height:1px;']X[/td][td style='[&GCS] background-color:[&NPCBG]; color:[&NPCBG]; font-size:1px; line-height:1px;']X[/td] --]| --?"[= [$NPCPageCount.Raw] % 3 ]" -eq "2"|[ --&NPCOutput|+[td style='[&GCS] background-color:[&NPCBG]; color:[&NPCBG]; font-size:1px; line-height:1px;']X[/td] --]| --&NPCOutput|+[/tr][/t] --&CardHTML|+[&CCR][&NPCOutput][/td][/tr] -->AppendAlphaNav|PICKER;[&NLLetters];[&NLP];[&NLPT]; --<| --:NPCSpellManager| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect --&NLP|[&reentryval] --?",START,BACK," -inc ",[&NLP],"|&NLP;0 -->BNPL|NPC --&BackButton|[&BackBtn]CharacterSelect;BACK[/rbutton] --&SettingsButton|[&SettingsBtn]NPCSpellManager[/rbutton] --&NLBT|SelectNPC --&NLPT|NPCSpellManager -->OpenSBMCard|NPC Spell Manager --?[$NPCCount.Raw] -eq 0|[ --&CardHTML|+[&CTR][&NoNPCSheetsText][/td][/tr] --]|[ --&NLST|Choose NPC -->AppendNPCPage| --]| -->ShowSBMCard| --X| --:SMCM| --&IMCM|1 --&IPSB|0 --&IsNPCSpellManager|0 --&CMS|0 --&WhatDo|CHOOSE --<| --:VPSBC|Mode; Mule ID; Excluded Mule ID --&PSBA|0 --&PSBCX|[%3%] --?"[&PSBCX]" -eq "undefined"|&PSBCX; --?"[&PSBCID]" -eq "" -or "[&PSBCID]" -eq "undefined"|< -->BPSBL|[&PSBCID];[%1%];[&PSBCX] --?"[&PSBAS]" -inc ",[%2%],"|&PSBA;1 --<| --:MCCD| --&MCPM|DEST --^MCPP| --:SMCD| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect -->SMCM| --&MCDID|[&reentryval] --&MCSID| --&SSM| --&ChosenChar|[&MCDID] --^MCCS| --:MCCS| --&MCPM|SOURCE --^MCPP| --:MCPP| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect --?"[&MCPM]" -ne "SOURCE"|&MCPM;DEST --?"[&MCPM]" -eq "SOURCE" -and "[&MCDID]" -eq ""|MCCD --?"[&MCPM]" -eq "SOURCE" -and "[&MCDID]" -eq "undefined"|MCCD --?"[&MCPM]" -eq "DEST"|[ -->SMCM| --&MCDID| --&MCSID| --&SSM| --]| --?"[&MCPM]" -ne "DEST"|[ -->SMCM| --]| --&NLP|[&reentryval] --?",START,BACK," -inc ",[&NLP],"|&NLP;0 --?"[&MCPM]" -eq "DEST"|[ -->BNPL|MULE --]| --?"[&MCPM]" -ne "DEST"|[ -->BNPL|MULE;[&MCDID] --]| --&MCPT|Spell Mule Copy --&MCPE|No SBM_ spell mules were found. --&NLST|Choose Destination Mule --&NLBT|SMCD --&NLPT|MCCD --&BackButton|[&BackBtn]CharacterSelect;BACK[/rbutton] --&SettingsButton|[&SettingsBtn]MCCD[/rbutton] --?"[&MCPM]" -eq "SOURCE"|[ --&MCDN|[*O:[&MCDID]:character:name] --~MCDN|string;replaceall;SBM_;;[&MCDN] --&MCPT|Copy to [&MCDN] --&MCPE|No other SBM_ spell mules were found. --&NLST|Choose Source Mule --&NLBT|SMCS --&NLPT|MCCS --&BackButton|[&BackBtn]MCCD;BACK[/rbutton] --&SettingsButton|[&SettingsBtn]MCCS[/rbutton] --]| -->OpenSBMCard|[&MCPT] --?[$NPCCount.Raw] -eq 0|[ --&CardHTML|+[&CTR][&MCPE][/td][/tr] --]|[ -->AppendNPCPage| --]| -->ShowSBMCard| --X| --:SMCS| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect -->SMCM| --&MCSID|[&reentryval] --&SSM|[&MCSID] --&ChosenChar|[&MCDID] --&CharID|[&MCDID] --^SpellList| --:PSBCD| -->SMCM| --&IPSB|1 --&MCDID| --&MCSID| --&SSM| --&PSBRE|[&reentryval] --?"[&PSBRE]" -inc "!@!"|[ --~PSBSP|string;split;!@!;[&PSBRE] --&PSBCID|[&PSBSP1] --&ChosenChar|[&PSBCID] --]| --?"[&PSBCID]" -eq "" -or "[&PSBCID]" -eq "undefined"|CharacterSelect -->BPSBL|[&PSBCID];DEST; --?[$NPCCount.Raw] -lt 1|CharacterSelect --~PSBSP|string;split;!@!;[@SBMValidNPCList(0)] --&MCDID|[&PSBSP2] -->VPSBC|DEST;[&MCDID]; --?"[&PSBA]" -ne "1"|CharacterSelect --&MCSID| --&SSM| --&ChosenChar|[&PSBCID] --^PSBCS| --:PSBCS| --?"[&MCDID]" -eq "" -or "[&MCDID]" -eq "undefined"|PSBCD --?"[&PSBCID]" -eq "" -or "[&PSBCID]" -eq "undefined"|CharacterSelect -->SMCM| --&IPSB|1 --&NLP|[&reentryval] --?",START,BACK," -inc ",[&NLP],"|&NLP;0 -->BPSBL|[&PSBCID];SOURCE;[&MCDID] --&MCDN|[*O:[&MCDID]:character:name] --~MCDN|string;replaceall;SBM_;;[&MCDN] --&BackButton|[&BackBtn]SelectCharacterReady;BACK[/rbutton] --&SettingsButton|[&SettingsBtn]PSBCS[/rbutton] --&NLBT|SPSBS --&NLPT|PSBCS -->OpenSBMCard|Copy to [&MCDN] --?[$NPCCount.Raw] -eq 0|[ --&CardHTML|+[&CTR]No assigned spell lists were found for this character.[/td][/tr] --]|[ --&NLST|Choose Spell List -->AppendNPCPage| --]| -->ShowSBMCard| --X| --:SPSBS| --?"[&MCDID]" -eq "" -or "[&MCDID]" -eq "undefined"|PSBCD -->SMCM| --&IPSB|1 --&MCSID|[&reentryval] -->VPSBC|SOURCE;[&MCSID];[&MCDID] --?"[&PSBA]" -ne "1"|PSBCS -->VPSBC|DEST;[&MCDID]; --?"[&PSBA]" -ne "1"|CharacterSelect --&SSM|[&MCSID] --&ChosenChar|[&PSBCID] --&CharID|[&MCDID] --^SpellList| --:SelectNPC| --&IMCM|0 --&ChosenChar|[&reentryval] --&CharID|[&ChosenChar] --&IsNPCSpellManager|1 --&CMS|0 --&WhatDo|CHOOSE --&SSM| --^NPCSpellSourceSelect| --:NPCSpellSourceSelect| --?"[&SendingPlayerIsGM]" -ne "1"|CharacterSelect --?"[&ChosenChar]" -eq "" -or "[&ChosenChar]" -eq "undefined"|NPCSpellManager --&CharID|[&ChosenChar] --&NLP|[&reentryval] --?",START,BACK," -inc ",[&NLP],"|&NLP;0 -->BNPL|MULE --&NPCDisplayName|[*O:[&CharID]:character:name] --&BackButton|[&BackBtn]NPCSpellManager;BACK[/rbutton] --&SettingsButton|[&SettingsBtn]NPCSpellSourceSelect[/rbutton] --&NLBT|SetNPCSpellSource --&NLPT|NPCSpellSourceSelect -->OpenSBMCard|[&NPCDisplayName] Spell Lists --?[$NPCCount.Raw] -eq 0|[ --&CardHTML|+[&CTR][&NSMFText][/td][/tr] --]|[ --&NLST|Choose Spell List -->AppendNPCPage| --]| -->ShowSBMCard| --X| --:SetNPCSpellSource| --&SSM|[&reentryval] --&WhatDo|CHOOSE --&IMCM|0 --&IsNPCSpellManager|1 --&CMS|0 --&ASMS|[&SSM], --^SpellList| --:SelectCharacter| --&IMCM|0 --&ChosenChar|[&reentryval] --&IsNPCSpellManager|0 --:SelectCharacterReady| --&CharID|[*[&ChosenChar]:character_id] --&CMS|1 --&ClassCheck|[*[&CharID]:class] [*[&CharID]:subclass] [*[&CharID]:cust_classname] --?"[*[&CharID]:multiclass1_flag]" -eq "1"|&ClassCheck;+ [*[&CharID]:multiclass1] [*[&CharID]:multiclass1_subclass] --?"[*[&CharID]:multiclass2_flag]" -eq "1"|&ClassCheck;+ [*[&CharID]:multiclass2] [*[&CharID]:multiclass2_subclass] --?"[*[&CharID]:multiclass3_flag]" -eq "1"|&ClassCheck;+ [*[&CharID]:multiclass3] [*[&CharID]:multiclass3_subclass] --~ClassCheck|string;tolowercase;[&ClassCheck] --=PSBCt|0 -->BPSBL|[&CharID];DEST; --=PSBCt|[$NPCCount.Raw] --?"[&SendingPlayerIsGM]" -ne "1" -and "[&ClassCheck]" -ninc "warlock" -and "[$PSBCt.Raw]" -eq "0"|[ --&CMS|0 --&WhatDo|CHOOSE --&SSM| --^SpellMuleSelect| --]| --?"[&SendingPlayerIsGM]" -ne "1" -and "[&ClassCheck]" -ninc "warlock"|&CMS;0 --&BackButton|  --?"[$PCCount.Raw]" -gt "1"|[ --&BackButton|[&BackBtn]CharacterSelect;[&ChP][/rbutton] --]| --&SettingsButton|[&SettingsBtn]SelectCharacterReady[/rbutton] -->OpenSBMCard|[*[&CharID]:character_name] --?"[&CMS]" -eq "1"|[ --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&OddRowBG];'][t style='width:100%; [&B0] [&TF]'][tr][td style='[&B0] padding:0; [&TC]'][rbutton]Choose Spells::SetSpellMode;CHOOSE!@![&ChosenChar][/rbutton][/td][td style='[&B0] padding:0; [&TC]'][rbutton]Move Spells::SMMO;[&ChosenChar][/rbutton][/td][/tr][/t][/td][/tr] --]| --?"[&CMS]" -ne "1"|[ --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&OddRowBG];'][rbutton]Choose Spells::SetSpellMode;CHOOSE!@![&ChosenChar][/rbutton][/td][/tr] --]| --?"[$PSBCt.Raw]" -gt "0"|[ --&CardHTML|+[tr][td style='[&B0] [&RP] [&CW] [&W6] [&TC] background-color:[&EvenRowBG];'][rbutton]Copy to Spell Book::PSBCD;[&CharID]!@!START[/rbutton][/td][/tr] --]| -->ShowSBMCard| --X| --:SMMO| --&WhatDo|MOVE --&ChosenChar|[&reentryval] --&SSM| --&SBCM|0 --&IMCM|0 --&IPSB|0 --&IsNPCSpellManager|0 --&CMS|1 --&CharID|[*[&ChosenChar]:character_id] --&ASMS|[&CharID], --^SpellList| --:SetSpellMode| --~ModeSplit|string;split;!@!;[&reentryval] --&WhatDo|[&ModeSplit1] --&ChosenChar|[&ModeSplit2] --&SSM| --&SBCM|0 --&IMCM|0 --&IPSB|0 --&IsNPCSpellManager|0 --?"[&WhatDo]" -ne "CHOOSE"|SpellList --^SpellMuleSelect| --:SetSpellSourceBackButton| --&BackButton|  --?"[&IsNPCSpellManager]" -eq "1"|[ --&BackButton|[&BackBtn]NPCSpellManager;[&NLP][/rbutton] --]| --?"[&IsNPCSpellManager]" -ne "1" -and "[&CMS]" -eq "1"|[ --&BackButton|[&BackBtn]SelectCharacterReady;BACK[/rbutton] --]| --?"[&IsNPCSpellManager]" -ne "1" -and "[&CMS]" -ne "1" -and "[$PCCount.Raw]" -gt "1"|[ --&BackButton|[&BackBtn]CharacterSelect;[&ChP][/rbutton] --]| --<| --:SpellMuleSelect| --&CharID|[*[&ChosenChar]:character_id] --&WhatDo|CHOOSE -->BuildCharacterMuleLists|[&CharID] --?"[&IsNPCSpellManager]" -ne "1" -and "[&IMCM]" -ne "1" -and "[&CSB]" -ne "" -and "[&CSB]" -ne "undefined"|[ --~SBCID|string;before;,;[&CSB] --&SSM|[&SBCID] --&SBCM|1 --^SpellList| --]| --?"[&ASMS]" -eq ","|NoAssignedSpellMules --~|array;fromstring;SpellMuleIDs;,;[&ASMS] -->SetSpellSourceBackButton| --&SettingsButton|[&SettingsBtn]SpellMuleSelect[/rbutton] --&SMST|[*[&CharID]:character_name] Spell Sources -->OpenSBMCard|[&SMST] --&CardHTML|+[&CSR]Choose Spell List[/td][/tr] --&SMSO|[t [>]][tr] --=SpellMuleSelectCount|0 --&SMSBG|[&OddRowBG] --&SMSO|+[td style='[&MGCS] background-color:[&SMSBG];'][rbutton]All Spells::SetSpellMuleSource;ALL[/rbutton][/td] --=SpellMuleSelectCount|1 --%SpellMuleSelectLoop|foreach;SpellMuleIDs --&SMID|[&SpellMuleSelectLoop] --?"[&SMID]" -eq "" -or "[&SMID]" -eq "undefined"|% --?"[= [$SpellMuleSelectCount.Raw] % 2 ]" -eq "0" -and "[$SpellMuleSelectCount.Raw]" -ne "0"|&SMSO;+[/tr][tr] --&SMSBG|[&OddRowBG] --?"[= [$SpellMuleSelectCount.Raw] \ 2 % 2 ]" -eq "1"|&SMSBG;[&EvenRowBG] --&SMName|[*O:[&SMID]:character:name] --~SMName|string;replaceall;SBM_;;[&SMName] --&SMSO|+[td style='[&MGCS] background-color:[&SMSBG];'][rbutton][&SMName]::SetSpellMuleSource;[&SMID][/rbutton][/td] --=SpellMuleSelectCount|[$SpellMuleSelectCount.Raw] + 1 --%| --?"[= [$SpellMuleSelectCount.Raw] % 2 ]" -eq "1"|[ --&SMSO|+[td style='[&MGCS] background-color:[&SMSBG]; color:[&SMSBG]; font-size:1px; line-height:1px;']X[/td] --]| --&SMSO|+[/tr][/t] --&CardHTML|+[&CCR][&SMSO][/td][/tr] -->ShowSBMCard| --X| --:SetSpellMuleSource| --&SSM|[&reentryval] --^SpellList| --:SpellList| --&CharID|[*[&ChosenChar]:character_id] --?"[&IsNPCSpellManager]" -eq "1"|&CharID;[&ChosenChar] --?"[&IMCM]" -eq "1"|&CharID;[&MCDID] --:Restart| --?"[&WhatDo]" -eq "MOVE"|[ --&Title|Move [*[&CharID]:character_name] Spells --]|[ --&Title|[*[&CharID]:character_name] Spell Choice --]| --?"[&IMCM]" -ne "1"|AMCT --&MCDN|[*O:[&MCDID]:character:name] --~MCDN|string;replaceall;SBM_;;[&MCDN] --&Title|Copy to [&MCDN] --:AMCT| --~|array;define;SpellLevels;cantrip;1;2;3;4;5;6;7;8;9 --?"[&WhatDo]" -eq "MOVE"|&ASMS;[&CharID], --?"[&WhatDo]" -eq "MOVE"|SpellSourceReady --?"[&SSM]" -ne "" -and "[&SSM]" -ne "undefined"|SpellSourceSelected --?"[&IMCM]" -eq "1" -and "[&IPSB]" -eq "1"|PSBCS --?"[&IMCM]" -eq "1"|MCCS --^SpellMuleSelect| --:SpellSourceSelected| --?"[&SSM]" -ne "ALL"|&ASMS;[&SSM], --:SpellSourceReady| --?"[&WhatDo]" -eq "CHOOSE" -and "[&SSM]" -eq "ALL"|&Title;[&Title]: All Spells --?"[&WhatDo]" -eq "CHOOSE" -and "[&SSM]" -ne "ALL" -and "[&IMCM]" -ne "1"|[ --&SSMN|[*O:[&SSM]:character:name] --~SSMN|string;replaceall;SBM_;;[&SSMN] --&Title|[&Title]: [&SSMN] --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&SSM]" -ne "ALL" -and "[&IMCM]" -eq "1"|[ --&SSMN|[*O:[&SSM]:character:name] --~SSMN|string;replaceall;SBM_;;[&SSMN] --&Title|[&SSMN] >> [&MCDN] --]| --~|array;fromstring;SpellMuleIDs;,;[&ASMS] --&KSL|!@! --?"[&WhatDo]" -ne "CHOOSE"|AfterKnownSpellList --%KnownLevelLoop|foreach;SpellLevels --~|array;fromrepeatingsection;KnownLevelSpells;[&CharID];repeating_spell-[&KnownLevelLoop];spellname --?[@KnownLevelSpells(maxindex)] -lt "0"|NextKnownSpellLevel --%KnownSpellLoop|foreach;KnownLevelSpells --&KSNC|[&KnownSpellLoop] --~KSNC|string;tolowercase;[&KSNC] --&KSL|+[&KSNC]!@! --%| --:NextKnownSpellLevel| --%| --:AfterKnownSpellList| --&BackButton|  --?"[&WhatDo]" -eq "CHOOSE" -and "[&IMCM]" -eq "1" -and "[&IPSB]" -eq "1"|[ --&BackButton|[&BackBtn]PSBCS;BACK[/rbutton] --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&IMCM]" -eq "1" -and "[&IPSB]" -ne "1"|[ --&BackButton|[&BackBtn]MCCS;BACK[/rbutton] --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&IMCM]" -ne "1" -and "[&SBCM]" -eq "1"|[ --&BackButton|[&BackBtn]SelectCharacterReady;BACK[/rbutton] --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&IMCM]" -ne "1" -and "[&SBCM]" -ne "1"|[ --&BackButton|[&BackBtn]SpellMuleSelect;BACK[/rbutton] --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&IsNPCSpellManager]" -eq "1"|[ --&BackButton|[&BackBtn]NPCSpellSourceSelect;BACK[/rbutton] --]| --?"[&WhatDo]" -ne "CHOOSE" -and "[&IsNPCSpellManager]" -eq "1"|[ --&BackButton|[&BackBtn]NPCSpellManager;[&NLP][/rbutton] --]| --?"[&WhatDo]" -ne "CHOOSE" -and "[&IsNPCSpellManager]" -ne "1" -and "[&CMS]" -eq "1"|[ --&BackButton|[&BackBtn]SelectCharacterReady;BACK[/rbutton] --]| --?"[&WhatDo]" -ne "CHOOSE" -and "[&IsNPCSpellManager]" -ne "1" -and "[&CMS]" -ne "1" -and "[$PCCount.Raw]" -gt "1"|[ --&BackButton|[&BackBtn]CharacterSelect;[&ChP][/rbutton] --]| --&SettingsButton|[&SettingsBtn]SpellList[/rbutton] -->OpenSBMCard|[&Title] --=SpellDisplayRow|0 --%LevelLoop|foreach;SpellLevels --?"[&WhatDo]" -eq "MOVE" -and "[&LevelLoop]" -eq "cantrip"|NextLevel --&DSL|!@! --=LevelSpellCount|0 --~|array;define;SortedLevelSpells;dummy --~|array;removeat;SortedLevelSpells;0 --%SpellMuleLoop|foreach;SpellMuleIDs --&SMID|[&SpellMuleLoop] --?"[&SMID]" -eq ""|NextSpellMule --&SIdx|0 --~|array;fromrepeatingsection;LvlSpells;[&SMID];repeating_spell-[&LevelLoop];spellname --?[@LvlSpells(maxindex)] -lt "0"|NextSpellMule --%SpellLoop|foreach;LvlSpells --&SLC|[&SpellLoop] --~SLC|string;tolowercase;[&SLC] --&DuplicateSpell|0 --?"[&WhatDo]" -eq "CHOOSE" -and "[&DSL]" -inc "!@![&SLC]!@!"|&DuplicateSpell;1 --?"[&DuplicateSpell]" -eq "0"|[ --&DSL|+[&SLC]!@! --&SortedLevelSpells(99999)|[&SLC]!@![&SpellLoop]!@![&SMID]!@![&SIdx] --=LevelSpellCount|[$LevelSpellCount.Raw] + 1 --]| --&SIdx|[= [&SIdx] + 1 ] --%| --:NextSpellMule| --%| --?[$LevelSpellCount.Raw] -eq 0|NextLevel --~|array;sort;SortedLevelSpells --?"[&LevelLoop]" -ne "cantrip"|[ --&LvlName|LEVEL [&LevelLoop] --]|[ --&LvlName|CANTRIP --]| --&Hbutton| --?"[&WhatDo]" -eq "CHOOSE"|[ --&Hbutton|[td style='width:115px; min-width:115px; [&B0] text-align:right; white-space:nowrap; [&RP] [&CR]' title="Description"][r][button][F::12]Spell Description Handout[/F]::http://journal.roll20.net/handout/[&SDHID][/button][/r][/td] --]| --&CardHTML|+[tr][td][t [&SHT]][tr][td [&SHTd]][&LvlName][/td][&Hbutton][/tr][/t][/td][/tr] --%SpellLoop|foreach;SortedLevelSpells --~SortedSpellSplit|string;split;!@!;[&SpellLoop] --&SLC|[&SortedSpellSplit1] --&SpellName|[&SortedSpellSplit2] --&SMID|[&SortedSpellSplit3] --&SIdx|[&SortedSpellSplit4] --&UpButton| --&DownButton| --&DescButton| --&CSpells| --&AKnown|0 --?"[&WhatDo]" -eq "MOVE"|[ --&UpButton|[td [&SITd]] [/td] --&DownButton|[td [&SITd]] [/td] --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&KSL]" -inc "!@![&SLC]!@!"|&AKnown;1 --?"[&LevelLoop]" -ne "cantrip" -and "[&WhatDo]" -eq "MOVE" -and "[&LevelLoop]" -ne "1"|[ --&UpButton|[td [&SITd]][rbutton]⮝::TransferSpell;UP!@![&LevelLoop]!@![&SIdx][/rbutton][/td] --]| --?"[&LevelLoop]" -ne "cantrip" -and "[&WhatDo]" -eq "MOVE" -and "[&LevelLoop]" -ne "9"|[ --&DownButton|[td [&SITd]][rbutton]⮟::TransferSpell;DOWN!@![&LevelLoop]!@![&SIdx][/rbutton][/td] --]| --?"[&WhatDo]" -eq "CHOOSE"|[ --&DescButton|[td [&SITd] title="Description"][rbutton][F::12]🕮[/F]::SpellDescription;[&SMID]!@![&SpellName]!@![&LevelLoop][/rbutton][/td] --]| --&CSBF|12 --?",eldritch,radiant," -inc ",[&SBMTC],"|&CSBF;10 --&CSBText|[F::[&CSBF]]Copy to Character[/F] --?"[&IMCM]" -eq "1"|&CSBText;[F::[&CSBF]]Copy to Mule[/F] --?"[&IPSB]" -eq "1"|&CSBText;[F::[&CSBF]]Copy to Spell Book[/F] --?"[&WhatDo]" -eq "CHOOSE" -and "[&AKnown]" -eq "0"|[ --&CSpells|[td [&SATd]][rbutton][&CSBText]::TransferSpell;[&SMID]!@![&LevelLoop]!@![&SIdx][/rbutton][/td] --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&AKnown]" -eq "1"|[ --&CSpells|[td style='width:115px; min-width:115px; [&B0] [&TC] white-space:nowrap; [&RP] [&CR] font-family:[&BFF];'][F::14][b][i]Already Known[/i][/b][/F][/td] --]| --=SpellDisplayRow|[$SpellDisplayRow.Raw] + 1 --&SpellRowBG|[&OddRowBG] --?"[= [$SpellDisplayRow.Raw] % 2 ]" -eq "0"|&SpellRowBG;[&EvenRowBG] --&CardHTML|+[tr][td style='[&B0] padding:0px; background-color:[&SpellRowBG];'][t style='width:100%; table-layout:fixed; [&B0] border-collapse:collapse; background-color:[&SpellRowBG]; [&CW]'][tr][&UpButton][&DownButton][td [&SNTd]][&SpellName].[/td][&DescButton][&CSpells][/tr][/t][/td][/tr] --%| --:NextLevel| --%| --&CardHTML|+[&CTiR][&CardTitleBar][&RowEnd] -->ShowSBMCard| --X| --:TransferSpell| --~STI|string;split;!@!;[&reentryval] --?"[&WhatDo]" -eq "CHOOSE" -and "[&IPSB]" -eq "1"|>VPSBC;DEST;[&MCDID]; --?"[&WhatDo]" -eq "CHOOSE" -and "[&IPSB]" -eq "1" -and "[&PSBA]" -ne "1"|CharacterSelect --?"[&WhatDo]" -eq "CHOOSE" -and "[&IPSB]" -eq "1"|>VPSBC;SOURCE;[&MCSID];[&MCDID] --?"[&WhatDo]" -eq "CHOOSE" -and "[&IPSB]" -eq "1" -and "[&PSBA]" -ne "1"|CharacterSelect --&TSCID|[&CharID] --&TSSec| --&TDSec| --&TSSP| --&TSDP| --&TSOL| --&ShouldAdjustWarlockDamage|0 --?"[&WhatDo]" -eq "CHOOSE"|[ --#hidecard|1 --&TSCID|[&STI1] --&SLevel|[&STI2] --&NewLevel|[&SLevel] --&RowNumber|[&STI3] --&TSSec|repeating_spell-[&SLevel] --&TStageSec|repeating_smmspellcopy --]| --?"[&WhatDo]" -eq "MOVE"|[ --&Direction|[&STI1] --&SLevel|[&STI2] --&RowNumber|[&STI3] --?"[&Direction]" -eq "UP"|&NewLevel;[= [&SLevel] - 1 ]|&NewLevel;[= [&SLevel] + 1 ] --&TSSec|repeating_spell-[&SLevel] --&TDSec|repeating_spell-[&NewLevel] --]| --Rbyindex|[&TSCID];[&TSSec];[&RowNumber] --&TSName|[*R:spellname] --&TSOut|[*R:spelloutput] --&TSDmg|[*R:spelldamage] --&TSD2|[*R:spelldamage2] --&TSHeal|[*R:spellhealing] --&TSHD|[*R:spellhldie] --&TSHDT|[*R:spellhldietype] --&TSHL|[*R:spellathigherlevels] --&TORSN|[*R>spellname] --~TORP|string;before;spellname;[&TORSN] --?"[&WhatDo]" -ne "CHOOSE"|AfterChooseTransferSpell --&TSOL|[&SLevel] --&AHCS|0 --&TSNameCheck|[&TSName] --~TSNameCheck|string;tolowercase;[&TSNameCheck] --%KnownCheckLevel|foreach;SpellLevels --~|array;fromrepeatingsection;KnownCheckSpells;[&CharID];repeating_spell-[&KnownCheckLevel];spellname --?[@KnownCheckSpells(maxindex)] -lt "0"|NextKnownCheckLevel --%KnownCheckSpellLoop|foreach;KnownCheckSpells --&KCSN|[&KnownCheckSpellLoop] --~KCSN|string;tolowercase;[&KCSN] --?"[&KCSN]" -eq "[&TSNameCheck]"|&AHCS;1 --%| --:NextKnownCheckLevel| --%| --?"[&AHCS]" -eq "1"|TransferSpellDone --?"[&IsNPCSpellManager]" -eq "1"|[ --!a:[&CharID]|!npcspellcastingflag:1 --]| --~|repeatingrow;copybyindex;[&TSCID];[&CharID];[&TSSec];[&RowNumber];[&TStageSec] --&CSRID|[&SC_LAST_CREATED_ROWID] --Rbysectionid|[&CharID];[&TStageSec];[&CSRID] --&TSRSN|[*R>spellname] --~TSSP|string;before;spellname;[&TSRSN] --~|array;define;CopyPointerFields;spellname;spelldescription;spellathigherlevels --%CopyPointerField|foreach;CopyPointerFields --~|array;attributes;COPA;[&TSCID];[&TORP][&CopyPointerField] --~|array;attributes;CSPA;[&CharID];[&TSSP][&CopyPointerField] --?"[@COPA(maxindex)]" -ge "0" -and "[@CSPA(maxindex)]" -ge "0"|[ --Pread|CopyTextPointer::[@COPA(0)]::current --Pset|CopyTextPointer::[@CSPA(0)]::current --]| --%| --&TSDP|[&TSSP(replace,[&TStageSec],[&TSSec])] --:AfterChooseTransferSpell| --?"[&WhatDo]" -eq "MOVE"|[ --&TSOL|[*R:smm_originallevel] --?"[&TSOL]" -eq "" -or "[&TSOL]" -eq "undefined" -or "[&TSOL]" -eq "[&NoRow]"|&TSOL;[&SLevel] --&TSSP|[&TORP] --&TSDP|[&TSSP(replace,[&TSSec],[&TDSec])] --=MovedLevelDelta|[&NewLevel] - [&SLevel] --=MovedOldBaselineDelta|[&SLevel] - [&TSOL] --=MovedNewBaselineDelta|[&NewLevel] - [&TSOL] --?[$MovedOldBaselineDelta.Raw] -gt 0 -or [$MovedNewBaselineDelta.Raw] -gt 0|&ShouldAdjustWarlockDamage;1 --]| --?"[&TSSP]" -eq "[&TSDP]"|SMRAR --~|array;attributes;MoveRowAttrs;[&CharID];[&TSSP] --?"[@MoveRowAttrs(maxindex)]" -lt "0"|SMRAR --%MoveAttrID|foreach;MoveRowAttrs --&OldAttrName|[*O:[&MoveAttrID]:attribute:name] --&NewAttrName|[&OldAttrName(replace,[&TSSP],[&TSDP])] --!attribute:[&MoveAttrID]|name:[&NewAttrName] --%| --:SMRAR| --!a:[&CharID]|[&TSDP]spelllevel:[&NewLevel] --!a:[&CharID]|$[&TSDP]smm_originallevel:[&TSOL] --?"[&WhatDo]" -eq "CHOOSE" -and "[&NewLevel]" -eq "cantrip"|[ --!a:[&CharID]|[&TSDP]spellathigherlevels:SBM_CANTRIP_REFRESH --!a:[&CharID]|[&TSDP]spellathigherlevels: --]| --?"[&WhatDo]" -eq "CHOOSE"|[ --!a:[&CharID]|[&TSDP]roll_output_dc:[*[&CharID]:spell_save_dc] --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&IMCM]" -ne "1" -and "[*[&CharID]:class]" -eq ""|[ --!a:[&CharID]|!npcspellcastingflag:1 --]| --?"[&WhatDo]" -eq "CHOOSE" -and "[&IMCM]" -ne "1" -and "[*[&CharID]:npc]" -eq "1"|[ --!a:[&CharID]|!npcspellcastingflag:1 --]| --?"[&TSOut]" -ne "ATTACK"|ATSAF --!a:[&CharID]|[&TSDP]spellhldie: --!a:[&CharID]|[&TSDP]spellathigherlevels: --!a:[&CharID]|[&TSDP]spellhldie:[&TSHD] --!a:[&CharID]|[&TSDP]spellathigherlevels:[&TSHL] --?"[&IsNPCSpellManager]" -eq "1"|ATSAR --&TSAID|[*[&CharID]:[&TSDP]spellattackid] --&PERC|% --&OB|{ --&CB|} --&Vbar|\\\\| --?"[&TSAID]" -eq "" -or "[&TSAID]" -eq "undefined" -or "[&TSAID]" -eq "[&NoRow]"|ATSAR --!a:[&CharID]|$[&TSDP]rollcontent:[&PERC][&OB][&CharID][&Vbar]repeating_attack_[&TSAID]_attack[&CB] --!a:[&CharID]|!repeating_attack_[&TSAID]_spelllevel:[&NewLevel] --?"[&WhatDo]" -ne "CHOOSE"|ATSASID --!a:[&CharID]|!repeating_attack_[&TSAID]_spellid:[&CSRID] --:ATSASID| --!a:[&CharID]|repeating_attack_[&TSAID]_options-flag:0 --:ATSAR| --?"[&WhatDo]" -ne "MOVE" -or "[&ShouldAdjustWarlockDamage]" -ne "1"|ATSAF --&TSPF|spelldamage --&TSPD|[&TSDmg] --?"[&TSHeal]" -ne "" -and "[&TSHeal]" -ne "undefined" -and "[&TSHeal]" -ne "[&NoRow]"|[ --&TSPF|spellhealing --&TSPD|[&TSHeal] --]| -->AWSD|[&CharID];[&TSDP];[&TSPF];[&TSAID];dmgbase;[&TSPD];[&TSHD];[&TSHDT];[$MovedLevelDelta.Raw] -->AWSD|[&CharID];[&TSDP];spelldamage2;[&TSAID];dmg2base;[&TSD2];[&TSHD];[&TSHDT];[$MovedLevelDelta.Raw] --:ATSAF| --?"[&TSOut]" -ne "ATTACK" -and "[&TSHL]" -ne ""|[ --!a:[&CharID]|[&TSDP]spellathigherlevels: --!a:[&CharID]|[&TSDP]spellathigherlevels:[&TSHL] --]| --?"[&WhatDo]" -eq "MOVE"|Restart --:TransferSpellDone| --X| --:AWSD|Character ID;Spell row prefix;Spell field;Attack row ID;Attack field;Dice expression;HL die count;HL sdie type;Level delta --?"[&WhatDo]" -ne "MOVE"|< --?"[&ShouldAdjustWarlockDamage]" -ne "1"|< --?"[%7%]" -match "^[0-9]+$" -and "[%6%]" -match "^[0-9]+d[0-9]+$"|AWSDReady --<| --:AWSDReady| --~AdjustedWriteDiceBase|string;before;d;[%6%] --=AdjustedWriteHLDice|[%7%] * [%9%] --=AdjustedWriteDiceRoll|[&AdjustedWriteDiceBase] + [$AdjustedWriteHLDice.Raw] --?[$AdjustedWriteDiceRoll.Raw] -lt 0|=AdjustedWriteDiceRoll;0 --&AWD|[$AdjustedWriteDiceRoll.Raw][%8%] --!a:[%1%]|[%2%][%3%]:[&AWD] --?"[%4%]" -eq "" -or "[%4%]" -eq "undefined" -or "[%4%]" -eq "[&NoRow]"|< --!a:[%1%]|$repeating_attack_[%4%]_[%5%]:[&AWD] --!a:[%1%]|$repeating_attack_[%4%]_hldmg: --<| --:SpellDescription| --#hidecard|1 -->LoadSBMSettings| -->ParseSBMSettings| -->LoadSBMPlayerTheme| -->ApplySBMTheme| --&lvlsuffix| --&Verbal| --&Somatic| --&Components| --&Materials| --&SDur| --~SpellInfo|string;split;!@!;[&reentryval] --&SMID|[&SpellInfo1] --&SpellName|[&SpellInfo2] --&LevelLoop|[&SpellInfo3] --Rfind|[&SMID];[&SpellName];repeating_spell-[&LevelLoop];spellname --&SDEL|[*R:spelllevel] --?"[&SDEL]" -eq "" -or "[&SDEL]" -eq "0" -or "[&SDEL]" -eq "undefined"|&SDEL;[&LevelLoop] --?"[&SDEL]" -eq "1"|&lvlsuffix;st --?"[&SDEL]" -eq "2"|&lvlsuffix;nd --?"[&SDEL]" -eq "3"|&lvlsuffix;rd --?"[&SDEL]" -ge "4"|&lvlsuffix;th --?"[*R:spellcomp_v]" -inc "v=1" -or "[*R:spellcomp_v]" -ne "0"|&Verbal;V --?"[*R:spellcomp_s]" -inc "s=1" -or "[*R:spellcomp_s]" -ne "0"|&Somatic;S --?"[*R:spellcomp_m]" -inc "m=1" -or "[*R:spellcomp_m]" -ne "0"|[ --&Components|M --&Materials|([*R:spellcomp_materials]) --]| --&SDur|[*R:spellduration] --?"[*R:spellconcentration]" -inc "concentration=1"|[ --?"[&SDur]" -ninc "up to "|&SDur;up to [&SDur] --&SDur|Concentration, [&SDur(tolowercase)]. --]| --&SpellLevelOutput|[&SDEL][&lvlsuffix] level [*R:spellschool] --&SDText|[*R:spelldescription] --&LB|[ --&RB|] --~SDText|string;replaceall;[&LB][&LB]spell_save_dc[&RB][&RB];[*[&CharID]:spell_save_dc];[&SDText] --&SDDie| --&SDRF| --&SDDB|1 -->FindSpellDescRoll|[&LB][&LB][&LB][&LB]spelllevel+1[&RB][&RB]d;1;2 -->FindSpellDescRoll|[&LB][&LB][&LB][&LB]spelllevel+5[&RB][&RB]d;5;2 -->FindSpellDescRoll|[&LB][&LB][&LB][&RB]d;5;2 -->FindSpellDescRoll|[&LB][&LB](spelllevel+1)d;1;1 --?"[&SDRF]" -eq ""|AfterSpellDescCustomRollDisplay --=SpellDescDiceCount|[&SDEL] + [&SDDB] --&SDRD|[$SpellDescDiceCount.Raw]d[&SDDie] [&LB][$SpellDescDiceCount.Raw]d[&SDDie][&RB] --~SDText|string;replaceall;[&SDRF];[&SDRD];[&SDText] --:AfterSpellDescCustomRollDisplay| --?"[&SDText]" -inc "[&LB][&LB][&LB][&RB]d6[&RB][&RB]"|[ --=SpellDescQueryDiceCount|[&SDEL] + 5 --&SDQRD|[$SpellDescQueryDiceCount.Raw]d6 [&LB][$SpellDescQueryDiceCount.Raw]d6[&RB] --~SDText|string;replaceall;[&LB][&LB][&LB][&RB]d6[&RB][&RB];[&SDQRD];[&SDText] --]| --&SWrite|[t [&SDO]][tr][td [&SDOC]][t [&SDT]][tr][td [&SDTi]][*R:spellname][/td][/tr][tr][td [&SDS]][&SpellLevelOutput(totitlecase)][/td][/tr][tr][td [&SDL]][b]Casting Time:[/b]  [*R:spellcastingtime][/td][/tr][tr][td [&SDL]][b]Range:[/b]  [*R:spellrange][/td][/tr] --?"[*R:spelltarget]" -ne "" -and "[*R:spelltarget]" -ne "undefined" -and "[*R:spelltarget]" -ne "[&NoRow]"|[ --&SWrite|+[tr][td [&SDL]][b]Target:[/b]  [*R:spelltarget][/td][/tr] --]| --&SWrite|+[tr][td [&SDL]][b]Components:[/b]  [&Verbal] [&Somatic] [&Components] [&Materials][/td][/tr][tr][td [&SDL]][b]Duration:[/b]  [&SDur][/td][/tr] --?"[*R:spellclass]" -ne "" -and "[*R:spellclass]" -ne "undefined" -and "[*R:spellclass]" -ne "[&NoRow]"|[ --&SWrite|+[tr][td [&SDL]][b]Classes:[/b]  [*R:spellclass][/td][/tr] --]| --?"[*R:spellsource]" -ne "" -and "[*R:spellsource]" -ne "undefined" -and "[*R:spellsource]" -ne "[&NoRow]"|[ --&SWrite|+[tr][td [&SDL]][b]Source:[/b]  [*R:spellsource][/td][/tr] --]| --&SWrite|+[tr][td [&SDTx]][&SDText][/td][/tr] --?"[*R:spellathigherlevels]" -ne "" -and "[*R:spellathigherlevels]" -ne "undefined" -and "[*R:spellathigherlevels]" -ne "[&NoRow]"|[ --&SWrite|+[tr][td [&SDSe]][b]At Higher Levels:[/b]  [*R:spellathigherlevels][/td][/tr] --]| --&SWrite|+[/t][/td][/tr][/t] --!h:[&SDHID]|notes:"[&SWrite]" --X| --:FindSpellDescRoll|Pattern;Bonus;Mode --?"[&SDRF]" -ne "" -or "[&SDText]" -ninc "[%1%]"|< --~SDDie|string;after;[%1%];[&SDText] --~SDDie|string;before;[&RB][&RB];[&SDDie] --&SDRF|[%1%][&SDDie][&RB][&RB] --?"[%3%]" -eq "2"|&SDRF;+ [&LB][&LB][&RB]d[&SDDie][&RB] --&SDDB|[%2%] --<| --:NoAssignedSpellMules| -->SetSpellSourceBackButton| --&NAMText|No spell lists are assigned to this character through class or character settings. Ask your DM to assign one or more spell lists to this character. --&SettingsButton|[&SettingsBtn]NoAssignedSpellMules[/rbutton] --?"[&SendingPlayerIsGM]" -eq "1"|&NAMText;No spell mules are assigned to this character through class or character settings. Open Settings and assign one or more spell mule characters to a matching class or directly to this character. -->OpenSBMCard|No Assigned Spell Mules --&CardHTML|+[&CTR][&NAMText][/td][/tr] -->ShowSBMCard| --X| }}