Ejemplo n.º 1
0
        public static void SetCreator(BattlegroundId id, string typeName)
        {
            Type type = ServerApp <WCell.RealmServer.RealmServer> .GetType(typeName);

            BattlegroundTemplate template = BattlegroundMgr.GetTemplate(id);

            if (type == (Type)null || template == null)
            {
                object obj1;
                object obj2;
                if (type == (Type)null)
                {
                    obj1 = (object)"type";
                    obj2 = (object)string.Format("({0}) - Please correct it in the Battleground-config file: {1}",
                                                 (object)typeName, (object)InstanceConfigBase <BattlegroundConfig, BattlegroundId> .Filename);
                }
                else
                {
                    obj1 = (object)"Template";
                    obj2 = (object)"<not in DB>";
                }

                BattlegroundMgr.log.Warn("Battleground {0} has invalid {1} {2}", (object)id, obj1, obj2);
            }
            else
            {
                IProducer producer = AccessorMgr.GetOrCreateDefaultProducer(type);
                template.Creator = (BattlegroundCreator)(() => (Battleground)producer.Produce());
            }
        }
Ejemplo n.º 2
0
 public BattlegroundQueue(BattlegroundTemplate template, int bracketId, int minLevel, int maxLevel)
     : this()
 {
     m_Template  = template;
     m_BracketId = bracketId;
     m_MinLevel  = minLevel;
     m_MaxLevel  = maxLevel;
 }
Ejemplo n.º 3
0
		public BattlegroundQueue(BattlegroundTemplate template, int lvlBracket, int minLevel, int maxLevel)
			: this()
		{
			m_Template = template;
			m_LevelBracket = lvlBracket;
			m_MinLevel = minLevel;
			m_MaxLevel = maxLevel;
		}
Ejemplo n.º 4
0
 public BattlegroundQueue(BattlegroundTemplate template, int bracketId, int minLevel, int maxLevel)
     : this()
 {
     m_Template = template;
     m_BracketId = bracketId;
     m_MinLevel = minLevel;
     m_MaxLevel = maxLevel;
 }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bm"></param>
        /// <param name="chr"></param>
        public static void TalkToBattlemaster(this NPC bm, Character chr)
        {
            chr.OnInteract(bm);

            BattlegroundTemplate templ = bm.Entry.BattlegroundTemplate;

            if (templ != null)
            {
                GlobalBattlegroundQueue queue = templ.GetQueue(chr.Level);
                if (queue != null)
                {
                    BattlegroundHandler.SendBattlefieldList(chr, queue);
                }
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bm"></param>
        /// <param name="chr"></param>
        public static void TalkToBattlemaster(this NPC bm, Character chr)
        {
            chr.OnInteract((WorldObject)bm);
            BattlegroundTemplate battlegroundTemplate = bm.Entry.BattlegroundTemplate;

            if (battlegroundTemplate == null)
            {
                return;
            }
            GlobalBattlegroundQueue queue = battlegroundTemplate.GetQueue(chr.Level);

            if (queue == null)
            {
                return;
            }
            BattlegroundHandler.SendBattlefieldList(chr, queue);
        }
Ejemplo n.º 7
0
        public BattlegroundTeam(BattlegroundTeamQueue queue, BattlegroundSide side, Battleground battleground)
        {
            this.Queue         = queue;
            this.Side          = side;
            this._battleground = battleground;
            BattlegroundTemplate template = battleground.Template;

            if (side == BattlegroundSide.Alliance)
            {
                this._startPosition    = template.AllianceStartPosition;
                this._startOrientation = template.AllianceStartOrientation;
            }
            else
            {
                this._startPosition    = template.HordeStartPosition;
                this._startOrientation = template.HordeStartOrientation;
            }
        }
Ejemplo n.º 8
0
 /// <summary>Enqueues players in a battleground queue.</summary>
 /// <param name="chr">the character who enqueued</param>
 /// <param name="bgId">the type of battleground</param>
 /// <param name="instanceId">the instance id of the battleground</param>
 /// <param name="asGroup">whether or not to enqueue the character or his/her group</param>
 internal static void EnqueuePlayers(Character chr, BattlegroundId bgId, uint instanceId, bool asGroup)
 {
     if (!chr.Battlegrounds.HasAvailableQueueSlots)
     {
         BattlegroundHandler.SendBattlegroundError((IPacketReceiver)chr, BattlegroundJoinError.Max3Battles);
     }
     else
     {
         if (chr.Battlegrounds.IsEnqueuedFor(bgId))
         {
             return;
         }
         BattlegroundTemplate template = BattlegroundMgr.GetTemplate(bgId);
         if (template == null)
         {
             return;
         }
         template.TryEnqueue(chr, asGroup, instanceId);
     }
 }
Ejemplo n.º 9
0
        public void FinalizeDataHolder()
        {
            NPCEntry entry = NPCMgr.GetEntry(this.BattleMasterId);

            if (entry == null)
            {
                ContentMgr.OnInvalidDBData("Invalid BattleMaster in: " + (object)this);
            }
            else
            {
                BattlegroundTemplate template = BattlegroundMgr.GetTemplate(this.BattlegroundId);
                if (template == null)
                {
                    ContentMgr.OnInvalidDBData("Invalid Battleground in: " + (object)this);
                }
                else
                {
                    entry.BattlegroundTemplate = template;
                }
            }
        }
Ejemplo n.º 10
0
		public Battleground(int minLevel, int maxlevel, BattlegroundTemplate template)
		{
			_minLevel = minLevel;
			_maxLevel = maxlevel;
			_template = template;
		}
Ejemplo n.º 11
0
 public Battleground(int minLevel, int maxlevel, BattlegroundTemplate template)
 {
     _minLevel = minLevel;
     _maxLevel = maxlevel;
     _template = template;
 }
Ejemplo n.º 12
0
 public GlobalBattlegroundQueue(BattlegroundTemplate template, int lvlBracket, int minLevel, int maxLevel) :
     base(template, lvlBracket, minLevel, maxLevel)
 {
     SetThreshold();
 }
Ejemplo n.º 13
0
 public GlobalBattlegroundQueue(BattlegroundTemplate template) :
     this(template, 0, 0, RealmServerConfiguration.MaxCharacterLevel)
 {
 }