def loadNpcs():
    npcAmount = database.getNumberOfRows('npcs')

    for i in range(0, npcAmount):
        query = database.sendQuery((i+1) % "SELECT * FROM npcs WHERE id=%i;")
        rows = query.fetchone()

        NPC[i].name = rows['name']
        NPC[i].attackSay = rows['attack_say']
        NPC[i].sprite = int(rows['sprite'])
        NPC[i].spawnSecs = int(rows['spawn_secs'])
        NPC[i].behaviour = int(rows['behavior'])
        NPC[i].range = int(rows['range'])

        NPC[i].dropChance = int(rows['drop_chance'])
        NPC[i].dropItem = rows['drop_item']
        NPC[i].dropItemValue = int(rows['drop_item_value'])

        NPC[i].stat[Stats.strength] = int(rows['stat_strength'])
        NPC[i].stat[Stats.defense] = int(rows['stat_defense'])
        NPC[i].stat[Stats.magic] = int(rows['stat_magic'])
        NPC[i].stat[Stats.speed] = int(rows['stat_speed'])


#################
# MAP FUNCTIONS #
#################
dataset/ETHPy150Open marcusmoller/pyorpg-server/src/database.py/loadNpcs/swapped operands of `%`