private static void EventSink_Login(LoginEventArgs args) { Mobile m = args.Mobile; if (args.Mobile.NetState == null) { return; } if (m is PlayerMobile) { PlayerMobile pm = (PlayerMobile)m; Configured c = new Configured(); XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); if (xmlplayer != null) { return; } else { if (m is PlayerMobile && c.AttachonLogon) { XmlAttach.AttachTo(m, new XMLPlayerLevelAtt()); } else { return; } } } }
public override void OnDoubleClick(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); PlayerMobile pm = from as PlayerMobile; Configured c = new Configured(); if (IsChildOf(pm.Backpack)) { if (!(Off.Enabled || Cl.Enabled)) { if (xmlplayer.MaxLevel >= c.EndMaxLvl) { pm.SendMessage("You cannot raise any farther with this!"); } else { xmlplayer.MaxLevel += m_RML; pm.SendMessage("Your MaxLevel has increased by {0}", m_RML); this.Delete(); } } } else { pm.SendMessage("This must be in your pack!"); } }
public override void OnAttach() { Configured c = new Configured(); base.OnAttach(); if (AttachedTo is PlayerMobile) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(((PlayerMobile)AttachedTo), typeof(XMLPlayerLevelAtt)); if (xmlplayer == null) { return; } else { if (xmlplayer.Levell < c.WhatLevelToDelete) { ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Dex, "XmlDex" + Name, c.StatBonusDex, TimeSpan.Zero)); ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Str, "XmlStr" + Name, c.StatBonusStr, TimeSpan.Zero)); ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Int, "XmlInt" + Name, c.StatBonusInt, TimeSpan.Zero)); InvalidateParentProperties(); } else { Delete(); } } } else { Delete(); } }
private static void EventSink_Login(LoginEventArgs args) { Mobile m = args.Mobile; if (args.Mobile.NetState == null) { return; } if (m is PlayerMobile) { PlayerMobile pm = (PlayerMobile)m; Configured c = new Configured(); XMLDeleteLevelAttOnLogin cr = new XMLDeleteLevelAttOnLogin(); XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(m, typeof(XMLPlayerLevelAtt)); if (xmlplayer != null && cr.ActivateDeleteOnLogin == true) { xmlplayer.Delete(); } else { return; } } }
public override void OnDoubleClick(Mobile from) { XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(from, typeof(XMLPlayerLevelAtt)); ExpPowerHour powerlevel = (ExpPowerHour)XmlAttach.FindAttachment(from, typeof(ExpPowerHour)); PlayerMobile pm = from as PlayerMobile; Configured c = new Configured(); var p = Party.Get(from); int range = c.PartyRange; if (IsChildOf(pm.Backpack)) { if (xmlplayer == null) { pm.SendMessage("This wont work for you!"); return; } else if (powerlevel != null) { pm.SendMessage("You must wait for your current Exp Power Hour to end!"); return; } else { if (p != null) { foreach (PartyMemberInfo mi in p.Members) { pm = mi.Mobile as PlayerMobile; if (pm.Alive && pm.InRange(pm, range)) { XMLPlayerLevelAtt xmlplayer2 = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt)); ExpPowerHour powerlevel2 = (ExpPowerHour)XmlAttach.FindAttachment(pm, typeof(ExpPowerHour)); if (powerlevel2 != null) { pm.SendMessage("You already have a power hour, your party gains their bonus!"); return; } if (xmlplayer2 == null) { pm.SendMessage("You lack level attachment, talk to your admin!"); return; } else { XmlAttach.AttachTo(pm, new ExpPowerHour()); this.Delete(); } } } } XmlAttach.AttachTo(from, new ExpPowerHour()); this.Delete(); } } else { pm.SendMessage("This must be in your pack!"); } }
private void AddToConfigured <TOptions>(string type, Action <TOptions> action) where TOptions : class { if (!Configured.Contains(type)) { Configured.Add(type); ServiceCollection.Configure(action); } }
/// <summary> /// Sets the run mode. /// </summary> /// <param name="isLite">if set to <c>true</c> [is lite].</param> public void SetRunMode(bool isLite) { Current = isLite ? TypeOfRunMode.Lite : TypeOfRunMode.Full; Configured.SetDefaultRunMode(Current); Save(Configured, GetLoadPath(), TypeOfMedia.XML); Mediator.Publish(Message.Create(Current)); }
public static void Gain(Mobile from, Skill skill) { #region Level System Configured c = new Configured(); if (c.DisableSkillGain == true && from is PlayerMobile) { return; } #endregion Gain(from, skill, (int)(from.Region.SkillGain(from) * 10)); }
public DIHelper Configure <TOptions>(string name, Action <TOptions> configureOptions) where TOptions : class { var serviceName = $"{typeof(TOptions)}{name}"; if (!Configured.Contains(serviceName)) { Configured.Add(serviceName); ServiceCollection.Configure(name, configureOptions); } return(this); }
public override void OnDelete() { Configured c = new Configured(); base.OnDelete(); if (AttachedTo is PlayerMobile) { ((PlayerMobile)AttachedTo).Str -= StrVar; ((PlayerMobile)AttachedTo).Dex -= DexVar; ((PlayerMobile)AttachedTo).Int -= IntVar; InvalidateParentProperties(); } }
public override void OnDelete() { Configured c = new Configured(); base.OnDelete(); if (AttachedTo is PlayerMobile) { /* Sanity Check, ensure the StatMod is Removed */ ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Dex, "XmlDex" + Name, c.StatBonusDex, m_Duration)); ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Str, "XmlStr" + Name, c.StatBonusStr, m_Duration)); ((PlayerMobile)AttachedTo).AddStatMod(new StatMod(StatType.Int, "XmlInt" + Name, c.StatBonusInt, m_Duration)); InvalidateParentProperties(); } }
public static void GetAttPetSet(Mobile pet, Mobile master) { Configured cpc = new Configured(); BaseCreature bc = (BaseCreature)pet; XMLPetLevelAtt petxml = (XMLPetLevelAtt)XmlAttach.FindAttachment(bc, typeof(XMLPetLevelAtt)); if (petxml == null) { XmlAttach.AttachTo(bc, new XMLPetLevelAtt()); if (cpc.TamingGivesExp == true) LevelCore.Taming(master); } else return; }
public void SaveConfiguration() { Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); config.AppSettings.Settings[nameof(Configured)].Value = Configured.ToString(); config.AppSettings.Settings[nameof(ConnectionString)].Value = ConnectionString.ToString(); config.AppSettings.Settings[nameof(JwtIssuer)].Value = JwtIssuer.ToString(); config.AppSettings.Settings[nameof(JwtAudience)].Value = JwtAudience.ToString(); config.AppSettings.Settings[nameof(JwtExpiryInDays)].Value = JwtExpiryInDays.ToString(); config.AppSettings.Settings[nameof(JwtSecurityKey)].Value = JwtSecurityKey.ToString(); //config.AppSettings.Settings[nameof(ExtendsClassApi)].Value = ExtendsClassApi.ToString(); config.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection(config.AppSettings.SectionInformation.Name); }
private static void EventSink_Login(LoginEventArgs args) { Mobile m = args.Mobile; if (args.Mobile.NetState == null) { return; } if (m is PlayerMobile) { PlayerMobile pm = (PlayerMobile)m; Configured c = new Configured(); XMLNewPlayer xmlnewplayers = (XMLNewPlayer)XmlAttach.FindAttachment(m, typeof(XMLNewPlayer)); if (xmlnewplayers != null) { if (c.LowLevelBonus == false) { XMLNewPlayer xmldel = (XMLNewPlayer)XmlAttach.FindAttachment(m, typeof(XMLNewPlayer)); xmldel.Delete(); } else { return; } } else { if (m is PlayerMobile && c.LowLevelBonus) { XmlAttach.AttachTo(m, new XMLNewPlayer()); } else { return; } } } }
public override void OnKill(Mobile killed, Mobile killer) { ConfiguredPetXML cp = new ConfiguredPetXML(); Configured cc = new Configured(); if (cc.ExpGainFromKill == true) { LevelHandler.Set(killer, killed); } if (killer is PlayerMobile) { PlayerMobile master = (PlayerMobile)killer; List <Mobile> pets = master.AllFollowers; if (pets.Count > 0) { for (int i = 0; i < pets.Count; ++i) { Mobile pet = (Mobile)pets[i]; if (pet is IMount && ((IMount)pet).Rider != null) { if (cp.MountedPetsGainEXP == false) { return; } } if (cp.EnabledLevelPets == true) { LevelHandlerPet.Set(pet, killed); } } } } }
public ConfirmBankPointsGump(PlayerMobile user, Mobile owner, BODType type, int points, double banked) : base(user, 1157076, 1157077, new object[] { points, banked, type, owner }, String.Format("{0}\t{1}", banked.ToString("0.000000"), points.ToString()), OnSave, OnClaim) { Closable = false; user.CloseGump(typeof(ConfirmBankPointsGump)); Points = points; Banked = banked; this.BODType = type; Owner = owner; Rectangle2D rec = ItemBounds.Table[0x2258]; AddItem(115 + rec.Width / 2 - rec.X, 110 + rec.Height / 2 - rec.Y, 0x2258, BulkOrderSystem.GetBodHue(this.BODType)); #region Level System Mod Configured c = new Configured(); if (c.GainExpFromBods == true) { LevelHandler.BodGainEXP(user, (int)points); } #endregion }
public static string ComputeTitle(Mobile beholder, Mobile beheld) { StringBuilder title = new StringBuilder(); bool showSkillTitle = beheld.ShowFameTitle && ((beholder == beheld) || (beheld.Fame >= 5000)); if (Core.UOR && beheld.ShowFameTitle && beheld is PlayerMobile && ((PlayerMobile)beheld).FameKarmaTitle != null) //UOSI- Core.SA { title.AppendFormat(((PlayerMobile)beheld).FameKarmaTitle, beheld.Name, beheld.Female ? "Lady" : "Lord"); } else if (beheld.ShowFameTitle || (beholder == beheld)) { title.Append(ComputeFameTitle(beheld)); } else { title.Append(beheld.Name); } if (beheld is PlayerMobile && ((PlayerMobile)beheld).DisplayChampionTitle) { PlayerMobile.ChampionTitleInfo info = ((PlayerMobile)beheld).ChampionTitles; if (Core.UOR) //UOSI- Core.SA { if (((PlayerMobile)beheld).CurrentChampTitle != null) { title.AppendFormat(((PlayerMobile)beheld).CurrentChampTitle); } } else if (info.Harrower > 0) { title.AppendFormat(": {0} of Evil", HarrowerTitles[Math.Min(HarrowerTitles.Length, info.Harrower) - 1]); } else { int highestValue = 0, highestType = 0; for (int i = 0; i < ChampionSpawnInfo.Table.Length; i++) { int v = info.GetValue(i); if (v > highestValue) { highestValue = v; highestType = i; } } int offset = 0; if (highestValue > 800) { offset = 3; } else if (highestValue > 300) { offset = (int)(highestValue / 300); } if (offset > 0) { ChampionSpawnInfo champInfo = ChampionSpawnInfo.GetInfo((ChampionSpawnType)highestType); title.AppendFormat(": {0} of the {1}", champInfo.LevelNames[Math.Min(offset, champInfo.LevelNames.Length) - 1], champInfo.Name); } } } string customTitle = beheld.Title; if (Core.UOR) //UOSI- Core.SA { #region Level System PlayerMobile pm = beheld as PlayerMobile; XMLPlayerLevelAtt xmlplayer = (XMLPlayerLevelAtt)XmlAttach.FindAttachment(pm, typeof(XMLPlayerLevelAtt)); Configured c = new Configured(); if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null) { if (c.PaperdollLevel) { string d = LevelCore.Display(pm, new Configured()); title.Append(" - Level " + d + ", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); } else { title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); } } else if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle == null) { string d = LevelCore.Display(pm, new Configured()); if (c.PaperdollLevel) { if (pm.AccessLevel > AccessLevel.Player && c.StaffHasLevel) { title.Append(" - Level " + d); } else { if (pm.AccessLevel < AccessLevel.GameMaster) { title.Append(" - Level " + d); } } } } else if (beheld is BaseVendor) { title.AppendFormat(" {0}", customTitle); } /* * if (beheld is PlayerMobile && ((PlayerMobile)beheld).PaperdollSkillTitle != null) * title.Append(", ").Append(((PlayerMobile)beheld).PaperdollSkillTitle); * else if (beheld is BaseVendor) * title.AppendFormat(" {0}", customTitle); */ #endregion } else if (customTitle != null && (customTitle = customTitle.Trim()).Length > 0) { title.AppendFormat(" {0}", customTitle); } else if (showSkillTitle && beheld.Player) { string skillTitle = GetSkillTitle(beheld); if (skillTitle != null) { title.Append(", ").Append(skillTitle); } } return(title.ToString()); }
/// <summary> /// Sets the timeout in minutes. /// </summary> /// <param name="newTimeout">The new timeout.</param> public void SetTimeoutInMinutes(int newTimeout) { Configured.SetTimeoutInMinutes(newTimeout); Save(Configured, GetLoadPath(), TypeOfMedia.XML); }
private void OnConfigured(object sender, CameraCaptureSessionStateEventArgs args) => Configured?.Invoke(sender, args);
/// <summary> /// Sets the name of the instance. /// </summary> /// <param name="newName">The new name.</param> public void SetInstanceName(string newName) { Configured.SetInstanceName(newName); Save(Configured, GetLoadPath(), TypeOfMedia.XML); }
public override void OnAttach() { base.OnAttach(); if (AttachedTo is PlayerMobile) { PlayerStatsConfig psc = new PlayerStatsConfig(); Configured c = new Configured(); if (this.m_Levell == 0) { m_Levell = 1; m_MaxLevel = c.StartMaxLvl; m_ToLevell = 100; } PlayerAttloop loop = (PlayerAttloop)XmlAttach.FindAttachment((((PlayerMobile)this.AttachedTo)), typeof(PlayerAttloop)); if (loop == null) { XmlAttach.AttachTo((((PlayerMobile)this.AttachedTo)), new PlayerAttloop()); } if (psc.ForceStartingStats == true) { (((PlayerMobile)this.AttachedTo)).RawStr = psc.ForceStartingStatsSTR; (((PlayerMobile)this.AttachedTo)).RawDex = psc.ForceStartingStatsDEX; (((PlayerMobile)this.AttachedTo)).RawInt = psc.ForceStartingStatsINT; } if (psc.ForceNewPlayerIntoGuild == true) { PlayerStatsConfig.ForceIntoGuild((((PlayerMobile)this.AttachedTo))); } if (psc.AddToBackpackOnAttach == true) { PlayerStatsConfig.CustomBackPackDrops((((PlayerMobile)this.AttachedTo))); } if (psc.NewStartingLocation == true) { PlayerStatsConfig.StartingLocation((((PlayerMobile)this.AttachedTo))); } if (psc.AutoActivate_GemMining == true) { (((PlayerMobile)this.AttachedTo)).GemMining = true; } if (psc.AutoActivate_BasketWeaving == true) { (((PlayerMobile)this.AttachedTo)).BasketWeaving = true; } if (psc.AutoActivate_CanBuyCarpets == true) { (((PlayerMobile)this.AttachedTo)).CanBuyCarpets = true; } if (psc.AutoActivate_AcceptGuildInvites == true) { (((PlayerMobile)this.AttachedTo)).AcceptGuildInvites = true; } if (psc.AutoActivate_Glassblowing == true) { (((PlayerMobile)this.AttachedTo)).Glassblowing = true; } if (psc.AutoActivate_LibraryFriend == true) { (((PlayerMobile)this.AttachedTo)).LibraryFriend = true; } if (psc.AutoActivate_Masonry == true) { (((PlayerMobile)this.AttachedTo)).Masonry = true; } if (psc.AutoActivate_SandMining == true) { (((PlayerMobile)this.AttachedTo)).SandMining = true; } if (psc.AutoActivate_StoneMining == true) { (((PlayerMobile)this.AttachedTo)).StoneMining = true; } if (psc.AutoActivate_Spellweaving == true) { (((PlayerMobile)this.AttachedTo)).Spellweaving = true; } if (psc.AutoActivate_MechanicalLife == true) { (((PlayerMobile)this.AttachedTo)).MechanicalLife = true; } if (psc.AutoActivate_DisabledPvpWarning == true) { (((PlayerMobile)this.AttachedTo)).DisabledPvpWarning = true; } if (psc.AutoActivate_isYoung == true) { (((PlayerMobile)this.AttachedTo)).Young = true; } if (psc.AutoActivate_CantWalk == true) { (((PlayerMobile)this.AttachedTo)).CantWalk = true; } if (psc.AutoActivate_MaxFollowSlots == true) { (((PlayerMobile)this.AttachedTo)).FollowersMax = psc.AutoActivate_MaxFollowSlotsTotal; } if (psc.AutoActivate_SkillsCap == true) { (((PlayerMobile)this.AttachedTo)).SkillsCap = psc.AutoActivate_SkillsCapVar; } if (psc.AutoActivate_StartingTotalStatCap == true) { (((PlayerMobile)this.AttachedTo)).StatCap = psc.AutoActivate_StartingTotalStatCapVar; } } else { Delete(); } }
void OnConfigured(C context) { Configured?.BeginInvoke(context, new AsyncCallback(x => {}), this); }
public override void OnConfigured(CameraCaptureSession session) { Configured?.Invoke(this, session); }
private static Configured SetProp(Configured allprop, Configured prop, bool bSet) { allprop &= (Configured.All ^ prop); if (bSet) allprop |= prop; return allprop; }
private void _SetProp(Configured prop, bool bSet) { this._configuredProperties &= (Configured.All ^ prop); if (bSet) this._configuredProperties |= prop; }
private void OnConfigured() { Configured?.Invoke(this, EventArgs.Empty); }