Esempio n. 1
0
        public void FinalizeDataHolder()
        {
            this.Race  = ArchetypeMgr.GetRace(this.RaceId);
            this.Class = ArchetypeMgr.GetClass(this.ClassId);
            if (this.Class != null)
            {
                BaseRace race = this.Race;
            }

            Archetype[] archetypeArray = ArchetypeMgr.Archetypes[(uint)this.ClassId];
            if (archetypeArray == null)
            {
                ArchetypeMgr.Archetypes[(uint)this.ClassId] =
                    archetypeArray = new Archetype[WCellConstants.RaceTypeLength];
            }
            this.StartLocation =
                (IWorldZoneLocation) new WorldZoneLocation(this.StartMapId, this.StartPosition, this.StartZoneId);
            if (this.StartLocation.Map == null)
            {
                LogManager.GetCurrentClassLogger().Warn("Failed to initialize Archetype \"" + (object)this +
                                                        "\" - StartMap does not exist: " + (object)this.StartMapId);
            }
            else
            {
                archetypeArray[(uint)this.RaceId] = this;
            }
        }
Esempio n. 2
0
        public void FinalizeDataHolder()
        {
            Race  = ArchetypeMgr.GetRace(RaceId);
            Class = ArchetypeMgr.GetClass(ClassId);

            if (Class == null || Race == null)
            {
                //throw new ContentException("Could not load Archetype \"{0}\" - Invalid Class or race.", this);
            }

            var races = ArchetypeMgr.Archetypes[(uint)ClassId];

            if (races == null)
            {
                ArchetypeMgr.Archetypes[(uint)ClassId] = races = new Archetype[WCellConstants.RaceTypeLength];
            }

            StartLocation = new WorldZoneLocation(StartMapId, StartPosition, StartZoneId);
            if (StartLocation.Map == null)
            {
                LogManager.GetCurrentClassLogger().Warn("Failed to initialize Archetype \"" + this + "\" - StartMap does not exist: " + StartMapId);
                //ArrayUtil.Set(ref RaceClassMgr.BaseRaces, (uint)Id, null);
            }
            else
            {
                /*if (StartLocation.ZoneTemplate == null)
                 * {
                 *      LogManager.GetCurrentClassLogger().Warn("Failed to initialize Archetype \"" + this +
                 *                                                               "\" - StartZone \"" + StartZoneId + "\" does not exist in StartMap \"" +
                 *                                                               StartMapId + "\"");
                 *      //ArrayUtil.Set(ref RaceClassMgr.BaseRaces, (uint)Id, null);
                 * }
                 * else
                 * {*/
                races[(uint)RaceId] = this;
                //}
            }

            //get levelstats
        }
Esempio n. 3
0
		public void FinalizeDataHolder()
		{
			Race = ArchetypeMgr.GetRace(RaceId);
			Class = ArchetypeMgr.GetClass(ClassId);

			if (Class == null || Race == null)
			{
				throw new ContentException("Could not load Archetype \"{0}\" - Invalid Class or race.", this);
			}

			var races = ArchetypeMgr.Archetypes[(uint)ClassId];
			if (races == null)
			{
				ArchetypeMgr.Archetypes[(uint)ClassId] = races = new Archetype[WCellDef.RaceTypeLength];
			}

			StartLocation = new WorldZoneLocation(StartMapId, StartPosition, StartZoneId);
			if (StartLocation.Map == null)
			{
				LogManager.GetCurrentClassLogger().Warn("Failed to initialize Archetype \"" + this + "\" - StartMap does not exist: " + StartMapId);
				//ArrayUtil.Set(ref RaceClassMgr.BaseRaces, (uint)Id, null);
			}
			else
			{
				if (StartLocation.ZoneTemplate == null)
				{
					LogManager.GetCurrentClassLogger().Warn("Failed to initialize Archetype \"" + this +
												 "\" - StartZone \"" + StartZoneId + "\" does not exist in StartMap \"" +
												 StartMapId + "\"");
					//ArrayUtil.Set(ref RaceClassMgr.BaseRaces, (uint)Id, null);
				}
				else
				{
					races[(uint)RaceId] = this;
				}
			}

			//get levelstats
		}