|
@ -0,0 +1,40 @@ |
|
|
|
|
|
const availability_map = { |
|
|
|
|
|
'Mercenaries': { |
|
|
|
|
|
'Light Infantry': ['4d100', '5d20', '5d10', '3d4', '1d6', '1d2'], |
|
|
|
|
|
'Heavy Infantry': ['2d100', '5d10', '3d8', '1d8', '1d3', '1d100<85'], |
|
|
|
|
|
'Slinger': ['8d20', '4d10', '2d10', '1d6', '1d2', '1d100<70'], |
|
|
|
|
|
'Bowman': ['8d20', '4d10', '2d10', '1d6', '1d2', '1d100<70'], |
|
|
|
|
|
'Crossbowman': ['8d20', '4d10', '2d10', '1d6', '1d2', '1d100<70'], |
|
|
|
|
|
'Longbowman': ['4d20', '2d10', '1d10', '1d3', '1', '1d100<33'], |
|
|
|
|
|
'Light Cavalry': ['4d20', '2d10', '1d10', '1d3', '1', '1d100<33'], |
|
|
|
|
|
'Mounted Crossbowman': ['3d20', '4d4', '2d4', '1d2', '1d100<70', '1d100<23'], |
|
|
|
|
|
'Horse Archers': ['3d20', '4d4', '2d4', '1d3', '1d100<70', '1d100<23'], |
|
|
|
|
|
'Medium Cavalry': ['3d20', '4d4', '2d4', '1d2', '1d100<70', '1d100<23'], |
|
|
|
|
|
'Heavy Cavalry': ['4d10', '1d10', '1d6', '2d100<50', '1d100<50', '1d100<15'], |
|
|
|
|
|
'Cataphract Cavalry': ['3d10', '1d8', '1d4', '2d100<33', '1d100<40', '1d100<10'], |
|
|
|
|
|
'Beast Riders': ['3d10', '1d8', '1d4', '2d100<33', '1d100<40', '1d100<10'], |
|
|
|
|
|
}, |
|
|
|
|
|
'Specialists': { |
|
|
|
|
|
}, |
|
|
|
|
|
'Henchmen': { |
|
|
|
|
|
'Normal Men': ['4d100', '5d20', '4d8', '3d4', '1d6', '1d2'], |
|
|
|
|
|
'Level 1': ['5d10', '2d6', '1d4', '1d2', '1d100<65', '1d100<20'], |
|
|
|
|
|
'Level 2': ['3d10', '2d4', '1d3', '1', '1d100<40', '1d100<15'], |
|
|
|
|
|
'Level 3': ['1d10', '1d3', '1d100<85', '1d100<33', '1d100<15', '1d100<5'], |
|
|
|
|
|
'Level 4': ['1d6', '1d2', '1d100<45', '1d100<15', '1d100<5', '0'] |
|
|
|
|
|
}, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
on("chat:message", function(msg) { |
|
|
|
|
|
if(msg.type == "api" && msg.content.indexOf("!hirelingavailability") !== -1) { |
|
|
|
|
|
var attrs = msg.content.split(' '); |
|
|
|
|
|
attrs[2] = attrs[2].replace('-', ' '); |
|
|
|
|
|
|
|
|
|
|
|
if(attrs[1] in availability_map && attrs[2] in availability_map[attrs[1]]) { |
|
|
|
|
|
let roll_text = availability_map[attrs[1]][attrs[2]][attrs[3] - 1]; |
|
|
|
|
|
|
|
|
|
|
|
let template = `&{template:acks} {{name=Hireling Availability}} {{subheader=${attrs[1]} - ${attrs[2]}}} {{desc=Market Class ${attrs[3]}}} {{Available=[[${roll_text}]]}}`; |
|
|
|
|
|
sendChat(msg.who, template); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |