Exemplo n.º 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();
                }
            }
        }
Exemplo n.º 2
0
        public static void RealmRankUp(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;

            if (player == null)
            {
                return;
            }

            if (!player.IsEligibleToGiveMeritPoints)
            {
                return;
            }

            GainedRealmPointsEventArgs rpsArgs = args as GainedRealmPointsEventArgs;

            if (player.RealmLevel % 10 == 0)
            {
                int newRR = 0;
                newRR = ((player.RealmLevel / 10) + 1);
                if (player.Guild != null && player.RealmLevel > 45)
                {
                    int a = (int)Math.Pow((3 * (newRR - 1)), 2);
                    player.Guild.GainMeritPoints(a);
                    player.Out.SendMessage("Your guild is awarded " + (int)Math.Pow((3 * (newRR - 1)), 2) + " merit points!", eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                }
            }
            else if (player.RealmLevel > 60)
            {
                int RRHigh = ((int)Math.Floor(player.RealmLevel * 0.1) + 1);
                int RRLow  = (player.RealmLevel % 10);
                if (player.Guild != null)
                {
                    int a = (int)Math.Pow((3 * (RRHigh - 1)), 2);
                    player.Guild.GainMeritPoints(a);
                    player.Out.SendMessage("Your guild is awarded " + (int)Math.Pow((3 * (RRHigh - 1)), 2) + " merit points!", eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                }
            }
            else
            {
                if (player.RealmLevel > 10)
                {
                    if (player.Guild != null)
                    {
                        int RRHigh = ((int)Math.Floor(player.RealmLevel * 0.1) + 1);
                        int a      = (int)Math.Pow((3 * (RRHigh - 1)), 2);
                        player.Guild.GainMeritPoints(a);
                        player.Out.SendMessage("Your guild is awarded " + (int)Math.Pow((3 * (RRHigh - 1)), 2) + " merit points!", eChatType.CT_Important, eChatLoc.CL_SystemWindow);
                    }
                }
            }

            if (player.Guild != null)
            {
                player.Guild.UpdateGuildWindow();
            }
        }
Exemplo n.º 3
0
        protected void RealmPointGain(DOLEvent e, object sender, EventArgs args)
        {
            if (sender is GamePlayer && args is GainedRealmPointsEventArgs)
            {
                GamePlayer player = sender as GamePlayer;
                GainedRealmPointsEventArgs arg = args as GainedRealmPointsEventArgs;

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

                if (player.MinotaurRelic.XP < MinotaurRelicManager.MAX_RELIC_EXP)
                {
                    player.MinotaurRelic.XP += (int)arg.RealmPoints / 6;
                }
            }
        }
Exemplo n.º 4
0
        public static void GainedRealmPointsCallback(DOLEvent e, object sender, EventArgs args)
        {
            GamePlayer player = sender as GamePlayer;
            GainedRealmPointsEventArgs gargs = args as GainedRealmPointsEventArgs;

            if (player == null || gargs == null)
            {
                return;
            }

            PlayerStatistics stats = player.Statistics as PlayerStatistics;

            if (stats == null)
            {
                return;
            }

            stats.TotalRP += (uint)gargs.RealmPoints;
        }