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

 

/****** Object:  Stored Procedure dbo.RMS_ARMY_BREAKUPARMY    Script Date: 2004-5-13 11:21:10 ******/


CREATE  PROCEDURE RMS_ARMY_BREAKUPARMY
 @ArmyID int,
 @Kind  tinyint -- Kind 0: Nonpayment of Operation Fee1: Commander"s order to disband 2: Inadequate number of Army members 3: By warfare

AS
set nocount on

begin transaction RMS_ARMY_BREAKUPARMY

 DECLARE @Content VARCHAR(200)
 SET @Content=''
 DECLARE @Commander VARCHAR(14)
 DECLARE @Name VARCHAR(10)
 SELECT @Commander=Commander,@Name=Name FROM tblArmyList1 WHERE ID=@ArmyID

 if @@ROWCOUNT!=0
 begin
  if @Kind=0
  begin
   SET @Content=
@Name+' 自由军时间过期.'
+@Name+' 军队正式解散.'

   EXEC RMS_ARMY_WRITEARMYLOG @ArmyID=@ArmyID, @LogKind='解散军队'
  end
  else if @Kind=1
  begin
   SET @Content=
@Name+' 自由军司令员 '+@Commander+'
已经下令解散军队.
'+@Name+' 军队正式解散.'
   EXEC RMS_ARMY_WRITEARMYLOG @ArmyID=@ArmyID, @LogKind='解散军队.命令'
  end
  else if @Kind=2
  begin
   SET @Content=
@Name+' 加如预备军人数不足.'
   EXEC RMS_ARMY_WRITEARMYLOG @ArmyID=@ArmyID, @LogKind='解散军队'
  end
  else if @Kind=3
  begin
   SET @Content=
@Name+' 自由军输掉了战争
已经解散.'
   EXEC RMS_ARMY_WRITEARMYLOG @ArmyID=@ArmyID, @LogKind='解散军队'
  end


  if @Kind>0 and @Kind<=3
  begin

   DECLARE @GameID varchar(14)
   DECLARE ArmyMemberList CURSOR
   FOR
    SELECT RegularSoldier FROM tblArmyMemberList1 WHERE ArmyID=@ArmyID
 
   OPEN ArmyMemberList

   FETCH FROM ArmyMemberList INTO @GameID
   WHILE @@FETCH_STATUS =0
   BEGIN
    EXEC RMS_SENDMAIL @Recipient=@GameID,@Sender='自由军管理员',@Title='解散军队',@Line=3,@MailContent=@Content,@Item=''
    EXEC RMS_ARMY_ADDREJOINSANCTION @GameID=@GameID
    FETCH FROM ArmyMemberList INTO @GameID
   END
   CLOSE ArmyMemberList
   DEALLOCATE ArmyMemberList
    
   EXEC RMS_SENDMAIL @Recipient=@Commander,@Sender='自由军管理员',@Title='解散军队',@Line=3,@MailContent=@Content,@Item=''
   EXEC RMS_ARMY_ADDREJOINSANCTION @GameID=@Commander
  end

  declare @AllianceID int
  declare @bHost bit

  select @AllianceID=AllianceID, @bHost=bHost from tblArmyAllianceList1 where ArmyID=@ArmyID
  if @@ROWCOUNT!=0
  begin
   if @bHost=1
   begin
    delete tblArmyAllianceList1 where AllianceID=@AllianceID
   end
   else
   begin
    delete tblArmyAllianceList1 where ArmyID=@ArmyID
    declare @AllianceCount int
    select @AllianceCount=count(*) from tblArmyAllianceList1 where AllianceID=@AllianceID
    if @AllianceCount=1
    begin
     delete tblArmyAllianceList1 where AllianceID=@AllianceID
    end
   end
  end
 
  EXEC RMS_ARMY_REMOVEARMYSHOP @ArmyID=@ArmyID,@Kind=3
  EXEC RMS_ARMY_REMOVEARMYAGIT @ArmyID=@ArmyID
  delete tblSubArmyList1 where ArmyID=@ArmyID
  delete tblArmyMemberList1 where ArmyID=@ArmyID
  delete tblArmyList1 where ID=@ArmyID
  delete tblHiredSoldierList1 where ArmyID=@ArmyID
 end

commit transaction RMS_ARMY_BREAKUPARMY

 


GO

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

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