public void ApplyStates()
 {
     this._oldLayerCore = Layer.core;
     Layer.core         = this.layerCore;
     this._oldLevelCore = Level.core;
     Level.core         = this.levelCore;
 }
Exemplo n.º 2
0
		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;
		}
Exemplo n.º 3
0
        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());
        }
 public GameContext()
 {
     this.layerCore = new LayerCore();
     this.layerCore.InitializeLayers();
     this.levelCore = new LevelCore();
 }
Exemplo n.º 5
0
 private void Start()
 {
     levelCore = GameManager.Instance.LvlCore;
 }