23 player = Crossfire.WhoIsActivator()
25 if type(player) == Crossfire.Player:
27 currentstep = player.QuestGetState(
"scorn/Aristocracy")
28 currentrecord = {
'#' : player.Name,
'rank' : currentstep,
'title' : player.Title }
29 lastrecord = nobledata.get_record(player.Name)
30 Crossfire.Log(Crossfire.LogDebug,
"castle_write: previous record %s, new record %s." % (lastrecord, currentrecord))
32 lastrecord = {
'#' : player.Name,
'rank' : -10,
'title' :
'The Default' }
33 if (currentrecord[
'rank'] == 0)
or (currentrecord[
'rank'] ==
int(lastrecord[
'rank'])
and currentrecord[
'title'] == lastrecord[
'title']):
34 Crossfire.Log(Crossfire.LogDebug,
"castle_write, no update needed for player %s." % player.Name)
36 Crossfire.Log(Crossfire.LogDebug,
"castle_write, updating player %s, old state %s, new state %d" %(player.Name, lastrecord[
'rank'], currentstep))
37 nobledata.put_record(currentrecord)
38 player.Message(
"The castle sage scribbles as you walk past")