网站地图 设为首页 加入收藏
 
红月私服中心 下载中心 发布红月 技术资料 发布家族 游戏IP生成   开区服务  
红月私服自由军团存储汉化之战争时间修改(一)
文章作者:管理员 文章来源:红月私服中心-Www.hy45.Net 更新时间:2012/2/28 8:40:09 

/****** Object:  Stored Procedure dbo.RMS_ARMY_DECLAREWAR    Script Date: 2004-5-13 11:21:06 ******/
 
 
CREATE  PROCEDURE RMS_ARMY_DECLAREWAR 
       @ArmyID1    int,
       @ArmyID2    int,
       @WarKind1    int,
       @WarKind2    int,
       @WarPlace     int,
       @WarStartHour     int,
       @WarDuration       int
 
AS
set nocount on
 
begin transaction RMS_ARMY_DECLAREWAR  
      
 
       declare @AllianceID1 int
       declare @AllianceID2 int
       declare @CheckArmyID int
       declare @RowCount int
       declare @IsCorrectWar int
       declare @IsAlliance1 int
       declare @IsAlliance2 int
       declare @GameID varchar(14)
       set @IsCorrectWar=1
       set @CheckArmyID=0
       set @IsAlliance1=0
       set @IsAlliance2=0
 
 
       if @WarKind1=2    or @WarKind2=2   -- Army hall War
       begin
              select @CheckArmyID=ArmyID from tblAgitList1 where AgitNumber=@WarPlace
       end
       else if @WarKind1=4 or @WarKind2=4       -- Shop War
       begin
              select @CheckArmyID=ArmyID from tblArmyShopList1 where ShopNumber=@WarPlace
       end
       else if @WarKind1=6 or @WarKind2=6       -- HQ War
       begin
              select @CheckArmyID=ArmyID from tblArmyBase1
       end
 
 
       if  (@WarKind1=0 and @WarKind2=0) or ( (@WarKind1=2 or @WarKind1=4 or @WarKind1=6)  and @CheckArmyID=@ArmyID1) or ( (@WarKind2=2 or @WarKind2=4 or @WarKind2=6) and @CheckArmyID=@ArmyID2)
       begin
              select @AllianceID1=AllianceID from tblArmyAllianceList1 where ArmyID=@ArmyID1
              if @@ROWCOUNT!=0
              begin
                     set @IsAlliance1=1
                     select @RowCount=count(*) from tblArmyWarList1 where ArmyID in (select ArmyID from tblArmyAllianceList1 where AllianceID=@AllianceID1)
                     if @RowCount!=0
                     begin
                            set @IsCorrectWar=0
                     end
              end
              else
              begin
                     select @RowCount=count(*) from tblArmyWarList1 where ArmyID=@ArmyID1
                     if @RowCount!=0
                     begin
                            set @IsCorrectWar=0
                     end
              end
 
              select @AllianceID2=AllianceID from tblArmyAllianceList1 where ArmyID=@ArmyID2
              if @@ROWCOUNT!=0
              begin
                     set @IsAlliance2=1
                     select @RowCount=count(*) from tblArmyWarList1 where ArmyID in (select ArmyID from tblArmyAllianceList1 where AllianceID=@AllianceID2)
                     if @RowCount!=0
                     begin
                            set @IsCorrectWar=0
                     end
              end
              else
              begin
                     select @RowCount=count(*) from tblArmyWarList1 where ArmyID=@ArmyID2
                     if @RowCount!=0
                     begin
                            set @IsCorrectWar=0
                     end
              end
 
             if (@IsCorrectWar=1) and datepart(hour,GetDate())>=19 and datepart(hour,GetDate())<=22
  begin
   declare @WarBegin datetime
   declare @WarEnd datetime
   set @WarBegin=GetDate()
   set @WarBegin=dateadd(hour,24,@WarBegin)
   if @WarKind1=6 or @WarKind2=6
   begin

                            insert tblArmyWarList1 values(@ArmyID1,@ArmyID2,@WarBegin,@WarEnd,@WarKind1,@WarPlace,0,0,'','','','',0)
                            insert tblArmyWarList1 values(@ArmyID2,@ArmyID1,@WarBegin,@WarEnd,@WarKind2,@WarPlace,0,0,'','','','',0)
                     end
                     else
                     begin
                            insert tblArmyWarList1 values(@ArmyID1,@ArmyID2,@WarBegin,@WarEnd,@WarKind1,@WarPlace,0,1000,'','','','',0)
                            insert tblArmyWarList1 values(@ArmyID2,@ArmyID1,@WarBegin,@WarEnd,@WarKind2,@WarPlace,0,1000,'','','','',0)
                     end
                     EXEC RMS_ARMY_WRITEWARLOG @ArmyID1=@ArmyID1,@ArmyID2=@ArmyID2,@LogKind='WarDeclaration'
 
                     declare @FromArmyName varchar(10)
                     declare @FromArmyCommander varchar(14)
                     declare @ToArmyName varchar(10)
                     set @FromArmyName=''
                     set @FromArmyCommander=''
                     set @ToArmyName=''
                     Select @FromArmyName=Name,@FromArmyCommander=Commander from tblArmyList1 where ID=@ArmyID1
                     Select @ToArmyName=Name from tblArmyList1 where ID=@ArmyID2
                    
                     Declare @MailContent varchar(400)
                     if @WarKind1=2 or @WarKind2=2
                     begin
                            declare @AgitChar varchar(30)
                            if @WarPlace>20 and @WarPlace<=40
                            begin
                                   set @WarPlace=@WarPlace-20
                                   set @AgitChar='解放自由军基地 '+CAST(@WarPlace AS varchar)
                            end
                            else
                            begin
                                   set @AgitChar='独立自由军基地 '+CAST(@WarPlace AS varchar)
                            end
 
                            set @MailContent=
@FromArmyName+' 自由军司令官 '+@FromArmyCommander+'
'+@ToArmyName+'自由军宣战.
战争时间:
开始: '+convert(varchar,@WarBegin, 120)+'
结束: '+convert(varchar,@WarEnd, 120)+'
战争地点是 '+@ToArmyName+' 自由军所有的'+@AgitChar+'楼.'
                     end
                     else if @WarKind1=0 and @WarKind2=0
                     begin
                            set @MailContent=
@FromArmyName+'自由军司令官 '+@FromArmyCommander+'
'+@ToArmyName+'自由军宣战.
战争时间:
开始: '+convert(varchar,@WarBegin, 120)+'
结束: '+convert(varchar,@WarEnd, 120)
                     end
                     else if @WarKind1=4 or @WarKind2=4
                     begin
                            declare @ShopOwner varchar(30)
                            declare @ShopNumber int
                            set @ShopNumber=@WarPlace
                            set @ShopOwner=''
                            if @ShopNumber=1
                            begin
                                   set @ShopOwner='住宅街1杂货店'
                            end
                            else if @ShopNumber=2
                            begin
                                   set @ShopOwner='住宅街1武器店'
                            end
                            else if @ShopNumber=3
                            begin
                                   set @ShopOwner='住宅街1离家少女'
                            end
                            else if @ShopNumber=4
                            begin
                                   set @ShopOwner='住宅街1邻居大嫂'
                            end
                            else if @ShopNumber=5
                            begin
                                   set @ShopOwner='住宅街2杂货店'
                            end
                            else if @ShopNumber=6
                            begin
                                   set @ShopOwner='住宅街2武器店'
                            end
                            else if @ShopNumber=7
                            begin
                                   set @ShopOwner='住宅街2离家少女'
                            end
                            else if @ShopNumber=8
                            begin
                                   set @ShopOwner='住宅街3杂货店'
                            end
                            else if @ShopNumber=9
                            begin
                                   set @ShopOwner='住宅街3地理学者'
                            end
                            else if @ShopNumber=10
                            begin
                                   set @ShopOwner='住宅街3邻居大嫂'
                            end
                            else if @ShopNumber=11
                            begin
                                   set @ShopOwner='住宅街3离家少女'
                            end
                            else if @ShopNumber=12
                            begin
                                   set @ShopOwner='住宅街3邻居大嫂2'
                            end
                            else if @ShopNumber=13
                            begin      
                                   set @ShopOwner='繁华街1科学研究员'
                            end
                            else if @ShopNumber=14
                            begin
                                   set @ShopOwner='繁华街1防范队员'
                            end
                            else if @ShopNumber=15
                            begin
                                   set @ShopOwner='繁华街2杂货店'
                            end
                            else if @ShopNumber=16
                            begin
                                   set @ShopOwner='繁华街2杂货店2'
                            end
                            else if @ShopNumber=17
                            begin      
                            set @ShopOwner='繁华街2武器店1'
                            end
                            else if @ShopNumber=18
                            begin
                                   set @ShopOwner='繁华街2考古学家'
                            end
                            else if @ShopNumber=19
                            begin
                                   set @ShopOwner='繁华街3武器店1'
                            end
                            else if @ShopNumber=20
                            begin
                                   set @ShopOwner='繁华街3武器店2'
                            end
                            else if @ShopNumber=21
                            begin
                                   set @ShopOwner='繁华街3地理学者'
                            end
                            else if @ShopNumber=22
                            begin
                                   set @ShopOwner='繁华街4杂货铺'
                            end
                            else if @ShopNumber=23
                            begin
                                   set @ShopOwner='喜马拉雅万物象'
                            end
                            else if @ShopNumber=24
                            begin
                                   set @ShopOwner='喜马拉雅饭店'
                            end
 
                            set @MailContent=

浏览次数:350
最新文章
· 2003系统任务栏显示桌面图标不见了处理办法...
· 修改红月私服某特定怪属性...
· 红月管理工具使用的配置...
· 教你怎么1个怪1级(去除10%限制)...
· 红月游戏帐号注册之二...
· 红月游戏帐号注册之三...
· 红月游戏帐号注册之一...
· 红月私服带杀人次数排行榜...
· 带防盗码生化排行...
· 出身完成任务一级发针存储过程...
热门文章
· 红月技能点属性上限...
· 3.8C红月私服限制部分外挂的方法...
· 调皮外挂不能正常使用...
· 红月私服角色之说...
· 升华原版升级代码...
· 红月私服自由军团存储汉化之自由军解散原因...
· 红月B2战争规则...
· 红月NPC各地点坐标...
· 红月服务器如何做到冲卡的...
· 红月外挂不能使用新解决办法...
关于我们 开区服务 网站帮助 全部私服
 
CopyRight @2010 hy45.net, Inc. All Rights Reserved  

备案登记号:苏ICP备11017169号-1