Aura.Channel.World.Entities.NPC.GetMemory C# (CSharp) Method

GetMemory() public method

Returns how well the NPC remembers the other creature.
public GetMemory ( Creature other ) : int
other Creature
return int
		public int GetMemory(Creature other)
		{
			// Get NPC memory and last change date
			var memory = other.Vars.Perm["npc_memory_" + this.Name] ?? 0;
			var change = other.Vars.Perm["npc_memory_change_" + this.Name];

			// Reduce memory by 1 each day
			if (change != null && memory > 0)
			{
				TimeSpan diff = DateTime.Now - change;
				memory = Math.Max(0, memory - Math.Floor(diff.TotalDays));
			}

			return (int)memory;
		}