public int GetFavor(Creature other)
{
// Get NPC favor and last change date
var favor = other.Vars.Perm["npc_favor_" + this.Name] ?? 0;
var change = other.Vars.Perm["npc_favor_change_" + this.Name];
// Reduce favor by 1 each hour
if (change != null && favor > 0)
{
TimeSpan diff = DateTime.Now - change;
favor = Math.Max(0, favor - Math.Floor(diff.TotalHours));
}
return (int)favor;
}