Example #1
0
        /// <summary>
        /// 关闭庆功宴
        /// </summary>
        private void CloseQingGongYan()
        {
            // 销毁怪物
            if (null != QingGongYanNpc)
            {
                NPCGeneralManager.RemoveMapNpc(QingGongYanNpc.MapCode, QingGongYanNpc.NpcID);
                QingGongYanNpc = null;
            }
            QingGongYanOpenFlag = false;

            // log it...

            // 档次没有配置
            QingGongYanInfo InfoData = GetInfoData();

            if (null == InfoData)
            {
                return;
            }

            if (InfoData.ZuanShiCoe <= 0)
            {
                return;
            }

            int JoinMoney    = GameManager.GameConfigMgr.GetGameConfigItemInt(GameConfigNames.QGYJoinMoney, 0);
            int ZuanShiAward = JoinMoney / InfoData.ZuanShiCoe;
            int DBRoleID     = GameManager.GameConfigMgr.GetGameConfigItemInt(GameConfigNames.QGYRoleID, 0);

            if (DBRoleID <= 0)
            {
                return;
            }

            //string sContent = "您在2015年02月02日 20:00举办的宴会已成功结束,共获得收益200钻石。";
            string sContent = string.Format(Global.GetLang("您在{0:0000}年{1:00}月{2:00}日 {3:00}点{4:00}分举办的宴会已成功结束,共获得收益{5}钻石。"), TimeUtil.NowDateTime().Year, TimeUtil.NowDateTime().Month, TimeUtil.NowDateTime().Day, DateTime.Parse(InfoData.BeginTime).Hour, DateTime.Parse(InfoData.BeginTime).Minute, ZuanShiAward);

            Global.UseMailGivePlayerAward3(DBRoleID, null, Global.GetLang("庆功宴"), sContent, ZuanShiAward);

            // 清空记录
            Global.UpdateDBGameConfigg(GameConfigNames.QGYRoleID, "");
            GameManager.GameConfigMgr.SetGameConfigItem(GameConfigNames.QGYRoleID, "");
            Global.UpdateDBGameConfigg(GameConfigNames.QGYGuildName, "");
            GameManager.GameConfigMgr.SetGameConfigItem(GameConfigNames.QGYGuildName, "");
            Global.UpdateDBGameConfigg(GameConfigNames.QGYStartDay, "");
            GameManager.GameConfigMgr.SetGameConfigItem(GameConfigNames.QGYStartDay, "");
            Global.UpdateDBGameConfigg(GameConfigNames.QGYGrade, "");
            GameManager.GameConfigMgr.SetGameConfigItem(GameConfigNames.QGYGrade, "");
            Global.UpdateDBGameConfigg(GameConfigNames.QGYJoinCount, "");
            GameManager.GameConfigMgr.SetGameConfigItem(GameConfigNames.QGYJoinCount, "");
            Global.UpdateDBGameConfigg(GameConfigNames.QGYJoinMoney, "");
            GameManager.GameConfigMgr.SetGameConfigItem(GameConfigNames.QGYJoinMoney, "");
            Global.UpdateDBGameConfigg(GameConfigNames.QGYJuBanMoney, "");
            GameManager.GameConfigMgr.SetGameConfigItem(GameConfigNames.QGYJuBanMoney, "");

            //播放用户行为消息
            string broadCastMsg = StringUtil.substitute(Global.GetLang("本次罗兰宴会已圆满结束,愿大家满载而归!"));

            Global.BroadcastRoleActionMsg(null, RoleActionsMsgTypes.Bulletin, broadCastMsg, true, GameInfoTypeIndexes.Hot, ShowGameInfoTypes.SysHintAndChatBox);
        }
Example #2
0
 public void MarryPartyPeriodicUpdate(long ticks)
 {
     if (ticks >= this.NextUpdateTime)
     {
         this.NextUpdateTime = ticks + 10000L;
         bool showNPC = this.m_MarryPartyDataCache.HasPartyStarted(ticks);
         if (showNPC != this.MarryPartyNPCShow)
         {
             this.MarryPartyNPCShow = showNPC;
             if (showNPC)
             {
                 GameMap gameMap = GameManager.MapMgr.DictMaps[this.MarryPartyNPCConfig.MapCode];
                 NPC     npc     = NPCGeneralManager.GetNPCFromConfig(this.MarryPartyNPCConfig.MapCode, this.MarryPartyNPCConfig.NpcID, this.MarryPartyNPCConfig.NpcX, this.MarryPartyNPCConfig.NpcY, this.MarryPartyNPCConfig.NpcDir);
                 if (null != npc)
                 {
                     if (NPCGeneralManager.AddNpcToMap(npc))
                     {
                         this.MarryPartyNpc = npc;
                     }
                     else
                     {
                         LogManager.WriteLog(LogTypes.Error, string.Format("add marry party npc failure, MapCode={0}, NpcID={1}", this.MarryPartyNPCConfig.MapCode, this.MarryPartyNPCConfig.NpcID), null, true);
                     }
                 }
             }
             else if (null != this.MarryPartyNpc)
             {
                 NPCGeneralManager.RemoveMapNpc(this.MarryPartyNPCConfig.MapCode, this.MarryPartyNPCConfig.NpcID);
                 this.MarryPartyNpc = null;
             }
         }
     }
 }
Example #3
0
        private void CloseQingGongYan()
        {
            if (null != this.QingGongYanNpc)
            {
                NPCGeneralManager.RemoveMapNpc(this.QingGongYanNpc.MapCode, this.QingGongYanNpc.NpcID);
                this.QingGongYanNpc = null;
                GameManager.ClientMgr.BroadcastServerCmd(733, "0", false);
            }
            this.QingGongYanOpenFlag = false;
            QingGongYanInfo InfoData = this.GetInfoData();

            if (null != InfoData)
            {
                if (InfoData.ZuanShiCoe > 0)
                {
                    int JoinMoney    = GameManager.GameConfigMgr.GetGameConfigItemInt("qinggongyan_joinmoney", 0);
                    int ZuanShiAward = JoinMoney / InfoData.ZuanShiCoe;
                    int DBRoleID     = GameManager.GameConfigMgr.GetGameConfigItemInt("qinggongyan_roleid", 0);
                    if (DBRoleID > 0)
                    {
                        string sContent = string.Format(GLang.GetLang(525, new object[0]), new object[]
                        {
                            TimeUtil.NowDateTime().Year,
                            TimeUtil.NowDateTime().Month,
                            TimeUtil.NowDateTime().Day,
                            DateTime.Parse(InfoData.BeginTime).Hour,
                            DateTime.Parse(InfoData.BeginTime).Minute,
                            ZuanShiAward
                        });
                        Global.UseMailGivePlayerAward3(DBRoleID, null, GLang.GetLang(526, new object[0]), sContent, ZuanShiAward, 0, 0);
                        Global.UpdateDBGameConfigg("qinggongyan_roleid", "");
                        GameManager.GameConfigMgr.SetGameConfigItem("qinggongyan_roleid", "");
                        Global.UpdateDBGameConfigg("qinggongyan_guildname", "");
                        GameManager.GameConfigMgr.SetGameConfigItem("qinggongyan_guildname", "");
                        Global.UpdateDBGameConfigg("qinggongyan_startday", "");
                        GameManager.GameConfigMgr.SetGameConfigItem("qinggongyan_startday", "");
                        Global.UpdateDBGameConfigg("qinggongyan_grade", "");
                        GameManager.GameConfigMgr.SetGameConfigItem("qinggongyan_grade", "");
                        Global.UpdateDBGameConfigg("qinggongyan_joincount", "");
                        GameManager.GameConfigMgr.SetGameConfigItem("qinggongyan_joincount", "");
                        Global.UpdateDBGameConfigg("qinggongyan_joinmoney", "");
                        GameManager.GameConfigMgr.SetGameConfigItem("qinggongyan_joinmoney", "");
                        Global.UpdateDBGameConfigg("qinggongyan_jubanmoney", "");
                        GameManager.GameConfigMgr.SetGameConfigItem("qinggongyan_jubanmoney", "");
                        string broadCastMsg = StringUtil.substitute(GLang.GetLang(527, new object[0]), new object[0]);
                        Global.BroadcastRoleActionMsg(null, RoleActionsMsgTypes.Bulletin, broadCastMsg, true, GameInfoTypeIndexes.Hot, ShowGameInfoTypes.SysHintAndChatBox, 0, 0, 100, 100);
                    }
                }
            }
        }
Example #4
0
        public void MarryPartyPeriodicUpdate(long ticks)
        {
            // 10秒检测一次
            if (ticks < NextUpdateTime)
            {
                return;
            }
            NextUpdateTime = ticks + 1000 * 10;

            bool showNPC = m_MarryPartyDataCache.HasPartyStarted(ticks);

            if (showNPC != MarryPartyNPCShow)
            {
                MarryPartyNPCShow = showNPC;

                if (showNPC == true)
                {
                    GameMap gameMap = GameManager.MapMgr.DictMaps[MarryPartyNPCConfig.MapCode];
                    NPC     npc     = NPCGeneralManager.GetNPCFromConfig(MarryPartyNPCConfig.MapCode, MarryPartyNPCConfig.NpcID, MarryPartyNPCConfig.NpcX, MarryPartyNPCConfig.NpcY, MarryPartyNPCConfig.NpcDir);
                    if (null != npc)
                    {
                        if (NPCGeneralManager.AddNpcToMap(npc))
                        {
                            MarryPartyNpc = npc;
                        }
                        else
                        {
                            LogManager.WriteLog(LogTypes.Error, string.Format("add marry party npc failure, MapCode={0}, NpcID={1}", MarryPartyNPCConfig.MapCode, MarryPartyNPCConfig.NpcID));
                        }
                    }
                }
                else
                {
                    if (null != MarryPartyNpc)
                    {
                        NPCGeneralManager.RemoveMapNpc(MarryPartyNPCConfig.MapCode, MarryPartyNPCConfig.NpcID);
                        MarryPartyNpc = null;
                    }
                }
            }
        }
Example #5
0
 /// <summary>
 /// 删除一个临时的地图NPC
 /// </summary>
 /// <param name="client"></param>
 /// <param name="gold"></param>
 public void RemoveMapNpc(int mapCode, int npcID)
 {
     NPCGeneralManager.RemoveMapNpc(mapCode, npcID);
 }