Exemple #1
0
        /// <summary>
        /// When Lord dies, we update Area Mgr to call the various functions we need
        /// And update the player stats
        /// </summary>
        /// <param name="killer">The killer object</param>
        public override void Die(GameObject killer)
        {
            m_lastRealm = eRealm.None;

            if (ServerProperties.Properties.LOG_KEEP_CAPTURES)
            {
                try
                {
                    if (Component != null)
                    {
                        DOL.Database.KeepCaptureLog keeplog = new DOL.Database.KeepCaptureLog();
                        keeplog.KeepName = Component.AbstractKeep.Name;

                        if (Component.AbstractKeep is GameKeep)
                        {
                            keeplog.KeepType = "Keep";
                        }
                        else
                        {
                            keeplog.KeepType = "Tower";
                        }

                        keeplog.NumEnemies  = GetEnemyCountInArea();
                        keeplog.RPReward    = RealmPointsValue;
                        keeplog.BPReward    = BountyPointsValue;
                        keeplog.XPReward    = ExperienceValue;
                        keeplog.MoneyReward = MoneyValue;

                        if (Component.AbstractKeep.StartCombatTick > 0)
                        {
                            keeplog.CombatTime = (int)((Component.AbstractKeep.CurrentRegion.Time - Component.AbstractKeep.StartCombatTick) / 1000 / 60);
                        }

                        keeplog.CapturedBy = GlobalConstants.RealmToName(killer.Realm);

                        string listRPGainers = string.Empty;

                        foreach (System.Collections.DictionaryEntry de in XPGainers)
                        {
                            GameLiving living = de.Key as GameLiving;
                            if (living != null)
                            {
                                listRPGainers += living.Name + ";";
                            }
                        }

                        keeplog.RPGainerList = listRPGainers.TrimEnd(';');

                        GameServer.Database.AddObject(keeplog);
                    }
                    else
                    {
                        log.Error("Component null for Guard Lord " + Name);
                    }
                }
                catch (System.Exception ex)
                {
                    log.Error("KeepCaptureLog Exception", ex);
                }
            }

            base.Die(killer);

            if (Component != null)
            {
                GameServer.ServerRules.ResetKeep(this, killer);
            }

            m_lastKillTime = CurrentRegion.Time;
        }
Exemple #2
0
		/// <summary>
		/// When Lord dies, we update Area Mgr to call the various functions we need
		/// And update the player stats
		/// </summary>
		/// <param name="killer">The killer object</param>
		public override void Die(GameObject killer)
		{
			m_lastRealm = eRealm.None;

			if (ServerProperties.Properties.LOG_KEEP_CAPTURES)
			{
				try
				{
					if (this.Component != null)
					{
						DOL.Database.KeepCaptureLog keeplog = new DOL.Database.KeepCaptureLog();
						keeplog.KeepName = Component.Keep.Name;

						if (Component.Keep is GameKeep)
							keeplog.KeepType = "Keep";
						else
							keeplog.KeepType = "Tower";

						keeplog.NumEnemies = GetEnemyCountInArea();
						keeplog.RPReward = RealmPointsValue;
						keeplog.BPReward = BountyPointsValue;
						keeplog.XPReward = ExperienceValue;
						keeplog.MoneyReward = MoneyValue;

						if (Component.Keep.StartCombatTick > 0)
						{
							keeplog.CombatTime = (int)((Component.Keep.CurrentRegion.Time - Component.Keep.StartCombatTick) / 1000 / 60);
						}

						keeplog.CapturedBy = GlobalConstants.RealmToName(killer.Realm);

						string listRPGainers = "";

						foreach (System.Collections.DictionaryEntry de in XPGainers)
						{
							GameLiving living = de.Key as GameLiving;
							if (living != null)
							{
								listRPGainers += living.Name + ";";
							}
						}

						keeplog.RPGainerList = listRPGainers.TrimEnd(';');

						GameServer.Database.AddObject(keeplog);
					}
					else
					{
						log.Error("Component null for Guard Lord " + Name);
					}
				}
				catch (System.Exception ex)
				{
					log.Error("KeepCaptureLog Exception", ex);
				}
			}

			base.Die(killer);

			if (this.Component != null)
			{
				GameServer.ServerRules.ResetKeep(this, killer);
			}

			m_lastKillTime = CurrentRegion.Time;
		}