/// <summary>
        /// upgrade keep to a target level
        /// </summary>
        /// <param name="targetLevel">the target level</param>
        public virtual void ChangeLevel(byte targetLevel)
        {
            this.Level = targetLevel;

            foreach (GameKeepComponent comp in this.KeepComponents)
            {
                comp.UpdateLevel();
                foreach (GameClient cln in WorldMgr.GetClientsOfRegion(this.CurrentRegion.ID))
                {
                    cln.Out.SendKeepComponentDetailUpdate(comp);
                }
                comp.FillPositions();
            }

            foreach (GameKeepGuard guard in this.Guards.Values)
            {
                SetGuardLevel(guard);
            }

            foreach (Patrol p in this.Patrols.Values)
            {
                p.ChangePatrolLevel();
            }

            foreach (GameKeepDoor door in this.Doors.Values)
            {
                door.UpdateLevel();
            }

            KeepGuildMgr.SendLevelChangeMessage(this);
            ResetPlayersOfKeep();

            this.SaveIntoDatabase();
        }
 /// <summary>
 /// Start changing the keeps level to a target level
 /// </summary>
 /// <param name="targetLevel">The target level</param>
 public void StartChangeLevel(byte targetLevel)
 {
     if (ServerProperties.Properties.ENABLE_KEEP_UPGRADE_TIMER)
     {
         if (this.Level == targetLevel)
         {
             return;
         }
         //this.TargetLevel = targetLevel;
         StartChangeLevelTimer();
         if (this.Guild != null)
         {
             KeepGuildMgr.SendChangeLevelTimeMessage(this);
         }
     }
 }
Exemple #3
0
        /// <summary>
        /// Sends message to guild for guard death with enemy count in area
        /// </summary>
        /// <param name="guard">The guard object</param>
        public static void GuardSpam(GameKeepGuard guard)
        {
            if (guard.Component == null)
            {
                return;
            }
            if (guard.Component.AbstractKeep == null)
            {
                return;
            }
            if (guard.Component.AbstractKeep.Guild == null)
            {
                return;
            }

            int    inArea  = guard.GetEnemyCountInArea();
            string message = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "GameKeepGuard.GuardSpam.Killed", guard.Name, guard.Component.AbstractKeep.Name, inArea);

            KeepGuildMgr.SendMessageToGuild(message, guard.Component.AbstractKeep.Guild);
        }