#
# Adds the character (spellCaster) defined here to a party XML file
#
import java.util as util
import burningbox.org.dsh as dsh
import burningbox.org.dsh.entities as entities
import burningbox.org.dsh.entities.equipment as equipment
configuration = dsh.Configuration.load("etc/dgsh-config.xml")
configuration.apply(0)
#
# build the character
c = entities.Character()
c.name="Plume"
c.player="Miniben"
c.abilities = entities.Abilities(13, 15, 15, 14, 18, 14)
# STR, DEX, CON, INT, WIS, CHA
c.raceName="gnome"
c.alignment=dsh.Definitions.GOOD
c.hitDice=2
c.hitPoints=18
c.currentHitPoints=18
c.experiencePoints = 1429
c.miscModifiers = None
c.speeds = "20ft"
c.size = entities.Size.SMALL
#
# character's classes
c.classes.add(entities.ClassLevel("clr", 2))
#c.classes.add(entities.ClassLevel("wiz", 1))
#c.classes.add(entities.ClassLevel("sor", 1))
#
# character's skills
# you will find skills and feats in etc/skills.xml and
# etc/feats.xml respectively
c.skills.add(entities.CharacterSkill("alchemy", 0))
c.skills.add(entities.CharacterSkill("bluff", 2))
c.skills.add(entities.CharacterSkill("concentration", 4))
c.skills.add(entities.CharacterSkill("diplomacy", 5))
c.skills.add(entities.CharacterSkill("heal", 5))
c.skills.add(entities.CharacterSkill("listen", 5))
c.skills.add(entities.CharacterSkill("profession (singer)", 5))
#
# character's feats
#c.feats.add(entities.FeatInstance("alertness", None, 0))
c.feats.add(entities.FeatInstance("simple weapon proficiency", None, 0))
c.feats.add(entities.FeatInstance("armor proficiency (light)", None, 0))
c.feats.add(entities.FeatInstance("armor proficiency (medium)", None, 0))
c.feats.add(entities.FeatInstance("armor proficiency (heavy)", None, 0))
c.feats.add(entities.FeatInstance("weapon focus", "gaxe", 1))
#
# add equipment
c.equipment.wornEquipment.add(entities.DataSets.findEquipment("scmarm"))
c.equipment.wornEquipment.add(entities.DataSets.findEquipment("lwdshield"))
c.equipment.heldEquipment.add(entities.DataSets.findEquipment("gaxe"))
#
# wizard spellbook
#
# (or sorcerer's known spells)
#spellbook = entities.magic.SpellList()
#spellbook.addSpell("wiz", "Magic Missile");
#spellbook.addSpell("wiz", "Detect Magic");
#spellbook.addSpell("wiz", "Disrupt Undead");
#spellbook.addSpell("wiz", "Alarm");
#spellbook.addSpell("sor", "Magic Missile");
#c.spellList = spellbook
#
# clerical domains
domains = util.ArrayList(2)
domains.add("Good")
domains.add("Protection")
c.setAttribute("domains_clr", domains)
#
# add and save
fileName = "%s.xml" % c.name
fileName = fileName.lower()
bs = entities.BeanSet()
bs.add(c)
bs.save(fileName)
print "Your character %s has been created and saved to %s" % (c.name, fileName)
|