Exemplo n.º 1
0
 public void RemoveUsers()
 {
     foreach (KeyValuePair <Account, DateTime> kvp in ObeliskUsers.ToList())
     {
         if (kvp.Value <= DateTime.UtcNow)
         {
             foreach (Mobile online in kvp.Key.Mobiles)
             {
                 if (online != null && online.NetState != null)
                 {
                     online.SendMessage(61, "You feel the power of one of the focal points leave your body.");
                 }
             }
             ObeliskUsers.Remove(kvp.Key);
         }
     }
 }
Exemplo n.º 2
0
        public override void OnDoubleClick(Mobile from)
        {
            var pm  = from as PlayerMobile;
            var acc = from.Account as Account;

            if (pm != null && acc != null && !String.IsNullOrEmpty(pm.FactionName) &&
                !string.IsNullOrEmpty(OwningFaction))
            {
                Faction     faction = Faction.Find(pm);
                PlayerState state   = PlayerState.Find(pm);
                if (faction != null && state != null && OwningFaction == faction.Definition.Name &&
                    !ObeliskUsers.ContainsKey(acc))
                {
                    if (DateTime.UtcNow <= state.LastKill + TimeSpan.FromHours(2) ||
                        from.AccessLevel > AccessLevel.Player)
                    {
                        Effects.SendIndividualFlashEffect(from, (FlashType)2);
                        from.SendMessage(61, "The obelisk fills you with great power.");
                        from.BoltEffect(2049);
                        from.HueMod = faction.Definition.HuePrimary;
                        ObeliskUsers.Add(acc, DateTime.UtcNow + TimeSpan.FromHours(2));
                    }
                    else
                    {
                        from.SendMessage(61,
                                         "You must honor thy faction with blood. Seek out an enemy faction member and slay them.  Only then will you be worthy of the focal point's power.");
                    }
                }
                else
                {
                    from.SendMessage(61, "You already wield the power of this focal point.");
                }
            }
            else
            {
                from.SendMessage(61,
                                 "You must be a part of factions and your faction must have control of this focal point in order for you to use it.");
            }
            base.OnDoubleClick(from);
        }