Exemplo n.º 1
0
def InitMobSpells():
    con = SpellClass._connection.getConnection()
    for scname,protoid,sclevel in con.execute("SELECT classname,spell_proto_id,level FROM spell_class WHERE (SELECT spell_type FROM spell_proto WHERE id=spell_proto_id)&%i;"%RPG_SPELL_AICAST):
        d = MOB_SPELLS.setdefault(scname,{}).setdefault(sclevel,{'pet': set(), 'harmful': set(), 'beneficial': set(), 'healing': set()})
        
        proto = SpellProto.get(protoid)
        if proto.pet:
            d["pet"].add(proto)
            continue
        if proto.spellType&RPG_SPELL_HARMFUL:
            d["harmful"].add(proto)
            continue
        if proto.spellType&RPG_SPELL_HEALING:
            d["healing"].add(proto)
            continue
        d["beneficial"].add(proto)
Exemplo n.º 2
0
    def _init(self, *args, **kw):
        Persistent._init(self, *args, **kw)
        self.level = self.plevel
        self.modifiedScale = self.scale  # Modified scale may get changed, but should not persist.

        from spell import SpellProto

        self.spawnSpells = []
        for s in self.spawnSpellsInternal:
            try:
                spell = SpellProto.byName(s.spellname)
                self.spawnSpells.append(spell)
            except:
                print "Warning: Unknown Spawn Spell -> %s" % s.spellname

        self.spawnStats = []
        for s in self.spawnStatsInternal:
            self.spawnStats.append(s)

        self.spawnInfoMale = None
        self.spawnInfoFemale = None
        self.sndProfileOverride = None
Exemplo n.º 3
0
 def _init(self,*args,**kw):
     Persistent._init(self, *args, **kw)
     self.level = self.plevel
     self.modifiedScale = self.scale # Modified scale may get changed, but should not persist.
     
     from spell import SpellProto
     
     self.spawnSpells = []
     for s in self.spawnSpellsInternal:
         try:
             spell = SpellProto.byName(s.spellname)
             self.spawnSpells.append(spell)
         except:
             print "Warning: Unknown Spawn Spell -> %s"%s.spellname
         
     self.spawnStats = []    
     for s in self.spawnStatsInternal:
         self.spawnStats.append(s)
         
     self.spawnInfoMale = None
     self.spawnInfoFemale = None
     self.sndProfileOverride = None
Exemplo n.º 4
0
def InitMobSpells():
    con = SpellClass._connection.getConnection()
    for scname, protoid, sclevel in con.execute(
            "SELECT classname,spell_proto_id,level FROM spell_class WHERE (SELECT spell_type FROM spell_proto WHERE id=spell_proto_id)&%i;"
            % RPG_SPELL_AICAST):
        d = MOB_SPELLS.setdefault(scname,
                                  {}).setdefault(sclevel, {
                                      'pet': set(),
                                      'harmful': set(),
                                      'beneficial': set(),
                                      'healing': set()
                                  })

        proto = SpellProto.get(protoid)
        if proto.pet:
            d["pet"].add(proto)
            continue
        if proto.spellType & RPG_SPELL_HARMFUL:
            d["harmful"].add(proto)
            continue
        if proto.spellType & RPG_SPELL_HEALING:
            d["healing"].add(proto)
            continue
        d["beneficial"].add(proto)