Пример #1
0
        public static void RealmPointsGain(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null || player.Guild == null)
            {
                return;
            }

            GainedRealmPointsEventArgs rpsArgs = args as GainedRealmPointsEventArgs;

            if (player.Guild != null)
            {
                if (player.Guild.BonusType == Guild.eBonusType.RealmPoints)
                {
                    long oldGuildRealmPoints = player.Guild.RealmPoints;
                    long bonusRealmPoints    = (long)Math.Ceiling((double)rpsArgs.RealmPoints * ServerProperties.Properties.GUILD_BUFF_RP / 100);

                    player.GainRealmPoints(bonusRealmPoints, false, false, false);
                    player.Out.SendMessage("You get an additional " + bonusRealmPoints + " realm points due to your guild's buff!", eChatType.CT_Important, eChatLoc.CL_SystemWindow);

                    if ((oldGuildRealmPoints < 100000000) && (player.Guild.RealmPoints > 100000000))
                    {
                        // Report to Newsmgr
                        string message = player.Guild.Name + " [" + GlobalConstants.RealmToName((eRealm)player.Realm) + "] has reached 100,000,000 Realm Points!";
                        NewsMgr.CreateNews(message, player.Realm, eNewsType.RvRGlobal, false);
                    }

                    player.Guild.UpdateGuildWindow();
                }
            }
        }
Пример #2
0
        public void MountRelic(GameRelic relic, bool returning)
        {
            m_mountedRelic = relic;

            if (relic.CurrentCarrier != null && returning == false)
            {
                /* Sending broadcast */
                string message = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "GameRelicPad.MountRelic.Stored", relic.CurrentCarrier.Name, GlobalConstants.RealmToName((eRealm)relic.CurrentCarrier.Realm), relic.Name, Name);
                foreach (GameClient cl in WorldMgr.GetAllPlayingClients())
                {
                    if (cl.Player.ObjectState != eObjectState.Active)
                    {
                        continue;
                    }

                    cl.Out.SendMessage(LanguageMgr.GetTranslation(cl.Account.Language, "GameRelicPad.MountRelic.Captured", GlobalConstants.RealmToName((eRealm)relic.CurrentCarrier.Realm), relic.Name), eChatType.CT_ScreenCenterSmaller, eChatLoc.CL_SystemWindow);
                    cl.Out.SendMessage(message + "\n" + message + "\n" + message, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                }

                NewsMgr.CreateNews(message, relic.CurrentCarrier.Realm, eNewsType.RvRGlobal, false);

                /* Increasing of CapturedRelics */

                // select targets to increase CapturedRelics
                // TODO increase stats
                List <GamePlayer> targets = new List <GamePlayer>();
                if (relic.CurrentCarrier.Group != null)
                {
                    foreach (GamePlayer p in relic.CurrentCarrier.Group.GetPlayersInTheGroup())
                    {
                        targets.Add(p);
                    }
                }
                else
                {
                    targets.Add(relic.CurrentCarrier);
                }

                foreach (GamePlayer target in targets)
                {
                    target.CapturedRelics++;
                }

                Notify(RelicPadEvent.RelicMounted, this, new RelicPadEventArgs(relic.CurrentCarrier, relic));
            }
            else
            {
                // relic returned to pad, probably because it was dropped on ground and timer expired.
                string message = string.Format("The {0} has been returned to {1}.", relic.Name, Name);
                foreach (GameClient cl in WorldMgr.GetAllPlayingClients())
                {
                    if (cl.Player.ObjectState != eObjectState.Active)
                    {
                        continue;
                    }

                    cl.Out.SendMessage(message + "\n" + message + "\n" + message, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                }
            }
        }
Пример #3
0
		/// <summary>
		/// Post a message in the server news and award a dragon kill point for
		/// every XP gainer in the raid.
		/// </summary>
		/// <param name="killer">The living that got the killing blow.</param>
		protected void ReportNews(GameObject killer)
		{
			int numPlayers = AwardDragonKillPoint();
			String message = String.Format("{0} has been slain by a force of {1} warriors!", Name, numPlayers);
			NewsMgr.CreateNews(message, killer.Realm, eNewsType.PvE, true);

			if (Properties.GUILD_MERIT_ON_DRAGON_KILL > 0)
			{
				foreach (GamePlayer player in GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
				{
					if (player.IsEligibleToGiveMeritPoints)
					{
						GuildEventHandler.MeritForNPCKilled(player, this, Properties.GUILD_MERIT_ON_DRAGON_KILL);
					}
				}
			}
		}
Пример #4
0
        public void RemoveRelic(GameRelic relic)
        {
            m_mountedRelic = null;

            if (relic.CurrentCarrier != null)
            {
                string message = LanguageMgr.GetTranslation(ServerProperties.Properties.SERV_LANGUAGE, "GameRelicPad.RemoveRelic.Removed", relic.CurrentCarrier.Name, GlobalConstants.RealmToName((eRealm)relic.CurrentCarrier.Realm), relic.Name, Name);
                foreach (GameClient cl in WorldMgr.GetAllPlayingClients())
                {
                    if (cl.Player.ObjectState != eObjectState.Active)
                    {
                        continue;
                    }
                    cl.Out.SendMessage(message + "\n" + message + "\n" + message, eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                }
                NewsMgr.CreateNews(message, relic.CurrentCarrier.Realm, eNewsType.RvRGlobal, false);

                Notify(RelicPadEvent.RelicStolen, this, new RelicPadEventArgs(relic.CurrentCarrier, relic));
            }
        }