diff --git a/Castles&Crusades/HeroLabImport.js b/Castles&Crusades/HeroLabImport.js index bddc28fe2c..cf11366281 100644 --- a/Castles&Crusades/HeroLabImport.js +++ b/Castles&Crusades/HeroLabImport.js @@ -146,7 +146,11 @@ on("chat:message", function (msg) { var numRaceAbilities = 0; for (var l = 0; l < abilityName.length; l++) { if (abilityType[l] == "class") { - AddAttribute("repeating_classabilities_" + numClassAbilities.toString() + "_ClassAbility", abilityName[l], Character.id); + if (abilityAttribute[l] == "") { + AddAttribute("repeating_classabilities_" + numClassAbilities.toString() + "_ClassAbility", abilityName[l], Character.id); + } else { + AddAttribute("repeating_classabilities_" + numClassAbilities.toString() + "_ClassAbility", abilityName[l] + " (" + abilityAttribute[l].substring(0,3) + ")", Character.id); + } numClassAbilities += 1; if (abilityName[l].match(/Weapon Specialization/)) { var wepRegex = /\((.*?)\)/g; @@ -154,7 +158,7 @@ on("chat:message", function (msg) { } } else if (abilityType[l] == "race") { AddAttribute("repeating_raceabilities_" + numRaceAbilities.toString() + "_RaceAbility", abilityName[l], Character.id); - numRaceAbilities =+ 1; + numRaceAbilities += 1; } } @@ -214,6 +218,63 @@ on("chat:message", function (msg) { for (var m = 0; m < senseNames.length; m++) { AddAttribute("repeating_senses_" + m.toString() + "_Senses", senseNames[m], Character.id); } + + var whatTypeSpells = "N"; + if ((CharClass == "Cleric") || (CharClass == "Druid")) { + whatTypeSpells = "D"; + } else if ((CharClass == "Wizard") || (CharClass == "Illusionist")) { + whatTypeSpells = "A"; + } + if ((whatTypeSpells == "A") || (whatTypeSpells == "D")) { + myRegex = / 0) { + AddAttribute("numspells_2", (parseInt(totalSpells[n]) - 1).toString(), Character.id); + AddAttribute("bonusspells_2", "1", Character.id); + } else { + AddAttribute("numspells_2", (parseInt(totalSpells[n])).toString(), Character.id); + AddAttribute("bonusspells_2", "0", Character.id); + } + } + } else if (n == 3) { + if (((whatTypeSpells == "D") && (WisVal < 18)) || ((whatTypeSpells == "A") && (IntVal < 18))) { + AddAttribute("numspells_3", totalSpells[n].toString(), Character.id); + AddAttribute("bonusspells_3", "0", Character.id); + } else { + if (parseInt(totalSpells[n]) > 0) { + AddAttribute("numspells_3", (parseInt(totalSpells[n]) - 1).toString(), Character.id); + AddAttribute("bonusspells_3", "1", Character.id); + } else { + AddAttribute("numspells_3", (parseInt(totalSpells[n])).toString(), Character.id); + AddAttribute("bonusspells_3", "0", Character.id); + } + } + } else { + AddAttribute("numspells_" + n.toString(), totalSpells[n].toString(), Character.id); + AddAttribute("bonusspells_" + n.toString(), "0", Character.id); + } + } + } } });