It takes a function,
Code: Select all
def pcInRoom(vnum):
Code: Select all
def mobDifficulty(cRoom, difficulty=0):
for occupant in pcInRoom(cRoom):
difficulty = difficulty + getLevel(occupant)
return difficulty
This is just concept code, I still need to refine the difficulty algorithm. The result is then used to select from a list of monsters;
Code: Select all
diff = mobDifficulty(10000, 100)
if diff < 125:
mSpawn(1000, 120) #(mobile vnum, room vnum)
elif diff < 150:
mSpawn(1001, 120)
...
else:
mSpawn(1010, 120)
I'm thinking this is something that would have to be hardcoded, but if there's a way to do solely in area code, I figure someone here would know!