Example #1
0
 public Player(Mobile mob)
     : base(mob)
 {
     this.m_Profile      = "Default";
     this.m_Friends      = new Friends();
     this.m_UseOnceAgent = new UseOnceAgent();
     this.equipAgent     = new EquipAgent();
     this.RestockAgent   = new RestockAgent();
     this.OrganizeAgent  = new OrganizeAgent();
 }
Example #2
0
 protected virtual void DeserializeChildren(PersistanceReader ip)
 {
     while (ip.HasChild)
     {
         object obj = (object)ip.GetChild();
         if (obj is Friends)
         {
             this.m_Friends = obj as Friends;
         }
         else if (!(obj is TravelAgent))
         {
             if (obj is UseOnceAgent)
             {
                 this.m_UseOnceAgent = obj as UseOnceAgent;
             }
             else if (obj is EquipAgent)
             {
                 this.equipAgent = obj as EquipAgent;
             }
             else if (obj is RestockAgent)
             {
                 this.RestockAgent = obj as RestockAgent;
             }
             else if (obj is OrganizeAgent)
             {
                 this.OrganizeAgent = obj as OrganizeAgent;
             }
         }
     }
     if (this.m_Friends == null)
     {
         this.m_Friends = new Friends();
     }
     if (this.m_UseOnceAgent == null)
     {
         this.m_UseOnceAgent = new UseOnceAgent();
     }
     if (this.equipAgent == null)
     {
         this.equipAgent = new EquipAgent();
     }
     if (this.RestockAgent == null)
     {
         this.RestockAgent = new RestockAgent();
     }
     if (this.OrganizeAgent != null)
     {
         return;
     }
     this.OrganizeAgent = new OrganizeAgent();
 }
Example #3
0
        protected override bool OnTarget(Item item)
        {
            UseOnceAgent useOnceAgent = Player.Current.UseOnceAgent;
            ItemRef      itemRef      = useOnceAgent[item];

            if (itemRef != null)
            {
                item.OverrideHue(-1);
                useOnceAgent.Items.Remove(itemRef);
            }
            else
            {
                item.OverrideHue(34);
                useOnceAgent.Items.Add(new ItemRef(item));
            }
            return(true);
        }