mirror of
https://github.com/RussellChamp/GrimoireJS.git
synced 2026-10-27 22:42:32 +00:00
Massive work on everything. Currently functional
This commit is contained in:
1 parent
1b4176c5f1
commit
4adddec3a6
24 files changed
+511
-1784
No files matched your search
+441
-67
@@ -21,6 +21,19 @@ var SPELL_TYPES = {
|
|||||||
ARCANE: 'Arcane',
|
ARCANE: 'Arcane',
|
||||||
DIVINE: 'Divine'
|
DIVINE: 'Divine'
|
||||||
};
|
};
|
||||||
|
var ENERGY_TYPES = {
|
||||||
|
ACID: 'Acid',
|
||||||
|
COLD: 'Cold',
|
||||||
|
ELEC: 'Electricity',
|
||||||
|
FIRE: 'Fire',
|
||||||
|
SONIC: 'Sonic'
|
||||||
|
};
|
||||||
|
/*var ARMOR_BONUS_COST = [ //cost for a +# armor or shield. bonus^2 * 1000
|
||||||
|
0, 1000, 4000, 9000, 16000, 25000, 36000, 49000, 64000, 81000, 100000
|
||||||
|
];
|
||||||
|
var WEAPON_BONUS_COST = [ //cost for a +# weapon. bonus^2 * 2000
|
||||||
|
0, 2000, 8000, 18000, 32000, 50000, 72000, 98000, 128000, 162000, 200000
|
||||||
|
];*/
|
||||||
var QUALITIES = {
|
var QUALITIES = {
|
||||||
MINOR:'minor',
|
MINOR:'minor',
|
||||||
MEDIUM: 'medium',
|
MEDIUM: 'medium',
|
||||||
@@ -63,29 +76,29 @@ WEIGHTS[QUALITIES.MAJOR] = {
|
|||||||
WONDROUS_ITEMS: 20,
|
WONDROUS_ITEMS: 20,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//Contains all the source info
|
//Contains all the source info
|
||||||
var Grimoire = function(config) {
|
var Grimoire = function(config) { // jshint ignore:line
|
||||||
var self = this;
|
var self = this;
|
||||||
this.chance = (config && config.chance ? config.chance : config && config.seed ? new Chance(config.seed) : new Chance());
|
this.chance = (config && config.chance ? config.chance : config && config.seed ? new Chance(config.seed) : new Chance());
|
||||||
|
|
||||||
this.SOURCES = [];
|
this.SOURCES = [];
|
||||||
$.getJSON('sources/sources.json', function(sources) {
|
$.getJSON('sources/sources.json', function(sources) {
|
||||||
sources.sources.forEach(function(url) {
|
sources.sources.forEach(function(url) {
|
||||||
$.getJSON('sources/' + url, function(source) {
|
$.getJSON(url, function(source) {
|
||||||
console.log('loaded sources/'+ url);
|
console.log('loaded '+ url);
|
||||||
source.data = {};
|
source.data = {};
|
||||||
//construct the data containers we will insert later data into
|
//construct the data containers we will insert later data into
|
||||||
source.types.forEach(function(type) {
|
source.types.forEach(function(type) {
|
||||||
source.data[type.name] = {};
|
source.data[type.name] = {};
|
||||||
source.data[type.name].enabled = true;
|
source.data[type.name].enabled = true;
|
||||||
if(type.source) {
|
if(type.source) {
|
||||||
var typeUrl = 'sources/' + type.source;
|
$.getJSON(type.source, function(typeData) {
|
||||||
$.getJSON(typeUrl, function(typeData) {
|
source.data[type.name].data = typeData;
|
||||||
source.data[type.name].data = typeData.data;
|
console.log('loaded ' + type.source);
|
||||||
console.log('loaded sources/' + typeUrl);
|
|
||||||
})
|
})
|
||||||
.fail(function(d, textStatus, error) {
|
.fail(function(d, textStatus, error) {
|
||||||
console.error('getJSON failed to load '+typeUrl+ ', status: ' + textStatus + ', error: '+error);
|
console.error('getJSON failed to load '+type.source+ ', status: ' + textStatus + ', error: '+error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -95,35 +108,46 @@ var Grimoire = function(config) {
|
|||||||
console.error('getJSON failed to load '+url+ ', status: ' + textStatus + ', error: '+error);
|
console.error('getJSON failed to load '+url+ ', status: ' + textStatus + ', error: '+error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
sources.other.forEach(function(url) {
|
||||||
|
$.getJSON(url, function(data) {
|
||||||
|
var dataName = url.replace(/.*\/(.*)\.json/, '$1');
|
||||||
|
self[dataName] = data;
|
||||||
|
console.log('loaded ' + url + ' as ' + dataName);
|
||||||
|
})
|
||||||
|
.fail(function(d, textStatus, error) {
|
||||||
|
console.error('getJSON failed to load '+url+', status: '+textStatus+', error: '+error);
|
||||||
|
});
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.fail(function(err) {
|
.fail(function(err) {
|
||||||
console.log('Failed to load sources list:', err);
|
console.error('Failed to load sources list:', err);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.getItems = function(sources, quality, count, types, options) {
|
this.getItems = function(quality, count, options) {
|
||||||
|
options = options ? options : {};
|
||||||
var items = [];
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
var types = options.types ? options.types : _.values(TYPES);
|
||||||
|
|
||||||
//Error checking block
|
//Error checking block
|
||||||
if(!sources || sources.length === 0) { console.log('No sources given!'); return items; }
|
if(!sources || sources.length === 0) { console.error('No sources given!'); return items; }
|
||||||
if(!types || types == 'any' || types.length === 0) {
|
if(!types || types == 'any' || types.length === 0) {
|
||||||
types = _.values(TYPES); //set to all types
|
types = _.values(TYPES); //set to all types
|
||||||
}
|
}
|
||||||
for(var i in types) {
|
for(var i in types) {
|
||||||
if(_.values(TYPES).indexOf(types[i]) == -1) { console.log('Invalid type ' + types[i]); return items; }
|
if(_.values(TYPES).indexOf(types[i]) == -1) { console.error('Invalid type ' + types[i]); return items; }
|
||||||
}
|
}
|
||||||
if(_.values(QUALITIES).indexOf(quality) == -1) { console.log('Invalid quality ' + quality); return items; }
|
if(_.values(QUALITIES).indexOf(quality) == -1) { console.error('Invalid quality ' + quality); return items; }
|
||||||
if(!count || count < 1) { count = 1; }
|
if(!count || count < 1) { count = 1; }
|
||||||
options = options ? options : {};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//initialize the chance engine, using a seed if provided (for testing purposes)
|
//initialize the chance engine, using a seed if provided (for testing purposes)
|
||||||
//we do this now instead of reinitializing the Chance engine each time we generate an item
|
//we do this now instead of reinitializing the Chance engine each time we generate an item
|
||||||
self.chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
self.chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
|
||||||
|
var items = [];
|
||||||
|
|
||||||
_.times(count, function() {
|
_.times(count, function() {
|
||||||
var item = self.getItem(sources, quality, types, options);
|
var item = self.getItem(quality, options);
|
||||||
if(item) {
|
if(item) {
|
||||||
items.push(item);
|
items.push(item);
|
||||||
console.log(item);
|
console.log(item);
|
||||||
@@ -143,11 +167,50 @@ var Grimoire = function(config) {
|
|||||||
var source = {};
|
var source = {};
|
||||||
var sourceWeights = {};
|
var sourceWeights = {};
|
||||||
|
|
||||||
|
//***UNIQUES FOR WEAPONS AND ARMORS***
|
||||||
|
//************************************
|
||||||
|
if(type == 'Uniques') {
|
||||||
|
if(!options.itemType || !options.uniqueType) {
|
||||||
|
console.error('itemType or uniqueType not provided', options);
|
||||||
|
}
|
||||||
|
sourceWeights = _.map(sources, function(source) {
|
||||||
|
if(source.data[options.itemType] && source.data[options.itemType].enabled &&
|
||||||
|
source.data[options.itemType].data[options.uniqueType]) {
|
||||||
|
return _.filter(source.data[options.itemType].data[options.uniqueType],
|
||||||
|
function(special) {
|
||||||
|
return special.weight[quality] > 0;
|
||||||
|
}).length; //return a count of all specials that have a quality weight above 0
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 0; //either itemType not found or not enabled or uniqueType not found
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
//***SPECIALS FOR WEAPONS AND ARMORS***
|
||||||
|
//*************************************
|
||||||
|
else if(type == 'Specials') {
|
||||||
|
if(!options.itemType || !options.specialType) {
|
||||||
|
console.error('itemType or specialType not provided', options);
|
||||||
|
}
|
||||||
|
sourceWeights = _.map(sources, function(source) {
|
||||||
|
if(source.data[options.itemType] && source.data[options.itemType].enabled &&
|
||||||
|
source.data[options.itemType].data[options.specialType]) {
|
||||||
|
return _.filter(source.data[options.itemType].data[options.specialType],
|
||||||
|
function(special) {
|
||||||
|
return special.weight[quality] > 0;
|
||||||
|
}).length; //return a count of all specials that have a quality weight above 0
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 0; //either itemType not found or not enabled or specialType not found
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
//***SPELLS AND SCROLLS AND WANDS***
|
//***SPELLS AND SCROLLS AND WANDS***
|
||||||
//************************
|
//**********************************
|
||||||
if(type == TYPES.SCROLLS || type == TYPES.SPELLS || type == TYPES.WANDS) {
|
else if(type == TYPES.SCROLLS || type == TYPES.SPELLS || type == TYPES.WANDS) {
|
||||||
if(!options.spellType || !options.spellLevel) {
|
if(!options.spellType || !options.spellLevel) {
|
||||||
console.log('Error selecting source for Spells. Invalid options', options);
|
console.error('Error selecting source for Spells. Invalid options', options);
|
||||||
}
|
}
|
||||||
sourceWeights = _.map(sources, function(source) {
|
sourceWeights = _.map(sources, function(source) {
|
||||||
//Check that we have a spells section
|
//Check that we have a spells section
|
||||||
@@ -196,7 +259,7 @@ var Grimoire = function(config) {
|
|||||||
//*********************
|
//*********************
|
||||||
else {
|
else {
|
||||||
if((type == TYPES.RODS || type == TYPES.STAVES) && quality == QUALITIES.MINOR) {
|
if((type == TYPES.RODS || type == TYPES.STAVES) && quality == QUALITIES.MINOR) {
|
||||||
console.log('Error! There are no ' + QUALITIES.MINOR + ' ' + type);
|
console.error('Error! There are no ' + QUALITIES.MINOR + ' ' + type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//Determine which source to use
|
//Determine which source to use
|
||||||
@@ -218,7 +281,7 @@ var Grimoire = function(config) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(_.sum(sourceWeights) <= 0) {
|
if(_.sum(sourceWeights) <= 0) {
|
||||||
console.log('Unable to find valid ' + quality + ' ' + type + ' within sources!', sources);
|
console.error('Unable to find valid ' + quality + ' ' + type + ' within sources!', sources);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//chance.weighted will DESTRUCTIVELY modify paramaters that have a weight of zero
|
//chance.weighted will DESTRUCTIVELY modify paramaters that have a weight of zero
|
||||||
@@ -230,8 +293,10 @@ var Grimoire = function(config) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
this.getItem = function(sources, quality, types, options) {
|
this.getItem = function(quality, options) {
|
||||||
options = options ? options : {};
|
options = options ? options : {};
|
||||||
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
var types = options.types ? options.types : _.values(TYPES);
|
||||||
|
|
||||||
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
|
||||||
@@ -248,7 +313,6 @@ var Grimoire = function(config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Determine the type of item to generate
|
//Determine the type of item to generate
|
||||||
//console.log(localWeights);
|
|
||||||
itemType = TYPES[chance.weighted(_.keys(localWeights), _.values(localWeights))];
|
itemType = TYPES[chance.weighted(_.keys(localWeights), _.values(localWeights))];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,79 +322,79 @@ var Grimoire = function(config) {
|
|||||||
//GENERATE ITEM
|
//GENERATE ITEM
|
||||||
//SCROLLS
|
//SCROLLS
|
||||||
if(itemType == TYPES.SCROLLS) {
|
if(itemType == TYPES.SCROLLS) {
|
||||||
item = self.getScroll(sources, quality, undefined /*spell type*/, options);
|
item = self.getScroll(quality, options);
|
||||||
}
|
}
|
||||||
else if(itemType == TYPES.POTIONS) {
|
else if(itemType == TYPES.POTIONS) {
|
||||||
item = self.getPotion(sources, quality, undefined /*potion level*/, options);
|
item = self.getPotion(quality, options);
|
||||||
}
|
}
|
||||||
else if(itemType == TYPES.WANDS) {
|
else if(itemType == TYPES.WANDS) {
|
||||||
item = self.getWand(sources, quality, undefined /*spell level*/, options);
|
item = self.getWand(quality, options);
|
||||||
}
|
}
|
||||||
//WONDROUS ITEMS
|
//WONDROUS ITEMS
|
||||||
else if(itemType == TYPES.WONDROUS_ITEMS) {
|
else if(itemType == TYPES.WONDROUS_ITEMS) {
|
||||||
//Select the item source based on the quality and item type
|
item = self.getWondrousItem(quality, options);
|
||||||
source = selectSource(sources, quality, itemType, options);
|
|
||||||
item = _.clone(chance.pick(source.data[itemType].data[quality]));
|
|
||||||
item.source = source.shortName;
|
|
||||||
|
|
||||||
//make an intelligent item if we either want ALL intelligent items
|
|
||||||
//OR intelligent items are NOT disabled AND we roll under the chance threshold
|
|
||||||
if(options.allIntelligent || (!options.disableIntelligent && chance.d100() <= (options.intelligenceChance || 1))) {
|
|
||||||
item.intelligence = 'WOOHOO I AM INTELLIGENT!';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//EVERYTHING ELSE
|
//EVERYTHING ELSE
|
||||||
else {
|
else {
|
||||||
//Select the item source based on the quality and item type
|
//Select the item source based on the quality and item type
|
||||||
source = selectSource(sources, quality, itemType, options);
|
source = selectSource(sources, quality, itemType, options);
|
||||||
var totalWeights = _.sum(_.map(source.data[itemType].data, function(item) { return item.weight[quality]; }));
|
|
||||||
var roll = chance.integer({min: 1, max: totalWeights});
|
|
||||||
|
|
||||||
//EXCEPTIONS FOR ARMOR_AND_SHEILDS
|
//EXCEPTIONS FOR ARMOR_AND_SHEILDS
|
||||||
|
|
||||||
//EXCEPTIONS FOR WEAPONS
|
//EXCEPTIONS FOR WEAPONS
|
||||||
|
|
||||||
//EXCEPTIONS FOR POTIONS
|
|
||||||
|
|
||||||
//EXCEPTIONS FOR WANDS
|
|
||||||
|
|
||||||
//CHANCE FOR INTELLIGENT WEAPONS, RINGS, RODS, STAVES, OR WONDROUS ITEMS
|
//CHANCE FOR INTELLIGENT WEAPONS, RINGS, RODS, STAVES, OR WONDROUS ITEMS
|
||||||
var itemData = source.data[itemType].data;
|
item = self.getWeightedItem(source.data[itemType].data, quality);
|
||||||
for(var i in itemData) { //check all 'itemType' items in the source
|
|
||||||
if(roll <= itemData[i].weight[quality]) { //if we roll under their weighted probability
|
|
||||||
item = _.clone(itemData[i]);
|
|
||||||
delete item.weight;
|
|
||||||
item.source = source.shortName;
|
item.source = source.shortName;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
else { //decrease the roll value by the current item's weighted probability
|
|
||||||
roll -= itemData[i].weight[quality];
|
if(!options.disableClue && chance.d100() <= (options.clueChance || 20)) {
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!options.disableClue && chance.d100() > 80) {
|
|
||||||
item.name += ' with a clue to it\'s purpose!';
|
item.name += ' with a clue to it\'s purpose!';
|
||||||
}
|
}
|
||||||
item.quality = quality;
|
item.quality = quality;
|
||||||
return item;
|
return item;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getSpells = function(sources, level, count, type, options) {
|
this.getWeightedItem = function(itemData, quality, options) {
|
||||||
options = options ? options : {};
|
options = options ? options : {};
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
|
||||||
|
var maxRoll = options.maxRoll || _.sum(_.map(itemData, function(item) { return item.weight[quality]; }));
|
||||||
|
var roll = chance.integer({min: 1, max: maxRoll});
|
||||||
|
var item = {};
|
||||||
|
|
||||||
|
for(var i in itemData) { //check all 'itemType' items in the source
|
||||||
|
if(roll <= itemData[i].weight[quality]) { //if we roll under their weighted probability
|
||||||
|
item = _.clone(itemData[i]);
|
||||||
|
delete item.weight;
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
else { //decrease the roll value by the current item's weighted probability
|
||||||
|
roll -= itemData[i].weight[quality];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.error('Could not find valid '+quality+'item in',itemData);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getSpells = function(level, count, options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
var type = options.type; //if undefined, we'll pass it on
|
||||||
|
|
||||||
var spells = [];
|
var spells = [];
|
||||||
self.chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
self.chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
|
||||||
_.times(count, function() {
|
_.times(count, function() {
|
||||||
|
spells.push(self.getSpell(sources, level, type, options));
|
||||||
spells.push(Grimoire.getSpell(sources, level, type, options));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return spells;
|
return spells;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getSpell = function(sources, level, type, options) {
|
this.getSpell = function(level, options) {
|
||||||
options = options ? options : {};
|
options = options ? options : {};
|
||||||
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
var type = options.type;
|
||||||
|
|
||||||
//initialize the chance engine, using a seed if provided (for testing purposes)
|
//initialize the chance engine, using a seed if provided (for testing purposes)
|
||||||
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
@@ -342,7 +406,7 @@ var Grimoire = function(config) {
|
|||||||
//console.log('Generating a level ' + level + ' ' + spellType + ' spell from ' + source.shortName);
|
//console.log('Generating a level ' + level + ' ' + spellType + ' spell from ' + source.shortName);
|
||||||
|
|
||||||
var spell = {
|
var spell = {
|
||||||
name: chance.pick(source.data.Spells.data[spellType][level]),
|
name: chance.pick(source.data[TYPES.SPELLS].data[spellType][level]),
|
||||||
level: level,
|
level: level,
|
||||||
type: spellType,
|
type: spellType,
|
||||||
source: source.shortName
|
source: source.shortName
|
||||||
@@ -351,8 +415,9 @@ var Grimoire = function(config) {
|
|||||||
return spell;
|
return spell;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getScroll = function(sources, quality, type, options) {
|
this.getScroll = function(quality, options) {
|
||||||
options = options ? options : {};
|
options = options ? options : {};
|
||||||
|
|
||||||
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
|
||||||
var cost = [12.5, 25, 150, 375, 700, 1125, 1650, 2275, 3000, 3825];
|
var cost = [12.5, 25, 150, 375, 700, 1125, 1650, 2275, 3000, 3825];
|
||||||
@@ -387,7 +452,7 @@ var Grimoire = function(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
options.quality = quality;
|
options.quality = quality;
|
||||||
var spell = self.getSpell(sources, spellLevel, type, options);
|
var spell = self.getSpell(spellLevel, options);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'name': 'Scroll of ' + spell.name,
|
'name': 'Scroll of ' + spell.name,
|
||||||
@@ -397,8 +462,11 @@ var Grimoire = function(config) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getPotion = function(sources, quality, level, options) {
|
this.getPotion = function(quality, options) {
|
||||||
options = options ? options : {};
|
options = options ? options : {};
|
||||||
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
var level = options.potionLevel;
|
||||||
|
|
||||||
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
var cost = [25, 50, 300, 750];
|
var cost = [25, 50, 300, 750];
|
||||||
|
|
||||||
@@ -437,8 +505,10 @@ var Grimoire = function(config) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getWand = function(sources, quality, level, options) {
|
this.getWand = function(quality, options) {
|
||||||
options = options ? options : {};
|
options = options ? options : {};
|
||||||
|
var level = options.wandLevel;
|
||||||
|
|
||||||
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
var cost = [375, 750, 4500, 11250, 21000];
|
var cost = [375, 750, 4500, 11250, 21000];
|
||||||
|
|
||||||
@@ -465,13 +535,317 @@ var Grimoire = function(config) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
options.quality = quality;
|
|
||||||
|
options.wandLevel = level;
|
||||||
options.typeOverride = TYPES.WANDS;
|
options.typeOverride = TYPES.WANDS;
|
||||||
var spell = self.getSpell(sources, level, SPELL_TYPES.ARCANE, options);
|
options.spellType = SPELL_TYPES.ARCANE;
|
||||||
|
var spell = self.getSpell(level, options);
|
||||||
return {'name': 'Wand of ' + spell.name,
|
return {'name': 'Wand of ' + spell.name,
|
||||||
'description': '(spell level ' + level + ', caster level ' + _.max([1, (level*2-1)]) + ', 50 charges)',
|
'description': '(spell level ' + level + ', caster level ' + _.max([1, (level*2-1)]) + ', 50 charges)',
|
||||||
'cost': cost[level],
|
'cost': cost[level],
|
||||||
'source': spell.source
|
'source': spell.source
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.getWondrousItem = function(quality, options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
|
||||||
|
//Select the item source based on the quality and item type
|
||||||
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
var source = selectSource(sources, quality, TYPES.WONDROUS_ITEMS, options);
|
||||||
|
|
||||||
|
//wondrous items of the same quality have equal probability weight
|
||||||
|
var item = _.clone(chance.pick(source.data[TYPES.WONDROUS_ITEMS].data[quality]));
|
||||||
|
item.source = source.shortName;
|
||||||
|
|
||||||
|
//make an intelligent item if we either want ALL intelligent items
|
||||||
|
//OR intelligent items are NOT disabled AND we roll under the chance threshold
|
||||||
|
if(options.allIntelligent || (!options.disableIntelligent && chance.d100() <= (options.intelligenceChance || 1))) {
|
||||||
|
item.intelligence = 'WOOHOO I AM INTELLIGENT!';
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getHumanoid = function(options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
return chance.weighted(
|
||||||
|
_.map(self.Humanoids, function(h) { return h.name; }),
|
||||||
|
_.map(self.Humanoids, function(h) { return h.weight; }));
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getOutsider = function(options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
return chance.weighted(
|
||||||
|
_.map(self.Outsiders, function(o) { return o.name; }),
|
||||||
|
_.map(self.Outsiders, function(o) { return o.weight; }));
|
||||||
|
};
|
||||||
|
this.getBane = function(options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
var bane = chance.weighted(
|
||||||
|
_.map(self.Banes, function(b) { return b.name; }),
|
||||||
|
_.map(self.Banes, function(b) { return b.weight; }));
|
||||||
|
bane = bane.replace(/GET_HUMANOID_TYPE/, self.getHumanoid(options));
|
||||||
|
bane = bane.replace(/GET_OUTSIDER_TYPE/, self.getOutsider(options));
|
||||||
|
return bane;
|
||||||
|
};
|
||||||
|
|
||||||
|
//type is 'armor', 'shield', 'melee', or 'ranged'
|
||||||
|
//options.excludeSpecials can contain a list of specials you do NOT want to get
|
||||||
|
//this is useful when creating a weapon that you do not want to have duplicate specials
|
||||||
|
this.getSpecials = function(quality, type, options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
options.excludeSpecials = options.excludeSpecials ? options.excludeSpecials : [];
|
||||||
|
options.itemType = options.itemType ? options.itemType :
|
||||||
|
(type == 'melee' || type == 'ranged') ? TYPES.WEAPONS :
|
||||||
|
(type == 'armor' || type == 'shield') ? TYPES.ARMOR_AND_SHIELDS :
|
||||||
|
undefined;
|
||||||
|
options.specialType = type + 'Specials';
|
||||||
|
if(!options.itemType) {
|
||||||
|
console.error('Invalid special type', type);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
|
||||||
|
var special = {};
|
||||||
|
do {
|
||||||
|
var roll = chance.d100();
|
||||||
|
if((quality == QUALITIES.MINOR && roll === 100) ||
|
||||||
|
(quality == QUALITIES.MEDIUM && roll > 95) ||
|
||||||
|
(quality == QUALITIES.MAJOR && roll > 90)) {
|
||||||
|
var special1 = self.getSpecials(quality, type, options);
|
||||||
|
options.excludeSpecials = options.excludeSpecials.concat(special1); //exclude the special(s) just rolled
|
||||||
|
var special2 = self.getSpecials(quality, type, options);
|
||||||
|
return special1.concat(special2); //could contain more than one special
|
||||||
|
}
|
||||||
|
else { //only 1 special
|
||||||
|
var source = selectSource(sources, quality, 'Specials', options);
|
||||||
|
//data source will look like source.data.Weapons.meleeSpecials
|
||||||
|
|
||||||
|
special = self.getWeightedItem(source.data[options.itemType].data[options.specialType], quality);
|
||||||
|
special.source = source.shortName;
|
||||||
|
}
|
||||||
|
} while(options.excludeSpecials.indexOf(special) != -1); //if we have a duplicate, try again
|
||||||
|
|
||||||
|
//EXCEPTION for Bane special
|
||||||
|
if(special.name.indexOf('GET_BANE_TYPE')) {
|
||||||
|
special.name = special.name.replace(/GET_BANE_TYPE/, self.getBane(options));
|
||||||
|
}
|
||||||
|
|
||||||
|
return [special]; //could contain one or more specials
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getUniqueWeapon = function(quality, options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
options.itemType = TYPES.WEAPONS;
|
||||||
|
options.uniqueType = 'uniqueWeapons';
|
||||||
|
|
||||||
|
var sources = options.sources ? options.sources : self.SOURCES;
|
||||||
|
|
||||||
|
var source = selectSource(sources, quality, 'Uniques', options);
|
||||||
|
var weapon = self.getWeightedItem(source.data[TYPES.WEAPONS].data.uniqueWeapons, quality);
|
||||||
|
weapon.source = source.shortName;
|
||||||
|
|
||||||
|
return weapon;
|
||||||
|
};
|
||||||
|
|
||||||
|
//options.type can be 'melee' or 'ranged'
|
||||||
|
//note that this option is not alwawys honored when a unique item is rolled
|
||||||
|
this.getWeapon = function(quality, options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
options.excludeSpecials = options.excludeSpecials || [];
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
var weapon = {
|
||||||
|
name: '',
|
||||||
|
type: '',
|
||||||
|
bonus: 0,
|
||||||
|
baseCost: 0,
|
||||||
|
specials: [],
|
||||||
|
intelligence: {},
|
||||||
|
glowing: false
|
||||||
|
};
|
||||||
|
weapon.type = (options.type == 'melee' || options.type == 'ranged') ? options.type
|
||||||
|
: chance.weighted(['melee', 'ranged'], [7,3]);
|
||||||
|
|
||||||
|
var roll = chance.d100();
|
||||||
|
var action = '';
|
||||||
|
|
||||||
|
if(quality == QUALITIES.MINOR) {
|
||||||
|
if(roll <= 70) {
|
||||||
|
//generic +1 weapon
|
||||||
|
weapon.bonus = 1;
|
||||||
|
}
|
||||||
|
else if(roll <= 85) {
|
||||||
|
//generic +2 weapon
|
||||||
|
weapon.bonus = 2;
|
||||||
|
}
|
||||||
|
else if(roll <= 90) {
|
||||||
|
action = 'getUnique';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//10% special ability and roll again
|
||||||
|
action = 'getSpecial';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(quality == QUALITIES.MEDIUM) {
|
||||||
|
if(roll <= 10) {
|
||||||
|
weapon.bonus = 1;
|
||||||
|
}
|
||||||
|
else if(roll <= 29) {
|
||||||
|
weapon.bonus = 2;
|
||||||
|
}
|
||||||
|
else if(roll <= 58) {
|
||||||
|
weapon.bonus = 3;
|
||||||
|
}
|
||||||
|
else if(roll <= 62) {
|
||||||
|
weapon.bonus = 4;
|
||||||
|
}
|
||||||
|
else if(roll <= 68) {
|
||||||
|
action = 'getUnique';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//32% special ability and roll again
|
||||||
|
action = 'getSpecial';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(quality == QUALITIES.MAJOR) {
|
||||||
|
if(roll <= 20) {
|
||||||
|
weapon.bonus = 3;
|
||||||
|
}
|
||||||
|
else if(roll <= 38) {
|
||||||
|
weapon.bonus = 4;
|
||||||
|
}
|
||||||
|
else if(roll <= 49) {
|
||||||
|
weapon.bonus = 5;
|
||||||
|
}
|
||||||
|
else if(roll <= 63) {
|
||||||
|
action = 'getUnique';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//37% special ability and roll again
|
||||||
|
action = 'getSpecial';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.error('invalid quality', quality);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(action == 'getUnique') {
|
||||||
|
var unique = self.getUniqueWeapon(quality, options);
|
||||||
|
weapon.name = unique.name;
|
||||||
|
weapon.baseCost = unique.cost;
|
||||||
|
weapon.source = unique.source;
|
||||||
|
weapon.url = unique.url;
|
||||||
|
}
|
||||||
|
else if(action == 'getSpecial') {
|
||||||
|
weapon = self.getWeapon(quality, options);
|
||||||
|
var specialsBonus = _.chain(weapon.specials).map(function(s) { return s.bonus; }).sum().value();
|
||||||
|
var specials = [];
|
||||||
|
var newSpecialsBonus = 0;
|
||||||
|
options.excludeSpecials = options.excludeSpecials.concat(weapon.specials);
|
||||||
|
if(weapon.bonus + specialsBonus < 10) {
|
||||||
|
var tries = 5;
|
||||||
|
//this has the opportunity to loop forever either if no match can be found
|
||||||
|
do {
|
||||||
|
specials = self.getSpecials(quality, weapon.type, options);
|
||||||
|
newSpecialsBonus = _.chain(specials).map(function(s) { return s.bonus; }).sum().value();
|
||||||
|
|
||||||
|
} while(weapon.bonus + specialsBonus + newSpecialsBonus > 10 && --tries > 0);
|
||||||
|
if(tries > 0) { //we found a match without running out of tries!
|
||||||
|
weapon.specials = weapon.specials.concat(specials);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//ALL
|
||||||
|
//1% chance to be intelligent (NOT usable items - eg Arrows)
|
||||||
|
//30% chance to be glowing
|
||||||
|
if(options.allIntelligent ||
|
||||||
|
(!options.disableIntelligent && chance.d100() <= (options.intelligenceChance || 1))) {
|
||||||
|
weapon.intelligence = 'WOOHOO I AM INTELLIGENT!';
|
||||||
|
}
|
||||||
|
if(!options.disableGlowing && chance.d100() <= (options.glowingChance || 30)) {
|
||||||
|
weapon.glowing = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return weapon;
|
||||||
|
};
|
||||||
|
|
||||||
|
//options.type can be 'armor' or 'shield'
|
||||||
|
this.getArmorOrShield = function(quality, options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
|
||||||
|
var item = {};
|
||||||
|
return item;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//can take clWeights and geWeights to weight the alignment probabilities
|
||||||
|
//clWeights are for [chaotic, neutral, lawful]
|
||||||
|
//geWeights are for [good, neutral, evil]
|
||||||
|
this.getAlignment = function(options) {
|
||||||
|
options = options ? options : {};
|
||||||
|
var chance = (self.chance ? self.chance : options.seed ? new Chance(options.seed) : new Chance());
|
||||||
|
var clWeights = options.clWeights ? options.clWeights : [1,1,1];
|
||||||
|
var geWeights = options.geWeights ? options.geWeights : [1,1,1];
|
||||||
|
|
||||||
|
var alignment = chance.weighted(['Chaotic', 'Neutral', 'Lawful'], clWeights) +
|
||||||
|
' ' +
|
||||||
|
chance.weighted(['Good', 'Neutral', 'Evil'], geWeights);
|
||||||
|
if(alignment == 'Neutral Neutral') {
|
||||||
|
alignment = 'True Neutral';
|
||||||
|
}
|
||||||
|
return alignment;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
//DEBUG - pass an instance of Grimoire
|
||||||
|
var Debug = function(grimoire) { // jshint ignore:line
|
||||||
|
//var self = this;
|
||||||
|
this.grimoire = grimoire;
|
||||||
|
|
||||||
|
if(!grimoire) {
|
||||||
|
console.error('did not get an instance of grimoire!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.validateSources = function() {
|
||||||
|
grimoire.SOURCES.forEach(function(source) {
|
||||||
|
console.log('----', source.name, '----');
|
||||||
|
source.types.forEach(function(type) {
|
||||||
|
if(type.source) {
|
||||||
|
if(!source.data[type.name] || !source.data[type.name].data) {
|
||||||
|
console.log(source.shortName + ' failed to load ' + type.name + '!');
|
||||||
|
}
|
||||||
|
console.log(type.name, source.data[type.name]);
|
||||||
|
if(type.name == TYPES.RINGS) {
|
||||||
|
var weights = {};
|
||||||
|
weights[QUALITIES.MINOR] = 0;
|
||||||
|
weights[QUALITIES.MEDIUM] = 0;
|
||||||
|
weights[QUALITIES.MAJOR] = 0;
|
||||||
|
source.data[type.name].data.forEach(function(ring) {
|
||||||
|
if(!ring.cost || ring.cost < 0) {
|
||||||
|
console.error('Invalid cost', ring.cost, 'for', ring.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!_.sum(ring.weight)) {
|
||||||
|
console.error(ring.name, 'has no weight!');
|
||||||
|
}
|
||||||
|
weights[QUALITIES.MINOR] += ring.weight.minor;
|
||||||
|
weights[QUALITIES.MEDIUM] += ring.weight.medium;
|
||||||
|
weights[QUALITIES.MAJOR] += ring.weight.major;
|
||||||
|
});
|
||||||
|
console.log('Weights ', weights);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
};
|
};
|
||||||
-56
@@ -1,56 +0,0 @@
|
|||||||
var Potions = {}
|
|
||||||
|
|
||||||
Potions.baseUrl = "http://paizo.com/pathfinderRPG/prd/spells/bleed.html";
|
|
||||||
//list of potion-able spells taken from
|
|
||||||
//http://paizo.com/threads/rzs2loj8?Alchemists-Lab-Potion-List-and-Questions
|
|
||||||
//TODO: implement url list later
|
|
||||||
Potions.getPotions = function() {
|
|
||||||
return [
|
|
||||||
/*level 0*/['Bleed','Touch of Fatigue','Resistance','Stabilize','Guidance'],
|
|
||||||
/*level 1*/['Cure Light Wounds','Chill Touch','Doom','Endure Elements','Enlarge Person','Feather Fall','Hide from Animals',
|
|
||||||
'Hide from Undead','Inflict Light Wounds','Jump','Mage Armor','Magic Fangs','Magic Weapon','Pass without Trace','Protection from Evil',
|
|
||||||
'Reduce Person','Remove Fear','Sanctuary','Shield of Faith'],
|
|
||||||
/*level 2*/['Aid','Barkskin','Bear\'s Endurance','Blindness/Deafness','Blur','Bull\'s Strength','Cat\'s Grace','Cure Moderate Wounds',
|
|
||||||
'Darkvision','Delay Poison','Eagle\'s Splendor','Fox\'s Cunning','Heroism','Hold Person','Inflict Moderate Wounds','Invisibility',
|
|
||||||
'Owl\'s Wisdom','Protection From Arrows','Rage','Remove Paralysis','Resist Energy','Restoration, Lesser','Tongues','Touch of Idiocy',
|
|
||||||
'Undetectable Alignment'],
|
|
||||||
/*level 3*/['Bestow Curse','Confusion','Contagion','Crushing Despair','Cure Serious Wounds','Deep Slumber','Dispel Magic','Displacement',
|
|
||||||
'Gaseous Form','Good Hope','Haste','Inflict Serious Wounds','Keen Edge','Magic Circle against Evil','Magic Fang, Greater','Magic Weapon, Greater',
|
|
||||||
'Magic Vestment','Neutralize Poison','Nondetection','Poison','Protection from Energy','Remove Blindness/Deafness','Remove Curse','Remove Disease',
|
|
||||||
'Slow','Water Breathing','Water Walking']
|
|
||||||
];
|
|
||||||
};
|
|
||||||
Potions.cost = [25, 50, 300, 750];
|
|
||||||
|
|
||||||
Potions.getLevelPotion = function(level) {
|
|
||||||
if(level < 0 || level > 3) return;
|
|
||||||
var potion = _.sample(Potions.getPotions()[level]);
|
|
||||||
return {"name": "Potion/Oil of " + potion,
|
|
||||||
"description": "(spell level " + level + ", caster level " + _.max([1, (level*2-1)]) + ")",
|
|
||||||
"cost": Potions.cost[level]
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
Potions.getPotion = function(type) {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
if(type == 'minor') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 20): return Potions.getLevelPotion(0); break;
|
|
||||||
case (roll <= 60): return Potions.getLevelPotion(1); break;
|
|
||||||
case (roll <= 100): return Potions.getLevelPotion(2); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 20): return Potions.getLevelPotion(1); break;
|
|
||||||
case (roll <= 60): return Potions.getLevelPotion(2); break;
|
|
||||||
case (roll <= 100): return Potions.getLevelPotion(3); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 20): return Potions.getLevelPotion(2); break;
|
|
||||||
case (roll <= 100): return Potions.getLevelPotion(3); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
/*global _:false */
|
|
||||||
'use strict';
|
|
||||||
var Rings = {};
|
|
||||||
Rings.getRingsAll = function() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
'name': 'Core Rule Book',
|
|
||||||
'shortName': 'CRB',
|
|
||||||
'baseUrl': 'http://paizo.com/pathfinderRPG/prd/magicItems/rings.html',
|
|
||||||
'items' : [
|
|
||||||
{ 'name' : 'Ring of Protection +1', 'cost' : 2000, 'url' : '#_ring-of-protection' },
|
|
||||||
{ 'name' : 'Ring of Feather falling', 'cost' : 2200, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Sustenance', 'cost' : 2500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Climbing', 'cost' : 2500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Jumping', 'cost' : 2500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Swimming', 'cost' : 2500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Counterspells', 'cost' : 400, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Mind shielding', 'cost' : 800, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Protection +2', 'cost' : 8000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Force shield', 'cost' : 8500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of the Ram', 'cost' : 8600, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Climbing, improved', 'cost' : 1000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Jumping, improved', 'cost' : 1000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Swimming, improved', 'cost' : 1000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Animal friendship', 'cost' : 10800, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Energy resistance, minor', 'cost' : 1200, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Chameleon power', 'cost' : 12700, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Water walking', 'cost' : 1500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Protection +3', 'cost' : 1800, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Spell storing, minor', 'cost' : 1800, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Invisibility', 'cost' : 20000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Wizardry (I)', 'cost' : 2000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Evasion', 'cost' : 2500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of X-ray vision', 'cost' : 2500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Blinking', 'cost' : 2700, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Energy resistance, major', 'cost' : 2800, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Protection +4', 'cost' : 3200, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Wizardry (II)', 'cost' : 4000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Freedom of movement', 'cost' : 4000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Energy resistance, greater', 'cost' : 4400, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Friend shield (pair)', 'cost' : 5000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Protection +5', 'cost' : 5000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Shooting stars', 'cost' : 5000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Spell storing', 'cost' : 5000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Wizardry (III)', 'cost' : 7000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Telekinesis', 'cost' : 7500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Regeneration', 'cost' : 9000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Spell turning', 'cost' : 10000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Wizardry (IV)', 'cost' : 10000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Three wishes', 'cost' : 12000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Djinni calling', 'cost' : 12500, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Elemental command (air)', 'cost' : 20000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Elemental command (earth)', 'cost' : 20000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Elemental command (fire)', 'cost' : 20000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Elemental command (water)', 'cost' : 20000, 'url' : '' },
|
|
||||||
{ 'name' : 'Ring of Spell storing, major', 'cost' : 2000, 'url' : '' },
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'Advanced Player\'s Guide',
|
|
||||||
'shortName': 'APG',
|
|
||||||
'baseUrl': 'http://paizo.com/pathfinderRPG/prd/advanced/magicItems/rings.html',
|
|
||||||
'items' : [
|
|
||||||
{ 'name' : 'Dungeon ring, prisoner\'s', 'cost': 250, 'url': '#dungeon-ring'},
|
|
||||||
{ 'name' : 'Arcane signets', 'cost': 1000, 'url': '' },
|
|
||||||
{ 'name' : 'Maniacal Devices', 'cost': 5000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (1 stone)', 'cost': 5000, 'url': '' },
|
|
||||||
{ 'name' : 'Forcefangs', 'cost': 8000, 'url': '' },
|
|
||||||
{ 'name' : 'Revelation, lesser', 'cost': 10000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (2 stones)', 'cost': 10000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (3 stones)', 'cost': 15000, 'url': '' },
|
|
||||||
{ 'name' : 'Retribution', 'cost': 15000, 'url': '' },
|
|
||||||
{ 'name' : 'Dungeon ring, jailer\'s', 'cost': 16000, 'url': '' },
|
|
||||||
{ 'name' : 'Revelation, greater', 'cost': 16000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (4 stones)', 'cost': 20000, 'url': '' },
|
|
||||||
{ 'name' : 'Revelation, superior', 'cost': 24000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (5 stones)', 'cost': 25000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (6 stones)', 'cost': 30000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (7 stones)', 'cost': 35000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (8 stones)', 'cost': 40000, 'url': '' },
|
|
||||||
{ 'name' : 'Delayed doom (9 stones)', 'cost': 45000, 'url': '' },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
Rings.getRings = function() {
|
|
||||||
return Rings.getRingsAll()[0].items;
|
|
||||||
};
|
|
||||||
|
|
||||||
Rings.getRing = function(type) {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
var ring = '';
|
|
||||||
if(type == 'minor') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 18): ring = Rings.getRings()[0]; break;
|
|
||||||
case (roll <= 28): ring = Rings.getRings()[1]; break;
|
|
||||||
case (roll <= 36): ring = Rings.getRings()[2]; break;
|
|
||||||
case (roll <= 44): ring = Rings.getRings()[3]; break;
|
|
||||||
case (roll <= 52): ring = Rings.getRings()[4]; break;
|
|
||||||
case (roll <= 60): ring = Rings.getRings()[5]; break;
|
|
||||||
case (roll <= 70): ring = Rings.getRings()[6]; break;
|
|
||||||
case (roll <= 75): ring = Rings.getRings()[7]; break;
|
|
||||||
case (roll <= 80): ring = Rings.getRings()[8]; break;
|
|
||||||
case (roll <= 85): ring = Rings.getRings()[9]; break;
|
|
||||||
case (roll <= 90): ring = Rings.getRings()[10]; break;
|
|
||||||
case (roll <= 93): ring = Rings.getRings()[14]; break;
|
|
||||||
case (roll <= 96): ring = Rings.getRings()[15]; break;
|
|
||||||
case (roll <= 98): ring = Rings.getRings()[16]; break;
|
|
||||||
case (roll <= 100): ring = Rings.getRings()[17]; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 5): ring = Rings.getRings()[6]; break;
|
|
||||||
case (roll <= 8): ring = Rings.getRings()[7]; break;
|
|
||||||
case (roll <= 18): ring = Rings.getRings()[8]; break;
|
|
||||||
case (roll <= 23): ring = Rings.getRings()[9]; break;
|
|
||||||
case (roll <= 28): ring = Rings.getRings()[10]; break;
|
|
||||||
case (roll <= 34): ring = Rings.getRings()[11]; break;
|
|
||||||
case (roll <= 40): ring = Rings.getRings()[12]; break;
|
|
||||||
case (roll <= 46): ring = Rings.getRings()[13]; break;
|
|
||||||
case (roll <= 50): ring = Rings.getRings()[14]; break;
|
|
||||||
case (roll <= 56): ring = Rings.getRings()[15]; break;
|
|
||||||
case (roll <= 61): ring = Rings.getRings()[16]; break;
|
|
||||||
case (roll <= 66): ring = Rings.getRings()[17]; break;
|
|
||||||
case (roll <= 71): ring = Rings.getRings()[18]; break;
|
|
||||||
case (roll <= 76): ring = Rings.getRings()[19]; break;
|
|
||||||
case (roll <= 81): ring = Rings.getRings()[20]; break;
|
|
||||||
case (roll <= 85): ring = Rings.getRings()[21]; break;
|
|
||||||
case (roll <= 90): ring = Rings.getRings()[22]; break;
|
|
||||||
case (roll <= 93): ring = Rings.getRings()[23]; break;
|
|
||||||
case (roll <= 97): ring = Rings.getRings()[24]; break;
|
|
||||||
case (roll <= 100): ring = Rings.getRings()[25]; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 2): ring = Rings.getRings()[15]; break;
|
|
||||||
case (roll <= 7): ring = Rings.getRings()[18]; break;
|
|
||||||
case (roll <= 10): ring = Rings.getRings()[19]; break;
|
|
||||||
case (roll <= 15): ring = Rings.getRings()[20]; break;
|
|
||||||
case (roll <= 19): ring = Rings.getRings()[21]; break;
|
|
||||||
case (roll <= 25): ring = Rings.getRings()[22]; break;
|
|
||||||
case (roll <= 28): ring = Rings.getRings()[23]; break;
|
|
||||||
case (roll <= 32): ring = Rings.getRings()[24]; break;
|
|
||||||
case (roll <= 39): ring = Rings.getRings()[25]; break;
|
|
||||||
case (roll <= 49): ring = Rings.getRings()[26]; break;
|
|
||||||
case (roll <= 55): ring = Rings.getRings()[27]; break;
|
|
||||||
case (roll <= 60): ring = Rings.getRings()[28]; break;
|
|
||||||
case (roll <= 63): ring = Rings.getRings()[29]; break;
|
|
||||||
case (roll <= 65): ring = Rings.getRings()[30]; break;
|
|
||||||
case (roll <= 70): ring = Rings.getRings()[31]; break;
|
|
||||||
case (roll <= 74): ring = Rings.getRings()[32]; break;
|
|
||||||
case (roll <= 79): ring = Rings.getRings()[33]; break;
|
|
||||||
case (roll <= 83): ring = Rings.getRings()[34]; break;
|
|
||||||
case (roll <= 86): ring = Rings.getRings()[35]; break;
|
|
||||||
case (roll <= 88): ring = Rings.getRings()[36]; break;
|
|
||||||
case (roll <= 91): ring = Rings.getRings()[37]; break;
|
|
||||||
case (roll <= 93): ring = Rings.getRings()[38]; break;
|
|
||||||
case (roll == 94): ring = Rings.getRings()[39]; break;
|
|
||||||
case (roll == 95): ring = Rings.getRings()[40]; break;
|
|
||||||
case (roll == 96): ring = Rings.getRings()[41]; break;
|
|
||||||
case (roll == 97): ring = Rings.getRings()[42]; break;
|
|
||||||
case (roll == 98): ring = Rings.getRings()[43]; break;
|
|
||||||
case (roll == 99): ring = Rings.getRings()[44]; break;
|
|
||||||
case (roll == 100): ring = Rings.getRings()[45]; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(_.random(1,100) <= 30) {
|
|
||||||
ring.name += ' (with a clue as to its purpose)';
|
|
||||||
}
|
|
||||||
return ring;
|
|
||||||
};
|
|
||||||
@@ -1,247 +0,0 @@
|
|||||||
/*global _:false, console:true */
|
|
||||||
/*global Intelligence:true */
|
|
||||||
'use strict';
|
|
||||||
var Rods = {};
|
|
||||||
Rods.getAllRods = function() {
|
|
||||||
return [
|
|
||||||
{'name': 'Core Rule Book',
|
|
||||||
'shortName': 'CRB',
|
|
||||||
'baseUrl': 'http://paizo.com/pathfinderRPG/prd/magicItems/rods.html',
|
|
||||||
'count': {'medium': 17, 'major': 29},
|
|
||||||
'items': [
|
|
||||||
{'name': 'Rod of Metamagic, Enlarge, lesser', 'cost': 3000, 'url': '#metamagic-enlarge'},
|
|
||||||
{'name': 'Rod of Metamagic, Extend, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Silent, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Immovable', 'cost': 5000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Empower, lesser', 'cost': 9000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metal and mineral detection', 'cost': 10500, 'url': ''},
|
|
||||||
{'name': 'Rod of Cancellation', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Enlarge', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Extend', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Silent', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Wonder', 'cost': 12000, 'url': ''},
|
|
||||||
{'name': 'Rod of Python', 'cost': 13000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Maximize, lesser', 'cost': 14000, 'url': ''},
|
|
||||||
{'name': 'Rod of Flame extinguishing', 'cost': 15000, 'url': ''},
|
|
||||||
{'name': 'Rod of Viper', 'cost': 19000, 'url': ''},
|
|
||||||
{'name': 'Rod of Enemy detection', 'cost': 23500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Enlarge, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Extend, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Silent, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Splendor', 'cost': 25000, 'url': ''},
|
|
||||||
{'name': 'Rod of Withering', 'cost': 25000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Empower', 'cost': 32500, 'url': ''},
|
|
||||||
{'name': 'Rod of Thunder and lightning', 'cost': 33000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Quicken, lesser', 'cost': 35000, 'url': ''},
|
|
||||||
{'name': 'Rod of Negation', 'cost': 37000, 'url': ''},
|
|
||||||
{'name': 'Rod of Absorption', 'cost': 50000, 'url': ''},
|
|
||||||
{'name': 'Rod of Flailing', 'cost': 50000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Maximize', 'cost': 54000, 'url': ''},
|
|
||||||
{'name': 'Rod of Rulership', 'cost': 60000, 'url': ''},
|
|
||||||
{'name': 'Rod of Security', 'cost': 61000, 'url': ''},
|
|
||||||
{'name': 'Rod of Lordly might', 'cost': 70000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Empower, greater', 'cost': 73000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Quicken', 'cost': 75500, 'url': ''},
|
|
||||||
{'name': 'Rod of Alertness', 'cost': 85000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Maximize, greater', 'cost': 121500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, Quicken, greater', 'cost': 170000, 'url': ''},
|
|
||||||
]},
|
|
||||||
{'name': 'Advanced Player\'s Guide',
|
|
||||||
'shortName': 'APG',
|
|
||||||
'baseUrl': 'http://paizo.com/pathfinderRPG/prd/advanced/magicItems/rods.html',
|
|
||||||
'count': {'medium': 25, 'major': 28},
|
|
||||||
'items': [
|
|
||||||
{'name': 'Rod of Metamagic, merciful, lesser', 'cost': 1500, 'url': '#metamagic,-merciful'},
|
|
||||||
{'name': 'Rod of Metamagic, bouncing, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, disruptive, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, ectoplasmic, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, elemental, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, focused, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, intensified, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, lingering, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, reach, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, selective, lesser', 'cost': 3000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, merciful', 'cost': 5500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, persistent, lesser', 'cost': 9000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, sickening, lesser', 'cost': 9000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, thundering, lesser', 'cost': 9000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, bouncing', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, disruptive', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, ectoplasmic', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, elemental', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, focused', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, intensified', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, lingering', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, reach', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, selective', 'cost': 11000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, merciful, greater', 'cost': 12250, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, dazing, lesser', 'cost': 14000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, bouncing, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, disruptive, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, ectoplasmic, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, elemental, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, focused, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, intensified, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, lingering, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, reach, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, selective, greater', 'cost': 24500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, persistent', 'cost': 32500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, sickening', 'cost': 32500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, thundering', 'cost': 32500, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, dazing', 'cost': 54000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, persistent, greater', 'cost': 73000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, sickening, greater', 'cost': 73000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, thundering, greater', 'cost': 73000, 'url': ''},
|
|
||||||
{'name': 'Rod of Metamagic, dazing, greater', 'cost': 121500, 'url': ''},
|
|
||||||
]}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
Rods.getRod = function(type, source) {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
var rod = {};
|
|
||||||
if(source === undefined) {
|
|
||||||
source = 'CRB';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(type == 'minor') {
|
|
||||||
console.log('Error: There are no minor rods');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var sourceRods = _.findWhere(Rods.getAllRods(), function(s) {
|
|
||||||
return s.shortName == source.toUpperCase();
|
|
||||||
}).items;
|
|
||||||
|
|
||||||
if(source.toUpperCase() == 'CRB')
|
|
||||||
{
|
|
||||||
if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 7): rod = sourceRods[0]; break;
|
|
||||||
case (roll <= 14): rod = sourceRods[1]; break;
|
|
||||||
case (roll <= 21): rod = sourceRods[2]; break;
|
|
||||||
case (roll <= 28): rod = sourceRods[3]; break;
|
|
||||||
case (roll <= 35): rod = sourceRods[4]; break;
|
|
||||||
case (roll <= 42): rod = sourceRods[5]; break;
|
|
||||||
case (roll <= 53): rod = sourceRods[6]; break;
|
|
||||||
case (roll <= 57): rod = sourceRods[7]; break;
|
|
||||||
case (roll <= 61): rod = sourceRods[8]; break;
|
|
||||||
case (roll <= 65): rod = sourceRods[9]; break;
|
|
||||||
case (roll <= 71): rod = sourceRods[10]; break;
|
|
||||||
case (roll <= 79): rod = sourceRods[11]; break;
|
|
||||||
case (roll <= 83): rod = sourceRods[12]; break;
|
|
||||||
case (roll <= 89): rod = sourceRods[13]; break;
|
|
||||||
case (roll <= 97): rod = sourceRods[14]; break;
|
|
||||||
case (roll <= 99): rod = sourceRods[21]; break;
|
|
||||||
case (roll <= 100): rod = sourceRods[23]; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 4): rod = sourceRods[6]; break;
|
|
||||||
case (roll <= 6): rod = sourceRods[7]; break;
|
|
||||||
case (roll <= 8): rod = sourceRods[8]; break;
|
|
||||||
case (roll <= 10): rod = sourceRods[9]; break;
|
|
||||||
case (roll <= 14): rod = sourceRods[10]; break;
|
|
||||||
case (roll <= 19): rod = sourceRods[11]; break;
|
|
||||||
case (roll <= 21): rod = sourceRods[13]; break;
|
|
||||||
case (roll <= 25): rod = sourceRods[14]; break;
|
|
||||||
case (roll <= 30): rod = sourceRods[15]; break;
|
|
||||||
case (roll <= 36): rod = sourceRods[16]; break;
|
|
||||||
case (roll <= 42): rod = sourceRods[17]; break;
|
|
||||||
case (roll <= 48): rod = sourceRods[18]; break;
|
|
||||||
case (roll <= 53): rod = sourceRods[19]; break;
|
|
||||||
case (roll <= 58): rod = sourceRods[20]; break;
|
|
||||||
case (roll <= 64): rod = sourceRods[21]; break;
|
|
||||||
case (roll <= 69): rod = sourceRods[22]; break;
|
|
||||||
case (roll <= 73): rod = sourceRods[23]; break;
|
|
||||||
case (roll <= 77): rod = sourceRods[24]; break;
|
|
||||||
case (roll <= 80): rod = sourceRods[25]; break;
|
|
||||||
case (roll <= 84): rod = sourceRods[26]; break;
|
|
||||||
case (roll <= 86): rod = sourceRods[27]; break;
|
|
||||||
case (roll <= 88): rod = sourceRods[28]; break;
|
|
||||||
case (roll <= 90): rod = sourceRods[29]; break;
|
|
||||||
case (roll <= 92): rod = sourceRods[30]; break;
|
|
||||||
case (roll <= 94): rod = sourceRods[31]; break;
|
|
||||||
case (roll <= 96): rod = sourceRods[32]; break;
|
|
||||||
case (roll <= 98): rod = sourceRods[33]; break;
|
|
||||||
case (roll <= 99): rod = sourceRods[34]; break;
|
|
||||||
case (roll <= 100): rod = sourceRods[35]; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(source.toUpperCase() == 'APG') {
|
|
||||||
if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 3): rod = sourceRods[0]; break;
|
|
||||||
case (roll <= 6): rod = sourceRods[1]; break;
|
|
||||||
case (roll <= 11): rod = sourceRods[2]; break;
|
|
||||||
case (roll <= 21): rod = sourceRods[3]; break;
|
|
||||||
case (roll <= 27): rod = sourceRods[4]; break;
|
|
||||||
case (roll <= 33): rod = sourceRods[5]; break;
|
|
||||||
case (roll <= 36): rod = sourceRods[6]; break;
|
|
||||||
case (roll <= 39): rod = sourceRods[7]; break;
|
|
||||||
case (roll <= 43): rod = sourceRods[8]; break;
|
|
||||||
case (roll <= 53): rod = sourceRods[9]; break;
|
|
||||||
case (roll <= 55): rod = sourceRods[10]; break;
|
|
||||||
case (roll <= 58): rod = sourceRods[11]; break;
|
|
||||||
case (roll <= 62): rod = sourceRods[12]; break;
|
|
||||||
case (roll <= 66): rod = sourceRods[13]; break;
|
|
||||||
case (roll <= 70): rod = sourceRods[14]; break;
|
|
||||||
case (roll <= 74): rod = sourceRods[15]; break;
|
|
||||||
case (roll <= 80): rod = sourceRods[16]; break;
|
|
||||||
case (roll <= 83): rod = sourceRods[17]; break;
|
|
||||||
case (roll <= 86): rod = sourceRods[18]; break;
|
|
||||||
case (roll <= 88): rod = sourceRods[19]; break;
|
|
||||||
case (roll <= 90): rod = sourceRods[20]; break;
|
|
||||||
case (roll <= 93): rod = sourceRods[21]; break;
|
|
||||||
case (roll <= 97): rod = sourceRods[22]; break;
|
|
||||||
case (roll <= 98): rod = sourceRods[23]; break;
|
|
||||||
case (roll <= 100): rod = sourceRods[24]; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 3): rod = sourceRods[14]; break;
|
|
||||||
case (roll <= 9): rod = sourceRods[15]; break;
|
|
||||||
case (roll <= 20): rod = sourceRods[16]; break;
|
|
||||||
case (roll <= 28): rod = sourceRods[17]; break;
|
|
||||||
case (roll <= 36): rod = sourceRods[18]; break;
|
|
||||||
case (roll <= 39): rod = sourceRods[19]; break;
|
|
||||||
case (roll <= 43): rod = sourceRods[20]; break;
|
|
||||||
case (roll <= 46): rod = sourceRods[21]; break;
|
|
||||||
case (roll <= 54): rod = sourceRods[22]; break;
|
|
||||||
case (roll <= 56): rod = sourceRods[23]; break;
|
|
||||||
case (roll <= 58): rod = sourceRods[24]; break;
|
|
||||||
case (roll <= 60): rod = sourceRods[25]; break;
|
|
||||||
case (roll <= 63): rod = sourceRods[26]; break;
|
|
||||||
case (roll <= 69): rod = sourceRods[27]; break;
|
|
||||||
case (roll <= 73): rod = sourceRods[28]; break;
|
|
||||||
case (roll <= 77): rod = sourceRods[29]; break;
|
|
||||||
case (roll <= 79): rod = sourceRods[30]; break;
|
|
||||||
case (roll <= 80): rod = sourceRods[31]; break;
|
|
||||||
case (roll <= 82): rod = sourceRods[32]; break;
|
|
||||||
case (roll <= 86): rod = sourceRods[33]; break;
|
|
||||||
case (roll <= 89): rod = sourceRods[34]; break;
|
|
||||||
case (roll <= 91): rod = sourceRods[35]; break;
|
|
||||||
case (roll <= 93): rod = sourceRods[36]; break;
|
|
||||||
case (roll <= 95): rod = sourceRods[37]; break;
|
|
||||||
case (roll <= 97): rod = sourceRods[38]; break;
|
|
||||||
case (roll <= 98): rod = sourceRods[39]; break;
|
|
||||||
case (roll <= 99): rod = sourceRods[40]; break;
|
|
||||||
case (roll <= 100): rod = sourceRods[41]; break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(rod) {
|
|
||||||
roll = _.random(1,100);
|
|
||||||
if(roll == 1) {
|
|
||||||
rod.name = 'Intelligent ' + rod.name;
|
|
||||||
rod.intelligence = Intelligence.getItemIntelligence(rod.cost);
|
|
||||||
}
|
|
||||||
else if(roll <= 30) {
|
|
||||||
rod.name += ' (with a clue as to its purpose)';
|
|
||||||
}
|
|
||||||
return rod;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
-47
@@ -1,47 +0,0 @@
|
|||||||
/*global _:false */
|
|
||||||
/*global Spells:true */
|
|
||||||
'use strict';
|
|
||||||
var Scrolls = {};
|
|
||||||
Scrolls.cost = [12.5, 25, 150, 375, 700, 1125, 1650, 2275, 3000, 3825];
|
|
||||||
|
|
||||||
Scrolls.getLevelScroll = function(level, type) {
|
|
||||||
if(level < 0 || level > 9) return;
|
|
||||||
if(type === undefined) {
|
|
||||||
type = _.random(0,1) ? 'arcane' : 'divine';
|
|
||||||
}
|
|
||||||
var spell = Spells.getLevelSpell(level, type);
|
|
||||||
return {'name': 'Scroll of ' + spell.name,
|
|
||||||
'description': '(' + type + ', spell level ' + level + ', caster level ' + _.max([1, (level*2-1)]) + ')',
|
|
||||||
'cost': Scrolls.cost[level],
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
Scrolls.getScroll = function(type) {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
if(type == 'minor') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 5): return Scrolls.getLevelScroll(0);
|
|
||||||
case (roll <= 50): return Scrolls.getLevelScroll(1);
|
|
||||||
case (roll <= 95): return Scrolls.getLevelScroll(2);
|
|
||||||
case (roll <= 100): return Scrolls.getLevelScroll(3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 5): return Scrolls.getLevelScroll(2);
|
|
||||||
case (roll <= 65): return Scrolls.getLevelScroll(3);
|
|
||||||
case (roll <= 95): return Scrolls.getLevelScroll(4);
|
|
||||||
case (roll <= 100): return Scrolls.getLevelScroll(5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 5): return Scrolls.getLevelScroll(4);
|
|
||||||
case (roll <= 50): return Scrolls.getLevelScroll(5);
|
|
||||||
case (roll <= 70): return Scrolls.getLevelScroll(6);
|
|
||||||
case (roll <= 85): return Scrolls.getLevelScroll(7);
|
|
||||||
case (roll <= 95): return Scrolls.getLevelScroll(8);
|
|
||||||
case (roll <= 100): return Scrolls.getLevelScroll(9);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
+4
-4
@@ -2,10 +2,10 @@
|
|||||||
"name": "Advanced Player's Guide",
|
"name": "Advanced Player's Guide",
|
||||||
"shortName": "APG",
|
"shortName": "APG",
|
||||||
"types": [
|
"types": [
|
||||||
{"name": "Rings", "source": "APG/Rings.json"},
|
{"name": "Rings", "source": "sources/APG/Rings.json"},
|
||||||
{"name": "Rods", "source": "APG/Rods.json"},
|
{"name": "Rods", "source": "sources/APG/Rods.json"},
|
||||||
{"name": "Spells", "source": "APG/Spells.json"},
|
{"name": "Spells", "source": "sources/APG/Spells.json"},
|
||||||
{"name": "Wands"},
|
{"name": "Wands"},
|
||||||
{"name": "Wondrous Items", "source": "APG/Wondrous Items.json"}
|
{"name": "Wondrous Items", "source": "sources/APG/Wondrous Items.json"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
[
|
||||||
"data": [
|
|
||||||
{ "name" : "Dungeon ring, prisoner's", "cost": 250, "url": "#dungeon-ring", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Dungeon ring, prisoner's", "cost": 250, "url": "#dungeon-ring", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
||||||
{ "name" : "Arcane signets", "cost": 1000, "url": "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Arcane signets", "cost": 1000, "url": "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
||||||
{ "name" : "Maniacal Devices", "cost": 5000, "url": "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Maniacal Devices", "cost": 5000, "url": "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
||||||
@@ -19,4 +18,3 @@
|
|||||||
{ "name" : "Delayed doom (8 stones)", "cost": 40000, "url": "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Delayed doom (8 stones)", "cost": 40000, "url": "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
||||||
{ "name" : "Delayed doom (9 stones)", "cost": 45000, "url": "", "weight": {"minor": 0, "medium": 0, "major": 0} }
|
{ "name" : "Delayed doom (9 stones)", "cost": 45000, "url": "", "weight": {"minor": 0, "medium": 0, "major": 0} }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
{
|
[
|
||||||
"_todo": "Add weights!",
|
|
||||||
"data": [
|
|
||||||
{"name": "Rod of Metamagic, merciful, lesser", "cost": 1500, "url": "#metamagic,-merciful", "weight": {"medium": 0, "major": 0} },
|
{"name": "Rod of Metamagic, merciful, lesser", "cost": 1500, "url": "#metamagic,-merciful", "weight": {"medium": 0, "major": 0} },
|
||||||
{"name": "Rod of Metamagic, bouncing, lesser", "cost": 3000, "url": "", "weight": {"medium": 0, "major": 0} },
|
{"name": "Rod of Metamagic, bouncing, lesser", "cost": 3000, "url": "", "weight": {"medium": 0, "major": 0} },
|
||||||
{"name": "Rod of Metamagic, disruptive, lesser", "cost": 3000, "url": "", "weight": {"medium": 0, "major": 0} },
|
{"name": "Rod of Metamagic, disruptive, lesser", "cost": 3000, "url": "", "weight": {"medium": 0, "major": 0} },
|
||||||
@@ -44,4 +42,3 @@
|
|||||||
{"name": "Rod of Metamagic, thundering, greater", "cost": 73000, "url": "", "weight": {"medium": 0, "major": 0} },
|
{"name": "Rod of Metamagic, thundering, greater", "cost": 73000, "url": "", "weight": {"medium": 0, "major": 0} },
|
||||||
{"name": "Rod of Metamagic, dazing, greater", "cost": 121500, "url": "", "weight": {"medium": 0, "major": 0} }
|
{"name": "Rod of Metamagic, dazing, greater", "cost": 121500, "url": "", "weight": {"medium": 0, "major": 0} }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"data": {
|
|
||||||
"Arcane": [
|
"Arcane": [
|
||||||
["Sift", "Spark", "Unwitting Ally", "Message", "Acid Splash", "Ray of Frost", "Putrefy Food and Drink"],
|
["Sift", "Spark", "Unwitting Ally", "Message", "Acid Splash", "Ray of Frost", "Putrefy Food and Drink"],
|
||||||
["Beguiling Gift", "Borrow Skill", "Dancing Lantern", "Feather Step", "Flare Burst", "Innocence", "Invigorate", "Memory Lapse",
|
["Beguiling Gift", "Borrow Skill", "Dancing Lantern", "Feather Step", "Flare Burst", "Innocence", "Invigorate", "Memory Lapse",
|
||||||
@@ -67,4 +66,3 @@
|
|||||||
["Winds of Vengeance", "Clashing Rocks", "Tsunami", "World Wave"]
|
["Winds of Vengeance", "Clashing Rocks", "Tsunami", "World Wave"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"data": {
|
|
||||||
"minor" : [
|
"minor" : [
|
||||||
{"name": "Ioun torch", "cost": 75, "url": "#_ioun-torch"},
|
{"name": "Ioun torch", "cost": 75, "url": "#_ioun-torch"},
|
||||||
{"name": "War paint of the terrible visage", "cost" : 100, "url" : ""},
|
{"name": "War paint of the terrible visage", "cost" : 100, "url" : ""},
|
||||||
@@ -69,4 +68,3 @@
|
|||||||
{"name": "Lord's banner (crusades)", "cost": 100000, "url": ""}
|
{"name": "Lord's banner (crusades)", "cost": 100000, "url": ""}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
+9
-6
@@ -3,12 +3,15 @@
|
|||||||
"name": "Core Rule Book",
|
"name": "Core Rule Book",
|
||||||
"shortName": "CRB",
|
"shortName": "CRB",
|
||||||
"types": [
|
"types": [
|
||||||
{"name": "Potions", "source": "CRB/Potions.json"},
|
{"name": "Potions", "source": "sources/CRB/Potions.json"},
|
||||||
{"name": "Rings", "source": "CRB/Rings.json"},
|
{"name": "Rings", "source": "sources/CRB/Rings.json"},
|
||||||
{"name": "Rods", "source": "CRB/Rods.json"},
|
{"name": "Rods", "source": "sources/CRB/Rods.json"},
|
||||||
{"name": "Spells", "source": "CRB/Spells.json"},
|
{"name": "Spells", "source": "sources/CRB/Spells.json"},
|
||||||
{"name": "Staves", "source": "CRB/Staves.json"},
|
{"name": "Scrolls"},
|
||||||
|
{"name": "Staves", "source": "sources/CRB/Staves.json"},
|
||||||
{"name": "Wands"},
|
{"name": "Wands"},
|
||||||
{"name": "Wondrous Items", "source": "CRB/Wondrous Items.json"}
|
{"name": "Weapons", "source": "sources/CRB/Weapons.json"},
|
||||||
|
{"name": "Armor and Shields", "source": "sources/CRB/Armor and Shields.json"},
|
||||||
|
{"name": "Wondrous Items", "source": "sources/CRB/Wondrous Items.json"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,4 @@
|
|||||||
{
|
[
|
||||||
"_comment": "These are NOT all from CRB but this seemed like the best place to put them for now. I'll put them in other sources eventually",
|
|
||||||
"_note": "Potions can appear as either potions or oils depending on the specific spell",
|
|
||||||
"data": [
|
|
||||||
["Bleed","Touch of Fatigue","Resistance","Stabilize","Guidance"],
|
["Bleed","Touch of Fatigue","Resistance","Stabilize","Guidance"],
|
||||||
["Cure Light Wounds","Chill Touch","Doom","Endure Elements","Enlarge Person","Feather Fall","Hide from Animals",
|
["Cure Light Wounds","Chill Touch","Doom","Endure Elements","Enlarge Person","Feather Fall","Hide from Animals",
|
||||||
"Hide from Undead","Inflict Light Wounds","Jump","Mage Armor","Magic Fangs","Magic Weapon","Pass without Trace","Protection from Evil",
|
"Hide from Undead","Inflict Light Wounds","Jump","Mage Armor","Magic Fangs","Magic Weapon","Pass without Trace","Protection from Evil",
|
||||||
@@ -15,4 +12,3 @@
|
|||||||
"Magic Vestment","Neutralize Poison","Nondetection","Poison","Protection from Energy","Remove Blindness/Deafness","Remove Curse","Remove Disease",
|
"Magic Vestment","Neutralize Poison","Nondetection","Poison","Protection from Energy","Remove Blindness/Deafness","Remove Curse","Remove Disease",
|
||||||
"Slow","Water Breathing","Water Walking"]
|
"Slow","Water Breathing","Water Walking"]
|
||||||
]
|
]
|
||||||
}
|
|
||||||
+38
-40
@@ -1,5 +1,4 @@
|
|||||||
{
|
[
|
||||||
"data": [
|
|
||||||
{ "name" : "Ring of Protection +1", "cost" : 2000, "url" : "#_ring-of-protection", "weight": {"minor": 18, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Protection +1", "cost" : 2000, "url" : "#_ring-of-protection", "weight": {"minor": 18, "medium": 0, "major": 0} },
|
||||||
{ "name" : "Ring of Feather falling", "cost" : 2200, "url" : "", "weight": {"minor": 10, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Feather falling", "cost" : 2200, "url" : "", "weight": {"minor": 10, "medium": 0, "major": 0} },
|
||||||
{ "name" : "Ring of Sustenance", "cost" : 2500, "url" : "", "weight": {"minor": 8, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Sustenance", "cost" : 2500, "url" : "", "weight": {"minor": 8, "medium": 0, "major": 0} },
|
||||||
@@ -9,42 +8,41 @@
|
|||||||
{ "name" : "Ring of Counterspells", "cost" : 400, "url" : "", "weight": {"minor": 10, "medium": 5, "major": 0} },
|
{ "name" : "Ring of Counterspells", "cost" : 400, "url" : "", "weight": {"minor": 10, "medium": 5, "major": 0} },
|
||||||
{ "name" : "Ring of Mind shielding", "cost" : 800, "url" : "", "weight": {"minor": 5, "medium": 3, "major": 0} },
|
{ "name" : "Ring of Mind shielding", "cost" : 800, "url" : "", "weight": {"minor": 5, "medium": 3, "major": 0} },
|
||||||
{ "name" : "Ring of Protection +2", "cost" : 8000, "url" : "", "weight": {"minor": 5, "medium": 10, "major": 0} },
|
{ "name" : "Ring of Protection +2", "cost" : 8000, "url" : "", "weight": {"minor": 5, "medium": 10, "major": 0} },
|
||||||
{ "name" : "Ring of Force shield", "cost" : 8500, "url" : "", "weight": {"minor": 5, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Force shield", "cost" : 8500, "url" : "", "weight": {"minor": 5, "medium": 5, "major": 0} },
|
||||||
{ "name" : "Ring of the Ram", "cost" : 8600, "url" : "", "weight": {"minor": 5, "medium": 0, "major": 0} },
|
{ "name" : "Ring of the Ram", "cost" : 8600, "url" : "", "weight": {"minor": 5, "medium": 5, "major": 0} },
|
||||||
{ "name" : "Ring of Climbing, improved", "cost" : 1000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Climbing, improved", "cost" : 1000, "url" : "", "weight": {"minor": 0, "medium": 6, "major": 0} },
|
||||||
{ "name" : "Ring of Jumping, improved", "cost" : 1000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Jumping, improved", "cost" : 1000, "url" : "", "weight": {"minor": 0, "medium": 6, "major": 0} },
|
||||||
{ "name" : "Ring of Swimming, improved", "cost" : 1000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Swimming, improved", "cost" : 1000, "url" : "", "weight": {"minor": 0, "medium": 6, "major": 0} },
|
||||||
{ "name" : "Ring of Animal friendship", "cost" : 10800, "url" : "", "weight": {"minor": 3, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Animal friendship", "cost" : 10800, "url" : "", "weight": {"minor": 3, "medium": 4, "major": 0} },
|
||||||
{ "name" : "Ring of Energy resistance, minor", "cost" : 1200, "url" : "", "weight": {"minor": 3, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Energy resistance, minor", "cost" : 1200, "url" : "", "weight": {"minor": 3, "medium": 6, "major": 2} },
|
||||||
{ "name" : "Ring of Chameleon power", "cost" : 12700, "url" : "", "weight": {"minor": 2, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Chameleon power", "cost" : 12700, "url" : "", "weight": {"minor": 2, "medium": 5, "major": 0} },
|
||||||
{ "name" : "Ring of Water walking", "cost" : 1500, "url" : "", "weight": {"minor": 2, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Water walking", "cost" : 1500, "url" : "", "weight": {"minor": 2, "medium": 5, "major": 0} },
|
||||||
{ "name" : "Ring of Protection +3", "cost" : 1800, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Protection +3", "cost" : 1800, "url" : "", "weight": {"minor": 0, "medium": 5, "major": 5} },
|
||||||
{ "name" : "Ring of Spell storing, minor", "cost" : 1800, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Spell storing, minor", "cost" : 1800, "url" : "", "weight": {"minor": 0, "medium": 5, "major": 3} },
|
||||||
{ "name" : "Ring of Invisibility", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Invisibility", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 5, "major": 5} },
|
||||||
{ "name" : "Ring of Wizardry (I)", "cost" : 2000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Wizardry (I)", "cost" : 2000, "url" : "", "weight": {"minor": 0, "medium": 4, "major": 4} },
|
||||||
{ "name" : "Ring of Evasion", "cost" : 2500, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Evasion", "cost" : 2500, "url" : "", "weight": {"minor": 0, "medium": 5, "major": 6} },
|
||||||
{ "name" : "Ring of X-ray vision", "cost" : 2500, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of X-ray vision", "cost" : 2500, "url" : "", "weight": {"minor": 0, "medium": 3, "major": 3} },
|
||||||
{ "name" : "Ring of Blinking", "cost" : 2700, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Blinking", "cost" : 2700, "url" : "", "weight": {"minor": 0, "medium": 4, "major": 4} },
|
||||||
{ "name" : "Ring of Energy resistance, major", "cost" : 2800, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Energy resistance, major", "cost" : 2800, "url" : "", "weight": {"minor": 3, "medium": 0, "major": 7} },
|
||||||
{ "name" : "Ring of Protection +4", "cost" : 3200, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Protection +4", "cost" : 3200, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 10} },
|
||||||
{ "name" : "Ring of Wizardry (II)", "cost" : 4000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Wizardry (II)", "cost" : 4000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 6} },
|
||||||
{ "name" : "Ring of Freedom of movement", "cost" : 4000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Freedom of movement", "cost" : 4000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 5} },
|
||||||
{ "name" : "Ring of Energy resistance, greater", "cost" : 4400, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Energy resistance, greater", "cost" : 4400, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 3} },
|
||||||
{ "name" : "Ring of Friend shield (pair)", "cost" : 5000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Friend shield (pair)", "cost" : 5000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 2} },
|
||||||
{ "name" : "Ring of Protection +5", "cost" : 5000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Protection +5", "cost" : 5000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 5} },
|
||||||
{ "name" : "Ring of Shooting stars", "cost" : 5000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Shooting stars", "cost" : 5000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 4} },
|
||||||
{ "name" : "Ring of Spell storing", "cost" : 5000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Spell storing", "cost" : 5000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 5} },
|
||||||
{ "name" : "Ring of Wizardry (III)", "cost" : 7000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Wizardry (III)", "cost" : 7000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 4} },
|
||||||
{ "name" : "Ring of Telekinesis", "cost" : 7500, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Telekinesis", "cost" : 7500, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 3} },
|
||||||
{ "name" : "Ring of Regeneration", "cost" : 9000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Regeneration", "cost" : 9000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 2} },
|
||||||
{ "name" : "Ring of Spell turning", "cost" : 10000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Spell turning", "cost" : 10000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 3} },
|
||||||
{ "name" : "Ring of Wizardry (IV)", "cost" : 10000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Wizardry (IV)", "cost" : 10000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 2} },
|
||||||
{ "name" : "Ring of Three wishes", "cost" : 12000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Three wishes", "cost" : 12000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 1} },
|
||||||
{ "name" : "Ring of Djinni calling", "cost" : 12500, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Djinni calling", "cost" : 12500, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 1} },
|
||||||
{ "name" : "Ring of Elemental command (air)", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Elemental command (air)", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 1} },
|
||||||
{ "name" : "Ring of Elemental command (earth)", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Elemental command (earth)", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 1} },
|
||||||
{ "name" : "Ring of Elemental command (fire)", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Elemental command (fire)", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 1} },
|
||||||
{ "name" : "Ring of Elemental command (water)", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} },
|
{ "name" : "Ring of Elemental command (water)", "cost" : 20000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 1} },
|
||||||
{ "name" : "Ring of Spell storing, major", "cost" : 2000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 0} }
|
{ "name" : "Ring of Spell storing, major", "cost" : 2000, "url" : "", "weight": {"minor": 0, "medium": 0, "major": 1} }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
{
|
[
|
||||||
"_todo": "Add weights!",
|
|
||||||
"data": [
|
|
||||||
{"name": "Rod of Metamagic, Enlarge, lesser", "cost": 3000, "url": "#metamagic-enlarge", "weight": {"medium": 7, "major": 0} },
|
{"name": "Rod of Metamagic, Enlarge, lesser", "cost": 3000, "url": "#metamagic-enlarge", "weight": {"medium": 7, "major": 0} },
|
||||||
{"name": "Rod of Metamagic, Extend, lesser", "cost": 3000, "url": "", "weight": {"medium": 7, "major": 0} },
|
{"name": "Rod of Metamagic, Extend, lesser", "cost": 3000, "url": "", "weight": {"medium": 7, "major": 0} },
|
||||||
{"name": "Rod of Metamagic, Silent, lesser", "cost": 3000, "url": "", "weight": {"medium": 7, "major": 0} },
|
{"name": "Rod of Metamagic, Silent, lesser", "cost": 3000, "url": "", "weight": {"medium": 7, "major": 0} },
|
||||||
@@ -38,4 +36,3 @@
|
|||||||
{"name": "Rod of Metamagic, Maximize, greater", "cost": 121500, "url": "", "weight": {"medium": 0, "major": 1} },
|
{"name": "Rod of Metamagic, Maximize, greater", "cost": 121500, "url": "", "weight": {"medium": 0, "major": 1} },
|
||||||
{"name": "Rod of Metamagic, Quicken, greater", "cost": 170000, "url": "", "weight": {"medium": 0, "major": 1} }
|
{"name": "Rod of Metamagic, Quicken, greater", "cost": 170000, "url": "", "weight": {"medium": 0, "major": 1} }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"data": {
|
|
||||||
"Arcane": [
|
"Arcane": [
|
||||||
["Resistance",
|
["Resistance",
|
||||||
"Acid Splash", "Detect Magic", "Detect Poison", "Read Magic",
|
"Acid Splash", "Detect Magic", "Detect Poison", "Read Magic",
|
||||||
@@ -255,4 +254,3 @@
|
|||||||
"Shapechange", "Summon Nature's Ally IX", "Sympathy"]
|
"Shapechange", "Summon Nature's Ally IX", "Sympathy"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
[
|
||||||
"data": [
|
|
||||||
{"name": "Staff of Charming", "cost": 17600, "url": "#staff-of-charming", "weight": { "medium": 15, "major": 3} },
|
{"name": "Staff of Charming", "cost": 17600, "url": "#staff-of-charming", "weight": { "medium": 15, "major": 3} },
|
||||||
{"name": "Staff of Fire", "cost": 18950, "url": "", "weight": { "medium": 15, "major": 6} },
|
{"name": "Staff of Fire", "cost": 18950, "url": "", "weight": { "medium": 15, "major": 6} },
|
||||||
{"name": "Staff of Swarming Insects", "cost": 22800, "url": "", "weight": { "medium": 15, "major": 2} },
|
{"name": "Staff of Swarming Insects", "cost": 22800, "url": "", "weight": { "medium": 15, "major": 2} },
|
||||||
@@ -22,4 +21,3 @@
|
|||||||
{"name": "Staff of Passage", "cost": 206900, "url": "", "weight": { "medium": 0, "major": 3} },
|
{"name": "Staff of Passage", "cost": 206900, "url": "", "weight": { "medium": 0, "major": 3} },
|
||||||
{"name": "Staff of Power", "cost": 235000, "url": "", "weight": { "medium": 0, "major": 2} }
|
{"name": "Staff of Power", "cost": 235000, "url": "", "weight": { "medium": 0, "major": 2} }
|
||||||
]
|
]
|
||||||
}
|
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"data": {
|
|
||||||
"minor": [
|
"minor": [
|
||||||
{ "name" : "Feather token, anchor", "cost" : 50, "url" : "#feather-token" },
|
{ "name" : "Feather token, anchor", "cost" : 50, "url" : "#feather-token" },
|
||||||
{ "name" : "Universal solvent", "cost" : 50, "url" : "" },
|
{ "name" : "Universal solvent", "cost" : 50, "url" : "" },
|
||||||
@@ -393,4 +392,3 @@
|
|||||||
{ "name" : "Mirror of life trapping", "cost" : 20000, "url" : "" }
|
{ "name" : "Mirror of life trapping", "cost" : 20000, "url" : "" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"data": ["acid", "cold", "electricity", "fire", "sonic"]
|
|
||||||
}
|
|
||||||
+1
-1
@@ -2,6 +2,6 @@
|
|||||||
"name": "Ultimate Magic",
|
"name": "Ultimate Magic",
|
||||||
"shortName": "UM",
|
"shortName": "UM",
|
||||||
"types": [
|
"types": [
|
||||||
{"name": "Spells", "source": "UM/Spells.json"}
|
{"name": "Spells", "source": "sources/UM/Spells.json"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"data": {
|
|
||||||
"Arcane": [
|
"Arcane": [
|
||||||
[],
|
[],
|
||||||
["Anticipate Peril", "Chord of Shards", "Delusional Pride", "Ear-Piercing Scream", "Forced Quiet", "Fumbletongue", "Horn of Pursuit", "Ki Arrow", "Play Instrument", "Summon Minor Monster", "Unnatural Lust", "Unprepared Combatant", "Vocal Alteration", "Youthful Appearance", "Corrosive Touch", "Frostbite", "Bungle", "Decompose Corpse", "Icicle Dagger", "Interrogation", "Polypurpose Panacea", "Ray of Sickening", "Restore Corpse", "Shadow Weapon", "Snapdragon Fireworks", "Diagnose Disease", "Hex Ward", "Remove Sickness", "Sanctify Corpse"],
|
["Anticipate Peril", "Chord of Shards", "Delusional Pride", "Ear-Piercing Scream", "Forced Quiet", "Fumbletongue", "Horn of Pursuit", "Ki Arrow", "Play Instrument", "Summon Minor Monster", "Unnatural Lust", "Unprepared Combatant", "Vocal Alteration", "Youthful Appearance", "Corrosive Touch", "Frostbite", "Bungle", "Decompose Corpse", "Icicle Dagger", "Interrogation", "Polypurpose Panacea", "Ray of Sickening", "Restore Corpse", "Shadow Weapon", "Snapdragon Fireworks", "Diagnose Disease", "Hex Ward", "Remove Sickness", "Sanctify Corpse"],
|
||||||
@@ -25,4 +24,3 @@
|
|||||||
["Create Demiplane, Greater", "Cursed Earth", "Interplanetary Teleport", "Overwhelming Presence", "Polar Midnight", "Symbol of Strife", "Symbol of Vulnerability", "Wooden Phalanx", "Summon Elder Worm", "Summon Froghemoth"]
|
["Create Demiplane, Greater", "Cursed Earth", "Interplanetary Teleport", "Overwhelming Presence", "Polar Midnight", "Symbol of Strife", "Symbol of Vulnerability", "Wooden Phalanx", "Summon Elder Worm", "Summon Froghemoth"]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
+13
-1
@@ -1,3 +1,15 @@
|
|||||||
{
|
{
|
||||||
"sources": ["CRB.json", "APG.json", "UM.json"]
|
"sources": [
|
||||||
|
"sources/CRB.json",
|
||||||
|
"sources/APG.json",
|
||||||
|
"sources/UM.json",
|
||||||
|
"sources/UC.json"
|
||||||
|
],
|
||||||
|
"other": [
|
||||||
|
"sources/Banes.json",
|
||||||
|
"sources/Deities.json",
|
||||||
|
"sources/Humanoids.json",
|
||||||
|
"sources/Outsiders.json",
|
||||||
|
"sources/ItemSkills.json"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -1,506 +0,0 @@
|
|||||||
/*global _:false */
|
|
||||||
'use strict';
|
|
||||||
var Spells = {};
|
|
||||||
Spells.getSpells = function() {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
'name': 'Core Rule Book',
|
|
||||||
'shortName': 'CRB',
|
|
||||||
'baseUrl': '',
|
|
||||||
'arcane': [
|
|
||||||
// arcane spells contain all Wizard/Sorcerer spells (at the wizard
|
|
||||||
// cost). I may add the others later
|
|
||||||
// level 0
|
|
||||||
['Resistance',
|
|
||||||
'Acid Splash', 'Detect Magic', 'Detect Poison', 'Read Magic',
|
|
||||||
'Daze', 'Dancing Lights', 'Flare', 'Light', 'Ray of Frost',
|
|
||||||
'Ghost Sound', 'Bleed', 'Disrupt Undead', 'Touch of Fatigue',
|
|
||||||
'Mage Hand', 'Mending', 'Message', 'Open/Close', 'Arcane Mark',
|
|
||||||
'Prestidigitation'],
|
|
||||||
// level 1
|
|
||||||
['Alarm',
|
|
||||||
'Endure Elements', 'Hold Portal', 'Protection from Chaos',
|
|
||||||
'Protection from Evil', 'Protection from Good',
|
|
||||||
'Protection from Law', 'Shield', 'Grease', 'Mage Armor',
|
|
||||||
'Mount', 'Obscuring Mist', 'Summon Monster I', 'Unseen Servant',
|
|
||||||
'Comprehend Languages', 'Detect Secret Doors', 'Detect Undead',
|
|
||||||
'Identify', 'True Strike', 'Charm Person', 'Hypnotism', 'Sleep',
|
|
||||||
'Burning Hands', 'Floating Disk', 'Magic Missile',
|
|
||||||
'Shocking Grasp', 'Color Spray', 'Disguise Self', 'Magic Aura',
|
|
||||||
'Silent Image', 'Ventriloquism', 'Cause Fear', 'Chill Touch',
|
|
||||||
'Ray of Enfeeblement', 'Animate Rope', 'Enlarge Person',
|
|
||||||
'Erase', 'Expeditious Retreat', 'Feather Fall', 'Jump',
|
|
||||||
'Magic Weapon', 'Reduce Person'],
|
|
||||||
// level2
|
|
||||||
['Arcane Lock',
|
|
||||||
'Obscure Object', 'Protection from Arrows', 'Resist Energy',
|
|
||||||
'Acid Arrow', 'Fog Cloud', 'Glitterdust', 'Summon Monster II',
|
|
||||||
'Summon Swarm', 'Web', 'Detect Thoughts', 'Locate Object',
|
|
||||||
'See Invisibility', 'Daze Monster', 'Hideous Laughter',
|
|
||||||
'Touch of Idiocy', 'Continual Flame', 'Darkness',
|
|
||||||
'Flaming Sphere', 'Gust of Wind', 'Scorching Ray', 'Shatter',
|
|
||||||
'Blur', 'Hypnotic Pattern', 'Invisibility', 'Magic Mouth',
|
|
||||||
'Minor Image', 'Mirror Image', 'Misdirection', 'Phantom Trap',
|
|
||||||
'Blindness/Deafness', 'Command Undead', 'False Life',
|
|
||||||
'Ghoul Touch', 'Scare', 'Spectral Hand', 'Alter Self',
|
|
||||||
'Bear\'s Endurance', 'Bull\'s Strength', 'Cat\'s Grace',
|
|
||||||
'Darkvision', 'Eagle\'s Splendor', 'Fox\'s Cunning', 'Knock',
|
|
||||||
'Levitate', 'Make Whole', 'Owl\'s Wisdom', 'Pyrotechnics',
|
|
||||||
'Rope Trick', 'Spider Climb', 'Whispering Wind'],
|
|
||||||
// level3
|
|
||||||
['Dispel Magic',
|
|
||||||
'Explosive Runes', 'Magic Circle against Chaos',
|
|
||||||
'Magic Circle against Evil', 'Magic Circle against Good',
|
|
||||||
'Magic Circle against Law', 'Nondetection',
|
|
||||||
'Protection from Energy', 'Phantom Steed', 'Sepia Snake Sigil',
|
|
||||||
'Sleet Storm', 'Stinking Cloud', 'Summon Monster III',
|
|
||||||
'Arcane Sight', 'Clairaudience/Clairvoyance', 'Tongues',
|
|
||||||
'Deep Slumber', 'Heroism', 'Hold Person', 'Rage', 'Suggestion',
|
|
||||||
'Daylight', 'Fireball', 'Lightning Bolt', 'Tiny Hut',
|
|
||||||
'Wind Wall', 'Displacement', 'Illusory Script',
|
|
||||||
'Invisibility Sphere', 'Major Image', 'Gentle Repose',
|
|
||||||
'Halt Undead', 'Ray of Exhaustion', 'Vampiric Touch',
|
|
||||||
'Beast Shape I', 'Blink', 'Flame Arrow', 'Fly', 'Gaseous Form',
|
|
||||||
'Haste', 'Keen Edge', 'Magic Weapon, Greater', 'Secret Page',
|
|
||||||
'Shrink Item', 'Slow', 'Water Breathing'],
|
|
||||||
// level4
|
|
||||||
['Dimensional Anchor',
|
|
||||||
'Fire Trap', 'Globe of Invulnerability, Lesser', 'Remove Curse',
|
|
||||||
'Stoneskin', 'Black Tentacles', 'Dimension Door',
|
|
||||||
'Minor Creation', 'Secure Shelter', 'Solid Fog',
|
|
||||||
'Summon Monster IV', 'Arcane Eye', 'Detect Scrying',
|
|
||||||
'Locate Creature', 'Scrying', 'Charm Monster', 'Confusion',
|
|
||||||
'Crushing Despair', 'Geas, Lesser', 'Fire Shield', 'Ice Storm',
|
|
||||||
'Resilient Sphere', 'Shout', 'Wall of Fire', 'Wall of Ice',
|
|
||||||
'Hallucinatory Terrain', 'Illusory Wall',
|
|
||||||
'Invisibility, Greater', 'Phantasmal Killer', 'Rainbow Pattern',
|
|
||||||
'Shadow Conjuration', 'Animate Dead', 'Bestow Curse',
|
|
||||||
'Contagion', 'Enervation', 'Fear', 'Beast Shape II',
|
|
||||||
'Elemental Body I', 'Enlarge Person, Mass', 'Mnemonic Enhancer',
|
|
||||||
'Reduce Person, Mass', 'Stone Shape'],
|
|
||||||
// level5
|
|
||||||
['Break Enchantment',
|
|
||||||
'Dismissal', 'Mage\'s Private Sanctum', 'Cloudkill',
|
|
||||||
'Mage\'s Faithful Hound', 'Major Creation',
|
|
||||||
'Planar Binding, Lesser', 'Secret Chest', 'Summon Monster V',
|
|
||||||
'Teleport', 'Wall of Stone', 'Contact Other Plane',
|
|
||||||
'Prying Eyes', 'Telepathic Bond', 'Dominate Person',
|
|
||||||
'Feeblemind', 'Hold Monster', 'Mind Fog', 'Symbol of Sleep',
|
|
||||||
'Cone of Cold', 'Interposing Hand', 'Sending', 'Wall of Force',
|
|
||||||
'Dream', 'False Vision', 'Mirage Arcana', 'Nightmare',
|
|
||||||
'Persistent Image', 'Seeming', 'Shadow Evocation', 'Blight',
|
|
||||||
'Magic Jar', 'Symbol of Pain', 'Waves of Fatigue',
|
|
||||||
'Animal Growth', 'Baleful Polymorph', 'Beast Shape III',
|
|
||||||
'Elemental Body II', 'Fabricate', 'Overland Flight', 'Passwall',
|
|
||||||
'Plant Shape I', 'Polymorph', 'Telekinesis',
|
|
||||||
'Transmute Mud to Rock', 'Transmute Rock to Mud', 'Permanency'],
|
|
||||||
// level6
|
|
||||||
['Antimagic Field',
|
|
||||||
'Dispel Magic, Greater', 'Globe of Invulnerability',
|
|
||||||
'Guards and Wards', 'Repulsion', 'Acid Fog', 'Planar Binding',
|
|
||||||
'Summon Monster VI', 'Wall of Iron', 'Analyze Dweomer',
|
|
||||||
'Legend Lore', 'True Seeing', 'Geas/Quest', 'Heroism, Greater',
|
|
||||||
'Suggestion, Mass', 'Symbol of Persuasion', 'Chain Lightning',
|
|
||||||
'Contingency', 'Forceful Hand', 'Freezing Sphere', 'Mislead',
|
|
||||||
'Permanent Image', 'Programmed Image', 'Shadow Walk', 'Veil',
|
|
||||||
'Circle of Death', 'Create Undead', 'Eyebite', 'Symbol of Fear',
|
|
||||||
'Undeath to Death', 'Bear\'s Endurance, Mass', 'Beast Shape IV',
|
|
||||||
'Bull\'s Strength, Mass', 'Cat\'s Grace, Mass', 'Control Water',
|
|
||||||
'Disintegrate', 'Eagle\'s Splendor, Mass', 'Elemental Body III',
|
|
||||||
'Flesh to Stone', 'Form of the Dragon I', 'Fox\'s Cunning, Mass',
|
|
||||||
'Mage\'s Lucubration', 'Move Earth', 'Owl\'s Wisdom, Mass',
|
|
||||||
'Plant Shape II', 'Stone to Flesh', 'Transformation'],
|
|
||||||
// level7
|
|
||||||
['Banishment',
|
|
||||||
'Sequester', 'Spell Turning', 'Instant Summons',
|
|
||||||
'Mage\'s Magnificent Mansion', 'Phase Door', 'Plane Shift',
|
|
||||||
'Summon Monster VII', 'Teleport, Greater', 'Teleport Object',
|
|
||||||
'Arcane Sight, Greater', 'Scrying, Greater', 'Vision',
|
|
||||||
'Hold Person, Mass', 'Insanity', 'Power Word Blind',
|
|
||||||
'Symbol of Stunning', 'Delayed Blast Fireball', 'Forcecage',
|
|
||||||
'Grasping Hand', 'Mage\'s Sword', 'Prismatic Spray',
|
|
||||||
'Invisibility, Mass', 'Project Image',
|
|
||||||
'Shadow Conjuration, Greater', 'Simulacrum', 'Control Undead',
|
|
||||||
'Finger of Death', 'Symbol of Weakness', 'Waves of Exhaustion',
|
|
||||||
'Control Weather', 'Elemental Body IV', 'Ethereal Jaunt',
|
|
||||||
'Form of the Dragon II', 'Giant Form I', 'Plant Shape III',
|
|
||||||
'Polymorph, Greater', 'Reverse Gravity', 'Statue',
|
|
||||||
'Limited Wish'],
|
|
||||||
// level8
|
|
||||||
['Dimensional Lock',
|
|
||||||
'Mind Blank', 'Prismatic Wall', 'Protection from Spells',
|
|
||||||
'Incendiary Cloud', 'Maze', 'Planar Binding, Greater',
|
|
||||||
'Summon Monster VIII', 'Trap the Soul', 'Discern Location',
|
|
||||||
'Moment of Prescience', 'Prying Eyes, Greater', 'Antipathy',
|
|
||||||
'Binding', 'Charm Monster, Mass', 'Demand',
|
|
||||||
'Irresistible Dance', 'Power Word Stun', 'Symbol of Insanity',
|
|
||||||
'Sympathy', 'Clenched Fist', 'Polar Ray', 'Shout, Greater',
|
|
||||||
'Sunburst', 'Telekinetic Sphere', 'Scintillating Pattern',
|
|
||||||
'Screen', 'Shadow Evocation, Greater', 'Clone',
|
|
||||||
'Create Greater Undead', 'Horrid Wilting', 'Symbol of Death',
|
|
||||||
'Form of the Dragon III', 'Giant Form II', 'Iron Body',
|
|
||||||
'Polymorph Any Object', 'Temporal Stasis'],
|
|
||||||
// level9
|
|
||||||
['Freedom',
|
|
||||||
'Imprisonment', 'Mage\'s Disjunction', 'Prismatic Sphere',
|
|
||||||
'Gate', 'Refuge', 'Summon Monster IX', 'Teleportation Circle',
|
|
||||||
'Foresight', 'Dominate Monster', 'Hold Monster, Mass',
|
|
||||||
'Power Word Kill', 'Crushing Hand', 'Meteor Swarm', 'Shades',
|
|
||||||
'Weird', 'Astral Projection', 'Energy Drain', 'Soul Bind',
|
|
||||||
'Wail of the Banshee', 'Etherealness', 'Shapechange',
|
|
||||||
'Time Stop', 'Wish']
|
|
||||||
], //end arcaneSpells
|
|
||||||
|
|
||||||
'divine' : [
|
|
||||||
// divine spells contain all cleric and druid spells but only
|
|
||||||
// ONE instance at whichever LOWER spell level
|
|
||||||
// level 0
|
|
||||||
['Bleed',
|
|
||||||
'Create Water', 'Detect Magic', 'Detect Poison', 'Guidance',
|
|
||||||
'Light', 'Mending', 'Purify Food and Drink', 'Read Magic',
|
|
||||||
'Resistance', 'Stabilize', 'Virtue', 'Flare', 'Know Direction'],
|
|
||||||
// level1
|
|
||||||
['Bane',
|
|
||||||
'Bless', 'Bless Water', 'Cause Fear', 'Command',
|
|
||||||
'Comprehend Languages', 'Cure Light Wounds', 'Curse Water',
|
|
||||||
'Deathwatch', 'Detect Chaos', 'Detect Evil', 'Detect Good',
|
|
||||||
'Detect Law', 'Detect Undead', 'Divine Favor', 'Doom',
|
|
||||||
'Endure Elements', 'Entropic Shield', 'Hide from Undead',
|
|
||||||
'Inflict Light Wounds', 'Magic Stone', 'Magic Weapon',
|
|
||||||
'Obscuring Mist', 'Protection from Chaos',
|
|
||||||
'Protection from Evil', 'Protection from Good',
|
|
||||||
'Protection from Law', 'Remove Fear', 'Sanctuary',
|
|
||||||
'Shield of Faith', 'Summon Monster I', 'Calm Animals',
|
|
||||||
'Charm Animal', 'Detect Animals or Plants',
|
|
||||||
'Detect Snares and Pits', 'Entangle', 'Faerie Fire',
|
|
||||||
'Goodberry', 'Hide from Animals', 'Jump', 'Longstrider',
|
|
||||||
'Magic Fang', 'Pass without Trace', 'Produce Flame',
|
|
||||||
'Shillelagh', 'Speak with Animals', 'Summon Nature\'s Ally I'],
|
|
||||||
// level2
|
|
||||||
['Aid',
|
|
||||||
'Align Weapon', 'Augury', 'Bear\'s Endurance', 'Bull\'s Strength',
|
|
||||||
'Calm Emotions', 'Consecrate', 'Cure Moderate Wounds',
|
|
||||||
'Darkness', 'Death Knell', 'Delay Poison', 'Desecrate',
|
|
||||||
'Eagle\'s Splendor', 'Enthrall', 'Find Traps', 'Gentle Repose',
|
|
||||||
'Hold Person', 'Inflict Moderate Wounds', 'Make Whole',
|
|
||||||
'Owl\'s Wisdom', 'Remove Paralysis', 'Resist Energy',
|
|
||||||
'Restoration, Lesser', 'Shatter', 'Shield Other', 'Silence',
|
|
||||||
'Sound Burst', 'Spiritual Weapon', 'Status',
|
|
||||||
'Summon Monster II', 'Undetectable Alignment', 'Zone of Truth',
|
|
||||||
'Animal Messenger', 'Animal Trance', 'Barkskin', 'Cat\'s Grace',
|
|
||||||
'Chill Metal', 'Delay Poison', 'Fire Trap', 'Flame Blade',
|
|
||||||
'Flaming Sphere', 'Fog Cloud', 'Gust of Wind', 'Heat Metal',
|
|
||||||
'Hold Animal', 'Reduce Animal', 'Soften Earth and Stone',
|
|
||||||
'Spider Climb', 'Summon Nature\'s Ally II', 'Summon Swarm',
|
|
||||||
'Tree Shape', 'Warp Wood', 'Wood Shape'],
|
|
||||||
// level3
|
|
||||||
['Animate Dead',
|
|
||||||
'Bestow Curse', 'Blindness/Deafness', 'Contagion',
|
|
||||||
'Continual Flame', 'Create Food and Water',
|
|
||||||
'Cure Serious Wounds', 'Daylight', 'Deeper Darkness',
|
|
||||||
'Dispel Magic', 'Glyph of Warding', 'Helping Hand',
|
|
||||||
'Inflict Serious Wounds', 'Invisibility Purge', 'Locate Object',
|
|
||||||
'Magic Circle against Chaos', 'Magic Circle against Evil',
|
|
||||||
'Magic Circle against Good', 'Magic Circle against Law',
|
|
||||||
'Magic Vestment', 'Meld into Stone', 'Obscure Object', 'Prayer',
|
|
||||||
'Protection from Energy', 'Remove Blindness/Deafness',
|
|
||||||
'Remove Curse', 'Remove Disease', 'Searing Light',
|
|
||||||
'Speak with Dead', 'Stone Shape', 'Summon Monster III',
|
|
||||||
'Water Breathing', 'Water Walk', 'Wind Wall', 'Call Lightning',
|
|
||||||
'Diminish Plants', 'Dominate Animal', 'Magic Fang, Greater',
|
|
||||||
'Meld into Stone', 'Neutralize Poison', 'Plant Growth',
|
|
||||||
'Poison', 'Quench', 'Sleet Storm', 'Snare', 'Speak with Plants',
|
|
||||||
'Spike Growth', 'Summon Nature\'s Ally III'],
|
|
||||||
// level4
|
|
||||||
['Air Walk',
|
|
||||||
'Chaos Hammer', 'Control Water', 'Cure Critical Wounds',
|
|
||||||
'Death Ward', 'Dimensional Anchor', 'Discern Lies', 'Dismissal',
|
|
||||||
'Divination', 'Divine Power', 'Freedom of Movement',
|
|
||||||
'Giant Vermin', 'Holy Smite', 'Imbue with Spell Ability',
|
|
||||||
'Inflict Critical Wounds', 'Magic Weapon, Greater',
|
|
||||||
'Neutralize Poison', 'Order\'s Wrath', 'Planar Ally, Lesser',
|
|
||||||
'Poison', 'Repel Vermin', 'Restoration', 'Sending',
|
|
||||||
'Spell Immunity', 'Summon Monster IV', 'Tongues',
|
|
||||||
'Unholy Blight', 'Antiplant Shell', 'Blight', 'Command Plants',
|
|
||||||
'Flame Strike', 'Freedom of Movement', 'Giant Vermin',
|
|
||||||
'Ice Storm', 'Reincarnate', 'Repel Vermin', 'Rusting Grasp',
|
|
||||||
'Scrying', 'Spike Stones', 'Summon Nature\'s Ally IV'],
|
|
||||||
// level5
|
|
||||||
['Atonement',
|
|
||||||
'Break Enchantment', 'Breath of Life', 'Command, Greater',
|
|
||||||
'Commune', 'Cure Light Wounds, Mass', 'Dispel Chaos',
|
|
||||||
'Dispel Evil', 'Dispel Good', 'Dispel Law', 'Disrupting Weapon',
|
|
||||||
'Flame Strike', 'Hallow', 'Inflict Light Wounds, Mass',
|
|
||||||
'Insect Plague', 'Mark of Justice', 'Plane Shift', 'Raise Dead',
|
|
||||||
'Righteous Might', 'Slay Living', 'Spell Resistance',
|
|
||||||
'Summon Monster V', 'Symbol of Pain', 'Symbol of Sleep',
|
|
||||||
'True Seeing', 'Unhallow', 'Wall of Stone', 'Animal Growth',
|
|
||||||
'Awaken', 'Baleful Polymorph', 'Call Lightning Storm',
|
|
||||||
'Commune with Nature', 'Control Winds', 'Death Ward',
|
|
||||||
'Insect Plague', 'Stoneskin', 'Summon Nature\'s Ally V',
|
|
||||||
'Transmute Mud to Rock', 'Transmute Rock to Mud', 'Tree Stride',
|
|
||||||
'Wall of Fire', 'Wall of Thorns'],
|
|
||||||
// level6
|
|
||||||
['Animate Objects',
|
|
||||||
'Antilife Shell', 'Banishment', 'Bear\'s Endurance, Mass',
|
|
||||||
'Blade Barrier', 'Bull\'s Strength, Mass', 'Create Undead',
|
|
||||||
'Cure Moderate Wounds, Mass', 'Dispel Magic, Greater',
|
|
||||||
'Eagle\'s Splendor, Mass', 'Find the Path', 'Forbiddance',
|
|
||||||
'Geas/Quest', 'Glyph of Warding, Greater', 'Harm', 'Heal',
|
|
||||||
'Heroes\' Feast', 'Inflict Moderate Wounds, Mass',
|
|
||||||
'Owl\'s Wisdom, Mass', 'Planar Ally', 'Summon Monster VI',
|
|
||||||
'Symbol of Fear', 'Symbol of Persuasion', 'Undeath to Death',
|
|
||||||
'Wind Walk', 'Word of Recall', 'Antilife Shell',
|
|
||||||
'Cat\'s Grace, Mass', 'Fire Seeds', 'Ironwood', 'Liveoak',
|
|
||||||
'Move Earth', 'Owl\'s Wisdom, Mass', 'Repel Wood', 'Spellstaff',
|
|
||||||
'Stone Tell', 'Summon Nature\'s Ally VI', 'Transport via Plants',
|
|
||||||
'Wall of Stone'],
|
|
||||||
// level7
|
|
||||||
['Blasphemy',
|
|
||||||
'Control Weather', 'Cure Serious Wounds, Mass', 'Destruction',
|
|
||||||
'Dictum', 'Ethereal Jaunt', 'Holy Word',
|
|
||||||
'Inflict Serious Wounds, Mass', 'Refuge', 'Regenerate',
|
|
||||||
'Repulsion', 'Restoration, Greater', 'Resurrection',
|
|
||||||
'Scrying, Greater', 'Summon Monster VII', 'Symbol of Stunning',
|
|
||||||
'Symbol of Weakness', 'Word of Chaos', 'Animate Plants',
|
|
||||||
'Changestaff', 'Control Weather', 'Creeping Doom', 'Fire Storm',
|
|
||||||
'Summon Nature\'s Ally VII', 'Sunbeam',
|
|
||||||
'Transmute Metal to Wood', 'True Seeing'],
|
|
||||||
// level8
|
|
||||||
['Antimagic Field',
|
|
||||||
'Cloak of Chaos', 'Create Greater Undead',
|
|
||||||
'Cure Critical Wounds, Mass', 'Dimensional Lock',
|
|
||||||
'Discern Location', 'Earthquake', 'Fire Storm', 'Holy Aura',
|
|
||||||
'Inflict Critical Wounds, Mass', 'Planar Ally, Greater',
|
|
||||||
'Shield of Law', 'Spell Immunity, Greater',
|
|
||||||
'Summon Monster VIII', 'Symbol of Death', 'Symbol of Insanity',
|
|
||||||
'Unholy Aura', 'Animal Shapes', 'Control Plants',
|
|
||||||
'Finger of Death', 'Repel Metal or Stone', 'Reverse Gravity',
|
|
||||||
'Summon Nature\'s Ally VIII', 'Sunburst', 'Whirlwind',
|
|
||||||
'Word of Recall'],
|
|
||||||
// level9
|
|
||||||
['Astral Projection',
|
|
||||||
'Energy Drain', 'Etherealness', 'Gate', 'Heal, Mass',
|
|
||||||
'Implosion', 'Miracle', 'Soul Bind', 'Storm of Vengeance',
|
|
||||||
'Summon Monster IX', 'True Resurrection', 'Antipathy',
|
|
||||||
'Elemental Swarm', 'Foresight', 'Regenerate', 'Shambler',
|
|
||||||
'Shapechange', 'Summon Nature\'s Ally IX', 'Sympathy']
|
|
||||||
] //end divine
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'Advanced Player Guide',
|
|
||||||
'shortName': 'APG',
|
|
||||||
'baseUrl': '',
|
|
||||||
'arcane': [
|
|
||||||
//level0
|
|
||||||
['Sift', 'Spark', 'Unwitting Ally', 'Message', 'Acid Splash', 'Ray of Frost', 'Putrefy Food and Drink'],
|
|
||||||
//level1
|
|
||||||
['Beguiling Gift', 'Borrow Skill', 'Dancing Lantern', 'Feather Step', 'Flare Burst', 'Innocence', 'Invigorate', 'Memory Lapse',
|
|
||||||
'Restful Sleep', 'Saving Finale', 'Share Language', 'Solid Note', 'Timely Inspiration', 'Touch of Gracelessness', 'Vanish', 'Alter Winds', 'Feather Fall',
|
|
||||||
'Shocking Grasp', 'Expeditious Excavation', 'Grease', 'Stone Fist', 'Burning Hands', 'Hydraulic Push', 'Obscuring Mist', 'Touch of the Sea', 'Ant Haul',
|
|
||||||
'Break', 'Crafter\'s Curse', 'Crafter\'s Fortune', 'Gravity Bow', 'Sculpt Corpse', 'Stumble Gap', 'Rejuvenate Eidolon, Lesser', 'Unfetter', 'Ill Omen',
|
|
||||||
'Mask Dweomer'],
|
|
||||||
//level2
|
|
||||||
['Blood Biography', 'Cacophonous Call', 'Create Treasure Map', 'Dust of Twilight', 'Enter Image', 'Gallant Inspiration',
|
|
||||||
'Ghostbane Dirge', 'Hidden Speech', 'Honeyed Tongue', 'Versatile Weapon', 'Elemental Speech', 'Elemental Touch', 'Resist Energy', 'Summon Monster II',
|
|
||||||
'Glide', 'Gust of Wind', 'Levitate', 'Whispering Wind', 'Acid Arrow', 'Create Pit', 'Glitterdust', 'Shatter', 'Stone Call', 'Burning Gaze', 'Fire Breath',
|
|
||||||
'Flaming Sphere', 'Pyrotechnics', 'Scorching Ray', 'Accelerate Poison', 'Fog Cloud', 'Slipstream', 'Arrow Eruption', 'Create Treasure Map', 'Share Language',
|
|
||||||
'Create Pit', 'Evolution Surge, Lesser', 'Summon Eidolon', 'Feast of Ashes', 'Fester', 'Perceive Cues', 'Pox Pustules', 'Vomit Swarm'],
|
|
||||||
//level3
|
|
||||||
['Arcane Concordance', 'Campfire Wall', 'Coordinated Effort', 'Elemental Speech', 'Feather Step, Mass', 'Invigorate, Mass',
|
|
||||||
'Jester\'s Jaunt', 'Purging Finale', 'Reviving Finale', 'Seek Thoughts', 'Thunderous Drums', 'Draconic Reservoir', 'Elemental Aura', 'Protection From Energy',
|
|
||||||
'Cloak of Winds', 'Fly', 'Gaseous Form', 'Lightning Bolt', 'Wind Wall', 'Shifting Sand', 'Spiked Pit', 'Stinking Cloud', 'Fireball', 'Flame Arrow', 'Aqueous Orb',
|
|
||||||
'Hydraulic Torrent', 'Sleet Storm', 'Water Breathing', 'Blood Biography', 'Devolution', 'Enter Image', 'Pain Strike', 'Twilight Knife', 'Versatile Weapon',
|
|
||||||
'Evolution Surge', 'Rejuvenate Eidolon', 'Cup of Dust', 'Guiding Star', 'Nature\'s Exile', 'Screech', 'Share Senses'],
|
|
||||||
//level4
|
|
||||||
['Denounce', 'Discordant Blast', 'Ghostbane Dirge, Mass', 'Heroic Finale', 'Treasure Stitching', 'Wandering Star Motes', 'Detonate',
|
|
||||||
'Dragon\'s Breath', 'Elemental Body I', 'Summon Monster IV', 'Ball Lightning', 'River of Wind', 'Shout', 'Acid Pit', 'Calcific Touch', 'Stone Shape', 'Stoneskin',
|
|
||||||
'Fire Shield', 'Fire Trap', 'Firefall', 'Wall of Fire', 'Ice Storm', 'Solid Fog', 'Wall of Ice', 'Acid Pit', 'Detonate', 'Moonstruck', 'Shadow Projection',
|
|
||||||
'Share Senses', 'True Form', 'Evolution Surge, Greater', 'Purified Calling', 'Transmogrify', 'Sleepwalk', 'Spite', 'Threefold Aspect'],
|
|
||||||
//level5
|
|
||||||
['Bard\'s Escape', 'Cacophonous Call, Mass', 'Cloak of Dreams', 'Deafening Song Bolt', 'Foe to Friend', 'Frozen Note', 'Phantasmal Web',
|
|
||||||
'Stunning Finale', 'Unwilling Shield', 'Elemental Body II', 'Planar Adaptation', 'Planar Binding, Lesser', 'Summon Monster V', 'Overland Flight', 'Suffocation',
|
|
||||||
'Hungry Pit', 'Passwall', 'Transmute Mud to Rock', 'Transmute Rock to Mud', 'Wall of Stone', 'Fire Snake', 'Geyser', 'Cloudkill', 'Cone of Cold',
|
|
||||||
'Life Bubble', 'Pain Strike, Mass', 'Treasure Stitching', 'Rejuvenate Eidolon, Greater', 'Banish Seeming', 'Rest Eternal'],
|
|
||||||
//level6
|
|
||||||
['Brilliant Inspiration', 'Deadly Finale', 'Euphoric Tranquility', 'Fool\'s Forbiddance', 'Getaway', 'Pied Piping', 'Elemental Body III',
|
|
||||||
'Planar Binding', 'Summon Monster VI', 'Chain Lightning', 'Sirocco', 'Acid Fog', 'Flesh to Stone', 'Move Earth', 'Stone to Flesh', 'Wall of Iron',
|
|
||||||
'Contagious Flame', 'Fluid Form', 'Freezing Sphere', 'Cloak of Dreams', 'Enemy Hammer', 'Unwilling Shield', 'Planar Adaptation, Mass', 'Fester, Mass',
|
|
||||||
'Swarm Skin'],
|
|
||||||
//level7
|
|
||||||
['Elemental Body IV', 'Planar Adaptation, Mass', 'Summon Monster VII', 'Control Weather', 'Fly, Mass', 'Rampart', 'Reverse Gravity',
|
|
||||||
'Statue', 'Delayed Blast Fireball', 'Firebrand', 'Vortex', 'Deflection', 'Expend', 'Phantasmal Revenge'],
|
|
||||||
//level8
|
|
||||||
['Planar Binding, Greater', 'Summon Monster VII', 'Shout, Greater', 'Stormbolts', 'Iron Body', 'Wall of Lava', 'Incendiary Cloud',
|
|
||||||
'Horrid Wilting', 'Polar Ray', 'Seamantle', 'Euphoric Tranquility'],
|
|
||||||
//level9
|
|
||||||
['Gate', 'Suffocation, Mass', 'Winds of Vengeance', 'Clashing Rocks', 'World Wave', 'Fiery Body', 'Meteor Swarm', 'Tsunami', 'Tsunami',
|
|
||||||
'Wall of SuppressionM'],
|
|
||||||
],
|
|
||||||
'divine' : [
|
|
||||||
//divine spells contain all cleric/druid/inquisitor/paladin/ranger spells but only ONE instance at whichever LOWER spell level
|
|
||||||
//level0
|
|
||||||
['Spark', 'Brand', 'Sift'],
|
|
||||||
//level1
|
|
||||||
['Ant Haul', 'Dancing Lantern', 'Alter Winds', 'Aspect of the Falcon', 'Bristle', 'Call Animal', 'Cloak of Shade', 'Detect Aberration',
|
|
||||||
'Expeditious Excavation', 'Feather Step', 'Flare Burst', 'Hydraulic Push', 'Keen Senses', 'Negate Aroma', 'Stone Fist', 'Touch of the Sea', 'Burst Bonds',
|
|
||||||
'Tireless Pursuit', 'Wrath', 'Challenge Evil', 'Ghostbane Dirge', 'Grace', 'Hero\'s Defiance', 'Honeyed Tongue', 'Knight\'s Calling', 'Rally Point',
|
|
||||||
'Veil of Positive Energy', 'Glide', 'Gravity Bow', 'Hunter\'s Howl', 'Lead Blades', 'Residual Tracking'],
|
|
||||||
//level2
|
|
||||||
['Blessing of Courage and Life', 'Ghostbane Dirge', 'Grace', 'Instant Armor', 'Oracle\'s Burden', 'Share Language', 'Weapon of Awe',
|
|
||||||
'Accelerate Poison', 'Aspect of the Bear', 'Burning Gaze', 'Campfire Wall', 'Eagle Eye', 'Elemental Speech', 'Feast of Ashes', 'Glide', 'Lockjaw',
|
|
||||||
'Natural Rhythm', 'Pox Pustules', 'Scent Trail', 'Slipstream', 'Stone Call', 'Bloodhound', 'Castigate', 'Confess', 'Corruption Resistance',
|
|
||||||
'Flames of the Faithful', 'Follow Aura', 'Honeyed Tongue', 'Perceive Cues', 'Sacred Bond', 'Aura of Greater Courage', 'Bestow Grace', 'Fire of Entanglement',
|
|
||||||
'Light Lance', 'Paladin\'s Sacrifice', 'Righteous Vigor', 'Saddle Surge', 'Wake of Light', 'Allfood', 'Arrow Eruption', 'Chameleon Stride',
|
|
||||||
'Create Treasure Map', 'Guiding Star', 'Hide Campsite', 'Hunter\'s Eye', 'Protective Spirit', 'Versatile Weapon'],
|
|
||||||
//level3
|
|
||||||
['Blood Biography', 'Borrow Fortune', 'Elemental Speech', 'Enter Image', 'Guiding Star', 'Nap Stack', 'Sacred Bond', 'Wrathful Mantle',
|
|
||||||
'Aqueous Orb', 'Cloak of Winds', 'Create Treasure Map', 'Cup of Dust', 'Feather Step, Mass', 'Hide Campsite', 'Hydraulic Torrent', 'Lily Pad Stride',
|
|
||||||
'Nature\'s Exile', 'Shifting Sand', 'Banish Seeming', 'Cast Out', 'Coordinated Effort', 'Fester', 'Hidden Speech', 'Hunter\'s Eye', 'Retribution',
|
|
||||||
'Righteous Vigor', 'Seek Thoughts', 'Ward the Faithful', 'Divine Transfer', 'Fire of Judgment', 'Ghostbane Dirge, Mass', 'Holy Whisper',
|
|
||||||
'Marks of Forbiddance', 'Sanctify Armor', 'Aspect of the Stag', 'Bloody Claws', 'Instant Enemy', 'Life Bubble', 'Strong Jaw', 'Tireless Pursuers',
|
|
||||||
'Venomous Bolt'],
|
|
||||||
//level4
|
|
||||||
['Blessing of Fervor', 'Planar Adaptation', 'Rest Eternal', 'Spiritual Ally', 'Aspect of the Stag', 'Ball Lightning', 'Bloody Claws',
|
|
||||||
'Geyser', 'Grove of Respite', 'Life Bubble', 'Moonstruck', 'River of Wind', 'Strong Jaw', 'Thorn Body', 'True Form', 'Brand, Greater', 'Coward\'s Lament',
|
|
||||||
'Defile Armor', 'Denounce', 'Forced Repentance', 'Rebuke', 'Sanctify Armor', 'Shared Wrath', 'Sleepwalk', 'Tireless Pursuers', 'Blaze of Glory',
|
|
||||||
'Fire of Vengeance', 'King\'s Castle', 'Oath of Peace', 'Resounding Blow', 'Sacrificial Oath', 'Stay the Hand', 'Aspect of the Wolf',
|
|
||||||
'Blessing of the Salamander', 'Bow Spirit'],
|
|
||||||
//level5
|
|
||||||
['Cleanse', 'Ghostbane Dirge, Mass', 'Life Bubble', 'Pillar of Life', 'Snake Staff', 'Treasure Stitching', 'Aspect of the Wolf',
|
|
||||||
'Blessing of the Salamander', 'Fire Snake', 'Rest Eternal', 'Threefold Aspect', 'Castigate, Mass', 'Resounding Blow', 'Unwilling Shield'],
|
|
||||||
//level6
|
|
||||||
['Planar Adaptation, Mass', 'Sirocco', 'Swarm Skin', 'Cleanse', 'Fester, Mass'],
|
|
||||||
//level7
|
|
||||||
['Rampart', 'Vortex'],
|
|
||||||
//level8
|
|
||||||
['Divine Vessel', 'Euphoric Tranquility', 'Stormbolts', 'Seamantle', 'Wall of Lava'],
|
|
||||||
//level9
|
|
||||||
['Winds of Vengeance', 'Clashing Rocks', 'Tsunami', 'World Wave'],
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'Ultimate Magic',
|
|
||||||
'shortName': 'UM',
|
|
||||||
'baseUrl': '',
|
|
||||||
'arcane': [
|
|
||||||
//arcane spells contain all Wizard/Sorcerer/Bard/Magus/Summoner/Witch spells.
|
|
||||||
//level0
|
|
||||||
[],
|
|
||||||
//level1
|
|
||||||
['Anticipate Peril', 'Chord of Shards', 'Delusional Pride', 'Ear-Piercing Scream', 'Forced Quiet', 'Fumbletongue', 'Horn of Pursuit', 'Ki Arrow', 'Play Instrument', 'Summon Minor Monster', 'Unnatural Lust', 'Unprepared Combatant', 'Vocal Alteration', 'Youthful Appearance', 'Corrosive Touch', 'Frostbite', 'Bungle', 'Decompose Corpse', 'Icicle Dagger', 'Interrogation', 'Polypurpose Panacea', 'Ray of Sickening', 'Restore Corpse', 'Shadow Weapon', 'Snapdragon Fireworks', 'Diagnose Disease', 'Hex Ward', 'Remove Sickness', 'Sanctify Corpse'],
|
|
||||||
//level2
|
|
||||||
['Acute Senses', 'Allegro', 'Boiling Blood', 'Compassionate Ally', 'Delay Pain', 'Disguise Other', 'Distracting Cacophony', 'Distressing Tone', 'Ghostly Disguise', 'Haunting Mists', 'Mad Hallucination', 'Masterwork Transformation', 'Miserable Pity', 'Oppressive Boredom', 'Piercing Shriek', 'Reckless Infatuation', 'Share Memory', 'Silk to Steel', 'Snapdragon Fireworks', 'Steal Voice', 'Unadulterated Loathing', 'Wartrain Mount', 'Blood Transcription', 'Defensive Shock', 'Frigid Touch', 'Badger\'s Ferocity', 'Cushioning Bands', 'Disfiguring Touch ', 'Pernicious Poison', 'Protective Penumbra', 'Sculpt Simulacrum', 'Silk To Steel', 'Skinsend', 'Symbol of Mirroring', 'Unnatural Lust', 'Unshakable Chill', 'Web Shelter', 'Restore Eidolon, Lesser'],
|
|
||||||
//level3
|
|
||||||
['Control Summoned Creature', 'Curse of Disgust', 'Exquisite Accompaniment', 'Rain of Frogs', 'Haunting Choir', 'Mad Monkeys', 'Malicious Spite', 'Overwhelming Grief', 'Smug Narcissism', 'Terrible Remorse', 'Vision of Hell', 'Witness', 'Force Hook Charge', 'Force Punch', 'Monstrous Physique I', 'Undead Anatomy I', 'Animate Dead, Lesser', 'Anthropomorphic Animal', 'Ash Storm', 'Burrow', 'Countless Eyes', 'Distracting Cacophony', 'Eldritch Fever', 'Eruptive Pustules', 'Excruciating Deformation', 'Howling Agony', 'Ki Leech', 'Loathsome Veil', 'Marionette Possession', 'Reckless Infatuation', 'Sands of Time', 'Strangling Hair', 'Toxic Gift', 'Unadulterated Loathing', 'Agonize', 'Restore Eidolon', 'Cackling Skull', 'Spit Venom', 'Vermin Shape I'],
|
|
||||||
//level4
|
|
||||||
['Dance of a Hundred Cuts', 'Daze, Mass', 'Echolocation', 'Envious Urge', 'Primal Scream', 'Serenity', 'Shadow Step', 'Sonic Thrust', 'Utter Contempt', 'Virtuoso Performance', 'Wall of Sound', 'Arcana Theft', 'Monstrous Physique II', 'Vermin Shape I', 'Age Resistance, Lesser', 'Agonize', 'Control Summoned Creature', 'Curse of Magic Negation', 'Darkvision, Greater', 'False Life, Greater', 'Familiar Melding', 'Fleshworm Infestation', 'Malfunction', 'Malicious Spite', 'Overwhelming Grief', 'Ride the Waves', 'Simulacrum, Lesser', 'Symbol of Revelation', 'Symbol of Slowing', 'Terrible Remorse', 'Touch of Slime', 'Vitriolic Mist', 'Volcanic Storm', 'Cape of Wasps', 'Symbol of Healing', 'Vermin Shape II'],
|
|
||||||
//level5
|
|
||||||
['Joyful Rapture', 'Ki Shout', 'Resonating Word', 'Shadowbard', 'Vengeful Outrage', 'Acidic Spray', 'Corrosive Consumption', 'Monstrous Physique III', 'Undead Anatomy II', 'Vermin Shape II', 'Astral Projection, Lesser', 'Curse of Disgust', 'Echolocation', 'Fickle Winds', 'Icy Prison', 'Lightning Arc', 'Plague Carrier', 'Possess Object', 'Rapid Repair', 'Smug Narcissism', 'Sonic Thrust', 'Soothe Construct', 'Symbol of Scrying', 'Unbreakable Construct', 'Wall of Sound', 'Conjure Black Pudding', 'Create Demiplane, Lesser', 'Ice Crystal Teleport', 'Contagion, Greater', 'Curse, Major'],
|
|
||||||
//level6
|
|
||||||
['Dance of a Thousand Cuts', 'Overwhelming Presence', 'Waves of Ecstasy', 'Monstrous Physique IV', 'Undead Anatomy III', 'Age Resistance', 'Battlemind Link', 'Cold Ice Strike', 'Conjure Black Pudding', 'Contagion, Greater', 'Curse, Major', 'Envious Urge', 'Ice Crystal Teleport', 'Leashed Shackles ', 'Serenity', 'Symbol of Sealing', 'Utter Contempt', 'Vengeful Outrage', 'Create Demiplane', 'Eagle Aerie', 'Epidemic', 'Plague Storm'],
|
|
||||||
//level7
|
|
||||||
['Age Resistance, Greater', 'Caustic Eruption', 'Circle of Clarity', 'Control Construct', 'Create Demiplane, Lesser', 'Epidemic', 'Ice Body', 'Joyful Rapture', 'Ki Shout', 'Lunar Veil', 'Plague Storm', 'Resonating Word', 'Scouring Winds', 'Temporary Resurrection', 'Waves of Ecstasy', 'Waves of Ecstasy'],
|
|
||||||
//level8
|
|
||||||
['Call Construct', 'Create Demiplane', 'Orb of the Void', 'Prediction of Failure', 'Undead Anatomy IV'],
|
|
||||||
//level9
|
|
||||||
['Create Demiplane, Greater', 'Cursed Earth', 'Icy Prison, Mass', 'Interplanetary Teleport', 'Overwhelming Presence', 'Ride the Lightning', 'Symbol of Strife', 'Symbol of Vulnerability', 'Transmute Blood to Acid', 'Wooden Phalanx', 'Polar Midnight',],
|
|
||||||
],
|
|
||||||
|
|
||||||
'divine': [
|
|
||||||
//divine spells contain all cleric/druid/inquisitor/paladin/ranger spells but only ONE instance at whichever LOWER spell level
|
|
||||||
//level0
|
|
||||||
[],
|
|
||||||
//level1
|
|
||||||
['Decompose Corpse', 'Diagnose Disease', 'Forbid Action', 'Know the Enemy', 'Murderous Command', 'Ray of Sickening', 'Remove Sickness', 'Restore Corpse', 'Sanctify Corpse', 'Summon Minor Monster', 'Frostbite', 'Summon Minor Ally', 'Ear-Piercing Scream', 'Forced Quiet', 'Hex Ward', 'Horn of Pursuit', 'Interrogation', 'Lend Judgment', 'Persuasive Goad', 'Vocal Alteration', 'Wartrain Mount', 'Wartrain Mount', 'Word of Resolve', 'Anticipate Peril'],
|
|
||||||
//level2
|
|
||||||
['Animate Dead, Lesser', 'Arrow of Law', 'Boiling Blood', 'Compassionate Ally', 'Delay Pain', 'Disfiguring Touch', 'Dread Bolt', 'Imbue with Aura', 'Masterwork Transformation', 'Protective Penumbra', 'Shard of Chaos', 'Spear of Purity', 'Surmount Affliction', 'Web Shelter', 'Frigid Touch', 'Pernicious Poison', 'Tar Ball', 'Unshakable Chill', 'Wartrain Mount', 'Acute Senses', 'Disguise Other', 'Distressing Tone', 'Ghostly Disguise', 'Howling Agony', 'Holy Shield', 'Vestment of the Champion', 'Badger\'s Ferocity'],
|
|
||||||
//level3
|
|
||||||
['Agonize', 'Archon\'s Aura', 'Badger\'s Ferocity', 'Blessing of the Mole', 'Ki Leech', 'Sands of Time', 'Symbol of Healing', 'Vision of Hell', 'Anthropomorphic Animal', 'Ash Storm', 'Burrow', 'Burst of Nettles', 'Fungal Infestation', 'Mad Monkeys', 'Rain of Frogs', 'Spit Venom', 'Vermin Shape I', 'Countless Eyes', 'Eldritch Fever', 'Terrible Remorse', 'Witness', 'Blade of Bright Victory', 'Fickle Winds'],
|
|
||||||
//level4
|
|
||||||
['Aura of Doom', 'Blood Crow Strike', 'Control Summoned Creature', 'Fleshworm Infestation', 'Oracle\'s Vessel', 'Plague Carrier', 'Ride the Waves', 'Soothe Construct', 'Spit Venom', 'Symbol of Revelation', 'Symbol of Slowing', 'Terrible Remorse', 'Age Resistance, Lesser', 'Arboreal Hammer', 'Atavism', 'Cape of Wasps', 'Echolocation', 'Touch of Slime', 'Vermin Shape II', 'Volcanic Storm', 'Battlemind Link', 'Curse of Magic Negation', 'Daze, Mass', 'Interrogation, Greater', 'Leashed Shackles ', 'Reprobation', 'Bestow Grace of the Champion', 'Raise Animal Companion', 'Symbol of Healing', 'Darkvision, Greater'],
|
|
||||||
//level5
|
|
||||||
['Astral Projection, Lesser', 'Contagion, Greater', 'Curse of Magic Negation', 'Curse, Major', 'Fickle Winds', 'Forbid Action, Greater', 'Holy Ice', 'Rapid Repair', 'Reprobation', 'Serenity', 'Symbol of Scrying', 'Unholy Ice', 'Raise Animal Companion', 'Divine Pursuit', 'Lend Greater Judgment'],
|
|
||||||
//level6
|
|
||||||
['Cold Ice Strike', 'Epidemic', 'Joyful Rapture', 'Plague Storm', 'Symbol of Sealing', 'Age Resistance', 'Eagle Aerie', 'Overwhelming Presence'],
|
|
||||||
//level7
|
|
||||||
['Bestow Grace of the Champion', 'Circle of Clarity', 'Create Demiplane, Lesser', 'Lunar Veil', 'Waves of Ecstasy', 'Call Construct', 'Create Demiplane', 'Orb of the Void', 'Age Resistance, Greater', 'Scouring Winds'],
|
|
||||||
//level8
|
|
||||||
['Atavism, Mass', 'Blood Mist'],
|
|
||||||
//level9
|
|
||||||
['Create Demiplane, Greater', 'Cursed Earth', 'Interplanetary Teleport', 'Overwhelming Presence', 'Polar Midnight', 'Symbol of Strife', 'Symbol of Vulnerability', 'Wooden Phalanx', 'Summon Elder Worm', 'Summon Froghemoth'],
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'name': 'Ultimate Combat',
|
|
||||||
'shortName': 'UC',
|
|
||||||
'baseUrl': '',
|
|
||||||
'arcane': [
|
|
||||||
//level0
|
|
||||||
['Haunted Fey Aspect', ],
|
|
||||||
//level1
|
|
||||||
['Adjuring Step', 'Abundant Ammunition', 'Adoration', 'Compel Hostility', 'Deadeye\'s Lore', 'Jury-Rig', 'Liberating Command', 'Lock Gaze', 'Moment of Greatness', 'Negative Reaction', 'See Alignment', 'Illusion of Calm', 'Longshot', 'Mirror Strike', 'Reinforce Armaments', 'Returning Weapon', 'Shock Shield', 'Unerring Weapon', 'Warding Weapon', 'Air Bubble', 'Damp Powder', 'Fabricate Bullets', 'Peacebond', 'Weaken Powder', 'Life Conduit', ],
|
|
||||||
//level2
|
|
||||||
['Blistering Invective', 'Discovery Torch', 'Pilfering Hand', 'Qualm', 'Returning Weapon', 'Share Language, Communal', 'Tactical Acumen', 'Thunder Fire', 'Adoration', 'Animal Aspect', 'Ant Haul, Communal', 'Bestow Weapon Proficiency', 'Brow Gasher', 'Bullet Shield', 'Certain Grip', 'Destabilize Powder', 'Endure Elements, Communal', 'Fiery Shuriken', 'Frost Fall', 'Kinetic Reverberation', 'Magic Siege Engine', 'Mount, Communal', 'Reloading Hands', 'Protection from Chaos, Communal', 'Protection from Evil, Communal', 'Protection from Good, Communal', 'Protection from Law, Communal', 'Recoil Fire', 'Reinforce Armaments, Communal', 'Ricochet Shot', 'Spontaneous Immolation', 'Stabilize Powder', 'Telekinetic Assembly', 'Twisted Space', 'Warding Weapon', 'Ablative Barrier', 'Mask Dweomer, Communal', ],
|
|
||||||
//level3
|
|
||||||
['Delay Poison, Communal', 'Phantom Driver', 'Returning Weapon, Communal', 'Tongues, Communal', 'Ablative Barrier', 'Animal Aspect', 'Bestow Weapon Proficiency', 'Brow Gasher', 'Effortless Armor', 'Mount, Communal', 'Pilfering Hand', 'Reloading Hands', 'Reinforce Armaments, Communal', 'Tactical Acumen', 'Telekinetic Assembly', 'Twisted Space', 'Animal Aspect, Greater', 'Burst of Speed', 'Locate Weakness', 'Chain of Perdition', 'Darkvision, Communal', 'Flash Fire', 'Healing Thief', 'Hostile Levitation', 'Pellet Blast', 'Protection from Arrows, Communal', 'Pup Shape', 'Resinous Skin', 'Resist Energy, Communal', 'Share Language, Communal', 'Spider Climb, Communal', 'Touch Injection', 'Life Conduit, Improved', 'Obsidian Flow', 'Phantom Chariot', 'Phantom Steed, Communal', ],
|
|
||||||
//level4
|
|
||||||
['Phantom Steed, Communal', 'Shocking Image', 'Pellet Blast', 'Wreath of Blades', 'Animal Aspect, Greater', 'Magic Siege Engine, Greater', 'Named Bullet', 'Nondetection, Communal', 'Obsidian Flow', 'Phantom Chariot', 'Protection from Energy, Communal', 'Telekinetic Charge', 'Tongues, Communal', 'Hostile Juxtaposition', 'Stoneskin, Communal', 'Summoner Conduit', 'Absorb Toxicity', 'Debilitating Portent', ],
|
|
||||||
//level5
|
|
||||||
['Symbol of Striking', 'Absorb Toxicity', 'Energy Siege Shot', 'Hostile Juxtaposition', 'Stoneskin, Communal', 'Summoner Conduit', 'Wreath of Blades', 'Life Conduit, Greater', 'Tar Pool', ],
|
|
||||||
//level6
|
|
||||||
['Walk through Space', 'Energy Siege Shot, Greater', 'Named Bullet, Greater', 'Tar Pool', 'Hostile Juxtaposition, Greater', 'Dust Form', ],
|
|
||||||
//level7
|
|
||||||
['Arcane Cannon', 'Hostile Juxtaposition, Greater', 'Walk through Space', 'Walk through Space', ],
|
|
||||||
//level8
|
|
||||||
['Frightful Aspect', ],
|
|
||||||
//level9
|
|
||||||
['Heroic Invocation', 'Mind Blank, Communal',],
|
|
||||||
],
|
|
||||||
'divine': [
|
|
||||||
//divine spells contain all cleric/druid/inquisitor/paladin/ranger spells but only ONE instance at whichever LOWER spell level
|
|
||||||
//level0
|
|
||||||
[],
|
|
||||||
//level1
|
|
||||||
['Abundant Ammunition', 'Air Bubble', 'Compel Hostility', 'Deadeye\'s Lore', 'Liberating Command', 'Moment of Greatness', 'Reinforce Armaments', 'Sun Metal', 'Damp Powder', 'Weaken Powder', 'Bowstaff', 'Litany of Sloth', 'Litany of Weakness', 'Lock Gaze', 'Longshot', 'Peacebond', 'Returning Weapon', 'Unerring Weapon', 'Tactical Acumen', ],
|
|
||||||
//level2
|
|
||||||
['Ant Haul, Communal', 'Bestow Weapon Proficiency', 'Effortless Armor', 'Endure Elements, Communal', 'Instrument of Agony', 'Magic Siege Engine', 'Pilfering Hand', 'Protection from Chaos, Communal', 'Protection from Evil, Communal', 'Protection from Good, Communal', 'Protection from Law, Communal', 'Reinforce Armaments, Communal', 'Returning Weapon', 'Animal Aspect', 'Certain Grip', 'Forest Friend', 'Frost Fall', 'Wilderness Soldiers', 'Blistering Invective', 'Brow Gasher', 'Discovery Torch', 'Litany of Defense', 'Qualm', 'Returning Weapon, Communal', 'Tactical Acumen', 'Divine Arrow', 'Litany of Eloquence', 'Litany of Entanglement', 'Litany of Righteousness', 'Litany of Warding', 'Locate Weakness', 'Reloading Hands', 'Ricochet Shot', ],
|
|
||||||
//level3
|
|
||||||
['Chain of Perdition', 'Daybreak Arrow', 'Deadly Juggernaut', 'Delay Poison, Communal', 'Discovery Torch', 'Resist Energy, Communal', 'Returning Weapon, Communal', 'Share Language, Communal', 'Animal Aspect, Greater', 'Companion Mind Link', 'Pup Shape', 'Resinous Skin', 'Spider Climb, Communal', 'Burst of Speed', 'Litany of Eloquence', 'Litany of Entanglement', 'Litany of Righteousness', 'Litany of Warding', 'Locate Weakness', 'Litany of Escape', 'Litany of Sight', 'Named Bullet', 'Protection from Energy, Communal', ],
|
|
||||||
//level4
|
|
||||||
['Debilitating Portent', 'Protection from Energy, Communal', 'Summoner Conduit', 'Water Walk, Communal', 'Absorb Toxicity', 'Obsidian Flow', 'Find Quarry', 'Judgment Light', 'Litany of Escape', 'Litany of Sight', 'Magic Siege Engine, Greater', 'Named Bullet', 'Litany of Thunder', 'Litany of Vengeance', 'Darkvision, Communal', 'Named Bullet, Greater', 'Terrain Bond'],
|
|
||||||
//level5
|
|
||||||
['Air Walk, Communal', 'Magic Siege Engine, Greater', 'Spell Immunity, Communal', 'Symbol of Striking', 'Tongues, Communal', 'Litany of Thunder', 'Litany of Vengeance', 'Stoneskin, Communal', ],
|
|
||||||
//level6
|
|
||||||
['Dust Form', 'Stoneskin, Communal', 'Tar Pool', 'Litany of Madness', 'Named Bullet, Greater'],
|
|
||||||
//level7
|
|
||||||
['Jolting Portent', 'Siege of Trees', ],
|
|
||||||
//level8
|
|
||||||
['Frightful Aspect', ],
|
|
||||||
//level9
|
|
||||||
['Spell Immunity, Greater Communal', 'Siege of Trees, Greater'],
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]; //end return
|
|
||||||
};
|
|
||||||
|
|
||||||
Spells.getLevelSpell = function(level, type, source) {
|
|
||||||
if(type === undefined) type = _.random(0,1) ? 'arcane' : 'divine';
|
|
||||||
//valid values CRB, APG, UM, UC
|
|
||||||
var sourceSpells = [];
|
|
||||||
var spell = '';
|
|
||||||
|
|
||||||
if(source === undefined) {
|
|
||||||
_.forEach(Spells.getSpells(), function(s) {
|
|
||||||
sourceSpells = _(sourceSpells).concat(s[type][level]).value();
|
|
||||||
});
|
|
||||||
spell = _.sample(sourceSpells);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
sourceSpells = _.findWhere(Spells.getSpells(), function(s) {
|
|
||||||
return s.shortName == source.toUpperCase();
|
|
||||||
});
|
|
||||||
spell = _.sample(sourceSpells[type][level]);
|
|
||||||
}
|
|
||||||
return {'name': spell, 'level': level, 'type': type, 'source': ''};
|
|
||||||
};
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/*global _:false */
|
|
||||||
/*global Spells:true */
|
|
||||||
'use strict';
|
|
||||||
var Wands = {};
|
|
||||||
|
|
||||||
Wands.cost = [375, 750, 4500, 11250, 21000];
|
|
||||||
|
|
||||||
Wands.getLevelWand = function(level) {
|
|
||||||
if(level < 0 || level > 4) return;
|
|
||||||
var spell = Spells.getLevelSpell(level, 'arcane');
|
|
||||||
return {'name': 'Wand of ' + spell.name,
|
|
||||||
'description': '(spell level ' + level + ', caster level ' + _.max([1, (level*2-1)]) + ', 50 charges)',
|
|
||||||
'cost': Wands.cost[level]
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
Wands.getWand = function(type) {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
if(type == 'minor') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 5): return Wands.getLevelWand(0);
|
|
||||||
case (roll <= 60): return Wands.getLevelWand(1);
|
|
||||||
case (roll <= 100): return Wands.getLevelWand(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 60): return Wands.getLevelWand(2);
|
|
||||||
case (roll <= 100): return Wands.getLevelWand(3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 60): return Wands.getLevelWand(3);
|
|
||||||
case (roll <= 100): return Wands.getLevelWand(4);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
-565
@@ -1,565 +0,0 @@
|
|||||||
/*global _:false, console:false */
|
|
||||||
/*global Grimoire:true, Intelligence:true */
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
var Weapons = {};
|
|
||||||
Weapons.data = {
|
|
||||||
'baseUrl': 'http://paizo.com/pathfinderRPG/prd/magicItems/weapons.html',
|
|
||||||
// [name, bonus modifier, cost, url]
|
|
||||||
'specific': [
|
|
||||||
{'name': 'Sleep arrow', 'bonus': 0, 'cost': 132, 'url': '#sleep-arrow'},
|
|
||||||
{'name': 'Screaming bolt', 'bonus': 0, 'cost': 267},
|
|
||||||
{'name': 'Silver dagger (masterwork)', 'bonus': 0, 'cost': 322},
|
|
||||||
{'name': 'Cold iron longsword (masterwork)', 'bonus': 0, 'cost': 330},
|
|
||||||
{'name': 'Javelin of lightning', 'bonus': 0, 'cost': 1500},
|
|
||||||
{'name': 'Slaying arrow', 'bonus': 0, 'cost': 2282},
|
|
||||||
{'name': 'Adamantine dagger', 'bonus': 0, 'cost': 3002},
|
|
||||||
{'name': 'Adamantine battleaxe', 'bonus': 0, 'cost': 3010},
|
|
||||||
{'name': 'Slaying arrow (greater)', 'bonus': 0, 'cost': 4057},
|
|
||||||
{'name': 'Shatterspike', 'bonus': 0, 'cost': 4315},
|
|
||||||
{'name': 'Dagger of venom', 'bonus': 0, 'cost': 8302},
|
|
||||||
{'name': 'Trident of warning', 'bonus': 0, 'cost': 10115},
|
|
||||||
{'name': 'Assassin\'s dagger', 'bonus': 0, 'cost': 10302},
|
|
||||||
{'name': 'Shifter\'s sorrow', 'bonus': 0, 'cost': 12780},
|
|
||||||
{'name': 'Trident of fish command', 'bonus': 0, 'cost': 18650},
|
|
||||||
{'name': 'Flame tongue', 'bonus': 0, 'cost': 20715},
|
|
||||||
{'name': 'Luck blade (0 wishes)', 'bonus': 0, 'cost': 22060},
|
|
||||||
{'name': 'Sword of subtlety', 'bonus': 0, 'cost': 22310},
|
|
||||||
{'name': 'Sword of the planes', 'bonus': 0, 'cost': 22315},
|
|
||||||
{'name': 'Nine lives stealer', 'bonus': 0, 'cost': 23057},
|
|
||||||
{'name': 'Oathbow', 'bonus': 0, 'cost': 25600},
|
|
||||||
{'name': 'Sword of life stealing', 'bonus': 0, 'cost': 25715},
|
|
||||||
{'name': 'Mace of terror', 'bonus': 0, 'cost': 38552},
|
|
||||||
{'name': 'Life-drinker', 'bonus': 0, 'cost': 40320},
|
|
||||||
{'name': 'Sylvan scimitar', 'bonus': 0, 'cost': 47315},
|
|
||||||
{'name': 'Rapier of puncturing', 'bonus': 0, 'cost': 50320},
|
|
||||||
{'name': 'Sun blade', 'bonus': 0, 'cost': 50335},
|
|
||||||
{'name': 'Frost brand', 'bonus': 0, 'cost': 54475},
|
|
||||||
{'name': 'Dwarven thrower', 'bonus': 0, 'cost': 60312},
|
|
||||||
{'name': 'Luck blade (1 wish)', 'bonus': 0, 'cost': 62360},
|
|
||||||
{'name': 'Mace of smiting', 'bonus': 0, 'cost': 75312},
|
|
||||||
{'name': 'Luck blade (2 wishes)', 'bonus': 0, 'cost': 102660},
|
|
||||||
{'name': 'Holy avenger', 'bonus': 0, 'cost': 120630},
|
|
||||||
{'name': 'Luck blade (3 wishes)', 'bonus': 0, 'cost': 14296},
|
|
||||||
] //34 specific weapons
|
|
||||||
};
|
|
||||||
|
|
||||||
Weapons.getSpecific = function(type) {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
if(type == 'minor') {
|
|
||||||
switch(true) {
|
|
||||||
case(roll <= 15): return Weapons.data.specific[0];
|
|
||||||
case(roll <= 25): return Weapons.data.specific[1];
|
|
||||||
case(roll <= 45): return Weapons.data.specific[2];
|
|
||||||
case(roll <= 65): return Weapons.data.specific[3];
|
|
||||||
case(roll <= 75): return Weapons.data.specific[4];
|
|
||||||
case(roll <= 80): return Weapons.data.specific[5];
|
|
||||||
case(roll <= 90): return Weapons.data.specific[6];
|
|
||||||
case(roll <= 100): return Weapons.data.specific[7];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case(roll <= 9): return Weapons.data.specific[4];
|
|
||||||
case(roll <= 15): return Weapons.data.specific[5];
|
|
||||||
case(roll <= 24): return Weapons.data.specific[6];
|
|
||||||
case(roll <= 33): return Weapons.data.specific[7];
|
|
||||||
case(roll <= 37): return Weapons.data.specific[8];
|
|
||||||
case(roll <= 40): return Weapons.data.specific[9];
|
|
||||||
case(roll <= 46): return Weapons.data.specific[10];
|
|
||||||
case(roll <= 51): return Weapons.data.specific[11];
|
|
||||||
case(roll <= 57): return Weapons.data.specific[12];
|
|
||||||
case(roll <= 62): return Weapons.data.specific[13];
|
|
||||||
case(roll <= 66): return Weapons.data.specific[14];
|
|
||||||
case(roll <= 74): return Weapons.data.specific[15];
|
|
||||||
case(roll <= 79): return Weapons.data.specific[16];
|
|
||||||
case(roll <= 86): return Weapons.data.specific[17];
|
|
||||||
case(roll <= 91): return Weapons.data.specific[18];
|
|
||||||
case(roll <= 95): return Weapons.data.specific[19];
|
|
||||||
case(roll <= 98): return Weapons.data.specific[20];
|
|
||||||
case(roll <= 100): return Weapons.data.specific[21];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case(roll <= 4): return Weapons.data.specific[12];
|
|
||||||
case(roll <= 7): return Weapons.data.specific[13];
|
|
||||||
case(roll <= 9): return Weapons.data.specific[14];
|
|
||||||
case(roll <= 13): return Weapons.data.specific[15];
|
|
||||||
case(roll <= 17): return Weapons.data.specific[16];
|
|
||||||
case(roll <= 24): return Weapons.data.specific[17];
|
|
||||||
case(roll <= 31): return Weapons.data.specific[18];
|
|
||||||
case(roll <= 37): return Weapons.data.specific[19];
|
|
||||||
case(roll <= 42): return Weapons.data.specific[20];
|
|
||||||
case(roll <= 46): return Weapons.data.specific[21];
|
|
||||||
case(roll <= 51): return Weapons.data.specific[22];
|
|
||||||
case(roll <= 57): return Weapons.data.specific[23];
|
|
||||||
case(roll <= 62): return Weapons.data.specific[24];
|
|
||||||
case(roll <= 67): return Weapons.data.specific[25];
|
|
||||||
case(roll <= 73): return Weapons.data.specific[26];
|
|
||||||
case(roll <= 79): return Weapons.data.specific[27];
|
|
||||||
case(roll <= 84): return Weapons.data.specific[28];
|
|
||||||
case(roll <= 91): return Weapons.data.specific[29];
|
|
||||||
case(roll <= 95): return Weapons.data.specific[30];
|
|
||||||
case(roll <= 97): return Weapons.data.specific[31];
|
|
||||||
case(roll <= 99): return Weapons.data.specific[32];
|
|
||||||
case(roll <= 100): return Weapons.data.specific[33];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}; //end getSpecific
|
|
||||||
|
|
||||||
Weapons.data.meleeSpecial = [
|
|
||||||
{'name': 'Bane', 'bonus': 1},
|
|
||||||
{'name': 'Defending', 'bonus': 1},
|
|
||||||
{'name': 'Flaming', 'bonus': 1},
|
|
||||||
{'name': 'Frost', 'bonus': 1},
|
|
||||||
{'name': 'Shock', 'bonus': 1},
|
|
||||||
{'name': 'Ghost touch', 'bonus': 1},
|
|
||||||
{'name': 'Keen', 'bonus': 1},
|
|
||||||
{'name': 'Ki Focus', 'bonus': 1},
|
|
||||||
{'name': 'Merciful', 'bonus': 1},
|
|
||||||
{'name': 'Mighty cleaving', 'bonus': 1},
|
|
||||||
{'name': 'Spell storing', 'bonus': 1},
|
|
||||||
{'name': 'Throwing', 'bonus': 1},
|
|
||||||
{'name': 'Thundering', 'bonus': 1},
|
|
||||||
{'name': 'Vicious', 'bonus': 1},
|
|
||||||
{'name': 'Anarchic', 'bonus': 2},
|
|
||||||
{'name': 'Axiomatic', 'bonus': 2},
|
|
||||||
{'name': 'Disruption', 'bonus': 2},
|
|
||||||
{'name': 'Flaming burst', 'bonus': 2},
|
|
||||||
{'name': 'Icy burst', 'bonus': 2},
|
|
||||||
{'name': 'Holy', 'bonus': 2},
|
|
||||||
{'name': 'Shocking burst', 'bonus': 2},
|
|
||||||
{'name': 'Unholy', 'bonus': 2},
|
|
||||||
{'name': 'Wounding', 'bonus': 2},
|
|
||||||
{'name': 'Speed', 'bonus': 3},
|
|
||||||
{'name': 'Brilliant energy', 'bonus': 4},
|
|
||||||
{'name': 'Dancing', 'bonus': 4},
|
|
||||||
{'name': 'Vorpal', 'bonus': 5},
|
|
||||||
]; //27 melee specials - name, bonus modifier
|
|
||||||
// 100 96–100 91–100 Roll again twice4
|
|
||||||
|
|
||||||
Grimoire.getHumanoidType = function() {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 6): return 'aquatic';
|
|
||||||
case (roll <= 19): return 'dwarf';
|
|
||||||
case (roll <= 32): return 'elf';
|
|
||||||
case (roll <= 39): return 'giant';
|
|
||||||
case (roll <= 45): return 'goblinoid';
|
|
||||||
case (roll <= 52): return 'gnoll';
|
|
||||||
case (roll <= 59): return 'gnome';
|
|
||||||
case (roll <= 67): return 'halfling';
|
|
||||||
case (roll <= 79): return 'human';
|
|
||||||
case (roll <= 92): return 'orc';
|
|
||||||
case (roll <= 100): return 'reptilian';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Grimoire.getOutsiderType = function() {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
switch(true) {
|
|
||||||
//There is NO roll chart for picking outsiders types.
|
|
||||||
//I made up this roll. Common enemy types have ~2x chance to roll
|
|
||||||
case (roll <= 9): return 'air';
|
|
||||||
case (roll <= 18): return 'earth';
|
|
||||||
case (roll <= 27): return 'fire';
|
|
||||||
case (roll <= 36): return 'water';
|
|
||||||
case (roll <= 54): return 'chaotic';
|
|
||||||
case (roll <= 72): return 'evil';
|
|
||||||
case (roll <= 81): return 'good';
|
|
||||||
case (roll <= 90): return 'lawful';
|
|
||||||
case (roll <= 100): return 'native';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Weapons.getBane = function() {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
switch(true) {
|
|
||||||
//There is NO roll chart for picking outsiders types.
|
|
||||||
//I made up this roll. Common enemy types have ~2x chance to roll
|
|
||||||
case (roll <= 5): return 'Bane of Aberations';
|
|
||||||
case (roll <= 9): return 'Bane of Animals';
|
|
||||||
case (roll <= 16): return 'Bane of Constructs';
|
|
||||||
case (roll <= 22): return 'Bane of Dragons';
|
|
||||||
case (roll <= 27): return 'Bane of Fey';
|
|
||||||
case (roll <= 60): return 'Bane of Humanoids (' + Grimoire.getHumanoidType() + ')';
|
|
||||||
case (roll <= 65): return 'Bane of Magical Beasts';
|
|
||||||
case (roll <= 70): return 'Bane of Monstrous Humanoids';
|
|
||||||
case (roll <= 72): return 'Bane of Oozes';
|
|
||||||
case (roll <= 88): return 'Bane of Outsiders (' + Grimoire.getOutsiderType() + ')';
|
|
||||||
case (roll <= 90): return 'Bane of Plants';
|
|
||||||
case (roll <= 98): return 'Bane of Undead';
|
|
||||||
case (roll <= 100): return 'Bane of Vermin';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Weapons.getMeleeSpecial = function(type) {
|
|
||||||
//TODO: check for conflicting or duplicate specials
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
var s1, s2;
|
|
||||||
if(type == 'minor') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 10): return {'name': Weapons.getBane(), 'bonus': 1};
|
|
||||||
case (roll <= 17): return Weapons.data.meleeSpecial[1];
|
|
||||||
case (roll <= 27): return Weapons.data.meleeSpecial[2];
|
|
||||||
case (roll <= 37): return Weapons.data.meleeSpecial[3];
|
|
||||||
case (roll <= 47): return Weapons.data.meleeSpecial[4];
|
|
||||||
case (roll <= 56): return Weapons.data.meleeSpecial[5];
|
|
||||||
case (roll <= 67): return Weapons.data.meleeSpecial[6];
|
|
||||||
case (roll <= 71): return Weapons.data.meleeSpecial[7];
|
|
||||||
case (roll <= 75): return Weapons.data.meleeSpecial[8];
|
|
||||||
case (roll <= 82): return Weapons.data.meleeSpecial[9];
|
|
||||||
case (roll <= 87): return Weapons.data.meleeSpecial[10];
|
|
||||||
case (roll <= 91): return Weapons.data.meleeSpecial[11];
|
|
||||||
case (roll <= 95): return Weapons.data.meleeSpecial[12];
|
|
||||||
case (roll <= 99): return Weapons.data.meleeSpecial[13];
|
|
||||||
case (roll <= 100): //roll twice
|
|
||||||
s1 = Weapons.getMeleeSpecial('minor');
|
|
||||||
s2 = Weapons.getMeleeSpecial('minor');
|
|
||||||
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 6): return {'name': Weapons.getBane(), 'bonus': 1};
|
|
||||||
case (roll <= 12): return Weapons.data.meleeSpecial[1];
|
|
||||||
case (roll <= 19): return Weapons.data.meleeSpecial[2];
|
|
||||||
case (roll <= 26): return Weapons.data.meleeSpecial[3];
|
|
||||||
case (roll <= 33): return Weapons.data.meleeSpecial[4];
|
|
||||||
case (roll <= 38): return Weapons.data.meleeSpecial[5];
|
|
||||||
case (roll <= 44): return Weapons.data.meleeSpecial[6];
|
|
||||||
case (roll <= 48): return Weapons.data.meleeSpecial[7];
|
|
||||||
case (roll <= 50): return Weapons.data.meleeSpecial[8];
|
|
||||||
case (roll <= 54): return Weapons.data.meleeSpecial[9];
|
|
||||||
case (roll <= 59): return Weapons.data.meleeSpecial[10];
|
|
||||||
case (roll <= 63): return Weapons.data.meleeSpecial[11];
|
|
||||||
case (roll <= 65): return Weapons.data.meleeSpecial[12];
|
|
||||||
case (roll <= 69): return Weapons.data.meleeSpecial[13];
|
|
||||||
case (roll <= 72): return Weapons.data.meleeSpecial[14];
|
|
||||||
case (roll <= 75): return Weapons.data.meleeSpecial[15];
|
|
||||||
case (roll <= 78): return Weapons.data.meleeSpecial[16];
|
|
||||||
case (roll <= 81): return Weapons.data.meleeSpecial[17];
|
|
||||||
case (roll <= 84): return Weapons.data.meleeSpecial[18];
|
|
||||||
case (roll <= 87): return Weapons.data.meleeSpecial[19];
|
|
||||||
case (roll <= 90): return Weapons.data.meleeSpecial[20];
|
|
||||||
case (roll <= 93): return Weapons.data.meleeSpecial[21];
|
|
||||||
case (roll <= 95): return Weapons.data.meleeSpecial[22];
|
|
||||||
case (roll <= 100): //roll twice
|
|
||||||
s1 = Weapons.getMeleeSpecial('medium');
|
|
||||||
s2 = Weapons.getMeleeSpecial('medium');
|
|
||||||
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 3): return {'name': Weapons.getBane(), 'bonus': 1};
|
|
||||||
case (roll <= 6): return Weapons.data.meleeSpecial[2];
|
|
||||||
case (roll <= 9): return Weapons.data.meleeSpecial[3];
|
|
||||||
case (roll <= 12): return Weapons.data.meleeSpecial[4];
|
|
||||||
case (roll <= 15): return Weapons.data.meleeSpecial[5];
|
|
||||||
case (roll <= 19): return Weapons.data.meleeSpecial[7];
|
|
||||||
case (roll <= 21): return Weapons.data.meleeSpecial[9];
|
|
||||||
case (roll <= 24): return Weapons.data.meleeSpecial[10];
|
|
||||||
case (roll <= 28): return Weapons.data.meleeSpecial[11];
|
|
||||||
case (roll <= 32): return Weapons.data.meleeSpecial[12];
|
|
||||||
case (roll <= 36): return Weapons.data.meleeSpecial[13];
|
|
||||||
case (roll <= 41): return Weapons.data.meleeSpecial[14];
|
|
||||||
case (roll <= 46): return Weapons.data.meleeSpecial[15];
|
|
||||||
case (roll <= 49): return Weapons.data.meleeSpecial[16];
|
|
||||||
case (roll <= 54): return Weapons.data.meleeSpecial[17];
|
|
||||||
case (roll <= 59): return Weapons.data.meleeSpecial[18];
|
|
||||||
case (roll <= 64): return Weapons.data.meleeSpecial[19];
|
|
||||||
case (roll <= 69): return Weapons.data.meleeSpecial[20];
|
|
||||||
case (roll <= 74): return Weapons.data.meleeSpecial[21];
|
|
||||||
case (roll <= 78): return Weapons.data.meleeSpecial[22];
|
|
||||||
case (roll <= 83): return Weapons.data.meleeSpecial[23];
|
|
||||||
case (roll <= 86): return Weapons.data.meleeSpecial[24];
|
|
||||||
case (roll <= 88): return Weapons.data.meleeSpecial[25];
|
|
||||||
case (roll <= 90): return Weapons.data.meleeSpecial[26];
|
|
||||||
case (roll <= 100): //roll twice
|
|
||||||
s1 = Weapons.getMeleeSpecial('major');
|
|
||||||
s2 = Weapons.getMeleeSpecial('major');
|
|
||||||
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Weapons.data.rangedSpecial = [
|
|
||||||
{'name': 'Bane', 'bonus': 1},
|
|
||||||
{'name': 'Distance', 'bonus': 1},
|
|
||||||
{'name': 'Flaming', 'bonus': 1},
|
|
||||||
{'name': 'Frost', 'bonus': 1},
|
|
||||||
{'name': 'Merciful', 'bonus': 1},
|
|
||||||
{'name': 'Returning', 'bonus': 1},
|
|
||||||
{'name': 'Shock', 'bonus': 1},
|
|
||||||
{'name': 'Seeking', 'bonus': 1},
|
|
||||||
{'name': 'Thundering', 'bonus': 1},
|
|
||||||
{'name': 'Anarchic', 'bonus': 2},
|
|
||||||
{'name': 'Axiomatic', 'bonus': 2},
|
|
||||||
{'name': 'Flaming burst', 'bonus': 2},
|
|
||||||
{'name': 'Holy', 'bonus': 2},
|
|
||||||
{'name': 'Icy burst', 'bonus': 2},
|
|
||||||
{'name': 'Shocking burst', 'bonus': 2},
|
|
||||||
{'name': 'Unholy', 'bonus': 2},
|
|
||||||
{'name': 'Speed', 'bonus': 3},
|
|
||||||
{'name': 'Brilliant energy', 'bonus': 4},
|
|
||||||
]; //18 ranged specials - name, bonus modifier
|
|
||||||
|
|
||||||
Weapons.getRangedSpecial = function(type) {
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
var s1, s2;
|
|
||||||
if(type == 'minor') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 12): return {'name': Weapons.getBane(), 'bonus': 1};
|
|
||||||
case (roll <= 25): return Weapons.data.rangedSpecial[1];
|
|
||||||
case (roll <= 40): return Weapons.data.rangedSpecial[2];
|
|
||||||
case (roll <= 55): return Weapons.data.rangedSpecial[3];
|
|
||||||
case (roll <= 60): return Weapons.data.rangedSpecial[4];
|
|
||||||
case (roll <= 68): return Weapons.data.rangedSpecial[5];
|
|
||||||
case (roll <= 83): return Weapons.data.rangedSpecial[6];
|
|
||||||
case (roll <= 93): return Weapons.data.rangedSpecial[7];
|
|
||||||
case (roll <= 99): return Weapons.data.rangedSpecial[8];
|
|
||||||
case (roll <= 100): //roll twice
|
|
||||||
s1 = Weapons.getRangedSpecial('minor');
|
|
||||||
s2 = Weapons.getRangedSpecial('minor');
|
|
||||||
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 8): return {'name': Weapons.getBane(), 'bonus': 1};
|
|
||||||
case (roll <= 16): return Weapons.data.rangedSpecial[1];
|
|
||||||
case (roll <= 28): return Weapons.data.rangedSpecial[2];
|
|
||||||
case (roll <= 40): return Weapons.data.rangedSpecial[3];
|
|
||||||
case (roll <= 42): return Weapons.data.rangedSpecial[4];
|
|
||||||
case (roll <= 47): return Weapons.data.rangedSpecial[5];
|
|
||||||
case (roll <= 59): return Weapons.data.rangedSpecial[6];
|
|
||||||
case (roll <= 64): return Weapons.data.rangedSpecial[7];
|
|
||||||
case (roll <= 68): return Weapons.data.rangedSpecial[8];
|
|
||||||
case (roll <= 71): return Weapons.data.rangedSpecial[9];
|
|
||||||
case (roll <= 74): return Weapons.data.rangedSpecial[10];
|
|
||||||
case (roll <= 79): return Weapons.data.rangedSpecial[11];
|
|
||||||
case (roll <= 82): return Weapons.data.rangedSpecial[12];
|
|
||||||
case (roll <= 87): return Weapons.data.rangedSpecial[13];
|
|
||||||
case (roll <= 92): return Weapons.data.rangedSpecial[14];
|
|
||||||
case (roll <= 95): return Weapons.data.rangedSpecial[15];
|
|
||||||
case (roll <= 100): //roll twice
|
|
||||||
s1 = Weapons.getRangedSpecial('medium');
|
|
||||||
s2 = Weapons.getRangedSpecial('medium');
|
|
||||||
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 4): return {'name': Weapons.getBane(), 'bonus': 1};
|
|
||||||
case (roll <= 8): return Weapons.data.rangedSpecial[1];
|
|
||||||
case (roll <= 12): return Weapons.data.rangedSpecial[2];
|
|
||||||
case (roll <= 16): return Weapons.data.rangedSpecial[3];
|
|
||||||
case (roll <= 21): return Weapons.data.rangedSpecial[5];
|
|
||||||
case (roll <= 25): return Weapons.data.rangedSpecial[6];
|
|
||||||
case (roll <= 27): return Weapons.data.rangedSpecial[7];
|
|
||||||
case (roll <= 29): return Weapons.data.rangedSpecial[8];
|
|
||||||
case (roll <= 34): return Weapons.data.rangedSpecial[9];
|
|
||||||
case (roll <= 39): return Weapons.data.rangedSpecial[10];
|
|
||||||
case (roll <= 49): return Weapons.data.rangedSpecial[11];
|
|
||||||
case (roll <= 54): return Weapons.data.rangedSpecial[12];
|
|
||||||
case (roll <= 64): return Weapons.data.rangedSpecial[13];
|
|
||||||
case (roll <= 74): return Weapons.data.rangedSpecial[14];
|
|
||||||
case (roll <= 79): return Weapons.data.rangedSpecial[15];
|
|
||||||
case (roll <= 84): return Weapons.data.rangedSpecial[16];
|
|
||||||
case (roll <= 90): return Weapons.data.rangedSpecial[17];
|
|
||||||
case (roll <= 100): //roll twice
|
|
||||||
s1 = Weapons.getRangedSpecial('major');
|
|
||||||
s2 = Weapons.getRangedSpecial('major');
|
|
||||||
return {'name': s1.name + ' ' + s2.name, 'bonus': s1.bonus + s2.bonus};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
Weapons.data.bonusCost = [
|
|
||||||
{'name': '', 'bonus': 0, 'cost': 0}, //just for bookkeeping
|
|
||||||
{'name': '+1', 'bonus': 1, 'cost': 2000},
|
|
||||||
{'name': '+2', 'bonus': 2, 'cost': 8000},
|
|
||||||
{'name': '+3', 'bonus': 3, 'cost': 18000},
|
|
||||||
{'name': '+4', 'bonus': 4, 'cost': 32000},
|
|
||||||
{'name': '+5', 'bonus': 5, 'cost': 50000},
|
|
||||||
{'name': '+6', 'bonus': 6, 'cost': 72000},
|
|
||||||
{'name': '+7', 'bonus': 7, 'cost': 98000},
|
|
||||||
{'name': '+8', 'bonus': 8, 'cost': 128000},
|
|
||||||
{'name': '+9', 'bonus': 9, 'cost': 162000},
|
|
||||||
{'name': '+10', 'bonus': 10, 'cost': 200000},
|
|
||||||
//5 possible roll'able weapons. Specific type of weapon is left up to DM
|
|
||||||
];
|
|
||||||
|
|
||||||
Weapons.getWeapon = function(type, wClass, final) {
|
|
||||||
//TODO: resolve issue where you get a 'Glowing Glowing Glowing item'
|
|
||||||
final = typeof final !== 'undefined' ? final : true; //set to false when we recursively call getWeapon
|
|
||||||
if(wClass === undefined) {
|
|
||||||
if(_.random(1,100) <= 75)
|
|
||||||
wClass = 'melee';
|
|
||||||
else
|
|
||||||
wClass = 'ranged';
|
|
||||||
}
|
|
||||||
var roll = _.random(1,100);
|
|
||||||
var weapon = {};
|
|
||||||
var newWeapon;
|
|
||||||
var special;
|
|
||||||
if(type == 'minor') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 70):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[1].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[1].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[1].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 85):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[2].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[2].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[2].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 90):
|
|
||||||
weapon = Weapons.getSpecific(type);
|
|
||||||
break;
|
|
||||||
case (roll <= 100):
|
|
||||||
//'Special ability and roll again'
|
|
||||||
newWeapon = Weapons.getWeapon(type, wClass, false);
|
|
||||||
special = (wClass == 'melee') ? Weapons.getMeleeSpecial(type) : Weapons.getRangedSpecial(type);
|
|
||||||
if(newWeapon.bonus + special.bonus <= 10) {
|
|
||||||
weapon = {'name': special.name + ' ' + newWeapon.name,
|
|
||||||
'bonus': special.bonus + newWeapon.bonus,
|
|
||||||
//base weapon cost plus the difference between bonuses
|
|
||||||
'cost': newWeapon.cost + Weapons.data.bonusCost[newWeapon.bonus + special.bonus].cost - Weapons.data.bonusCost[newWeapon.bonus].cost,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
weapon = newWeapon; //Don't apply the new special
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'medium') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 10):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[1].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[1].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[1].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 29):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[2].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[2].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[2].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 58):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[3].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[3].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[3].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 62):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[4].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[4].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[4].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 68):
|
|
||||||
weapon = Weapons.getSpecific(type);
|
|
||||||
break;
|
|
||||||
case (roll <= 100):
|
|
||||||
//'Special ability and roll again'
|
|
||||||
newWeapon = Weapons.getWeapon(type, wClass, false);
|
|
||||||
special = (wClass == 'melee') ? Weapons.getMeleeSpecial(type) : Weapons.getRangedSpecial(type);
|
|
||||||
if(newWeapon.bonus + special.bonus <= 10) {
|
|
||||||
weapon = {'name': special.name + ' ' + newWeapon.name,
|
|
||||||
'bonus': special.bonus + newWeapon.bonus,
|
|
||||||
//base weapon cost plus the difference between bonuses
|
|
||||||
'cost': newWeapon.cost + Weapons.data.bonusCost[newWeapon.bonus + special.bonus].cost - Weapons.data.bonusCost[newWeapon.bonus].cost,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
weapon = newWeapon; //Don't apply the new special
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if(type == 'major') {
|
|
||||||
switch(true) {
|
|
||||||
case (roll <= 20):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[3].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[3].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[3].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 38):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[4].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[4].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[4].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 49):
|
|
||||||
weapon = {'name': Weapons.data.bonusCost[5].name + ' ' + type + ' ' + wClass + ' weapon',
|
|
||||||
'bonus': Weapons.data.bonusCost[5].bonus,
|
|
||||||
'cost': Weapons.data.bonusCost[5].cost,};
|
|
||||||
break;
|
|
||||||
case (roll <= 63):
|
|
||||||
weapon = Weapons.getSpecific(type);
|
|
||||||
break;
|
|
||||||
case (roll <= 100):
|
|
||||||
//'Special ability and roll again'
|
|
||||||
newWeapon = Weapons.getWeapon(type, wClass, false);
|
|
||||||
special = (wClass == 'melee') ? Weapons.getMeleeSpecial(type) : Weapons.getRangedSpecial(type);
|
|
||||||
if(newWeapon.bonus + special.bonus <= 10) {
|
|
||||||
weapon = {'name': special.name + ' ' + newWeapon.name,
|
|
||||||
'bonus': special.bonus + newWeapon.bonus,
|
|
||||||
//base weapon cost plus the difference between bonuses
|
|
||||||
'cost': newWeapon.cost + Weapons.data.bonusCost[newWeapon.bonus + special.bonus].cost - Weapons.data.bonusCost[newWeapon.bonus].cost,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
weapon = newWeapon; //Don't apply the new special
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(weapon === undefined || Object.keys(weapon).length === 0) {
|
|
||||||
var err = new Error();
|
|
||||||
console.log(type);
|
|
||||||
console.log(wClass);
|
|
||||||
console.log(final);
|
|
||||||
console.log('roll: ' + roll);
|
|
||||||
console.log(newWeapon);
|
|
||||||
console.log(special);
|
|
||||||
return err.stack;
|
|
||||||
}
|
|
||||||
var i = weapon.name.indexOf('+');
|
|
||||||
if(i != -1) {
|
|
||||||
//move the '+X' to the front
|
|
||||||
weapon.name = weapon.name.slice(i, i+3) + weapon.name.slice(0, i) + weapon.name.slice(i+3);
|
|
||||||
}
|
|
||||||
|
|
||||||
//There is the possibility of getting a special modifier on a specific item that does not match
|
|
||||||
//This is hilarious and has not yet been fixed
|
|
||||||
|
|
||||||
if(final === true && _.random(1,100) === 1) {
|
|
||||||
weapon.name = 'Intelligent ' + weapon.name;
|
|
||||||
weapon.intelligence = Intelligence.getItemIntelligence(weapon.cost);
|
|
||||||
weapon.cost += weapon.intelligence.cost;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(final === true && _.random(1,100) <= 30) {
|
|
||||||
weapon.name = 'Glowing ' + weapon.name;
|
|
||||||
}
|
|
||||||
return weapon;
|
|
||||||
};
|
|
||||||
|
|
||||||
Weapons.getWeapons = function (numMinor, numMedium, numMajor, wClass) {
|
|
||||||
//where wClass can be 'melee' or 'ranged'
|
|
||||||
var weapons = [];
|
|
||||||
_(numMinor).times(function() {
|
|
||||||
weapons.push(Weapons.getWeapon('minor', wClass));
|
|
||||||
});
|
|
||||||
_(numMedium).times(function() {
|
|
||||||
weapons.push(Weapons.getWeapon('medium', wClass));
|
|
||||||
});
|
|
||||||
_(numMajor).times(function() {
|
|
||||||
weapons.push(Weapons.getWeapon('major', wClass));
|
|
||||||
});
|
|
||||||
return weapons;
|
|
||||||
};
|
|
||||||
Reference in new issue
Block a user