!!insidediv!!



Being the Official Discussion Forum for HYPERBOREA®, a role-playing game of swords, sorcery, and weird science-fantasy


Visit us at the HYPERBOREA web site!


You are not logged in. Would you like to login or register?

7/14/2022 9:48 am  #1


Roll20 Character Sheet

Just starting a Roll20 specific character sheet thread.

It all starts with roll20's github repo

https://github.com/Roll20/roll20-character-sheets


What? Me worry?
 

7/14/2022 9:51 am  #2


Re: Roll20 Character Sheet

I don't have much time at the moment to go into any kind of depth.

But you can fork the repo, muck with the sheet that is already there and copy/paste it into a "new" roll20 game so you can test changes.

I don't recall how active the creator of it is here or elsewhere.

Once your private/test version works like you think then do a PR against the main repo.


What? Me worry?
     Thread Starter
 

7/14/2022 6:45 pm  #3


Re: Roll20 Character Sheet

That's what I was thinking of but I am definitely not the coder you are, I'm merely editing the 2e sheet. If you'd like I can post what changes I've made/am trying to make and you can make sure its more structurally sound than wet cardboard.

 

7/15/2022 12:09 pm  #4


Re: Roll20 Character Sheet

Oh, I'm not coder of that variety.

I think the github repo might mention the person that created the Hyperborea character sheet. They would be a much better person to look at changes than I


What? Me worry?
     Thread Starter
 

7/15/2022 4:05 pm  #5


Re: Roll20 Character Sheet

I know that Zach made the first roll 20 sheet ("under_score" here on the forum I think).

 

7/18/2022 9:09 am  #6


Re: Roll20 Character Sheet

WebwayDrifter wrote:

I know that Zach made the first roll 20 sheet ("under_score" here on the forum I think).

Yes, he did. He's also on Discord as under_score....
 


-- 
BlackKnight, AKA Sausage
Older than Dirt, Crusty, and set in my ways. Been playing TTRPGs for over 45 years...
 

7/18/2022 3:13 pm  #7


Re: Roll20 Character Sheet

Well hey guys.  Yeah, I haven't been around in a while.
The Roll20 sheet I made started out as a copy of the Swords & Wizardry sheet.  I haven't updated it in a couple years because I stopped using Roll20.  I spent some time working on a Foundry ruleset but it never got to a state I liked it.  So I'm not sure I can be much help.

 

7/19/2022 7:06 pm  #8


Re: Roll20 Character Sheet

I've been tinkering with the character sheet for the last week and while I've only made a few personal changes to the layout, I also developed a script that auto calculates the derived statistics from attributes. If you have Roll20 pro you can copy this at the bottom of the sheet HTML layout. I've changed the html attribute names for ST,DX,CN,IN,WS,and CH to lower case so make those changes in the top side of the HTML layout of change them back here to uppercase. 

<script type="text/worker">
on("change:st sheet:opened", function() {
    getAttrs(['st', 'meleehitbonus', 'meleedmgbonus', 'testst', 'featst'], function(values) { 
        var strength = parseInt(values.st)||0;
        var mhb = 0;
        var mdb = 0;
        var ts = 0;
        var fs = 0;
        if (strength === 3){
           mhb = -2;
            mdb = -2;
            ts = 1;
            fs = 0;
        }
        else if (strength === 4 || strength === 5 || strength === 6){
             mhb = -1;
             mdb = -1;
             ts = 1;
             fs = 1;
        }   
            else if (strength === 7 || strength === 8){
                 mhb = 0;
                 mdb = -1;
                 ts = 2;
                 fs = 2;
            }
                else if (strength === 9 || strength === 10 || strength === 11 || strength === 12){
                    mhb = 0;
                    mdb = 0;
                    ts = 2;
                    fs = 4;
                }
                    else if (strength === 13 || strength === 14){
                        mhb = 0;
                        mdb = 1;
                        ts = 3;
                        fs = 8;
                    }
                        else if (strength === 15 || strength === 16 ){
                            mhb = 1;
                            mdb = 1;
                            ts = 3;
                            fs = 16;
                        }
                            else if (strength === 17){
                                 mhb = 1;
                                 mdb = 2;
                                 ts = 4;
                                 fs = 24;
                            }
                                else if (strength === 18){
                                 mhb = 2;
                                 mdb = 3;
                                 ts = 5;
                                 fs = 32;
                                }
        setAttrs({ 
        "meleehitbonus": mhb, 
        "meleedmgbonus": mdb, 
        "testst": ts, 
        "featst": fs
        });
    });
}); 

on("change:dx sheet:opened", function() {
    getAttrs(['dx', 'missilehitbonus', 'dexdefbonus', 'testdx', 'featdx'], function(values) { 
        var dexterity = parseInt(values.dx)||0;
        var mihb = 0;
        var ddb = 0;
        var td = 0;
        var fd = 0;
        if (dexterity === 3){
           mihb = -2;
            ddb = -2;
            td = 1;
            fd = 0;
        }
        else if (dexterity === 4 || dexterity === 5 || dexterity === 6){
             mihb = -1;
             ddb = -1;
             td = 1;
             fd = 1;
        }   
            else if (dexterity === 7 || dexterity === 8){
                 mihb = -1;
                 ddb = 0;
                 td = 2;
                 fd = 2;
            }
                else if (dexterity === 9 || dexterity === 10 || dexterity === 11 || dexterity === 12){
                    mihb = 0;
                    ddb = 0;
                    td = 2;
                    fd = 4;
                }
                    else if (dexterity === 13 || dexterity === 14){
                        mihb = 1;
                        ddb = 0;
                        td = 3;
                        fd = 8;
                    }
                        else if (dexterity === 15 || dexterity === 16 ){
                            mihb = 1;
                            ddb = 1;
                            td = 3;
                            fd = 16;
                        }
                            else if (dexterity === 17){
                                 mihb = 2;
                                 ddb = 1;
                                 td = 4;
                                 fd = 24;
                            }
                                else if (dexterity === 18){
                                 mihb = 3;
                                 ddb = 2;
                                 td = 5;
                                 fd = 32;
                                }
        setAttrs({ 
        "missilehitbonus": mihb, 
        "dexdefbonus": ddb, 
        "testdx": td, 
        "featdx": fd
        });
    });
});

on("change:cn sheet:opened", function() {
    getAttrs(['cn', 'poisonbonus', 'hpbonus', 'traumasurvive', 'testcn', 'featcn'], function(values) { 
        var constitution = parseInt(values.cn)||0;
        var hpb = 0;
        var pb = 0;
        var trs = 0;
        var tc = 0;
        var fc = 0;
        if (constitution === 3){
            hpb = -1;
            pb = -2;
            trs = 45;
            tc = 1;
            fc = 0;
        }
        else if (constitution === 4 || constitution === 5 || constitution === 6){
             hpb = -1;
             pb = -1;
             trs = 55;
             tc = 1;
             fc = 1;
        }   
            else if (constitution === 7 || constitution === 8){
                 hpb = 0;
                 pb = 0;
                 trs = 65;
                 tc = 2;
                 fc = 2;
             }
                else if (constitution === 9 || constitution === 10 || constitution === 11 || constitution === 12){
                    hpb = 0;
                    pb = 0;
                    trs = 75;
                    tc = 2;
                    fc = 4;
                }
                    else if (constitution === 13 || constitution === 14){
                        hpb = 1;
                        pb = 0;
                        trs = 80;
                        tc = 3;
                        fc = 8;
                    }
                        else if (constitution === 15 || constitution === 16 ){
                            hpb = 1;
                            pb = 1;
                            trs = 85;
                            tc = 3;
                            fc = 16;
                        }
                            else if (constitution === 17){
                                 hpb = 2;
                                 pb = 1;
                                 trs = 90;
                                 tc = 4;
                                 fc = 24;
                            }
                                else if (constitution === 18){
                                 hpb = 3;
                                 pb = 2;
                                 trs = 95;
                                 tc = 5;
                                 fc = 32;
                                }
        setAttrs({ 
        "hpbonus": hpb, 
        "poisonbonus": pb, 
        "traumasurvive": trs, 
        "testcn": tc,
        "featcn": fc,
        });
    });
});

on("change:in sheet:opened", function() {
    getAttrs(['in', 'langbonus', 'bonusmagspells', 'learnmagspell'], function(values) { 
        var intelligence = parseInt(values.in)||0;
        var lb = 0;
        var bms = 0;
        var lms = 0;
        if (intelligence === 3){
            lb = 0;
            bms = 0;
            lms = 0;
        }
        else if (intelligence === 4 || intelligence === 5 || intelligence === 6){
             lb = 0;
             bms = 0;
             lms = 0;
        }   
            else if (intelligence === 7 || intelligence === 8){
                 lb = 0;
                 bms = 0;
                 lms = 0;
             }
                else if (intelligence === 9 || intelligence === 10 || intelligence === 11 || intelligence === 12){
                    lb = 0;
                    bms = 0;
                    lms = 50;
                }
                    else if (intelligence === 13 || intelligence === 14){
                        lb = 1;
                        bms = 1;
                        lms = 65;
                    }
                        else if (intelligence === 15 || intelligence === 16 ){
                            lb = 1;
                            bms = 2;
                            lms = 75;
                        }
                            else if (intelligence === 17){
                                 lb = 2;
                                 bms = 3;
                                 lms = 85;
                            }
                                else if (intelligence === 18){
                                 lb = 3;
                                 bms = 4;
                                 lms = 95;
                                }
        setAttrs({ 
        "langbonus": lb, 
        "bonusmagspells": bms, 
        "learnmagspell": lms, 
        });
    });
});

on("change:ws sheet:opened", function() {
    getAttrs(['ws', 'willmod', 'bonusclerspells', 'learnclerspell'], function(values) { 
        var wisdom = parseInt(values.ws)||0;
        var wm = 0;
        var bcs = 0;
        var lcs = 0;
        if (wisdom === 3){
            wm = -2;
            bcs = 0;
            lcs = 0;
        }
        else if (wisdom === 4 || wisdom === 5 || wisdom === 6){
             wm = -1;
             bcs = 0;
             lcs = 0;
        }   
            else if (wisdom === 7 || wisdom === 8){
                 wm = 0;
                 bcs = 0;
                 lcs = 0;
             }
                else if (wisdom === 9 || wisdom === 10 || wisdom === 11 || wisdom === 12){
                    wm = 0;
                    bcs = 0;
                    lcs = 50;
                }
                    else if (wisdom === 13 || wisdom === 14){
                        wm = 0;
                        bcs = 1;
                        lcs = 65;
                    }
                        else if (wisdom === 15 || wisdom === 16 ){
                            wm = 1;
                            bcs = 2;
                            lcs = 75;
                        }
                            else if (wisdom === 17){
                                 wm = 1;
                                 bcs = 3;
                                 lcs = 85;
                            }
                                else if (wisdom === 18){
                                 wm = 2;
                                 bcs = 4;
                                 lcs = 95;
                                }
        setAttrs({ 
        "willmod": wm, 
        "bonusclerspells": bcs, 
        "learnclerspell": lcs, 
        });
    });
});
on("change:ch sheet:opened", function() {
    getAttrs(['ch', 'reactionmod', 'maxhench', 'turningadj'], function(values) { 
        var charisma = parseInt(values.ch)||0;
        var rm = 0;
        var mh = 0;
        var ta = 0;
        if (charisma === 3){
            rm = -3;
            mh = 1;
            ta = -1;
        }
        else if (charisma === 4 || charisma === 5 || charisma === 6){
             rm = -2;
             mh = 2;
             ta = -1;
        }   
            else if (charisma === 7 || charisma === 8){
                 rm = -1;
                 mh = 3;
                 ta = 0;
             }
                else if (charisma === 9 || charisma === 10 || charisma === 11 || charisma === 12){
                    rm = 0;
                    mh = 4;
                    ta = 0;
                }
                    else if (charisma === 13 || charisma === 14){
                        rm = 1;
                        mh = 6;
                        ta = 0;
                    }
                        else if (charisma === 15 || charisma === 16 ){
                            rm = 1;
                            mh = 8;
                            ta = 1;
                        }
                            else if (charisma === 17){
                                 rm = 2;
                                 mh = 10;
                                 ta = 1;
                            }
                                else if (charisma === 18){
                                 rm = 3;
                                 mh = 12;
                                 ta = 1;
                                }
        setAttrs({ 
        "reactionmod": rm, 
        "maxhench": mh, 
        "turningadj": ta, 
        });
    });
});
</script>

 

7/23/2022 11:50 am  #9


Re: Roll20 Character Sheet

So I did a quick test:

0) went to the roll20 github page for the AS&SH sheet to get html/css
https://github.com/Roll20/roll20-character-sheets/tree/master/AS%26SH

1) created new game in roll20

2) Go to Settings (gear) -> Game Settings

3) copy and paste html/css into the respective tabs

A quick test shows things working as expected.

The next step  would be to modify Feats of ST/DX/CN based upon class. Trying to correct that in the current form of the sheet resets back to the "correct" setting.


What? Me worry?
     Thread Starter
 

7/25/2022 12:43 am  #10


Re: Roll20 Character Sheet

Roger, I've just finished a Turn Undead table that auto updates based on your turning level and your charisma modifier.
I've also been screwing the u.i for button displays (so they match the dice being rolled) and adding information in the top like complexion and more language slots. Right now I'm working on button to randomize race and physique. After, I'm gonna start working on class derived stats like fighting/casting/turning ability and bonuses to feats of st/dx/cn. 

 

7/25/2022 10:13 am  #11


Re: Roll20 Character Sheet

I'm dubious about the feature to randomly generate player stuff.

However, the rest is cool.

This might be useful for updating the roll20 github character sheet

https://app.roll20.net/forum/post/6674418/updating-an-existing-character-sheet


What? Me worry?
     Thread Starter
 

8/16/2022 12:46 am  #12


Re: Roll20 Character Sheet

Alrighty, it's been a heck of a month but I've finished as much as I think I can with the java I know. 
I've modified the character sheet heavily enough to where I don't feel comfortable replacing the pre-existing sheet without some kind of peer review and maybe some cleaning up so I'm just gonna post the HTML layout and the CSS styling code which (provided you have roll20 pro) you can take a look at yourself and fiddle with. Generally, my mission with this project was to make character creation easier and reducing the amount of looking up tables from the book. 
 
As far as features added in:

-I reformatted the class, race, and gender inputs as selectable options (as they are used in other calculations)

-I created buttons that allow you to randomly generate race, gender, age, secondary skills, and all of the physique traits (which are based off of gender and race). All of which can be overwritten if so desired. 
   - gender has 3 options in the event someone wants to make someone non-binary but the buttons for random physique only work with man or woman so roll those first and then switch gender. 

-Primary attributes should be automatically written based on your class selection.

-I made a button that auto rolls attributes (which also automatically print derived statistics).

-I tried to edit the buttons so they resembled the rolls being made (when possible).

-The HD calculator is also automatically derived from class, level, and hp modifiers.

-XP needed is automatically derived from class and level and, if your primary attribute(s) is high enough, is automatically lowered by 10% to reflect bonus xp.

-I fleshed out the saving throws section to include more specifics about where your numbers are coming from (all automated).

-Fighting ability, unskilled attack penalty, Turning ability, and Casting ability are all automated and I added a table for turning ability and progressive thief abilities that automatically adjust based on turning ability and level respectively. 

Wishlist
I want to make it easier to generate a new character by adding a function to automatically replace equipment with the class' starting pack and add class abilities. Given that these are repeating lists, I'm not sure how to do it. 

Last edited by Bellhopper (8/16/2022 12:50 am)

 

8/16/2022 12:51 am  #13


Re: Roll20 Character Sheet

<div style="display:inline-block;font-size:11px;color: #888888;text-align:left;font-weight: bold;"><span>Sheet:</span></div>
<input type="radio" name="attr_sheetStyle" value="1" class="sheet-styleCharacter" checked="checked" title="Character" /><span><span>Character</span></span>
<input type="radio" name="attr_sheetStyle" value="2" class="sheet-styleMonster" title="Monster" /><span><span>Monster</span></span>

<div class="sheet-main">
    <div class="sheet-ligne"> <!-- LINE 1 -->
        <div class="mycol sheet-nobord"> <!-- HEADER -->
            <div class="sheet-ligne" style="margin-bottom: 2px;">
                <span class="sheet-libred">Player Character Sheet</span>
            </div>
            <div class="sheet-mycol" style="width: 250px;">
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Name</span>
                    <input type="text" class="sheet-longinput" name="attr_character_name" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Class</span>
                    <select name="attr_class" style="width: 140px;">
                    <option value="0">Fighter</option>
                    <option value="1">Magician</option>
                    <option value="2">Cleric</option>
                    <option value="3">Thief</option>
                    <option value="4">Barbarian</option>
                    <option value="5">Berserker</option>
                    <option value="6">Cataphract</option>
                    <option value="7">Huntsman</option>
                    <option value="8">Paladin</option>
                    <option value="9">Ranger</option>
                    <option value="10">Warlock</option>
                    <option value="11">Cryomancer</option>
                    <option value="12">Illusionist</option>
                    <option value="13">Necromancer</option>
                    <option value="14">Pyromancer</option>
                    <option value="15">Witch</option>
                    <option value="16">Druid</option>
                    <option value="17">Monk</option>
                    <option value="18">Priest</option>
                    <option value="19">Runegraver</option>
                    <option value="20">Shaman</option>
                    <option value="21">Assassin</option>
                    <option value="22">Bard</option>
                    <option value="23">Legerdemainist</option>
                    <option value="24">Purloiner</option>
                    <option value="25">Scout</option>
                    </select>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Race</span>
                    <select name="attr_race" style="width: 140px;">
                        <option value="0">Common</option>
                        <option value="1">Amazon</option>
                        <option value="2">Atlantean</option>
                        <option value="3">Esquimaux</option>
                        <option value="4">Hyperborean</option>
                        <option value="5">Ixian</option>
                        <option value="6">Kelt</option>
                        <option value="7">Kimmerian</option>
                        <option value="8">Kimmeri-Kelt</option>
                        <option value="9">Pict</option>
                        <option value="10">Pict(Half-Blood)</option>
                        <option value="11">Viking</option>
                        <option value="12">Anglo-Saxon</option>
                        <option value="13">Carolingian Frank</option>
                        <option value="14">Esquimaux-Ixian</option>
                        <option value="15">Greek</option>
                        <option value="16">Lapp</option>
                        <option value="17">Lemurian</option>
                        <option value="18">Moor</option>
                        <option value="19">Mu</option>
                        <option value="20">Oon</option>
                        <option value="21">Roman</option>
                        <option value="22">Tlingit</option>
                        <option value="23">Yakut</option>
                    </select>
                    <button class="sheet-actiond100" type="action" name="act_raceroll"></button>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Level</span>
                    <input type="number" class="sheet-longinput" name="attr_level" placeholder="" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Alignment</span>
                    <input type="text" class="sheet-longinput" name="attr_align" placeholder="" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Primary</span>
                    <input type="text" class="sheet-longinput" name="attr_primeatt" placeholder="" />
                </div>
            </div>
            <div class="sheet-mycol" style="width: 250px;">
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Gender</span>
                    <select name="attr_gender" style="width: 140px;">
                    <option value="0">Man</option>
                    <option value="1">Woman</option>
                    <option value="2">Non-binary</option>
                    </select>
                    <button class="sheet-actiond20" type="action" name="act_genderroll"></button>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Age</span>
                    <input type="number" class="sheet-medinput" name="attr_age" placeholder=""/>
                    <button class="sheet-actiond20" type="action" name="act_ageroll"></button>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Height</span>
                    <input type="number" class="sheet-medinput" name="attr_heightfeet" placeholder=""/>
                    <span class="sheet-libmin1 sheet-wid1">ft</span>
                    <input type="number" class="sheet-medinput" name="attr_heightinches" placeholder=""/>
                    <span class="sheet-libmin1 sheet-wid1">in</span>
                    <button class="sheet-actiond6" type="action" name="act_heightweightroll"></button>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Weight</span>
                    <input type="number" class="sheet-medinput" name="attr_weight" placeholder=""/>
                    <span class="sheet-libmin1 sheet-wid1">lbs</span>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Hair</span>
                    <input type="text" class="sheet-medinput" name="attr_hair" placeholder=""/>
                    <button class="sheet-actiond20" type="action" name="act_hairroll"></button>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Eyes</span>
                    <input type="text" class="sheet-medinput" name="attr_eyes" placeholder=""/>
                    <button class="sheet-actiond20" type="action" name="act_eyeroll"></button>
                </div>
            </div>
            <div class="sheet-mycol" style="width: 250px;">
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Complexion</span>
                    <input type="text" class="sheet-medinput" name="attr_complexion" placeholder=""/>
                    <button class="sheet-actiond20" type="action" name="act_skinroll"></button>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Languages</span>
                    <input type="text" class="sheet-longinput" name="attr_languages_1" placeholder="" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70"></span>
                    <input type="text" class="sheet-longinput" name="attr_languages_2" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70"></span>
                    <input type="text" class="sheet-longinput" name="attr_languages_3" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Religion</span>
                    <input type="text" class="sheet-longinput" name="attr_religion" placeholder="" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Secondary Skills</span>
                    <input type="text" class="sheet-longinput" name="attr_skills" placeholder="" />
                    <button class="sheet-actiond20" type="action" name="act_skillroll"></button>
                </div>
            </div>
        </div>
    </div>  <!-- END LINE 1 -->
    <div class="sheet-ligne"> <!-- LINE 2 -->
        <div class="sheet-mycol sheet-nobord" style="width:430px;"> <!--ATTRIBUTES-->
            <div class="sheet-ligne">
                <span class="sheet-libred">Attributes</span>
                <button class="sheet-actiond6" type="action" name="act_attributeroll"></button>
            </div>
            <div class="sheet-ligne">
                <input type="number" name="attr_st" value="0" class="sheet-stats" />
                <span class="sheet-lib0 sheet-wid30">ST</span>
                <span class="sheet-libmin1 sheet-wid70">Atk Mod</span>
                <input type="number" name="attr_meleehitbonus" value="0" class="sheet-tinyinput"/>
                <span class="sheet-libmin1 sheet-wid70">Damage</span>
                <input type="number" class="sheet-tinyinput" name="attr_meleedmgbonus" value="0" />
            </div>
            <div class="sheet-ligne" style="padding-left: 78px;">
                <span class="sheet-libmin1 sheet-wid30"></span>
                <span class="sheet-libmin1" style="width:39px;">Test of ST</span>
                <button class="sheet-d6" type="roll" name="TestOfST" title="Test of ST" value="&{template:tmpl} {{pc=@{character_name}}} {{name=Test of Strength}} {{talent=1}} {{roll=[[1d6cs1cf6]]}} {{target=[[@{testst}]]}}" /></button>
                <input type="number" class="sheet-tinyinput" name="attr_testst" value="1"/>
                <span class="sheet-libmin1" style="width:39px;">Feat of ST</span>
                <button class="sheet-d100" type="roll" name="RollFeatST" title="Feat of ST" value="&{template:tmpl} {{pc=@{character_name}}} {{name=Feat of Strength}} {{talent=1}} {{roll=[[1d100cs1cf100]]}} {{target=[[@{featst}]]}}" /></button>
                <input type="number" class="sheet-tinyinput" name="attr_featst" value="0"/>
            </div>
            <div class="sheet-ligne">
                <input type="number" name="attr_dx" value="0" class="sheet-stats" />
                <span class="sheet-lib0 sheet-wid30">DX</span>
                <span class="sheet-libmin1 sheet-wid70">Atk Mod</span>
                <input type="number" name="attr_missilehitbonus" value="0" class="sheet-tinyinput"/>
                <span class="sheet-libmin1 sheet-wid70">Defense</span>
                <input type="number" class="sheet-tinyinput" name="attr_dexdefbonus" value="0" />
                </div>
            <div class="sheet-ligne" style="padding-left: 78px;">
                <span class="sheet-libmin1 sheet-wid30"></span>
                <span class="sheet-libmin1" style="width:39px;">Test of DX</span>
                <button class="sheet-d6" type="roll" name="RollTestDX" value="&{template:tmpl} {{pc=@{character_name}}} {{name=Test of DX}} {{talent=1}} {{roll=[[1d6cs1cf6]]}} {{target=[[@{testdx}]]}}" /></button>
                <input type="number" class="sheet-tinyinput" name="attr_testdx" value="1"/>
                <span class="sheet-libmin1" style="width:39px;">Feat of DX</span>
                <button class="sheet-d100" type="roll" name="RollFeatDX" value="&{template:tmpl} {{pc=@{character_name}}} {{name=Feat of DX}} {{talent=1}} {{roll=[[1d100cs1cf100]]}} {{target=[[@{featdx}]]}}" /></button>
                <input type="number" class="sheet-tinyinput" name="attr_featdx" value="1"/>
            </div>
            <div class="sheet-ligne">
                <input type="number" name="attr_cn" value="0" class="sheet-stats" />
                <span class="sheet-lib0 sheet-wid30">CN</span>
                <span class="sheet-libmin1 sheet-wid70">HP Mod</span>
                <input type="number" name="attr_hpbonus" value="0" class="sheet-tinyinput"/>
                <span class="sheet-libmin1 sheet-wid70">Poison/Radiation</span>
                <input type="number" class="sheet-tinyinput" name="attr_poisonbonus" value="0" />
            </div>
            <div class="sheet-ligne">
                <span class="sheet-libmin1" style="width:39px;">Trauma</span>
                <button class="sheet-d100" type="roll" name="RollTraumaSurvive" value="&{template:tmpl} {{pc=@{character_name}}} {{name=^{trauma_survive}}} {{talent=1}} {{roll=[[1d100cs1cf100]]}} {{target=[[@{traumasurvive}]]}}" /></button>
                <input type="number" class="sheet-tinyinput" name="attr_traumasurvive" value="1"/>
                <span class="sheet-libmin1" style="width:39px;">Test of CN</span>
                <button class="sheet-d6" type="roll" name="RollTestCN" value="&{template:tmpl} {{pc=@{character_name}}} {{name=Test of CN}} {{talent=1}} {{roll=[[1d6cs1cf6]]}} {{target=[[@{testcn}]]}}" /></button>
                <input type="number" class="sheet-tinyinput" name="attr_testcn" value="1"/>
                <span class="sheet-libmin1" style="width:39px;">Feat of CN</span>
                <button class="sheet-d100" type="roll" name="RollFeatCN" value="&{template:tmpl} {{pc=@{character_name}}} {{name=Feat of CN}} {{talent=1}} {{roll=[[1d100cs1cf100]]}} {{target=[[@{featcn}]]}}" /></button>
                <input type="number" class="sheet-tinyinput" name="attr_featcn" value="1"/>
            </div>
            <div class="sheet-ligne">
                <input type="number" name="attr_in" value="0" class="sheet-stats" />
                <span class="sheet-lib0 sheet-wid30">IN</span>
                <span class="sheet-libmin1 sheet-wid70">Languages</span>
                <input type="text" name="attr_langbonus" value="0" class="sheet-tinyinput"/>
                <span class="sheet-libmin1" style="width:39px;">Learn Spell</span>
                <button class="sheet-d100" type="roll" name="RollLearnMagicianSpell" value="&{template:tmpl} {{pc=@{character_name}}} {{name=Learn Spell}} {{talent=1}} {{roll=[[1d100cs1cf100]]}} {{target=[[@{learnmagspell}]]}}" /></button>
                <input type="text" class="sheet-tinyinput" name="attr_learnmagspell" value="1"/>
            </div>
            <div class="sheet-ligne" style="padding-left: 78px;">
                <span class="sheet-libmin1 sheet-wid30"></span>
                <span class="sheet-libmin1 sheet-wid70">Bonus Spells</span>
                <input type="text" name="attr_bonusmagspells" value="0" class="sheet-tinyinput"/>
            </div>
            <div class="sheet-ligne">
                <input type="number" name="attr_ws" value="0" class="sheet-stats" />
                <span class="sheet-lib0 sheet-wid30">WS</span>
                <span class="sheet-libmin1 sheet-wid70">Willpower</span>
                <input type="number" name="attr_willmod" value="0" class="sheet-tinyinput"/>
                <span class="sheet-libmin1" style="width:39px;">Learn Spell</span>
                <button class="sheet-d100" type="roll" name="RollLearnClericSpell" value="&{template:tmpl} {{pc=@{character_name}}} {{name=Learn Spell}} {{talent=1}} {{roll=[[1d100cs1cf100]]}} {{target=[[@{learnclerspell}]]}}" /></button>
                <input type="text" class="sheet-tinyinput" name="attr_learnclerspell" value="1"/>
            </div>
            <div class="sheet-ligne" style="padding-left: 78px;">
                <span class="sheet-libmin1 sheet-wid30"></span>
                <span class="sheet-libmin1 sheet-wid70">Bonus Spells</span>
                <input type="text" name="attr_bonusclerspells" value="0" class="sheet-tinyinput"/>
            </div>
            <div class="sheet-ligne">
                <input type="number" name="attr_ch" value="0" class="sheet-stats" />
                <span class="sheet-lib0 sheet-wid30">CH</span>
                <span class="sheet-libmin1 sheet-wid70">React/Loyalty</span>
                <input type="number" name="attr_reactionmod" value="0" class="sheet-tinyinput"/>
                <span class="sheet-libmin1 sheet-wid70">Max Henchmen</span>
                <input type="number" name="attr_maxhench" value="0" class="sheet-tinyinput"/>
            </div>
            <div class="sheet-ligne" style="padding-left: 78px;">
                <span class="sheet-libmin1 sheet-wid30"></span>
                <span class="sheet-libmin1 sheet-wid70">Turning Adj</span>
                <input type="number" name="attr_turningadj" value="0" class="sheet-tinyinput"/>
            </div>
        </div> <!--END ATTRIBUTES-->
        <div class="sheet-mycol sheet-nobord" style="width:400px;"> <!--SAVING THROWS & HP & XP-->
            <div class="sheet-mycol sheet-nobord" style="width:350px;">
                <div class="sheet-ligne">
                    <span class="sheet-libred">Health</span>
                </div>
                <div class="sheet-mycol" style="width:310px;">
                    <span class="sheet-lib1">HP</span>
                    <input type="number" name="attr_hp" value="0" class="sheet-shortinput"/>
                    <input type="number" name="attr_hp_max" value="0" class="sheet-shortinput"/>
                    <span class="sheet-lib1 sheet-wid30">HD</span>
                    <button class="sheet-d8" type="roll" name="RollHD" value="&{template:tmpl} {{pc=@{character_name}}} {{hd=1}} {{roll=[[@{hd}]]}}"></button>
                    <input type="text" name="attr_hd" class="sheet-medinput" placeholder="Ex:5d6+5" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-libred">Experience</span>
                </div>
                <div class="sheet-mycol" style="width:310px;">
                    <span class="sheet-lib1">XP</span>
                    <input type="number" name="attr_xp" value="0" class="sheet-shortinput"/>
                    <span class="sheet-lib1">To Level</span>
                    <input type="number" name="attr_xp_needed" value="0" class="sheet-shortinput"/>
                    <span class="sheet-lib1 sheet-wid30">Bonus</span>
                    <input type="number" name="attr_xpbonus" value="0" class="sheet-shortinput"/>
                </div>
            </div>
            <div class="sheet-ligne">
                <div class="sheet-mycol sheet-bord" style="width:370px;">
                    <div class="sheet-ligne">
                        <span class="sheet-libred" >Saving Throw</span>
                        <button class="sheet-d20" type="roll" name="RollSavingThrow" title="Roll Base Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{roll=[[1d20cs20cf1]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <input type="number" name="attr_savingthrow" value="0" class="sheet-shortinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-lib0 sheet-wid30">Bonuses </span>
                        <span class="sheet-libmin1 sheet-wid10" style="width: 95px;"></span>
                        <span class="sheet-libmin1 sheet-wid30">Class</span>
                        <span class="sheet-libmin1 sheet-wid10" style="width: 12px;"></span>
                        <span class="sheet-libmin1 sheet-wid30">Magic</span>
                        <span class="sheet-libmin1 sheet-wid10" style="width: 10px;"></span>
                        <span class="sheet-libmin1 sheet-wid30">Misc</span>
                          <span class="sheet-libmin1 sheet-wid10" style="width: 10px;"></span>
                    </div>
                    <div class="sheet-ligne">
                        <button class="sheet-d20" type="roll" name="RollDeathSavingThrow" title="Roll Death Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Death}} {{roll=[[(1d20cs20cf1)+@{deathbonus}]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <span class="sheet-libmin1 sheet-wid30">DEATH:</span>
                        <span class="sheet-libmin1 sheet-wid10" style="width: 27px;"></span>
                        <input type="number" name="attr_deathbonus" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1 sheet-wid10">=</span>
                        <input type="number" name="attr_deathclassbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_deathmagicbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_deathmiscbonus" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid10" style="width: 10px;"></span>
                        <button class="sheet-d20" type="roll" name="RollPoison/RadiationSavingThrow" title="Roll Poison/Radiation Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Death}} {{roll=[[(1d20cs20cf1)+@{poison_radiation}]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <span class="sheet-libmin1 sheet-wid30">Poison/Radiation:</span>
                        <input type="number" name="attr_poison_radiation" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <button class="sheet-d20" type="roll" name="RollTransformSavingThrow" title="Roll Transform Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Transformation}} {{roll=[[(1d20cs20cf1)+@{transformationbonus}]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <span class="sheet-libmin1 sheet-wid30">TRANSFORM:</span>
                        <input type="number" name="attr_transformationbonus" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1 sheet-wid10">=</span>
                        <input type="number" name="attr_transformationclassbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_transformationmagicbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_transformationmiscbonus" value="0" class="sheet-tinyinput" />
                    </div>               
                    <div class="sheet-ligne">
                        <button class="sheet-d20" type="roll" name="RollDeviceSavingThrow" title="Roll Device Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Device}} {{roll=[[(1d20cs20cf1)+@{devicebonus}]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <span class="sheet-libmin1 sheet-wid30">DEVICE:</span>
                        <span class="sheet-libmin1 sheet-wid10" style="width: 22px;"></span>
                        <input type="number" name="attr_devicebonus" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1 sheet-wid10">=</span>
                        <input type="number" name="attr_deviceclassbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_devicemagicbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_devicemiscbonus" value="0" class="sheet-tinyinput" />
                       
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid10" style="width: 10px;"></span>
                        <button class="sheet-d20" type="roll" name="RollDeviceWillpowerSavingThrow" title="Roll Device Willpower Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Device}} {{roll=[[(1d20cs20cf1)+@{device_willpower}]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <span class="sheet-libmin1 sheet-wid30">Device Willpower:</span>
                        <input type="number" name="attr_device_willpower" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1 sheet-wid10" style="width: 122px;"></span>
                        <span class="sheet-libmin1 sheet-wid30">Dex Bonus</span>
                    </div>
                    <div class="sheet-ligne">
                        <button class="sheet-d20" type="roll" name="RollAvoidanceSavingThrow" title="Roll Avoidance Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Avoidance}} {{roll=[[(1d20cs20cf1)+@{avoidbonus}]]}} {{target=[[@{savingthrow}]]}}"></button>                   
                        <span class="sheet-libmin1 sheet-wid30">AVOIDANCE:</span>
                        <span class="sheet-libmin1 sheet-wid10" style="width: 1px;"></span>
                        <input type="number" name="attr_avoidbonus" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1 sheet-wid10">=</span>
                        <input type="number" name="attr_avoidclassbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_avoidmagicbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_avoidmiscbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_avoiddexbonus" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <button class="sheet-d20" type="roll" name="RollSorcerySavingThrow" title="Roll Sorcery Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Sorcery}} {{roll=[[(1d20cs20cf1)+@{sorcerybonus}]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <span class="sheet-libmin1 sheet-wid30">SORCERY:</span>
                        <span class="sheet-libmin1 sheet-wid10" style="width: 10px;"></span>
                        <input type="number" name="attr_sorcerybonus" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1 sheet-wid10">=</span>
                        <input type="number" name="attr_sorceryclassbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_sorcerymagicbonus" value="0" class="sheet-tinyinput" />
                        <input type="number" name="attr_sorcerymiscbonus" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid10" style="width: 10px;"></span>
                        <button class="sheet-d20" type="roll" name="RollSorceryWillpowerSavingThrow" title="Roll Sorcery Willpower Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Sorcery}} {{roll=[[(1d20cs20cf1)+@{sorcery_willpower}]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <span class="sheet-libmin1 sheet-wid30">Sorcery Willpower:</span>
                        <input type="number" name="attr_sorcery_willpower" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                    <button class="sheet-d20" type="roll" name="RollOtherSavingThrow" title="Roll Other Saving Throw" value="&{template:tmpl} {{pc=@{character_name}}} {{save=1}} {{type=Other}} {{roll=[[(1d20cs20cf1)+@{othersavebonus}]]}} {{target=[[@{savingthrow}]]}}"></button>
                        <span class="sheet-libmin1 sheet-wid30">OTHER:</span>
                        <span class="sheet-libmin1 sheet-wid10" style="width: 23px;"></span>
                        <input type="number" name="attr_othersavebonus" value="0" class="sheet-tinyinput" />
                        <input type="text" name="attr_othersavedesc" class="sheet-shortinput" />
                    </div>
                </div>
            </div>
        </div> <!--END SAVING THROWS & HP-->
    </div> <!-- END LINE 2 -->
    <div class="sheet-ligne"> <!-- LINE 3 -->
        <div class="sheet-mycol sheet-nobord" style="width:300px;"> <!--FIGHTING ABILITY-->
            <div class="sheet-ligne">
                <div class="sheet-mycol sheet-bord" style="width:200px;">
                    <span class="sheet-libred" >Fighting Ability</span>
                    <input type="number" name="attr_fightingability" value="0" class="sheet-shortinput" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib2 sheet-wid50" style="width:250;">Weapon Masteries / New Weapon Skills</span>
                    <span class="sheet-lib2 sheet-wid50" style="width:50px;">Level</span>
                    <fieldset class="repeating_weaponskills">
                        <div class="sheet-ligne">
                            <input type="text" name="attr_wpnskill" value="" class="sheet-longinput sheet-bold" style="width:250px;" placeholder="" />
                            <input type="text" name="attr_wpnlevel" value="" class="sheet-shortinput sheet-bold" style="width:50px;" placeholder="" />
                        </div>
                    </fieldset>
                </div>
            </div>
            <div class="sheet-ligne">
                <span class="sheet-lib2 sheet-wid50">Unskilled Attack penalty</span>
                <input type="number" name="attr_unskilledpenalty" value="" class="sheet-shortinput sheet-bold" placeholder="" />
            </div>
        </div>
        <div class="sheet-mycol sheet-nobord" style="width:300px;"> <!--ARMOUR CLASS-->
            <div class="sheet-ligne">
                <span class="sheet-libred" >Armour Class</span>
                <input type="number" name="attr_ac" value="0" class="sheet-shortinput"/>
                <span class="sheet-lib1">DR</span>
                <input type="number" name="attr_armourdr" value="0" class="sheet-shortinput"/>
            </div>
            <div class="sheet-ligne">
                <span class="sheet-libmin1 sheet-wid70">Armour and Shield</span>
                <input type="text" name="attr_wpnskill" value="" class="sheet-longinput sheet-bold" style="width:200px;" placeholder="" />
            </div>
            <div class="sheet-ligne">
                <span class="sheet-libmin1 sheet-wid70">Dexterity Bonus</span>
                <input type="number" name="attr_dexac" value="" class="sheet-tinyinput sheet-bold"; placeholder="0" />
            </div>
            <div class="sheet-ligne">
                <span class="sheet-libmin1 sheet-wid70">Other AC Mods</span>
                <input type="text" name="attr_otherac" value="" class="sheet-longinput sheet-bold" style="width:210px;" placeholder="" />
            </div>
        </div>
        <div class="sheet-mycol sheet-nobord" style="width:100px;"> <!--MOVEMENT-->
            <div class="sheet-ligne">
                <span class="sheet-libred" >Movement</span>
            </div>
            <div class="sheet-ligne">
                <span class="sheet-libmin1 sheet-wid70">(x2 if running / charging)</span>
            </div>
            <div class="sheet-ligne">
                <span class="sheet-lib1">MV</span>
                <input type="number" name="attr_movement" value="" class="sheet-shortinput"/>
            </div>
        </div>
    </div> <!-- END LINE 3 -->
    <div class="sheet-ligne"> <!-- LINE 4 -->
        <div class="sheet-mycol sheet-nobord" style="width:850px;"> <!--WEAPON COMBAT-->
            <div class="sheet-ligne">
                <img style="width:100px;" src="http://i.imgur.com/afa8l5h.png" alt="sword">
                <span class="sheet-libred" >Weapon Combat</span>
                <img style="width:100px;" src="http://i.imgur.com/nuHg8T5.png" alt="scroll">
                <div class="sheet-ligne">
                    <span class="sheet-lib2l" style="width: 275px;">Melee Weapon</span>
                    <span class="sheet-lib2l" style="width: 50px;">Class</span>
                    <span class="sheet-lib2l" style="width: 50px;">Atk Rate</span>
                    <span class="sheet-lib2l" style="width: 50px;">Atk Mod</span>
                    <span class="sheet-lib2l" style="width: 50px;">Damage</span>
                    <span class="sheet-lib2l" style="width: 250px;">Notes</span>
                    <fieldset class="repeating_melee">
                    <button type="roll" name="attr_meleeweapon_roll" value="&{template:tmpl} {{pc=@{character_name}}} {{name=@{meleeweaponname}}} {{attack=1}} {{roll=[[20-(1d20+@{fightingability}+@{meleehitbonus}+@{meleeatkmod})]]}} {{damage=[[(@{meleedamage}+@{meleedmgbonus})]]}}" /></button>
                    <input type="text" name="attr_meleeweaponname" style="width: 250px;" placeholder="Weapon" />
                    <input type="number" name="attr_meleeweaponclass" value="0" />
                    <input type="text" name="attr_meleeatkrate" value="0" class="sheet-tinyinput"/>
                    <input type="number" name="attr_meleeatkmod" value="0" />
                    <input type="text" name="attr_meleedamage" value="" class="sheet-tinyinput"/>
                    <input type="text" name="attr_meleeweaponnote" style="width: 250px;" placeholder="Notes" />
                   
                    </fieldset>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib2l" style="width: 280px;">Missile Weapon</span>
                    <span class="sheet-lib2l" style="width: 50px;">Range</span>
                    <span class="sheet-lib2l" style="width: 50px;">Atk Rate</span>
                    <span class="sheet-lib2l" style="width: 50px;">Atk Mod</span>
                    <span class="sheet-lib2l" style="width: 50px;">Damage</span>
                    <span class="sheet-lib2l" style="width: 250px;">Notes</span>
                    <fieldset class="repeating_missile">
                    <button type="roll" name="attr_missileweapon_roll" value="&{template:tmpl} {{pc=@{character_name}}} {{name=@{missileweaponname}}} {{attack=1}} {{roll=[[20-(1d20+@{fightingability}+@{missilehitbonus}+@{missileatkmod})]]}} {{damage=[[@{missiledamage}]]}}" /></button>
                    <input type="text" name="attr_missileweaponname" style="width: 250px;" placeholder="Weapon" />
                    <input type="text" name="attr_missileweaponrange" value="" class="sheet-shortinput"/>
                    <input type="text" name="attr_missileatkrate" value="0" class="sheet-tinyinput"/>
                    <input type="number" name="attr_missileatkmod" value="0" />
                    <input type="text" name="attr_missiledamage" value="" class="sheet-tinyinput"/>
                    <input type="text" name="attr_missileweaponnote" style="width: 250px;" placeholder="Notes" />
                    </fieldset>
                </div>   
            </div>
        </div>
    </div> <!-- END LINE 4 -->
    <div class="sheet-ligne"> <!-- LINE 5 -->
        <div class="sheet-mycol sheet-nobord" style="width:850px;"> <!--CLASS ABILITIES-->
            <div class="sheet-ligne">
                <span class="sheet-libred" >Class Abilities</span>
                <div class="sheet-ligne">
                    <span class="sheet-lib2l" style="width: 250px;">Ability name</span>
                    <span class="sheet-lib2l" style="width: 550px;">Notes</span>
                    <fieldset class="repeating_abilities">
                    <input type="text" name="attr_abilityname" style="width: 250px;" placeholder="Ability" />
                    <input type="text" name="attr_abilitynote" style="width: 550px;" placeholder="Notes" />
                    </fieldset>
                </div>
            </div>
        </div>
    </div> <!-- END LINE 5 -->
    <div class="sheet-ligne"> <!-- LINE 6 -->
        <div class="sheet-mycol sheet-nobord" style="width:850px;"> <!--SORCERY ABILITIES-->
            <div class="sheet-ligne">
                <span class="sheet-lib2">Progressive Thief Abilities (X:12)</span>
                <div class="sheet-ligne">
                    <span class="sheet-libmin1">Climb</span><input type="text" name="attr_thiefclimb" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">Decipher Script</span><input type="text" name="attr_thiefdecipherscript" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">Discern Noise</span><input type="text" name="attr_thiefdiscernnoise" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">Hide</span><input type="text" name="attr_thiefhide" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">Manipulate Traps</span><input type="text" name="attr_thiefmanipulatetraps" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">Move Silently</span><input type="text" name="attr_thiefmovesilently" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">Open Locks</span><input type="text" name="attr_thiefopenlocks" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">Pick Pockets</span><input type="text" name="attr_thiefpickpockets" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">Read Scrolls</span><input type="text" name="attr_thiefreadscrolls" value="" class="sheet-tinyinput" style="width:25px;" />
                </div>
            </div>
            <div class="sheet-mycol sheet-bord" style="width:200px;">
                    <span class="sheet-libred" >Turning Ability</span>
                    <input type="number" name="attr_turningability" value="0" class="sheet-shortinput" />
            </div>
            <div class="sheet-ligne">
                <span class="sheet-lib2">Turn Undead Success by Undead Type</span>
                <div class="sheet-ligne">
                    <span class="sheet-libmin1">0</span><input type="text" name="attr_undeadtype0" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">1</span><input type="text" name="attr_undeadtype1" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">2</span><input type="text" name="attr_undeadtype2" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">3</span><input type="text" name="attr_undeadtype3" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">4</span><input type="text" name="attr_undeadtype4" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">5</span><input type="text" name="attr_undeadtype5" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">6</span><input type="text" name="attr_undeadtype6" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">7</span><input type="text" name="attr_undeadtype7" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">8</span><input type="text" name="attr_undeadtype8" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">9</span><input type="text" name="attr_undeadtype9" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">10</span><input type="text" name="attr_undeadtype10" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">11</span><input type="text" name="attr_undeadtype11" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">12</span><input type="text" name="attr_undeadtype12" value="" class="sheet-tinyinput" style="width:25px;" />
                    <span class="sheet-libmin1">13</span><input type="text" name="attr_undeadtype13" value="" class="sheet-tinyinput" style="width:25px;" />
                </div>
            </div>
            <div class="sheet-ligne">
                <div class="sheet-mycol sheet-bord" style="width:200px;">
                    <span class="sheet-libred" >Casting Ability</span>
                    <input type="number" name="attr_castingability" value="0" class="sheet-shortinput" />
                </div>
            </div>
            <div class="sheet-mycol sheet-nobord" style="width:450px;">
                <div class="sheet-ligne">
                    <span class="sheet-libred" >Spells Cast Per Day</span>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib2">Magician Spells by Level</span>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1">1:</span><input type="number" name="attr_maglvl1spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">2:</span><input type="number" name="attr_maglvl2spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">3:</span><input type="number" name="attr_maglvl3spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">4:</span><input type="number" name="attr_maglvl4spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">5:</span><input type="number" name="attr_maglvl5spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">6:</span><input type="number" name="attr_maglvl6spells" value="0" class="sheet-tinyinput" />
                    </div>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib2">Cleric Spells by Level</span>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1">1:</span><input type="number" name="attr_clerlvl1spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">2:</span><input type="number" name="attr_clerlvl2spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">3:</span><input type="number" name="attr_clerlvl3spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">4:</span><input type="number" name="attr_clerlvl4spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">5:</span><input type="number" name="attr_clerlvl5spells" value="0" class="sheet-tinyinput" />
                        <span class="sheet-libmin1">6:</span><input type="number" name="attr_clerlvl6spells" value="0" class="sheet-tinyinput" />
                    </div>
                </div>
            </div>
                <div class="sheet-mycol sheet-nobord">
                    <div class="sheet-ligne" style="text-align: right;">
                        <img style="width:100px;" src="http://i.imgur.com/RBBwBGb.png" alt="scroll">
                    </div>
                </div>
            <div class="sheet-ligne">
                <span class="sheet-libred" >Spells Known</span>
                <div class="sheet-ligne">
                    <span class="sheet-lib2l" style="width: 250px;">Spell</span>
                    <span class="sheet-lib2l" style="width: 50px;">Level</span>
                    <span class="sheet-lib2l" style="width: 300px;">Notes</span>
                    <span class="sheet-lib2l" style="width: 50px;"># Mem</span>
                    <span class="sheet-lib2l" style="width: 80px;">Mod</span>
                    <fieldset class="repeating_spells">
                    <input type="text" name="attr_spellname" style="width: 250px;" placeholder="Spell" />
                    <input type="number" name="attr_spelllevel" style="width: 50px;" placeholder="" />
                    <input type="text" name="attr_spellnote" style="width: 320px;" placeholder="Notes" />
                    <input type="number" name="attr_spellmem" style="width: 50px;" placeholder="" />
                    <input type="text" name="attr_spellmodifier" style="width: 60px;" placeholder="1dx+x" />
                    <button type="roll" name="attr_spellmod_roll" value="&{template:tmpl} {{pc=@{character_name}}} {{name=@{spellname}}} {{spell=1}} {{roll=[[ {[[@{spellmodifier}+0d0]], 0}kh1 ]]}}" /></button>
                    </fieldset>
                </div>
            </div>           
        </div>
    </div> <!-- END LINE 6 -->
    <div class="sheet-ligne"> <!-- LINE 7 -->
        <div class="sheet-mycol sheet-nobord" style="width:850px;"> <!--HENCHMEN/HIRELINGS/COMPANIONS-->
            <div class="sheet-ligne">
                <span class="sheet-libred" >Henchmen / Hirelings / Companions</span>
                <div class="sheet-ligne">
                    <span class="sheet-lib2l" style="width: 250px;">Name</span>
                    <span class="sheet-lib2l" style="width: 550px;">Notes</span>
                    <fieldset class="repeating_companions">
                    <input type="text" name="attr_compname" style="width: 250px;" placeholder="Name" />
                    <input type="text" name="attr_compnote" style="width: 550px;" placeholder="Notes" />
                    </fieldset>
                </div>
            </div>
        </div>
    </div> <!-- END LINE 7 -->
    <div class="sheet-ligne"> <!-- LINE 8 -->
        <div class="sheet-ligne">
            <div class="sheet-mycol sheet-nobord" style="width:100px;">
                <div class="sheet-ligne" style="text-align: center;">
                    <img style="width:100px;" src="http://i.imgur.com/wScjQAm.png" alt="backpack">
                </div>
            </div>
            <div class="sheet-mycol sheet-nobord" style="width:250px;"> <!--COINAGE-->
                <div class="sheet-ligne">
                    <span class="sheet-libred" >Coinage</span>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Copper (cp):</span>
                        <input type="number" name="attr_cpcoin" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Silver (sp):</span>
                        <input type="number" name="attr_spcoin" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Electrum (ep):</span>
                        <input type="number" name="attr_epcoin" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Gold (gp):</span>
                        <input type="number" name="attr_gpcoin" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Platinum (pp):</span>
                        <input type="number" name="attr_ppcoin" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Gems and Jewellery:</span>
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70 sheet-bold">Type</span>
                        <span class="sheet-libmin1 sheet-wid85 sheet-bold">Value</span>
                        <span class="sheet-libmin1 sheet-wid40 sheet-bold">Cnt</span>
                        <fieldset class="repeating_blingbling">
                        <input type="text" name="attr_blingtype" class="sheet-tinyinput" style="width: 120px;" placeholder="Type" />
                        <input type="text" name="attr_blingvalue" class="sheet-tinyinput" style="width: 50px;" placeholder="Value" />
                        <input type="number" name="attr_blingcnt" value="0" class="sheet-tinyinput" />
                        </fieldset>
                    </div>
                </div>           
            </div>
            <div class="sheet-mycol sheet-nobord" style="width:250px;"> <!--AMMUNITION-->
                <div class="sheet-ligne">
                    <span class="sheet-libred" >Ammunition</span>
                    <div class="sheet-ligne">
                        <span class="sheet-lib2l" style="width: 200px;">Type</span>
                        <span class="sheet-lib2l" style="width: 50px;">Count</span>
                        <fieldset class="repeating_ammo">
                        <input type="text" name="attr_ammoname" style="width: 200px;" placeholder="Name" />
                        <input type="number" name="attr_ammocount" style="width: 50px;" placeholder="Notes" />
                        </fieldset>
                    </div>
                </div>
            </div>
            <div class="sheet-mycol sheet-nobord" style="width:250px;"> <!--SUPPLIES-->
                <div class="sheet-ligne">
                    <span class="sheet-libred" >Supplies</span>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Water / Wine:</span>
                        <input type="number" name="attr_water" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Rations:</span>
                        <input type="number" name="attr_rations" value="0" class="sheet-tinyinput" />
                    </div>
                    <div class="sheet-ligne">
                        <span class="sheet-libmin1 sheet-wid70">Feed:</span>
                        <input type="number" name="attr_feed" value="0" class="sheet-tinyinput" />
                    </div>
                </div>
            </div>
        </div>
        <div class="sheet-ligne">
          <div class="sheet-mycol sheet-nobord" style="width:850px;"> <!--EQUIPAGE-->
              <div class="sheet-ligne">
                  <span class="sheet-libred" >Equipage</span>
                  <div class="sheet-ligne">
                      <span class="sheet-lib2l" style="width: 250px;">Name</span>
                      <span class="sheet-lib2l" style="width: 400px;">Notes</span>
                      <span class="sheet-lib2l" style="width: 50px;">Count</span>
                      <span class="sheet-lib2l" style="width: 50px;">Weight</span>
                      <fieldset class="repeating_equipage">
                      <input type="text" name="attr_equipname" style="width: 250px;" placeholder="Name" />
                      <input type="text" name="attr_equipnote" style="width: 400px;" placeholder="Note" />
                      <input type="text" name="attr_equipcount" style="width: 50px;" placeholder="" />
                      <input type="text" name="attr_equipweight" style="width: 50px;" placeholder="" />
                      </fieldset>
                  </div>
              </div>
          </div>
        </div>
    </div> <!-- END LINE 8 -->
</div>


<div class="sheet-monster">
    <div class="sheet-ligne"> <!-- LINE 1 -->
        <div class="mycol sheet-bord"> <!-- HEADER -->
            <div class="sheet-ligne" style="margin-bottom: 2px;">
                    <span class="sheet-libred">Monster Character Sheet</span>
            </div>
            <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Name</span>
                    <input type="text" class="sheet-biginput" name="attr_character_name" />
            </div>
            <div class="sheet-mycol" style="width: 250px;">
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Alignment</span>
                    <input type="text" class="sheet-longinput" name="attr_m_alignment" placeholder="Alignment"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Size</span>
                    <input type="text" class="sheet-shortinput" name="attr_m_size" placeholder="Size"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Movement</span>
                    <input type="text" class="sheet-longinput" name="attr_m_mv" placeholder="MV"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Dexterity</span>
                    <input type="text" class="sheet-longinput" name="attr_m_dx" placeholder="DX"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Armour Class</span>
                    <input type="text" class="sheet-longinput" name="attr_m_ac" placeholder="AC"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1">HP</span>
                    <input type="number" name="attr__m_hp" value="0" class="sheet-shortinput"/>
                    /
                    <input type="number" name="attr_m_hp_max" value="0" class="sheet-shortinput"/>
                    <span class="sheet-lib1 sheet-wid30">HD</span>
                    <input type="text" name="attr_m_hd" class="sheet-medinput" placeholder="Ex:5d6+5" />
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Attack Rate</span>
                    <input type="text" class="sheet-longinput" name="attr_m_attack" placeholder="Attack"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Damage</span>
                    <input type="text" class="sheet-longinput" name="attr_m_damage" placeholder="Damage"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Saving Throw</span>
                    <input type="text" class="sheet-longinput" name="attr_m_sv" placeholder="SV"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Morale</span>
                    <input type="text" class="sheet-longinput" name="attr_m_morale" placeholder="Morale"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Experience Points</span>
                    <input type="text" class="sheet-longinput" name="attr_m_xp" placeholder="XP"/>
                </div>
                <div class="sheet-ligne">
                    <span class="sheet-lib1 sheet-wid70">Treasure</span>
                    <input type="text" class="sheet-longinput" name="attr_m_treasure" placeholder="Treasure Class"/>
                </div>
            </div>
        </div>
        <div class="mycol sheet-nobord">
            <div class="sheet-ligne" style="margin-bottom: 2px;">
                    <span class="sheet-libred">Notes</span>
            </div>
            <div class="sheet-mycol" style="width: 350px;">
                <div class="sheet-ligne">
                    <textarea style="width:350px;height:275px;" name="attr_m_notes" placeholder="Notes"></textarea>
                </div>
            </div>
        </div>
    </div>
</div>

 

8/16/2022 12:51 am  #14


Re: Roll20 Character Sheet

<!-- === TEMPLATE   === -->
<rolltemplate class="sheet-rolltemplate-tmpl">
    <div class="sheet-tplmain">
        <div class="sheet-pc">{{pc}}</div>
        {{#attr}}
            <div class="sheet-jet">{{roll}} <= {{target}}</div>
            <div class="sheet-jet sheet-jetbordleft">
            {{#rollLess() roll target}}
                <span class="sheet-success">Success</span>
            {{/rollLess() roll target}}
            {{#rollTotal() roll target}}
                <span class="sheet-success">Success</span>
            {{/rollTotal() roll target}}
            {{#rollGreater() roll target}}
                <span class="sheet-failure">Failure</span>
            {{/rollGreater() roll target}}
            </div>
            <div class="sheet-jetnom"><span>{{type}} Check</span> {{#name}}({{name}}){{/name}}</div>
        {{/attr}}
        {{#save}}
            <div class="sheet-jet">{{roll}} >= {{target}}</div>
            <div class="sheet-jet sheet-jetbordleft">
            {{#rollGreater() roll target}}
                <span class="sheet-success">Success</span>
            {{/rollGreater() roll target}}
            {{#rollTotal() roll target}}
                <span class="sheet-success">Success</span>
            {{/rollTotal() roll target}}
            {{#rollLess() roll target}}
                <span class="sheet-failure">Failure</span>
            {{/rollLess() roll target}}
            </div>
            <div class="sheet-jetnom"><span>{{type}} Saving Throw</span> {{#name}}({{name}}){{/name}}</div>
        {{/save}}
        {{#talent}}
            {{#target}}
                {{#rollTotal() target 0}}
                    <div class="sheet-jet">{{roll}}</div>
                    <div class="sheet-jet"> </div>
                {{/rollTotal() target 0}}
                {{#rollGreater() target 0}}
                    <div class="sheet-jet">{{roll}} <= {{target}}</div>
                    <div class="sheet-jet sheet-jetbordleft">
                    {{#rollGreater() roll target}}
                        <span class="sheet-failure">Failure</span>
                    {{/rollGreater() roll target}}
                    {{#rollTotal() roll target}}
                       <span class="sheet-success">Success</span>
                    {{/rollTotal() roll target}}
                    {{#rollLess() roll target}}
                        <span class="sheet-success">Success</span>
                    {{/rollLess() roll target}}
                    </div>
                {{/rollGreater() target 0}}
            {{/target}}
            <div class="sheet-jetnom">{{name}}</div>
        {{/talent}}
        {{#attack}}
            <div class="sheet-jet"><span>Hits AC</span> {{roll}}</div>
            <div class="sheet-jet sheet-jetbordleft"><span>Damage</span> {{damage}}</div>
            <div class="sheet-jetnom">{{name}}</div>
        {{/attack}}
        {{#hd}}
            <div class="sheet-jet">{{roll}}</div>
            <div class="sheet-jet"> </div>
            <div class="sheet-jetnom"><span>Hit Points</span></div>
        {{/hd}}
        {{#spell}}
            <div class="sheet-jet"><span>Damage/Duration</span> {{roll}}</div>
            <div class="sheet-jetnom"><span>Spell:</span> {{name}}</div>
        {{/spell}}
    </div>
</rolltemplate>

<script type="text/worker">

//Ability score derived statistics auto calculator
on("change:class change:st sheet:opened", function() {
    getAttrs(['st', 'meleehitbonus', 'meleedmgbonus', 'testst', 'featst', 'class'], function(values) {
        var strength = parseInt(values.st)||0;
        const getclass = parseInt(values.class)||0;
        var mhb = 0;
        var mdb = 0;
        var ts = 0;
        var fs = 0;
       
        var extraordinarybonusstrength = 0;
   
        if (getclass === 0 || getclass === 4 || getclass === 5 || getclass === 6 || getclass === 7 || getclass === 8 || getclass === 9 || getclass === 10 || getclass === 19) {
           var extraordinarybonusstrength = 8;
        }
       
        if (strength === 3){
           mhb = -2;
            mdb = -2;
            ts = 1;
            fs = 0;
        }
        else if (strength === 4 || strength === 5 || strength === 6){
             mhb = -1;
             mdb = -1;
             ts = 1;
             fs = 1;
        }   
            else if (strength === 7 || strength === 8){
                 mhb = 0;
                 mdb = -1;
                 ts = 2;
                 fs = 2;
            }
                else if (strength === 9 || strength === 10 || strength === 11 || strength === 12){
                    mhb = 0;
                    mdb = 0;
                    ts = 2;
                    fs = 4;
                }
                    else if (strength === 13 || strength === 14){
                        mhb = 0;
                        mdb = 1;
                        ts = 3;
                        fs = 8;
                    }
                        else if (strength === 15 || strength === 16 ){
                            mhb = 1;
                            mdb = 1;
                            ts = 3;
                            fs = 16;
                        }
                            else if (strength === 17){
                                 mhb = 1;
                                 mdb = 2;
                                 ts = 4;
                                 fs = 24;
                            }
                                else if (strength === 18){
                                 mhb = 2;
                                 mdb = 3;
                                 ts = 5;
                                 fs = 32;
                                }
        setAttrs({
            "meleehitbonus": mhb,
            "meleedmgbonus": mdb,
            "testst": ts,
            "featst": fs + extraordinarybonusstrength
        });
    });
});

on("change:class change:dx sheet:opened", function() {
    getAttrs(['dx', 'missilehitbonus', 'dexdefbonus', 'testdx', 'featdx', 'class'], function(values) {
        var dexterity = parseInt(values.dx)||0;
        var mihb = 0;
        var ddb = 0;
        var td = 0;
        var fd = 0;
        const getclass = parseInt(values.class)||0;
        var extraordinarybonusdexterity = 0;
       
        if (getclass === 3 || getclass === 4 || getclass === 12 || getclass === 17 || getclass === 21 || getclass === 22 || getclass === 23 || getclass === 24 || getclass === 25) {
            var extraordinarybonusdexterity = 8;
        }
       
        if (dexterity === 3){
           mihb = -2;
            ddb = -2;
            td = 1;
            fd = 0;
        }
        else if (dexterity === 4 || dexterity === 5 || dexterity === 6){
             mihb = -1;
             ddb = -1;
             td = 1;
             fd = 1;
        }   
            else if (dexterity === 7 || dexterity === 8){
                 mihb = -1;
                 ddb = 0;
                 td = 2;
                 fd = 2;
            }
                else if (dexterity === 9 || dexterity === 10 || dexterity === 11 || dexterity === 12){
                    mihb = 0;
                    ddb = 0;
                    td = 2;
                    fd = 4;
                }
                    else if (dexterity === 13 || dexterity === 14){
                        mihb = 1;
                        ddb = 0;
                        td = 3;
                        fd = 8;
                    }
                        else if (dexterity === 15 || dexterity === 16 ){
                            mihb = 1;
                            ddb = 1;
                            td = 3;
                            fd = 16;
                        }
                            else if (dexterity === 17){
                                 mihb = 2;
                                 ddb = 1;
                                 td = 4;
                                 fd = 24;
                            }
                                else if (dexterity === 18){
                                 mihb = 3;
                                 ddb = 2;
                                 td = 5;
                                 fd = 32;
                                }
        setAttrs({
            missilehitbonus: mihb,
            dexdefbonus: ddb,
            testdx: td,
            featdx: fd + extraordinarybonusdexterity
        });
    });
});

on("change:class change:cn sheet:opened", function() {
    getAttrs(['cn', 'poisonbonus', 'hpbonus', 'traumasurvive', 'testcn', 'featcn', 'class'], function(values) {
        const constitution = parseInt(values.cn)||0;
        const getclass = parseInt(values.class)||0;
        var hpb = 0;
        var pb = 0;
        var trs = 0;
        var tc = 0;
        var fc = 0;
        var extraordinarybonusconstitution = 0;
       
       
        if (getclass === 5) {
            var extraordinarybonusconstitution = 8;
        }
       
        if (constitution === 3){
            hpb = -1;
            pb = -2;
            trs = 45;
            tc = 1;
            fc = 0;
        }
        else if (constitution === 4 || constitution === 5 || constitution === 6){
             hpb = -1;
             pb = -1;
             trs = 55;
             tc = 1;
             fc = 1;
        }   
            else if (constitution === 7 || constitution === 8){
                 hpb = 0;
                 pb = 0;
                 trs = 65;
                 tc = 2;
                 fc = 2;
             }
                else if (constitution === 9 || constitution === 10 || constitution === 11 || constitution === 12){
                    hpb = 0;
                    pb = 0;
                    trs = 75;
                    tc = 2;
                    fc = 4;
                }
                    else if (constitution === 13 || constitution === 14){
                        hpb = 1;
                        pb = 0;
                        trs = 80;
                        tc = 3;
                        fc = 8;
                    }
                        else if (constitution === 15 || constitution === 16 ){
                            hpb = 1;
                            pb = 1;
                            trs = 85;
                            tc = 3;
                            fc = 16;
                        }
                            else if (constitution === 17){
                                 hpb = 2;
                                 pb = 1;
                                 trs = 90;
                                 tc = 4;
                                 fc = 24;
                            }
                                else if (constitution === 18){
                                 hpb = 3;
                                 pb = 2;
                                 trs = 95;
                                 tc = 5;
                                 fc = 32;
                                }
        setAttrs({
            "hpbonus": hpb,
            "poisonbonus": pb,
            "traumasurvive": trs,
            "testcn": tc,
            "featcn": fc + extraordinarybonusconstitution
        });
    });
});

on("change:in sheet:opened", function() {
    getAttrs(['in', 'langbonus', 'bonusmagspells', 'learnmagspell'], function(values) {
        var intelligence = parseInt(values.in)||0;
        var lb = 0;
        var bms = 0;
        var lms = 0;
        if (intelligence === 3){
            lb = "Illiterate";
            bms = "N/A";
            lms = "N/A";
        }
        else if (intelligence === 4 || intelligence === 5 || intelligence === 6){
             lb = "Illiterate";
             bms = "N/A";
             lms = "N/A";
        }   
            else if (intelligence === 7 || intelligence === 8){
                 lb = 0;
                 bms = "N/A";
                 lms = "N/A";
             }
                else if (intelligence === 9 || intelligence === 10 || intelligence === 11 || intelligence === 12){
                    lb = 0;
                    bms = 0;
                    lms = 50;
                }
                    else if (intelligence === 13 || intelligence === 14){
                        lb = 1;
                        bms = 1;
                        lms = 65;
                    }
                        else if (intelligence === 15 || intelligence === 16 ){
                            lb = 1;
                            bms = 2;
                            lms = 75;
                        }
                            else if (intelligence === 17){
                                 lb = 2;
                                 bms = 3;
                                 lms = 85;
                            }
                                else if (intelligence === 18){
                                 lb = 3;
                                 bms = 4;
                                 lms = 95;
                                }
        setAttrs({
            "langbonus": lb,
            "bonusmagspells": bms,
            "learnmagspell": lms,
        });
    });
});

on("change:ws sheet:opened", function() {
    getAttrs(['ws', 'willmod', 'bonusclerspells', 'learnclerspell'], function(values) {
        var wisdom = parseInt(values.ws)||0;
        var wm = 0;
        var bcs = 0;
        var lcs = 0;
        if (wisdom === 3){
            wm = -2;
            bcs = "N/A";
            lcs = "N/A";
        }
        else if (wisdom === 4 || wisdom === 5 || wisdom === 6){
             wm = -1;
             bcs = "N/A";
             lcs = "N/A";
        }   
            else if (wisdom === 7 || wisdom === 8){
                 wm = 0;
                 bcs = "N/A";
                 lcs = "N/A";
             }
                else if (wisdom === 9 || wisdom === 10 || wisdom === 11 || wisdom === 12){
                    wm = 0;
                    bcs = 0;
                    lcs = 50;
                }
                    else if (wisdom === 13 || wisdom === 14){
                        wm = 0;
                        bcs = 1;
                        lcs = 65;
                    }
                        else if (wisdom === 15 || wisdom === 16 ){
                            wm = 1;
                            bcs = 2;
                            lcs = 75;
                        }
                            else if (wisdom === 17){
                                 wm = 1;
                                 bcs = 3;
                                 lcs = 85;
                            }
                                else if (wisdom === 18){
                                 wm = 2;
                                 bcs = 4;
                                 lcs = 95;
                                }
        setAttrs({
            "willmod": wm,
            "bonusclerspells": bcs,
            "learnclerspell": lcs,
        });
    });
});
on("change:ch sheet:opened", function() {
    getAttrs(['ch', 'reactionmod', 'maxhench', 'turningadj'], function(values) {
        var charisma = parseInt(values.ch)||0;
        var rm = 0;
        var mh = 0;
        var ta = 0;
        if (charisma === 3){
            rm = -3;
            mh = 1;
            ta = -1;
        }
        else if (charisma === 4 || charisma === 5 || charisma === 6){
             rm = -2;
             mh = 2;
             ta = -1;
        }   
            else if (charisma === 7 || charisma === 8){
                 rm = -1;
                 mh = 3;
                 ta = 0;
             }
                else if (charisma === 9 || charisma === 10 || charisma === 11 || charisma === 12){
                    rm = 0;
                    mh = 4;
                    ta = 0;
                }
                    else if (charisma === 13 || charisma === 14){
                        rm = 1;
                        mh = 6;
                        ta = 0;
                    }
                        else if (charisma === 15 || charisma === 16 ){
                            rm = 1;
                            mh = 8;
                            ta = 1;
                        }
                            else if (charisma === 17){
                                 rm = 2;
                                 mh = 10;
                                 ta = 1;
                            }
                                else if (charisma === 18){
                                 rm = 3;
                                 mh = 12;
                                 ta = 1;
                                }
        setAttrs({
            "reactionmod": rm,
            "maxhench": mh,
            "turningadj": ta,
        });
    });
});

//Turning ability auto calculator
on("change:turningability change:turningadj sheet:opened", function() {
    getAttrs(['turningability', 'turningadj', 'undeadtype0', 'undeadtype1', 'undeadtype2', 'undeadtype3', 'undeadtype4', 'undeadtype5', 'undeadtype6', 'undeadtype7', 'undeadtype8', 'undeadtype9', 'undeadtype10', 'undeadtype11', 'undeadtype12', 'undeadtype13'], function(values) {
        const turnability = parseInt(values.turningability)||0;
        const turnmod = parseInt(values.turningadj)||0;
        let ut0 = "NT";
        let ut1 = "NT";
        let ut2 = "NT";
        let ut3 = "NT";
        let ut4 = "NT";
        let ut5 = "NT";
        let ut6 = "NT";
        let ut7 = "NT";
        let ut8 = "NT";
        let ut9 = "NT";
        let ut10 = "NT";
        let ut11 = "NT";
        let ut12 = "NT";
        let ut13 = "NT";
        if (turnability === 0){
       
        }
        else if (turnability === 1) {
        ut0 = 10 + turnmod;
        ut1 = 7 + turnmod;
        ut2 = 4 + turnmod;
        ut3 = 1 + turnmod;
        }
        else if (turnability === 2) {
        ut0 = "T";
        ut1 = 10 + turnmod;
        ut2 = 7 + turnmod;
        ut3 = 4 + turnmod;
           ut4 = 1 + turnmod;
        }
        else if (turnability === 3) {
            ut0 = "T";
            ut1 = "T";
            ut2 = 10 + turnmod;
            ut3 = 7 + turnmod;
            ut4 = 4 + turnmod;
            ut5 = 1 + turnmod;
        }
        else if (turnability === 4) {
            ut0 = "D";
            ut1 = "T";
            ut2 = "T";
            ut3 = 10 + turnmod;
            ut4 = 7 + turnmod;
            ut5 = 4 + turnmod;
            ut6 = 1 + turnmod;
        }
        else if (turnability === 5) {
            ut0 = "D";
            ut1 = "D";
            ut2 = "T";
            ut3 = "T";
            ut4 = 10 + turnmod;
            ut5 = 7 + turnmod;
            ut6 = 4 + turnmod;
            ut7 = 1 + turnmod;
        }
        else if (turnability === 6) {
            ut0 = "D";
            ut1 = "D";
            ut2 = "D";
            ut3 = "T";
            ut4 = "T";
            ut5 = 10 + turnmod;
            ut6 = 7 + turnmod;
            ut7 = 4 + turnmod;
            ut8 = 1 + turnmod;
        }
        else if (turnability === 7) {
            ut0 = "UD";
            ut1 = "D";
            ut2 = "D";
            ut3 = "D";
            ut4 = "T";
            ut5 = "T";
            ut6 = 10 + turnmod;
            ut7 = 7 + turnmod;
            ut8 = 4 + turnmod;
            ut9 = 1 + turnmod;
        }
        else if (turnability === 8) {
            ut0 = "UD";
            ut1 = "UD";
            ut2 = "D";
            ut3 = "D";
            ut4 = "D";
            ut5 = "T";
            ut6 = "T";
            ut7 = 10 + turnmod;
            ut8 = 7 + turnmod;
            ut9 = 4 + turnmod;
            ut10 = 1 + turnmod;
        }
        else if (turnability === 9) {
            ut0 = "UD";
            ut1 = "UD";
            ut2 = "UD";
            ut3 = "D";
            ut4 = "D";
            ut5 = "D";
            ut6 = "T";
            ut7 = "T";
            ut8 = 10 + turnmod;
            ut9 = 7 + turnmod;
            ut10 = 4 + turnmod;
            ut11 = 1 + turnmod;
        }
        else if (turnability === 10) {
            ut0 = "UD";
            ut1 = "UD";
            ut2 = "UD";
            ut3 = "UD";
            ut4 = "D";
            ut5 = "D";
            ut6 = "D";
            ut7 = "T";
            ut8 = "T";
            ut9 = 10 + turnmod;
            ut10 = 7 + turnmod;
            ut11 = 4 + turnmod;
            ut12 = 1 + turnmod;
        }
        else if (turnability === 11) {
            ut0 = "UD";
            ut1 = "UD";
            ut2 = "UD";
            ut3 = "UD";
            ut4 = "UD";
            ut5 = "D";
            ut6 = "D";
            ut7 = "D";
            ut8 = "T";
            ut9 = "T";
            ut10 = 10 + turnmod;
            ut11 = 7 + turnmod;
            ut12 = 4 + turnmod;
            ut13 = 1 + turnmod;
        }
        else if (turnability === 12) {
            ut0 = "UD";
            ut1 = "UD";
            ut2 = "UD";
            ut3 = "UD";
            ut4 = "UD";
            ut5 = "UD";
            ut6 = "D";
            ut7 = "D";
            ut8 = "D";
            ut9 = "T";
            ut10 = "T";
            ut11 = 10 + turnmod;
            ut12 = 7 + turnmod;
            ut13 = 4 + turnmod;
        }
        setAttrs({
        "undeadtype0": ut0,
        "undeadtype1": ut1,
        "undeadtype2": ut2,
        "undeadtype3": ut3,
        "undeadtype4": ut4,
        "undeadtype5": ut5,
        "undeadtype6": ut6,
        "undeadtype7": ut7,
        "undeadtype8": ut8,
        "undeadtype9": ut9,
        "undeadtype10": ut10,
        "undeadtype11": ut11,
        "undeadtype12": ut12,
        "undeadtype13": ut13,
        });
    });
});

 

8/16/2022 12:52 am  #15


Re: Roll20 Character Sheet

//Race randomizer
on("clicked:raceroll", function() {
    getAttrs(['race'], function(values) {
    var percentroll = Math.floor(Math.random() * 100) + 1;
    var selectrace = parseInt(values.race)||0;
        if (percentroll <= 20){
            selectrace = 0; 
        }
        else if (percentroll <= 26){
            selectrace = 1; 
        }
        else if (percentroll <= 28){
            selectrace = 2; 
        }
        else if (percentroll <= 35){
            selectrace = 3; 
        }
        else if (percentroll <= 37){
            selectrace = 4; 
        }
        else if (percentroll <= 43){
            selectrace = 5; 
        }
        else if (percentroll <= 53){
            selectrace = 6; 
        }
        else if (percentroll <= 60){
            selectrace = 7; 
        }
        else if (percentroll <= 66){
            selectrace = 8; 
        }
        else if (percentroll <= 75){
            selectrace = 9; 
        }
        else if (percentroll <= 85){
            selectrace = 10; 
        }
        else if (percentroll <= 95){
            selectrace = 11; 
        }
            else if (percentroll <= 100){
            var ancillaryroll = Math.floor(Math.random() * 12) + 1; 
                if (ancillaryroll === 1){
                    selectrace = 12; 
                }
                else if (ancillaryroll === 2){
                    selectrace = 13; 
                }
                else if (ancillaryroll === 3){
                    selectrace = 14; 
                }
                else if (ancillaryroll === 4){
                    selectrace = 15; 
                }
                else if (ancillaryroll === 5){
                    selectrace = 16; 
                }
                else if (ancillaryroll === 6){
                    selectrace = 17; 
                }
                else if (ancillaryroll === 7){
                    selectrace = 18; 
                }
                else if (ancillaryroll === 8){
                    selectrace = 19; 
                }
                else if (ancillaryroll === 9){
                    selectrace = 20; 
                }
                else if (ancillaryroll === 10){
                    selectrace = 21; 
                }
                else if (ancillaryroll === 11){
                    selectrace = 22; 
                }
                else if (ancillaryroll === 12){
                    selectrace = 23; 
                }
            }
        setAttrs({
        "race": selectrace
        });
    });
});

//gender randomizer
on('clicked:genderroll', function () {
    const gendervalue = Math.floor(Math.random() * 2);
    setAttrs({
      gender: gendervalue,
    });
});

//age randomizer
on("clicked:ageroll", function() {
    getAttrs(['race', 'age'], function(values) {
        var getrace = parseInt(values.race)||0;
        //Hyperboreans age
        if (getrace === 4) {
            var ageroll = Math.floor(Math.random() * 86) + 14;
        }
        //Standard age
        else {
            var ageroll = Math.floor(Math.random() * 30) + 14;
        }
        setAttrs({
            "age": ageroll
        });
    });
});

//height and weight randomizer
on("clicked:heightweightroll", function() {
    getAttrs(['race', 'gender', 'heightfeet', 'heightinches', 'weight'], function(values) {
       
        //declared varibles
        var getrace = parseInt(values.race)||0;
        var getgender = parseInt(values.gender)||0;
       
        //height and weight
        var heightweightrollone = Math.floor(Math.random() * 6) + 1;
        var heightweightrolltwo = Math.floor(Math.random() * 6) + 1;
        var heightweightrollthree = Math.floor(Math.random() * 6) + 1;
       
        //Race Exceptions
            //Amazonian women Reroll 1's
            if (getrace === 1 && getgender === 1) {
                var heightweightrollone = Math.floor(Math.random() * 5) + 2;
                var heightweightrolltwo = Math.floor(Math.random() * 5) + 2;
                var heightweightrollthree = Math.floor(Math.random() * 5) + 2;
            }
            //Lapps, Mu, Picts, and Pict half-bloods Reroll 6's
            if (getrace === 9 || getrace === 10|| getrace === 16 || getrace === 19) {
                var heightweightrollone = Math.floor(Math.random() * 5) + 1;
                var heightweightrolltwo = Math.floor(Math.random() * 5) + 1;
                var heightweightrollthree = Math.floor(Math.random() * 5) + 1;
            }
            //Esquimaux, Lemurians, and Tlingits 4d6 drop highest
            if (getrace === 3 || getrace === 17 || getrace === 22) {
                var heightweightrollone = Math.floor(Math.random() * 6) + 1;
                var heightweightrolltwo = Math.floor(Math.random() * 6) + 1;
                var heightweightrollthree = Math.floor(Math.random() * 6) + 1;
                var heightweightrollfour = Math.floor(Math.random() * 6) + 1;
                var heightarray = [heightweightrollone,heightweightrolltwo,heightweightrollthree,heightweightrollfour];
                var heighthigh = Math.max.apply(Math,heightarray);
                var heightarrayttotal = heightweightrollone+heightweightrolltwo+heightweightrollthree+heightweightrollfour-heighthigh;
               
            }
            //Anglo-Saxons, Esquimaux, Ixians, Kimmerians, Vikings, and Yakuts 4d6 drop lowest
            if (getrace === 5 || getrace === 7 || getrace === 11 || getrace === 12 || getrace === 14  || getrace === 23){
                var heightweightrollone = Math.floor(Math.random() * 6) + 1;
                var heightweightrolltwo = Math.floor(Math.random() * 6) + 1;
                var heightweightrollthree = Math.floor(Math.random() * 6) + 1;
                var heightweightrollfour = Math.floor(Math.random() * 6) + 1;
                var heightarray = [heightweightrollone,heightweightrolltwo,heightweightrollthree,heightweightrollfour];
                var heightlow = Math.min.apply(Math,heightarray);
                var heightarrayttotal = heightweightrollone+heightweightrolltwo+heightweightrollthree+heightweightrollfour-heightlow;
               
            }
                //Calculate height total from normal dice or array function
                if (getrace === 3 || getrace === 17 || getrace === 22 || getrace === 5 || getrace === 7  || getrace === 11 || getrace === 12 || getrace === 14  || getrace === 23) {
                    var heighttotal = heightarrayttotal;
                } else {
                    var heighttotal = heightweightrollone + heightweightrolltwo + heightweightrollthree;
                }
               
                    //Oon Always average
                    if (getrace === 20) {
                        var heightweightrollone = 3;
                        var heightweightrolltwo = 3;
                        var heightweightrollthree = 3;
                    }
                    //Hyperboreans 33% 17, 66% 18
                    if (getrace === 4) {
                        var hyperboreanheightroll = Math.floor(Math.random() * 6) + 1;
                        if (hyperboreanheightroll <= 2) {
                            var heighttotal = 17;
                        }
                        else if (hyperboreanheightroll > 2) {
                            var heighttotal = 18;
                        }
                    }
       
        //Weight variability
        var weightvariability = Math.floor(Math.random() * 10) + 1;
       
            //Hyperboreans under weight
            if (getrace === 4) {var weightvariability = 1;}
            //Oon average weight
            if (getrace === 20) {var weightvariability = 5;}
           
        if (heighttotal === 3){
            if (getgender === 0) {
                var heightinches = 59 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 120 - (120 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 120 + (120 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 120;
                }
               
            } else {
                var heightinches = 55 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 85 - (85 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 85 + (85 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 85;
                }
            }
        } else if (heighttotal === 4){
            if (getgender === 0) {
                var heightinches = 61 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 130 - (130 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 130 + (130 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 130;
                }
               
            } else {
                var heightinches = 57 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 95 - (95 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 95 + (95 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 95;
                }
            }
        } else if (heighttotal === 5){
            if (getgender === 0) {
                var heightinches = 63 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 140 - (140 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 140 + (140 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 140;
                }
               
            } else {
                var heightinches = 59 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 105 - (105 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 105 + (105 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 105;
                }
            }
        } else if (heighttotal === 6){
            if (getgender === 0) {
                var heightinches = 65 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 150 - (150 * (weightchange * 0.01));
                }else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 150 + (150 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 150;
                }
               
            } else {
                var heightinches = 61 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 115 - (115 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 115 + (115 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 115;
                }
            }
        } else if (heighttotal === 7 || heighttotal === 8){
            if (getgender === 0) {
                var heightinches = 67 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 160 - (160 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 160 + (160 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 160;
                }
               
            } else {
                var heightinches = 63 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 125 - (125 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 125 + (125 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 125;
                }
            }
        }
        else if (heighttotal === 9 || heighttotal === 10 || heighttotal === 11 || heighttotal === 12){
            if (getgender === 0) {
                var heightinches = 69 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 170 - (170 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 170 + (170 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 170;
                }
               
            } else {
                var heightinches = 65 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 135 - (135 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 135 + (135 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 135;
                }
            }
        }
        else if (heighttotal === 13 || heighttotal === 14){
            if (getgender === 0) {
                var heightinches = 71 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 180 - (180 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 180 + (180 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 180;
                }
               
            } else {
                var heightinches = 67 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 145 - (145 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 145 + (145 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 145;
                }
            }
        }
        else if (heighttotal === 15){
            if (getgender === 0) {
                var heightinches = 73 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 195 - (195 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 195 + (195 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 195;
                }
               
            } else {
                var heightinches = 69 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 155 - (155 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 155 + (155 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 155;
                }
            }
        }
        else if (heighttotal === 16){
            if (getgender === 0) {
                var heightinches = 75 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 210 - (210 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 210 + (210 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 210;
                }
            } else {
                var heightinches = 71 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 165 - (165 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 165 + (165 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 165;
                }
            }
        } else if (heighttotal === 17){
            if (getgender === 0) {
                var heightinches = 77 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 230 - (230 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 230 + (230 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 230;
                }
               
            } else {
                var heightinches = 73 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 180- (180 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 180 + (180 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 180;
                }
            }
        } else if (heighttotal === 18){
            if (getgender === 0) {
                var heightinches = 80 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 250 - (250 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 250 + (250 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 250;
                }
               
            } else {
                var heightinches = 75 + (Math.floor(Math.random() * 3) + 1);
                if (weightvariability <= 3) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 5;
                    var weightlbs = 250 - (250 * (weightchange * 0.01));
                } else if (weightvariability >= 8) {
                    var weightchange = (Math.floor(Math.random() * 4) + 1) * 10;
                    var weightlbs = 250 + (250 * (weightchange * 0.01));
                } else {
                    var weightchange = 0;
                    var weightlbs = 250;
                }
            }
        }
        var feetfrominches = Math.floor(heightinches / 12);
        var inchesremainder = heightinches % 12;
       
        setAttrs({
            heightfeet: feetfrominches,
            heightinches: inchesremainder,
            weight: weightlbs
        });
    });
});

//Hair color randomizer
on("clicked:hairroll", function() {
    getAttrs(['race', 'gender', 'hair'], function(values) {
        const getrace = parseInt(values.race)||0;
        const getgender = parseInt(values.gender)||0;
        var hairfind = 0;
        var selecthair = '';
       
        //race specific haircolor
        if (getrace === 0) {
           var hairfind = 20 + (Math.floor(Math.random() * 100) + 1);
        }
        if (getrace === 1) {
            var hairfind = 40 + (Math.floor(Math.random() * 50) + 1);   
        }
        if (getrace === 2) {
            var hairfind = 20 + (Math.floor(Math.random() * 20) + 1);   
        }
        if (getrace === 3) {
            var hairfind = 40 + (Math.floor(Math.random() * 30) + 1);   
        }
        if (getrace === 4) {
            if (getgender === 0) {
                var hairfind = 122 + (Math.floor(Math.random() * 10) + 1);
            } else {
                var hairfind = 120 + (Math.floor(Math.random() * 12) + 1);   
            }
        }
        if (getrace === 5) {
            var hairfind = 20;
        }
        if (getrace === 6) {
            var hairfind = 66 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 7) {
            var hairfind = 20;
        }
        if (getrace === 8) {
            var hairfind = 40 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 9) {
            var hairfind = Math.floor(Math.random() * 20) + 1;
        }
        if (getrace === 10) {
            var hairfind = 18 + (Math.floor(Math.random() * 10) + 1);
        }
        if (getrace === 11) {
            var hairfind = 90 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 12) {
            var hairfind = 50 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 13) {
            var hairfind = 50 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 14) {
            var hairfind = 20;
        }
        if (getrace === 15) {
            var hairfind = 40 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 16) {
            var hairfind = 65 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 17) {
            var hairfind = 40 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 18) {
            var hairfind = 20;
        }
        if (getrace === 19) {
            var hairfind = 20;
        }
        if (getrace === 20) {
            var hairfind = 20;
        }
        if (getrace === 21) {
            var hairfind = 40 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 22) {
            var hairfind = 20;
        }
        if (getrace === 23) {
            var hairfind = 40 + (Math.floor(Math.random() * 30) + 1);
        }
       
        //haircolor list
        if (hairfind === 1) {
            var selecthair = "Aurburn, Medium";
        }
        if (hairfind === 2) {
            var selecthair = "Aurburn, Light";
        }
        if (hairfind > 2 && hairfind < 9) {
            var selecthair = "Red-Orange, Light";
        }
        if (hairfind > 8 && hairfind < 15) {
            var selecthair = "Red-Orange, Medium";
        }
        if (hairfind > 14 && hairfind < 20) {
            var selecthair = "Red-Orange, Dark";
        }
        if (hairfind > 19 && hairfind < 31) {
            var selecthair = "Black";
        }
        if (hairfind > 30 && hairfind < 36) {
            var selecthair = "Blond, Dark";
        }
        if (hairfind > 35 && hairfind < 41) {
            var selecthair = "Blonde, Light";
        }
        if (hairfind > 40 && hairfind < 51) {
            var selecthair = "Black";
        }
        if (hairfind > 50 && hairfind < 61) {
            var selecthair = "Brown, Dark";
        }
        if (hairfind > 60 && hairfind < 71) {
            var selecthair = "Brown, Medium";
        }
        if (hairfind > 70 && hairfind < 81) {
            var selecthair = "Brown, Light";
        }
        if (hairfind > 80 && hairfind < 84) {
            var selecthair = "Auburn, Dark";
        }
        if (hairfind > 83 && hairfind < 87) {
            var selecthair = "Aurburn, Medium";
        }
        if (hairfind > 86 && hairfind < 91) {
            var selecthair = "Aurburn, Light";
        }
        if (hairfind > 90 && hairfind < 93) {
            var selecthair = "Red, Dark";
        }
        if (hairfind > 92 && hairfind < 95) {
            var selecthair = "Red, Medium";
        }
        if (hairfind === 95 || hairfind === 96) {
            var selecthair = "Red, Light";
        }
        if (hairfind > 96 && hairfind < 101) {
            var selecthair = "Blond, Dark";
        }
        if (hairfind > 100 && hairfind < 111) {
            var selecthair = "Blond, Dark";
        }
        if (hairfind > 110 && hairfind < 116) {
            var selecthair = "Blonde, Light";
        }
        if (hairfind > 115 && hairfind < 121) {
            var selecthair = "White";
        }
        if (hairfind === 121) {
            var selecthair = "Blue-Black";
        }
        if (hairfind > 121 && hairfind < 127) {
            var selecthair = "Golden, Pale";
        }
        if (hairfind > 126 && hairfind < 132) {
            var selecthair = "Golden, Rich";
        }
        if (hairfind === 132){
            var selecthair = "Silvery-White";
        }
       
        setAttrs({
        hair: selecthair
        });
    });
});

//Eye color randomizer
on("clicked:eyeroll", function() {
    getAttrs(['race', 'gender', 'eyes'], function(values) {
        const getrace = parseInt(values.race)||0;
        const getgender = parseInt(values.gender)||0;
        var eyefind = 0;
        var selecteye = '';
       
        //race specific eyeolor
        if (getrace === 0) {
           var eyefind = 10 + (Math.floor(Math.random() * 100) + 1);
        }
        if (getrace === 1) {
            var eyefind = 58 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 2) {
            var eyefind = 4 + (Math.floor(Math.random() * 6) + 1);   
        }
        if (getrace === 3) {
            var eyefind = 10 + (Math.floor(Math.random() * 50) + 1);   
        }
        if (getrace === 4) {
            var eyefind = 110 + (Math.floor(Math.random() * 4) + 1);   
        }
        if (getrace === 5) {
            if (getgender === 1) {
                var eyefind = Math.floor(Math.random() * 4) + 1;
            }
            else {
                var selecteye = "Black";
            }
        } 
        if (getrace === 6) {
            var eyefind = 58 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 7) {
            var eyefind = 100;
        }
        if (getrace === 8) {
            var eyefind = 58 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 9) {
            var eyefind = 79 + (Math.floor(Math.random() * 6) + 1);
        }
        if (getrace === 10) {
            var eyefind = 10 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 11) {
            var eyefind = 58 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 12) {
            var eyefind = 58 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 13) {
            var eyefind = 58 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 14) {
            var eyefind = 10 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 15) {
            var eyefind = 12 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 16) {
            var eyefind = 58 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 17) {
            var eyefind = 10 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 18) {
            var eyefind = 34 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 19) {
            var eyefind = 12 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 20) {
            var eyefind = 100;
        }
        if (getrace === 21) {
            var eyefind = 58 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 22) {
            var eyefind = 10 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 23) {
            var eyefind = 12 + (Math.floor(Math.random() * 30) + 1);
        }
       
        //eyecolor list
        if (eyefind === 1 || eyefind === 2) {
            var selecteye = "Green, Emerald";
        }
        if (eyefind === 3) {
            var selecteye = "Hazel, Dark";
        }
        if (eyefind === 4) {
            var selecteye = "Hazel, Light";
        }
        if (eyefind === 5) {
            var selecteye = "Yellow, Dark";
        }
        if (eyefind === 6) {
            var selecteye = "Yellow, Light";
        }
        if (eyefind > 6 && eyefind < 11) {
            var selecteye = "Grey, Light";
        }
        if (eyefind === 11) {
            var selecteye = "Amber, Dark";
        }
        if (eyefind === 12) {
            var selecteye = "Amber, Light";
        }
        if (eyefind > 12 && eyefind < 36) {
            var selecteye = "Brown, Dark";
        }
        if (eyefind > 35 && eyefind < 59) {
            var selecteye = "Brown, Light";
        }
        if (eyefind > 58 && eyefind < 64) {
            var selecteye = "Hazel, Dark";
        }
        if (eyefind > 63 && eyefind < 69) {
            var selecteye = "Hazel, Light";
        }
        if (eyefind > 68 && eyefind < 75) {
            var selecteye = "Blue, Dark";
        }
        if (eyefind > 74 && eyefind < 81) {
            var selecteye = "Blue, Light";
        }
        if (eyefind === 81 || eyefind === 82) {
            var selecteye = "Green, Dark";
        }
        if (eyefind === 83 || eyefind === 84) {
            var selecteye = "Green, Light";
        }
        if (eyefind > 84 && eyefind < 92) {
            var selecteye = "Blue, Dark";
        }
        if (eyefind > 91 && eyefind < 99) {
            var selecteye = "Blue, Light";
        }
        if (eyefind > 98 && eyefind < 105) {
            var selecteye = "Grey, Dark";
        }
        if (eyefind > 104 && eyefind < 111) {
            var selecteye = "Grey, Light";
        }
        if (eyefind === 111 || eyefind === 112) {
            var selecteye = "Violet, Dark";
        }
        if (eyefind === 113 || eyefind === 114) {
            var selecteye = "Violet, Light";
        }
       
        setAttrs({
        eyes: selecteye
        });
    });
});

//Complexion randomizer
on("clicked:skinroll", function() {
    getAttrs(['race', 'gender', 'complexion'], function(values) {
        const getrace = parseInt(values.race)||0;
        const getgender = parseInt(values.gender)||0;
        var skinfind = 0;
        var selectskin = '';
       
        //race specific eyeolor
        if (getrace === 0) {
           var skinfind = 70 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 1) {
            var skinfind = 70 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 2) {
            var skinfind = Math.floor(Math.random() * 10) + 1;
        }
        if (getrace === 3) {
            var skinfind = 10;   
        }
        if (getrace === 4) {
            var selectskin = "Milky-White";
        }
        if (getrace === 5) {
            var selectskin = "Dusky";
        }
        if (getrace === 6) {
            var skinfind = 80 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 7) {
            var skinfind = 65 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 8) {
            var skinfind = 58 + (Math.floor(Math.random() * 50) + 1);
        }
        if (getrace === 9) {
            var skinfind = 70 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 10) {
            if (getgender === 0) {
               var skinfind = 80 + (Math.floor(Math.random() * 12) + 1);
            }
            else {
               var skinfind = 88 + (Math.floor(Math.random() * 12) + 1);
            }
        }
        if (getrace === 11) {
            var skinfind = 80 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 12) {
            var skinfind = 70 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 13) {
            var skinfind = 80 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 14) {
            var selectskin = "Dusky";
        }
        if (getrace === 15) {
            var skinfind = 70 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 16) {
            var skinfind = 65 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 17) {
            var skinfind = 40 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 18) {
            var skinfind = 10 + (Math.floor(Math.random() * 20) + 1);
        }
        if (getrace === 19) {
            var selectskin = "Ebony";
        }
        if (getrace === 20) {
            var selectskin = "Albino";
        }
        if (getrace === 21) {
            var skinfind = 70 + (Math.floor(Math.random() * 30) + 1);
        }
        if (getrace === 22) {
            var skinfind = 30 + (Math.floor(Math.random() * 10) + 1);
        }
        if (getrace === 23) {
            var skinfind = 50 + (Math.floor(Math.random() * 50) + 1);
        }
       
        //complexion list
        if (skinfind > 0 && skinfind < 6) {
            var selectskin = "Glaucous";
        }
        if (skinfind > 5 && skinfind < 11) {
            var selectskin = "Jaundiced";
        }
        if (skinfind > 10 && skinfind < 21) {
            var selectskin = "Dark brown";
        }
        if (skinfind > 20 && skinfind < 31) {
            var selectskin = "Medium brown";
        }
        if (skinfind > 30 && skinfind < 36) {
            var selectskin = "Coppery";
        }
        if (skinfind > 35 && skinfind < 41) {
            var selectskin = "Light brown";
        }
        if (skinfind > 40 && skinfind < 46) {
            var selectskin = "Jaundiced";
        }
        if (skinfind > 45 && skinfind < 51) {
            var selectskin = "Light brown";
        }
        if (skinfind > 50 && skinfind < 56) {
            var selectskin = "Dusky";
        }
        if (skinfind > 55 && skinfind < 66) {
            var selectskin = "Tan";
        }
        if (skinfind > 65 && skinfind < 71) {
            var selectskin = "Bronzed";
        }
        if (skinfind > 70 && skinfind < 81) {
            var selectskin = "Olive";
        }
        if (skinfind > 80 && skinfind < 91) {
            var selectskin = "Ruddy";
        }
        if (skinfind > 90 && skinfind < 101) {
            var selectskin = "Fair";
        }

        setAttrs({
        complexion: selectskin
        });
    });
});

//Secondary skill randomizer
on("clicked:skillroll", function() {
    getAttrs(['skill'], function(values) {
        var skillfind = (Math.floor(Math.random() * 60) + 1);
        var selectskill = '';
       
        if (skillfind === 1) {
           var selectskill = "animal trainer";
        }
        if (skillfind === 2) {
           var selectskill = "armourer";
        } 
        if (skillfind === 3) {
           var selectskill = "atiliator";
        } 
        if (skillfind === 4) {
           var selectskill = "baker/cook";
        }
        if (skillfind === 5) {
           var selectskill = "barber/dentist";
        }
        if (skillfind === 6) {
           var selectskill = "bar-/innkeeper";
        }
        if (skillfind === 7) {
           var selectskill = "black-/coin-/metalsmith";
        }
        if (skillfind === 8) {
           var selectskill = "boat-/shipwright";
        }
        if (skillfind === 9) {
           var selectskill = "bookbinder";
        }
        if (skillfind === 10) {
           var selectskill = "bowyer/fletcher";
        }
        if (skillfind === 11) {
           var selectskill = "brewer/vintner";
        }
        if (skillfind === 12) {
           var selectskill = "butcher/salter";
        }
        if (skillfind === 13) {
           var selectskill = "carpenter";
        }
        if (skillfind === 14) {
           var selectskill = "cart-/wrainwright";
        }
        if (skillfind === 15) {
           var selectskill = "chandler";
        }
        if (skillfind === 16) {
           var selectskill = "charcoaler/peatman";
        }
        if (skillfind === 17) {
           var selectskill = "clothier/dyer";
        }
        if (skillfind === 18) {
           var selectskill = "cobbler/shoemaker";
        }
        if (skillfind === 19) {
           var selectskill = "cooper";
        }
        if (skillfind === 20) {
           var selectskill = "engineer";
        }
        if (skillfind === 21) {
           var selectskill = "farmer";
        }
        if (skillfind === 22) {
           var selectskill = "fisherman/whaler";
        } 
        if (skillfind === 23) {
           var selectskill = "fuller";
        } 
        if (skillfind === 24) {
           var selectskill = "furrier/skinner";
        }
        if (skillfind === 25) {
           var selectskill = "gaffer/glazier";
        }
        if (skillfind === 26) {
           var selectskill = "gaoler/turnkey";
        }
        if (skillfind === 27) {
           var selectskill = "gardener";
        }
        if (skillfind === 28) {
           var selectskill = "gem cutter/jeweller";
        }
        if (skillfind === 29) {
           var selectskill = "grocer";
        }
        if (skillfind === 30) {
           var selectskill = "guard/watchman";
        }
        if (skillfind === 31) {
           var selectskill = "herdsman/pack handler";
        }
        if (skillfind === 32) {
           var selectskill = "hunter/trapper";
        }
        if (skillfind === 33) {
           var selectskill = "labourer/yardman";
        }
        if (skillfind === 34) {
           var selectskill = "leatherworker/saddler/tanner";
        }
        if (skillfind === 35) {
           var selectskill = "limner/painter/sculptor";
        }
        if (skillfind === 36) {
           var selectskill = "linkboy/messenger";
        }
        if (skillfind === 37) {
           var selectskill = "locksmith";
        }
        if (skillfind === 38) {
           var selectskill = "logger/woodcutter";
        }
        if (skillfind === 39) {
           var selectskill = "mason/slater";
        }
        if (skillfind === 40) {
           var selectskill = "merchant/monger";
        }
        if (skillfind === 41) {
           var selectskill = "miller";
        }
        if (skillfind === 42) {
           var selectskill = "miner";
        } 
        if (skillfind === 43) {
           var selectskill = "minstrel/musician";
        } 
        if (skillfind === 44) {
           var selectskill = "mortician";
        }
        if (skillfind === 45) {
           var selectskill = "navigator";
        }
        if (skillfind === 46) {
           var selectskill = "potter";
        }
        if (skillfind === 47) {
           var selectskill = "riverman/waterman";
        }
        if (skillfind === 48) {
           var selectskill = "roofer/thatcher";
        }
        if (skillfind === 49) {
           var selectskill = "roper";
        }
        if (skillfind === 50) {
           var selectskill = "sailor/seaman";
        }
        if (skillfind === 51) {
           var selectskill = "scribe/scrivener";
        }
        if (skillfind === 52) {
           var selectskill = "soldier/mercenary";
        }
        if (skillfind === 53) {
           var selectskill = "stabler";
        }
        if (skillfind === 54) {
           var selectskill = "stevedor";
        }
        if (skillfind === 55) {
           var selectskill = "sword-/weaponsmith";
        }
        if (skillfind === 56) {
           var selectskill = "tailor/weaver";
        }
        if (skillfind === 57) {
           var selectskill = "teamster";
        }
        if (skillfind === 58) {
           var selectskill = "tinker";
        }
        if (skillfind === 59) {
           var selectskill = "wheelwright";
        }
        if (skillfind === 60) {
           var selectskill = "wire drawer";
        }

        setAttrs({
        skills: selectskill
        });
    });
});

 

8/16/2022 12:54 am  #16


Re: Roll20 Character Sheet

//Hit Dice, Primary Attribute, and Bonus XP auto calculator
on("change:class change:level change:st change:dx change:cn change:in change:ws change:ch sheet:opened", function() {
getAttrs(['class', 'level', 'hd', 'hpbonus', 'xpbonus', 'st', 'dx', 'cn', 'in', 'ws', 'ch'], function(values) {
const getclass = parseInt(values.class)||0;
const getlevel = parseInt(values.level)||0;
const hpmodifier = parseInt(values.hpbonus)||0;
const strength = parseInt(values.st)||0;
const dexterity = parseInt(values.dx)||0;
const constitution = parseInt(values.cn)||0;
const intelligence = parseInt(values.in)||0;
const wisdom = parseInt(values.ws)||0;
const charisma = parseInt(values.ch)||0;


//hitdice
var hitdicetype = 0;

if (getclass === 1 || getclass === 11 || getclass === 12 || getclass === 13 || getclass === 14 || getclass === 15 || getclass === 18) {
var hitdicetype = 4;
}
if (getclass === 3 || getclass === 20 || getclass === 21 || getclass === 23 || getclass === 24 || getclass === 25) {
var hitdicetype = 6;
}
if (getclass === 2 || getclass === 10 || getclass === 16 || getclass === 17 || getclass === 19 || getclass === 22) {
var hitdicetype = 8;
}
if (getclass === 0 || getclass === 6 || getclass === 7 || getclass === 8 || getclass === 9) {
var hitdicetype = 10;
}
if (getclass === 4 || getclass === 5) {
var hitdicetype = 12;
}

var hitdicecalc = `${getlevel}d${hitdicetype}+${hpmodifier}`;

if (getlevel === 10 && getclass === 1 ||getlevel === 10 && getclass === 11 || getlevel === 10 && getclass === 12 || getlevel === 10 && getclass === 13 || getlevel === 10 && getclass === 14 ||getlevel === 10 && getclass === 15 || getlevel === 10 && getclass === 18) {
var hitdicecalc = `9d${hitdicetype}+1+${hpmodifier}`;
}
if (getlevel === 10 && getclass === 3 || getlevel === 10 && getclass === 20 || getlevel === 10 && getclass === 21 || getlevel === 10 && getclass === 23 || getlevel === 10 && getclass === 24 || getlevel === 10 && getclass === 25) {
var hitdicecalc = `9d${hitdicetype}+2+${hpmodifier}`;
}
if (getlevel === 10 && getclass === 2 || getlevel === 10 && getclass === 10 || getlevel === 10 && getclass === 16 || getlevel === 10 && getclass === 17 || getlevel === 10 && getclass === 19 || getlevel === 10 && getclass === 22) {
var hitdicecalc = `9d${hitdicetype}+2+${hpmodifier}`;
}
if (getlevel === 10 && getclass === 0 || getlevel === 10 && getclass === 6 || getlevel === 10 && getclass === 7 || getlevel === 10 && getclass === 8 || getlevel === 10 && getclass === 9) {
var hitdicecalc = `9d${hitdicetype}+3+${hpmodifier}`;
}
if (getlevel === 10 && getclass === 4 || getlevel === 10 && getclass === 5) {
var hitdicecalc = `9d${hitdicetype}+4+${hpmodifier}`;
}
if (getlevel === 11 && getclass === 1 || getlevel === 11 && getclass === 11 || getlevel === 11 && getclass === 12 || getlevel === 11 && getclass === 13 || getlevel === 11 && getclass === 14 || getlevel === 11 && getclass === 15 || getlevel === 11 && getclass === 18) {
var hitdicecalc = `9d${hitdicetype}+2+${hpmodifier}`;
}
if (getlevel === 11 && getclass === 3 || getlevel === 11 && getclass === 20 || getlevel === 11 && getclass === 21 || getlevel === 11 && getclass === 23 || getlevel === 11 && getclass === 24 || getlevel === 11 && getclass === 25) {
var hitdicecalc = `9d${hitdicetype}+4+${hpmodifier}`;
}
if (getlevel === 11 && getclass === 2 || getlevel === 11 && getclass === 10 || getlevel === 11 && getclass === 16 || getlevel === 11 && getclass === 17 || getlevel === 11 && getclass === 19 || getlevel === 11 && getclass === 22) {
var hitdicecalc = `9d${hitdicetype}+4+${hpmodifier}`;
}
if (getlevel === 11 && getclass === 0 || getlevel === 11 && getclass === 6 || getlevel === 11 && getclass === 7 || getlevel === 11 && getclass === 8 || getlevel === 11 && getclass === 9) {
var hitdicecalc = `9d${hitdicetype}+6+${hpmodifier}`;
}
if (getlevel === 11 && getclass === 4 || getlevel === 11 && getclass === 5) {
var hitdicecalc = `9d${hitdicetype}+8+${hpmodifier}`;
}
if (getlevel === 12 && getclass === 1 || getlevel === 12 && getclass === 11 || getlevel === 12 && getclass === 12 || getlevel === 12 && getclass === 13 || getlevel === 12 && getclass === 14 || getlevel === 12 && getclass === 15 || getlevel === 12 && getclass === 18) {
var hitdicecalc = `9d${hitdicetype}+3+${hpmodifier}`;
}
if (getlevel === 12 && getclass === 3 || getlevel === 12 && getclass === 20 || getlevel === 12 && getclass === 21 || getlevel === 12 && getclass === 23 || getlevel === 12 && getclass === 24 || getlevel === 12 && getclass === 25) {
var hitdicecalc = `9d${hitdicetype}+6+${hpmodifier}`;
}
if (getlevel === 12 && getclass === 2 || getlevel === 12 && getclass === 10 || getlevel === 12 && getclass === 16 || getlevel === 12 && getclass === 17 || getlevel === 12 && getclass === 19 || getlevel === 12 && getclass === 22) {
var hitdicecalc = `9d${hitdicetype}+6+${hpmodifier}`;
}
if (getlevel === 12 && getclass === 0 || getlevel === 12 && getclass === 6 || getlevel === 12 && getclass === 7 || getlevel === 12 && getclass === 8 || getlevel === 12 && getclass === 9) {
var hitdicecalc = `9d${hitdicetype}+9+${hpmodifier}`;
}
if (getlevel === 12 && getclass === 4 || getlevel === 12 && getclass === 5) {
var hitdicecalc = `9d${hitdicetype}+12+${hpmodifier}`;
}

//primary attributes
var primaryattribute = '';
if (getclass === 0) {
var primaryattribute = "Strength";
}
if (getclass === 1) {
var primaryattribute = "Intelligence";
}
if (getclass === 2) {
var primaryattribute = "Wisdom";
}
if (getclass === 3) {
var primaryattribute = "Dexterity";
}
if (getclass === 4) {
var primaryattribute = "Strength and Dexterity";
}
if (getclass === 5) {
var primaryattribute = "Strength and Constitution";
}
if (getclass === 6 || getclass === 8) {
var primaryattribute = "Strength and Charisma";
}
if (getclass === 7 || getclass === 9 || getclass === 19) {
var primaryattribute = "Strength and Wisdom";
}
if (getclass === 10) {
var primaryattribute = "Strength and Intelligence";
}
if (getclass === 11 || getclass === 13 || getclass === 14 || getclass === 20) {
var primaryattribute = "Intelligence and Wisdom";
}
if (getclass === 15) {
var primaryattribute = "Intelligence and Charisma";
}
if (getclass === 12 || getclass === 21 || getclass === 23 || getclass === 25) {
var primaryattribute = "Dexterity and Intelligence";
}
if (getclass === 17 || getclass === 24) {
var primaryattribute = "Dexterity and Wisdom";
}
if (getclass === 16 || getclass === 18) {
var primaryattribute = "Wisdom and Charisma";
}
if (getclass === 22) {
var primaryattribute = "Dexterity and Charisma";
}

//bonus xp
var bonusxp = 0;

if (getclass === 0 && strength >= 16) {
var bonusxp = 10;
}
if (getclass === 1 && intelligence >= 16) {
var bonusxp = 10;
}
if (getclass === 2 && wisdom >= 16) {
var bonusxp = 10;
}
if (getclass === 3 && dexterity >= 16) {
var bonusxp = 10;
}
if (getclass === 4 && strength >= 16 && dexterity >= 16) {
var bonusxp = 10;
}
if (getclass === 5 && strength >= 16 && constitution >= 16) {
var bonusxp = 10;
}
if (getclass === 6 && strength >= 16 && charisma >= 16 || getclass === 8 && strength >= 16 && charisma >= 16) {
var bonusxp = 10;
}
if (getclass === 7 && strength >= 16 && charisma >= 16 || getclass === 9 && strength >= 16 && charisma >= 16 || getclass === 19 && strength >= 16 && wisdom >= 16) {
var bonusxp = 10;
}
if (getclass === 10 && strength >= 16 && intelligence >= 16) {
var bonusxp = 10;
}
if (getclass === 11 && intelligence >= 16 && wisdom >= 16 || getclass === 13 && intelligence >= 16 && wisdom >= 16 || getclass === 14 && intelligence >= 16 && wisdom >= 16 || getclass === 20 && intelligence >= 16 && wisdom >= 16) {
var bonusxp = 10;
}
if (getclass === 15 && intelligence >= 16 && charisma >= 16) {
var bonusxp = 10;
}
if (getclass === 12 && dexterity >= 16 && intelligence >= 16 || getclass === 21 && dexterity >= 16 && intelligence >= 16 || getclass === 23 && dexterity >= 16 && intelligence >= 16 || getclass === 25 && dexterity >= 16 && intelligence >= 16) {
var bonusxp = 10;
}
if (getclass === 17 && dexterity >= 16 && wisdom >= 16 || getclass === 24 && dexterity >= 16 && wisdom >= 16) {
var bonusxp = 10;
}
if (getclass === 16 && wisdom >= 16 && charisma >= 16 || getclass === 18 && wisdom >= 16 && charisma >= 16) {
var bonusxp = 10;
}
if (getclass === 22 && dexterity >= 16 && charisma >= 16) {
var bonusxp = 10;
}

setAttrs({
hd: hitdicecalc,
primeatt: primaryattribute,
xpbonus: bonusxp
});
});
});

//Fighting Ability, Casting Ability, Turning Ability, and XP requirements auto calculator
on("change:class change:level change:st change:dx change:cn change:in change:ws change:ch change:xpbonus sheet:opened", function() {
getAttrs(['class', 'level', 'xp_needed', 'xpbonus', 'fightingability', 'castingability', 'savingthrow', 'turningability'], function(values) {
const getclass = parseInt(values.class)||0;
const getlevel = parseInt(values.level)||0;
const bonusxp = parseInt(values.xpbonus)||0;



//fighting ability
if (getclass === 0 || getclass === 4 || getclass === 5 || getclass === 6 || getclass === 7 || getclass === 8 || getclass === 9 || getclass === 10 || getclass === 19) {
var fightability = getlevel;
}
if (getclass === 17){
var fightability = getlevel - 1;
}
if (getclass === 1 || getclass === 11 || getclass === 12 || getclass === 13 || getclass === 14 || getclass === 15 || getclass === 18){
var fightability = Math.round(getlevel / 2) - 1;
}
if (getclass === 2 || getclass === 3 || getclass === 16 || getclass === 21 || getclass === 22 || getclass === 23 || getclass === 24 || getclass === 25){
var fightability = Math.round(getlevel*0.66);
}
if (getclass === 20){
if (getlevel === 1){
var fightability = 0;
}
if (getlevel === 2){
var fightability = 0;
}
if (getlevel === 3){
var fightability = 1;
}
if (getlevel === 4){
var fightability = 2;
}
if (getlevel === 5){
var fightability = 2;
}
if (getlevel === 6){
var fightability = 3;
}
if (getlevel === 7){
var fightability = 4;
}
if (getlevel === 8){
var fightability = 4;
}
if (getlevel === 9){
var fightability = 5;
}
if (getlevel === 10){
var fightability = 6;
}
if (getlevel === 11){
var fightability = 6;
}
if (getlevel === 12){
var fightability = 7;
}
}

//casting ability
var castability = 0;

if (getclass === 1 || getclass === 2 || getclass === 10 || getclass === 11 || getclass === 12 || getclass === 13 || getclass === 14 || getclass === 15 || getclass === 16 || getclass === 18 || getclass === 19 || getclass === 20 || getclass === 22 || getclass === 23 || getclass === 24) {
var castability = getlevel;
}
if (getclass === 8 || getclass === 9) {
var castability = getlevel - 6;
if (Math.sign(castability) === -1) {
var castability = 0;
}
}

//turning ability
var turnability = 0;

if (getclass === 2 || getclass === 18){
var turnability = getlevel;
}
if (getclass === 8) {
var turnability = getlevel - 4;
if (Math.sign(turnability) === -1) {
var turnability = 0;
}
}
if (getclass === 13 || getclass === 20 || getclass === 24) {
var turnability = getlevel - 2;
if (Math.sign(turnability) === -1) {
var turnability = 0;
}
}

//class based xp requirement
if (getclass === 0 || getclass === 2 || getclass === 16 || getclass === 18) {
xptable = [0, 2000, 4000, 8000, 16000, 32000, 64000, 128000, 256000, 384000, 512000, 640000];
}
if (getclass === 1 || getclass === 5 || getclass === 11 || getclass === 12 || getclass === 13 || getclass === 14 || getclass === 17 || getclass === 20 || getclass === 22 || getclass === 24) {
xptable = [0, 2500, 5000, 10000, 20000, 40000, 80000, 160000, 320000, 480000, 640000, 800000];
}
if (getclass === 3) {
xptable = [0, 1500, 3000, 6000, 12000, 24000, 48000, 96000, 192000, 288000, 384000, 480000];
}
if (getclass === 4 || getclass === 10 || getclass === 15 || getclass === 19) {
xptable = [0, 3000, 6000, 12000, 24000, 48000, 96000, 192000, 384000, 576000, 768000, 960000];
}
if (getclass === 6 || getclass === 7 || getclass === 9) {
xptable = [0, 2250, 4500, 9000, 18000, 36000, 72000, 144000, 288000, 432000, 576000, 720000];
}
if (getclass === 8 || getclass === 23){
xptable = [0, 2750, 5500, 11000, 22000, 44000, 88000, 176000, 352000, 528000, 704000, 880000];
}
if (getclass === 21) {
xptable = [0, 1750, 3500, 7000, 14000, 28000, 56000, 112000, 224000, 336000, 448000, 560000];
}

var xpneed = `${xptable.at(getlevel)}`;

if (bonusxp === 10){
var xpneed = xpneed*.90;
}

setAttrs({
fightingability: fightability,
castingability: castability,
turningability: turnability,
xp_needed: xpneed
});
});
});

//get saving throw modifiers from class and ability scores
on("change:class change:level change:deathmagicbonus change:deathmiscbonus changeoisonbonus change:transformationmagicbonus change:transformationmiscbonus change:devicemagicbonus change:devicemiscbonus change:willmod change:avoidmagicbonus change:avoidmiscbonus change:dexdefbonus change:sorcerymagicbonus change:sorcerymiscbonus sheet:opened", function() {
getAttrs(['level', 'class', 'savingthrow', 'deathbonus', 'deathclassbonus', 'deathmagicbonus', 'deathmiscbonus', 'poison_radiation', 'poisonbonus', 'transformationbonus', 'transformationclassbonus', 'transformationmagicbonus', 'transformationmiscbonus', 'devicebonus', 'deviceclassbonus', 'devicemagicbonus', 'devicemiscbonus', 'willmod', 'device_willpower', 'avoidbonus', 'avoidclassbonus', 'avoidmagicbonus', 'avoidmiscbonus', 'avoiddexbonus', 'dexdefbonus', 'sorcerybonus', 'sorceryclassbonus', 'sorcerymagicbonus', 'sorcerymiscbonus', 'sorcery_willpower'], function(values) {
const getlevel = parseInt(values.level)||0;
const getclass = parseInt(values.class)||0;
const getdeathmagicbonus = parseInt(values.deathmagicbonus)||0;
const getdeathmiscbonus = parseInt(values.deathmiscbonus)||0;
const getpoisonbonus = parseInt(values.poisonbonus)||0;
const gettransformationmagicbonus = parseInt(values.transformationmagicbonus)||0;
const gettransformationmiscbonus = parseInt(values.transformationmiscbonus)||0;
const getdevicemagicbonus = parseInt(values.devicemagicbonus)||0;
const getdevicemiscbonus = parseInt(values.devicemiscbonus)||0;
const getwillpower = parseInt(values.willmod)||0;
const getavoidmagicbonus = parseInt(values.avoidmagicbonus)||0;
const getavoidmiscbonus = parseInt(values.avoidmiscbonus)||0;
const getavoiddexbonus = parseInt(values.dexdefbonus)||0;
const getsorcerymagicbonus = parseInt(values.sorcerymagicbonus)||0;
const getsorcerymiscbonus = parseInt(values.sorcerymiscbonus)||0;

//saving throws
var savethrow = 17 - Math.round(getlevel / 2);

//death saving throws
var getdeathclassbonus = 0;
if (getclass === 0 || getclass === 2 || getclass === 4 || getclass === 5 || getclass === 6 || getclass === 7 || getclass === 8 || getclass === 9 || getclass === 13 || getclass === 16 || getclass === 18 || getclass === 20) {
var getdeathclassbonus = 2;
}
var getdeathbonus = getdeathclassbonus + getdeathmagicbonus + getdeathmiscbonus;
var getpoison_radiation = getdeathbonus + getpoisonbonus;

//transform saving throws
var gettransformationclassbonus = 0;
if (getclass === 0 || getclass === 4 || getclass === 5 || getclass === 6 || getclass === 7 || getclass === 8 || getclass === 9 || getclass === 10 || getclass === 15 || getclass === 17 || getclass === 19) {
var gettransformationclassbonus = 2;
}
var gettransformationbonus = gettransformationclassbonus + gettransformationmagicbonus + gettransformationmiscbonus;

//device saving throws
var getdeviceclassbonus = 0;
if (getclass === 1 || getclass === 3 || getclass === 4 || getclass === 5 || getclass === 8 || getclass === 11 || getclass === 12 || getclass === 14 || getclass === 21 || getclass === 22 || getclass === 25) {
var getdeviceclassbonus = 2;
}
var getdevicebonus = getdeviceclassbonus + getdevicemagicbonus + getdevicemiscbonus;
var getdevicewillpower = getdevicebonus + getwillpower;

//avoidance saving throws
var getavoidclassbonus = 0;
if (getclass === 3 || getclass === 4 || getclass === 5 || getclass === 8 || getclass === 17 || getclass === 22 || getclass === 23 || getclass === 24 || getclass === 25) {
var getavoidclassbonus = 2;
}
var getavoidbonus = getavoidclassbonus + getavoidmagicbonus + getavoidmiscbonus + getavoiddexbonus;

//sorcery saving throws
var getsorceryclassbonus = 0;
if (getclass === 1 || getclass === 2 || getclass === 4 || getclass === 5 || getclass === 8 || getclass === 10 || getclass === 11 || getclass === 12 || getclass === 13 || getclass === 14 || getclass === 15 || getclass === 16 || getclass === 18 || getclass === 19 || getclass === 20 || getclass === 21 || getclass === 23 || getclass === 24) {
var getsorceryclassbonus = 2;
}
var getsorcerybonus = getsorceryclassbonus + getsorcerymagicbonus + getsorcerymiscbonus;
var getsorcerywillpower = getsorcerybonus + getwillpower;

setAttrs({
savingthrow: savethrow,
deathclassbonus: getdeathclassbonus,
deathbonus: getdeathbonus,
poison_radiation: getpoison_radiation,
transformationclassbonus: gettransformationclassbonus,
transformationbonus: gettransformationbonus,
deviceclassbonus: getdeviceclassbonus,
devicebonus: getdevicebonus,
device_willpower: getdevicewillpower,
avoidclassbonus: getavoidclassbonus,
avoiddexbonus: getavoiddexbonus,
avoidbonus: getavoidbonus,
sorceryclassbonus: getsorceryclassbonus,
sorcerybonus: getsorcerybonus,
sorcerywillpower: getsorcerywillpower
});
});
});

//unskilled weapon attack penalty
on("change:class", function() {
getAttrs(['class', 'unskilledpenalty'], function(values) {
const getclass = parseInt(values.class)||0;
var getunskilledpenalty = 0;

if (getclass === 1 || getclass === 11 || getclass === 12 || getclass === 13 || getclass === 14 || getclass === 15 || getclass === 18 || getclass === 20) {
var getunskilledpenalty = -4;
}
if (getclass === 2 || getclass === 16 || getclass === 17 || getclass === 3 || getclass === 21 || getclass === 23 || getclass === 24 || getclass === 25) {
var getunskilledpenalty = -2;
}

setAttrs({
unskilledpenalty: getunskilledpenalty
});
});
});

//defense bonus from dexterity in AC section
on("change:dexdefbonus", function() {
getAttrs(['dexdefbonus', 'dexac'], function(values) {
const getdexdefbonus = parseInt(values.dexdefbonus)||0;

setAttrs({
dexac: getdexdefbonus
});
});
});

//Attribute random roller
on("clicked:attributeroll", function() {
getAttrs(['st', 'dx', 'cn', 'in', 'ws', 'ch'], function(values) {
var getst1 = (Math.floor(Math.random() * 6) + 1);
var getst2 = (Math.floor(Math.random() * 6) + 1);
var getst3 = (Math.floor(Math.random() * 6) + 1);
var getdx1 = (Math.floor(Math.random() * 6) + 1);
var getdx2 = (Math.floor(Math.random() * 6) + 1);
var getdx3 = (Math.floor(Math.random() * 6) + 1);
var getcn1 = (Math.floor(Math.random() * 6) + 1);
var getcn2 = (Math.floor(Math.random() * 6) + 1);
var getcn3 = (Math.floor(Math.random() * 6) + 1);
var getin1 = (Math.floor(Math.random() * 6) + 1);
var getin2 = (Math.floor(Math.random() * 6) + 1);
var getin3 = (Math.floor(Math.random() * 6) + 1);
var getws1 = (Math.floor(Math.random() * 6) + 1);
var getws2 = (Math.floor(Math.random() * 6) + 1);
var getws3 = (Math.floor(Math.random() * 6) + 1);
var getch1 = (Math.floor(Math.random() * 6) + 1);
var getch2 = (Math.floor(Math.random() * 6) + 1);
var getch3 = (Math.floor(Math.random() * 6) + 1);

var getst = getst1 + getst2 + getst3;
var getdx = getdx1 + getdx2 + getdx3;
var getcn = getcn1 + getcn2 + getcn3;
var getin = getin1 + getin2 + getin3;
var getws = getws1 + getws2 + getws3;
var getch = getch1 + getch2 + getch3;

setAttrs({
st: getst,
dx: getdx,
cn: getcn,
"in": getin,
ws: getws,
ch: getch
});
});
});

//auto-calc progressive thief abilities
on("change:class change:level change:dx change:in change:ws sheet:opened", function() {
getAttrs(['class', 'level', 'dx', 'in', 'ws'], function(values) {
const getclass = parseInt(values.class)||0;
const getlevel = parseInt(values.level)||0;
const getdx = parseInt(values.dx)||0;
const getin = parseInt(values.in)||0;
const getws = parseInt(values.ws)||0;

var setclimb = 'NA';
var setdecipherscript = 'NA';
var setdiscernnoise = 'NA';
var sethide = 'NA';
var setmanipulatetraps = 'NA';
var setmovesilently = 'NA';
var setopenlocks = 'NA';
var setpickpockets = 'NA';
var setreadscrolls = 'NA';
var dexbonus = 0;
var intbonus = 0;
var wisbonus = 0;

if (getdx >= 16){
var dexbonus = 1;
}
if (getin >= 16){
var intbonus = 1;
}
if (getws >= 16){
var wisbonus = 1;
}

if (getclass === 3 || getclass === 4 || getclass === 5 || getclass === 7 || getclass === 9 || getclass === 17 || getclass === 21 || getclass === 23 || getclass === 24 || getclass === 25){
if (getlevel <= 4){
var setclimb = 8 + dexbonus;
}
else if (getlevel <= 8){
var setclimb = 9 + dexbonus;
}
else if (getlevel <= 12){
var setclimb = 10 + dexbonus;
}
}
if (getclass === 3 || getclass === 22 || getclass === 23 || getclass === 24){
if (getlevel === 1 || getlevel === 2){
var setdecipherscript = 0 + intbonus;
}
if (getlevel === 3 || getlevel === 4){
var setdecipherscript = 1 + intbonus;
}
if (getlevel === 5 || getlevel === 6){
var setdecipherscript = 2 + intbonus;
}
if (getlevel === 7 || getlevel === 8){
var setdecipherscript = 3 + intbonus;
}
if (getlevel === 9 || getlevel === 10){
var setdecipherscript = 4 + intbonus;
}
if (getlevel === 11 || getlevel === 12){
var setdecipherscript = 5 + intbonus;
}
}
if (getclass === 3 || getclass === 9 || getclass === 17 || getclass === 21 || getclass === 22 || getclass === 23 || getclass === 24 || getclass === 25){
if (getlevel === 1 || getlevel === 2){
var setdiscernnoise = 4 + wisbonus;
}
if (getlevel === 3 || getlevel === 4){
var setdiscernnoise = 5 + wisbonus;
}
if (getlevel === 5 || getlevel === 6){
var setdiscernnoise = 6 + wisbonus;
}
if (getlevel === 7 || getlevel === 8){
var setdiscernnoise = 7 + wisbonus;
}
if (getlevel === 9 || getlevel === 10){
var setdiscernnoise = 8 + wisbonus;
}
if (getlevel === 11 || getlevel === 12){
var setdiscernnoise = 9 + wisbonus;
}
}
if (getclass === 3 || getclass === 7 || getclass === 9 || getclass === 17 || getclass === 21 || getclass === 22 || getclass === 23 || getclass === 24 || getclass === 25){
if (getlevel === 1 || getlevel == 2){
var sethide = 5 + dexbonus;
}
if (getlevel === 3 || getlevel == 4){
var sethide = 6 + dexbonus;
}
if (getlevel === 5 || getlevel == 6){
var sethide = 7 + dexbonus;
}
if (getlevel === 7 || getlevel == 8){
var sethide = 8 + dexbonus;
}
if (getlevel === 9 || getlevel == 10){
var sethide = 9 + dexbonus;
}
if (getlevel === 11 || getlevel == 12){
var sethide = 10 + dexbonus;
}
}
if (getclass === 3 || getclass === 7 || getclass === 21 || getclass === 23 || getclass === 24 || getclass === 25){
if (getlevel === 1 || getlevel == 2){
var setmanipulatetraps = 3 + dexbonus;
}
if (getlevel === 3 || getlevel == 4){
var setmanipulatetraps = 4 + dexbonus;
}
if (getlevel === 5 || getlevel == 6){
var setmanipulatetraps = 5 + dexbonus;
}
if (getlevel === 7 || getlevel == 8){
var setmanipulatetraps = 6 + dexbonus;
}
if (getlevel === 9 || getlevel == 10){
var setmanipulatetraps = 7 + dexbonus;
}
if (getlevel === 11 || getlevel == 12){
var setmanipulatetraps = 8 + dexbonus;
}
}
if (getclass === 3 || getclass === 4 || getclass === 7 || getclass === 9 || getclass === 17 || getclass === 21 || getclass === 22 || getclass === 23 || getclass === 24 || getclass === 25){
if (getlevel === 1 || getlevel == 2){
var setmovesilently = 5 + dexbonus;
}
if (getlevel === 3 || getlevel == 4){
var setmovesilently = 6 + dexbonus;
}
if (getlevel === 5 || getlevel == 6){
var setmovesilently = 7 + dexbonus;
}
if (getlevel === 7 || getlevel == 8){
var setmovesilently = 8 + dexbonus;
}
if (getlevel === 9 || getlevel == 10){
var setmovesilently = 9 + dexbonus;
}
if (getlevel === 11 || getlevel == 12){
var setmovesilently = 10 + dexbonus;
}
}
if (getclass === 3 || getclass === 21 || getclass === 23 || getclass === 24 || getclass === 25){
if (getlevel === 1 || getlevel == 2){
var setopenlocks = 3 + dexbonus;
}
if (getlevel === 3 || getlevel == 4){
var setopenlocks = 4 + dexbonus;
}
if (getlevel === 5 || getlevel == 6){
var setopenlocks = 5 + dexbonus;
}
if (getlevel === 7 || getlevel == 8){
var setopenlocks = 6 + dexbonus;
}
if (getlevel === 9 || getlevel == 10){
var setopenlocks = 7 + dexbonus;
}
if (getlevel === 11 || getlevel == 12){
var setopenlocks = 8 + dexbonus;
}
}
if (getclass === 3 || getclass === 23 || getclass === 24){
if (getlevel === 1 || getlevel == 2){
var setpickpockets = 4 + dexbonus;
}
if (getlevel === 3 || getlevel == 4){
var setpickpockets = 5 + dexbonus;
}
if (getlevel === 5 || getlevel == 6){
var setpickpockets = 6 + dexbonus;
}
if (getlevel === 7 || getlevel == 8){
var setpickpockets = 7 + dexbonus;
}
if (getlevel === 9 || getlevel == 10){
var setpickpockets = 8 + dexbonus;
}
if (getlevel === 11 || getlevel == 12){
var setpickpockets = 9 + dexbonus;
}
}
if (getclass === 3){
if (getlevel === 5 || getlevel == 6){
var setreadscrolls = 0 + intbonus;
}
if (getlevel === 7 || getlevel == 8){
var setreadscrolls = 3 + intbonus;
}
if (getlevel === 9 || getlevel == 10){
var setreadscrolls = 4 + intbonus;
}
if (getlevel === 11 || getlevel == 12){
var setreadscrolls = 5 + intbonus;
}
}

setAttrs({
thiefclimb: setclimb,
thiefdecipherscript: setdecipherscript,
thiefdiscernnoise: setdiscernnoise,
thiefhide: sethide,
thiefmanipulatetraps: setmanipulatetraps,
thiefmovesilently: setmovesilently,
thiefopenlocks: setopenlocks,
thiefpickpockets: setpickpockets,
thiefreadscrolls: setreadscrolls
});
});
});

</script>

 

8/16/2022 12:54 am  #17


Re: Roll20 Character Sheet

___________________________________________________________
This is the end of the HTML Layout

Under is CSS styling
___________________________________________________________

 

8/16/2022 12:56 am  #18


Re: Roll20 Character Sheet

/*************************************************************/
/* Colors
#993333 / rgb(153, 51, 51)
*/
div,
button,
textarea,
span,
input,
select{
box-sizing: border-box;
}
div{
margin: none;
padding: none;
background-color: transparent;
}

input[type=radio].sheet-styleCharacter,
input[type=radio].sheet-styleMonster{
margin-left:2px;
margin-right: 1px;
display: inline-block;
}
input[type=radio].sheet-styleCharacter + span,
input[type=radio].sheet-styleMonster + span{
font-size:11px;
color: #888888;
text-align:left;
}
input[type=radio].sheet-styleCharacter:checked ~ .sheet-monster{
display: none;
}
input[type=radio].sheet-styleMonster:checked ~ .sheet-main{
display: none;
}
input[type=checkbox]{
margin-left: 10px;
}


div.sheet-main{
width: 890px;
min-width: 890px;
max-width: 890px;
text-align: center;
font-size: 13px;
background-color : #FDFDFD;
padding: 4px;
}
div.sheet-monster{
width: 890px;
min-width: 890px;
max-width: 890px;
text-align: center;
font-size: 13px;
background-color : #FDFDFD;
padding: 4px;
}
div.sheet-ligne{
display: block;
text-align: left;
vertical-align: top;
width: 100%;
white-space: nowrap;
}
div.sheet-mycol{
display: inline-block;
text-align: left;
vertical-align: top;
}
input, textarea{
background-color: transparent;
display: inline-block;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
font-family: 'Patrick Hand';
font-size: 16px;
border: none;
box-shadow: none;
resize:none;
z-index: 2;
border-radius: 0;
border-bottom: 1px dotted black;
}
input:focus, input:hover, textarea:focus, textarea:hover{
box-shadow: inset 0px 1px 1px rgba(153,51,51,0.01),0 0 6px rgba(153,51,51,0.5);
background-color: rgba(153,51,51,0.05);
}
textarea{
padding: 1px 2px 0px 2px;
border-left: 1px dotted black;
border-right: 1px dotted black;
}
input[type="text"]{
padding: 0px 0px 0px 2px;
}
input[type="text"].sheet-inptxt1 {
font-weight: bold;
font-size: 18px;
}
input[type="number"]{
text-align: right;
padding: 0px 2px 0px 0px;
}
input[type="number"].sheet-stats{
width: 30px;
font-size: 20px;
text-align: center;
-moz-appearance: textfield;
}
input[type="number"].sheet-tinyinput {
width:40px;
font-size:13px;
}
input[type="text"].sheet-tinyinput {
width:50px;
font-size:13px;
text-align: center;
}
input[type="text"].sheet-shortinput{
width:76px;
}
input[type="number"].sheet-shortinput{
width:56px;
}
input[type="text"].sheet-medinput{
width:110px;
}
input[type="number"].sheet-medinput {
width:90px;
}
input[type="text"].sheet-longinput {
width:160px;
}
input[type="text"].sheet-biginput{
width:250px;
font-weight: bold;
font-size: 25px;
}
input[type="number"].sheet-stats::-webkit-inner-spin-button,
input[type="number"].sheet-stats::-webkit-outer-spin-button {
-webkit-appearance: none;
appearance: none;
}
select{
background-color: rgba(255,255,255,0.6);
padding: 0px;
margin: 0px;
height: 18px;
line-height: 18px;
max-height 18px;
font-weight:normal;
font-family: Arial;
font-size: 14px;
border: none;
border-bottom: 1px dotted black;
text-align: center;
color: #993333;
}
select:hover{
border: 1px solid #993333;
}
select.sheet-seldice{
width: 48px;
}


.charsheet button[type=roll], button[type=action], label{
background-color: transparent;
border: none;
line-height: 12px;
background-image: none;
box-shadow: none;
padding: 0px;
margin: 0px;
font-weight: bold;
text-align:left;
position:relative;
}

.charsheet button[type=roll].sheet-d4::before {
font-family: "dicefontd4";
content: 'd';
}

.charsheet button[type=roll].sheet-d6::before {
font-family: dicefontd6;
content: "l";
}

.charsheet button[type=roll].sheet-d8::before {
font-family: "dicefontd8";
content: 'h';
}

.charsheet button[type=roll].sheet-d10::before {
font-family: "dicefontd10";
content: 'k';
}

.charsheet button[type=roll].sheet-d100::before {
font-family: "dicefontd10";
content: 't';
}

.charsheet button[type=roll].sheet-d12::before {
font-family: "dicefontd12";
content: 'l';
}

.charsheet button[type=roll].sheet-d20::before {
font-family: "dicefontd20";
content: 't';
}

.charsheet button[type=action].sheet-actiond6::before {
font-family: dicefontd6;
content: "l";
}

.charsheet button[type=action].sheet-actiond20::before {
font-family: "dicefontd20";
content: 't';
}

.charsheet button[type=action].sheet-actiond100::before {
font-family: "dicefontd10";
content: 't';
}

.sheet-libred{
font-size: 18px;
color:#993333;
font-weight: bold;
padding-top:4px;
font-family: 'Contrail One';
}
.sheet-lib0{
display: inline-block;
text-align: right;
font-size:14px;
font-weight:bold;
color:#333;
margin-right: 4px;
}
.sheet-lib1{
display: inline-block;
text-align: right;
font-size:14px;
font-weight:bold;
color:#333;
margin-right: 4px;
}
.sheet-lib2{
display: inline-block;
text-align: right;
font-size:12px;
font-weight:bold;
color:#333;
margin-right: 4px;
}
.sheet-lib2l{
display: inline-block;
text-align: left;
font-size:12px;
font-weight:bold;
color:#333;
margin-right: 4px;
}
.sheet-libmin1{
display: inline-block;
text-align: right;
font-size:10px;
font-weight:normal; color:#333;
}
.sheet-greybg{
background-color:#eee;
padding: 4px;
}
.sheet-bord{
border-width: 1px 2px 1px 2px;
border-style: solid;
border-color: black;
border-radius: 6px;
padding: 4px;
margin: 2px;
}
.sheet-nobord{
border-width: 1px 2px 1px 2px;
border-style: solid;
border-color: white;
border-radius: 6px;
padding: 4px;
margin: 2px;
}
.sheet-wid30{
min-width: 30px;
}
.sheet-wid40{
min-width: 40px;
}
.sheet-wid50{
min-width: 50px;
}
.sheet-wid55{
min-width: 55px;
}
.sheet-wid60{
min-width: 60px;
}
.sheet-wid70{
min-width: 70px;
}
.sheet-wid80{
min-width: 80px;
}
.sheet-wid85{
min-width: 85px;
}
.sheet-wid90{
min-width: 90px;
}
.sheet-wid100{
min-width: 100px;
}
.sheet-wid110{
min-width: 110px;
}
.sheet-wid120{
min-width: 120px;
}
.sheet-bold{
font-weight: bold;
}
/* === fieldset button === */
div.repcontrol{
display: inline-block;
width: 100%;
}
.repcontrol_move{
height: 11px;
line-height: 11px;
margin-top: 4px;
}
.repcontrol_del {
height: 22px;
line-height: 12px;
margin-top: 4px;
width: 30px;
}
.repcontrol_add, .repcontrol_edit {
color: transparent;
box-shadow: none;
background: transparent;
border-color: transparent;
text-shadow:none;
width: 100px;
}
.repcontrol_add:focus, .repcontrol_edit:focus {
outline: none;
}
.repcontrol .repcontrol_edit:after {
content: 'y';
visibility: visible;
font-family: pictos;
border: 1px solid transparent;
border-radius: 2px;
font-size: 20px;
height: 20px;
width: 20px;
padding: 2px 4px 2px 4px;
color: rgba(153,51,51,0.7);
}
.editmode ~ .repcontrol .repcontrol_edit:after {
content: '2';
}
.repcontrol .repcontrol_add:before {
content: '+';
visibility: visible;
font-family: pictos;
border: 1px solid transparent;
border-radius: 2px;
font-size: 20px;
height: 20px;
width: 20px;
padding: 2px 4px 2px 4px;
color: rgba(153,51,51,0.7);
}
.repcontrol .repcontrol_edit:hover:after,
.repcontrol .repcontrol_add:hover:before
{
box-shadow: 1px 1px 4px 2px rgba(147,35,21,0.8);
border-color: #993333;
color: #993333;
}
.repcontrol_add:focus:before, .repcontrol_edit:focus:after {
color: #993333;
}
/* === TEMPLATES === */
.sheet-rolltemplate-tmpl div{
vertical-align: middle;
border: none;
box-sizing: border-box;
display: block;
}
.sheet-rolltemplate-tmpl div.sheet-tplmain{
background-color: transparent;
border-width: 1px 2px 1px 2px;
border-radius: 0px 6px 6px 0px;
border-style: solid;
border-color: black;
width: 220px;
}
.sheet-rolltemplate-tmpl div.sheet-pc{
background-color: #eee;
color : #993333;
padding: 2px 10px 2px 10px;
border-radius: 0px 6px 0px 0px;
font-size: 15px;
font-family: 'Contrail One';
display: inline-block;
border-bottom: 1px dotted black;
width: 100%;
}
.sheet-rolltemplate-tmpl div.sheet-jetnom{
background-color: #eee;
color : #993333;
padding: 2px 10px 4px 10px;
border-radius: 0px 0px 6px 0px;
font-size: 15px;
font-family: 'Contrail One';
display: inline-block;
border-top: 1px dotted black;
width: 100%;
}
.sheet-rolltemplate-tmpl div.sheet-jet{
background-color: white;
display: inline-block;
padding: 6px;
display: table-cell;
font-family: 'Candal';
text-align: center;
white-space: nowrap;
width: 100%;
}
.sheet-rolltemplate-tmpl div.sheet-jetbordleft{
border-left: 1px dotted black;
}
.sheet-rolltemplate-tmpl div.sheet-borderd{
border-right: 2px solid black;
}
.sheet-rolltemplate-tmpl .inlinerollresult {
background-color: transparent;
border: none;
padding: 0px 0px;
font-weight: bold;
cursor: help;
font-size: 22px;
font-family: 'Candal';
}
.sheet-rolltemplate-tmpl .sheet-success{
color: #3FB315;;
}
.sheet-rolltemplate-tmpl .sheet-failure{
color: #B31515;
}
.sheet-rolltemplate-tmpl .inlinerollresult.fullcrit{
border: none;
color: #3FB315;
}
.sheet-rolltemplate-tmpl .inlinerollresult.importantroll{
border: none;
color: #4A57ED;
}
.sheet-rolltemplate-tmpl .inlinerollresult.fullfail{
border: none;
color: #B31515;
}

 

8/16/2022 12:56 am  #19


Re: Roll20 Character Sheet

________________________________________________________
CSS styling finish

Y'all let me know what you think.

-Bellhopper

 

8/16/2022 12:30 pm  #20


Re: Roll20 Character Sheet

What you could also do is create a new roll20 character sheet and name it Hyperborea.

Leave the old one was the less automated one and the Hyperborea one be the "all singing all dancing fully automated luxury Hyperborea character sheet" :-)

You could put what you have currently in a github repo and point to that until/if you get a character sheet in roll20.


What? Me worry?
     Thread Starter
 

Board footera






© 2009-2024 North Wind Adventures, LLC. “HYPERBOREA” is a registered trademark of North Wind Adventures, LLC. “Astonishing Swordsmen & Sorcerers of Hyperborea,” “AS&SH,” and all other North Wind Adventures product names and their respective logos are trademarks of North Wind Adventures, LLC in the USA and other countries. ALL RIGHTS RESERVED.