Example #1
0
 def _add_default_spells(char_data, consts):
     spells_id = consts["class"]["spells"]
     for spell_id in spells_id:
         try:
             Spell.create(
                 character = char_data,
                 ident     = spell_id.value
             )
         except PeeweeException as exc:
             LOG.error("Couldn't add spell {} for char {}".format(
                 spell_id.name, char_data.guid
             ))
             LOG.error(str(exc))
Example #2
0
 def _add_default_spells(char_data, consts):
     spells_id = consts["class"]["spells"]
     for spell_id in spells_id:
         try:
             Spell.create(
                 character = char_data,
                 ident     = spell_id.value
             )
         except PeeweeException as exc:
             LOG.error("Couldn't add spell {} for char {}".format(
                 spell_id.name, char_data.guid
             ))
             LOG.error(str(exc))
Example #3
0
 def import_spells(self, char_data):
     with self.lock:
         self.spells = []
         spells = (Spell.select().where(
             Spell.character == char_data).order_by(Spell.ident).limit(
                 self.NUM_SPELLS))
         for spell in spells:
             self.spells.append(spell)
Example #4
0
 def _delete_char_spells(character):
     Spell.delete().where(Spell.character == character).execute()
Example #5
0
 def _delete_char_spells(character):
     Spell.delete().where(Spell.character == character).execute()