This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//API:Events:ChatMessage:processAPIswitch:common:critical********************************************** | |
roll20API.processAPIcritical = function() { | |
var MeleeArmed = new Array(); | |
MeleeArmed[0] = {Code: "FGM", Text: "Lost Footing"}; | |
MeleeArmed[1] = {Code: "DPM", Text: "Drop Weapon"}; | |
MeleeArmed[2] = {Code: "SIM", Text: "Self Injury"}; | |
MeleeArmed[3] = {Code: "EGA", Text: "Entangle With Foe"}; | |
MeleeArmed[4] = {Code: "TWM", Text: "Twist Muscle"}; | |
MeleeArmed[5] = {Code: "SDM", Text: "Scenery Disadvantage"}; | |
MeleeArmed[6] = {Code: "WMM", Text: "Wardrobe Malfunction"}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FumbleTables | |
roll20API.processAPI_FGM = function() { | |
var fumble = new Array(); | |
fumble[0] = "Fumbler’s movements put them off balance. They take a -1 penalty to \ | |
their armor class for the next round."; | |
fumble[1] = "Fumbler’s movements put them severely off balance. They lose Dexterity \ | |
and Shield bonuses to AC for the next round. If losing these bonuses does not \ | |
reduce the fumbler’s AC by -2 (or more), then they still must take a -2 penalty."; | |
fumble[2] = "Fumbler trips, and falls prone. They lose Dexterity and Shield bonuses \ | |
to AC for the current round and the next round. If losing these bonuses does not \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var roll20API = roll20API || {}; | |
//NOTES: | |
// | |
//***Display Names*** | |
//Display Names should be one word, nospaces or special characters and distinct. | |
// | |
//***roll20API.Owner = "135636"*** | |
//Campaign Owner. You can find your own personal user id by visiting the wiki and clicking on your name in the | |
//left-hand sidebar. On your wiki page you will see "Home » User:#" below your name on your userpage, where # | |
//is your user id. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Chronos Record Sheet Attributes Array | |
roll20API.attribs = []; | |
roll20API.attribs["Year"] = {name: "Year", current: "00000", max: null}; | |
roll20API.attribs["Month"] = {name: "Month", current: "08", max: null}; | |
roll20API.attribs["Day"] = {name: "Day", current: "01", max: null}; | |
roll20API.attribs["Hour"] = {name: "Hour", current: "00", max: null}; | |
roll20API.attribs["Minute"] = {name: "Minute", current: "00", max: null}; | |
roll20API.attribs["Region"] = {name: "Region", current: "Temperate", max: null}; | |
roll20API.attribs["Terrain"] = {name: "Terrain", current: "Forest", max: null}; | |
roll20API.attribs["Temp High"] = {name: "TempHigh", current: "+085", max: null}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//API:Events:ChatMessage:processAPIswitch:Chronos:add********************************************** | |
roll20API.processAPIaddChronos = function() { | |
//Add Chronos sheet if needed | |
if(findObjs({ _type: "character", name: "GM_Chronos" }).length == 0){ | |
createObj("character", { | |
name: "GM_Chronos", | |
bio: "Text Here" | |
}); | |
GM_ChronosObject = findObjs({ _type: "character", name: "GM_Chronos" }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//API:Events:ChatMessage:processAPIswitch:Chronos:minutes********************************************** | |
roll20API.processAPIminuteChronos = function() { | |
var addNumMins = parseInt(roll20API.valueGiven) + roll20API.currentMinute; | |
if(isNaN(addNumMins)){var addNumMins = 0}; | |
roll20API.tempCarryHours = Math.floor(addNumMins/60); | |
var tempCurrentMinutes = Math.round(((addNumMins/60) % 1) * 60); | |
var newCurrentMinutes = tempCurrentMinutes.toString(); | |
if(newCurrentMinutes.length == 1){newCurrentMinutes = "0" + newCurrentMinutes}; | |
findObjs({ _type: "attribute", name: "Minute", _characterid: GM_Chronosid})[0].set({current: newCurrentMinutes}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//API:Events:ChatMessage:processAPIswitch:Chronos:report********************************************** | |
roll20API.processAPIreportChronos = function() { | |
//Check for GM_Chronos report | |
var GM_Chronoslength = findObjs({ _type: "handout", name: "GM_Chronos_Report" }).length | |
var GM_ChronosExist = false; | |
if(GM_Chronoslength !== 0){ | |
GM_ChronosExist = true; | |
}else{ | |
GM_ChronosExist = false; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Roll20 UserIDs that can use this command (replace "999999" another player allowed and as more as needed.) | |
var allowedUser = ["999999","999999"]; | |
var GM_CombatMarkerDefaultTokenExist = false; | |
//dice used for combat | |
var rollValue = 10; | |
on('chat:message', function(msg) { | |
//Return if its not an API command | |
if(msg.type !== "api"){return}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on('chat:message', function(msg) { | |
if(msg.type !== "api"){return}; | |
roll20API.contentPlayerid = getObj("player", msg.playerid); | |
roll20API.contentUserid = roll20API.contentPlayerid.get("d20userid"); | |
if(allowedUser.indexOf(roll20API.contentUserid) == -1){return}; | |
roll20API.contentGiven = msg.content.toLowerCase(); | |
if(roll20API.contentGiven.indexOf(' ') == -1){ | |
roll20API.contentMessage = null; | |
roll20API.contentCommand = roll20API.contentGiven.substr(1, roll20API.contentGiven.length); | |
}else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on('chat:message', function(msg) { | |
if(msg.type !== "api"){return}; | |
roll20API.contentPlayerid = getObj("player", msg.playerid); | |
roll20API.contentUserid = roll20API.contentPlayerid.get("d20userid"); | |
if(allowedUser.indexOf(roll20API.contentUserid) == -1){return}; | |
roll20API.contentGiven = msg.content.toLowerCase(); | |
if(roll20API.contentGiven.indexOf(' ') == -1){ | |
roll20API.contentMessage = null; | |
roll20API.contentCommand = roll20API.contentGiven.substr(1, roll20API.contentGiven.length); | |
}else{ |
OlderNewer