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
HERO combat system scripts for Roll20 | |
There are 5 scripts in total: heroturntracker2.0, autocombat, effects, recovery, locations. | |
The first manages the turn tracker, subdividing the turns into phases in which it shows only the tokens acting during those phases depending on their SPD attribute. It supports delayed actions (by putting a "d" in place of the Dex of the token). It also keeps track of status like stunned, deeply stunned, bleeding, movement, actions, etc. | |
The second manages the weapon and their effects (or spells that damage the opponent). It can be used for modern weapons and for fantasy ones. Any spell that does damage can be | |
emulated by this script. |
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) { | |
var command = msg.content.toLowerCase(); | |
if (msg.type == "api" && command == "!combatstart"){ | |
sendChat("GM", "Combat begins!"); | |
var selected = msg.selected; | |
var aChars = new Array(); | |
var nCount = 0; | |
_.each(selected, function(obj) { | |
if(obj._type != 'graphic') 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; // We're only deal with API commands | |
//var parts = msg.content.toLowerCase().split(' '); | |
var parts = msg.content.split(';'); | |
var command = parts.shift(); | |
if(command == '!recovery') | |
{ | |
//var page = getObj('page', Campaign().get('playerpageid')); | |
var selected = msg.selected; |
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
// {effect}[id]|[type:n[fixed/dice]]|[attribute]|[defence]|[frequency(type)][duration(number and type)][counter(0)][active][description][marker]{/effect} | |
// id a numeric, unique id - It is auto-generated when the Effect is applied by the macro | |
// dam:n[d/f]|aid:n[d/f]|fla:n[d]|ent:n[d] dam = damage (can also be used as a drain), aid = aid, fla = flash (not implemented yet), ent = entangle, | |
// n = number of dice | fixed value of effect, I.e. 3 dice of damage is dam:3d | |
// Special: if dam is set to 0 fixed, it means the attribute(s) is zeroed, if it is set to -1 fixed, the attribute(s) is halved - i.e. dam:0f, dam:-1f | |
// normal|killing|body|stun|str|dex|con|int|ego|pre|run|ocv|dcv|omcv|dmcv|end|pd|ed|rec|spd stat affected, can be more than one separated by "/". Type and hasDef are then common to all attributes in the list, though. | |
// hasdef:[pd][ed][rpd][red][powerdef][flashdef][mentaldef][no] |
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" && msg.content == "!tableread") { | |
var locsMalus = [8,6,5,5,3,7,8,4,6,8]; | |
var oTable = findObjs({name: "locs",_type: "rollabletable"}); | |
var oItems = findObjs({_type: "tableitem", _rollabletableid: oTable[0].id}); | |
for(var i=0;i<oItems.length;i++) | |
{ | |
log("aLocsModifier["+i+"] = ["+locsMalus[i]+",'"+oItems[i].get('avatar')+"'];"); | |
} | |
} |
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' && msg.content.indexOf('!newsheet ') != -1) | |
{ | |
var name = msg.content.substring(10); | |
var ocharacter = findObjs({ | |
_type: "character", | |
_name: name, | |
}); | |
if(ocharacter.length==0) |
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
/* | |
The macro sends the ID or name of the attacker, the ID or name of the defender, and optionally some other modifiers to the script: | |
attmod - Default = 0, optional OCV modifier (because of status like SET, BRACE or various types of bonus/malus); | |
distance - Default = 0, optional distance (in meters) - In case you have to manually specify a distance in metres; | |
shots - optional modifiers - can be: shots[n] - Number of shots firing for that phase for weapons with selective autofire [1 (max = autofire value)]; | |
abort - optional modifier needed for "abort" type maneuvers like block and dodge. | |
manualroll - optional in case players want to roll manually to hit | |
macro example: |
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
/* | |
USAGE: | |
Select tokens and | |
!combatstart Initiate combat | |
!nextphase Advance to next phase in which at least one of the tokens in combat acts | |
!combatend End combat | |
!combatadd Add token(s) into combat | |
!combatremove Remove token(s) from combat |
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" && msg.content == "!spawn") { | |
var selected = msg.selected; | |
_.each(selected, function(obj) { | |
var newID = spawnCharacter(obj._id); | |
var oAttrib = findObjs({name: "STR",_type: "attribute", _characterid: newID}, {caseInsensitive: true})[0]; | |
var attrib = parseInt(oAttrib.get('current')); | |
attrib += 10; |
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
/* --------------------------------------------------------------------------------------------------- */ | |
// Initiative Script | |
// | |
// Usage: Select the tokens you want the initiative to be rolled for and use the command "!initiative" | |
// This command rolls a die of the type specified using the "initiativeDie" variable, adds | |
// the result to the attribute specified using the "initiativeAttribute" variable (for each | |
// token), then sorts the tokens by the total achieved (higher to lower) and puts them into | |
// the Turn Tracker. Use the command "!nextround" to move to the next round and increase the | |
// counter. | |
// |
NewerOlder