搜索
 找回密码
 加入

Procedure: Nation Transfer 种族转换进程

ctgwglzc 2009-6-7 01:41:16 1471
Human NT 人族转换
  1. USE [KN_online]
  2. GO
  3. /****** Object: StoredProcedure [dbo].[humanNT] Script Date: 08/18/2008 09:50:06 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO

  8. CREATE procedure [dbo].[humanNT]
  9. @Account char(30)

  10. AS DECLARE @clannumber smallint, @length int,@row int,@i int,@dwid int,@pos int,@dur int,@dur1 int,@ext int,@StackSize1 int,@strName varchar(30),@strExtName varchar(30),@Cdwid varbinary(4),@cdur varchar(2),@cstack varchar(2)
  11. begin tran
  12. declare @char1 varchar(21)
  13. set @char1 = (select strcharid1 from account_char where straccountid = @account)
  14. declare @char2 varchar(21)
  15. set @char2 = (select strcharid2 from account_char where straccountid = @account)
  16. declare @char3 varchar(21)
  17. set @char3 = (select strcharid3 from account_char where straccountid = @account)
  18. declare @clannumber1 smallint
  19. set @clannumber1 = (select idnum from knights where chief = @char1)
  20. declare @clannumber2 smallint
  21. set @clannumber2 = (select idnum from knights where chief = @char2)
  22. declare @clannumber3 smallint
  23. set @clannumber3 = (select idnum from knights where chief = @char3)
  24. update account_char set bnation = '2' where bnation = '1' and straccountid = @Account
  25. update userdata set nation = '2' where nation = '1' and struserid = @char1
  26. update userdata set race = '11' where race = '1' and class in ('101','105','106') and struserid = @char1
  27. Update userdata set race = '12' where race = '2' and class in ('107','111','102','104','112','108') and struserid = @char1
  28. update userdata set race = '13' where race = '3' and class in ('103','109','110') and struserid = @char1
  29. update userdata set race = '13' where race = '4' and class in ('104','111','112') and struserid = @char1
  30. update userdata set class = '205' where class = '105' and struserid = @char1
  31. update userdata set class = '207' where class = '107' and struserid = @char1
  32. update userdata set class = '209' where class = '109' and struserid = @char1
  33. update userdata set class = '211' where class = '111' and struserid = @char1
  34. update userdata set class = '201' where class = '101' and struserid = @char1
  35. update userdata set class = '202' where class = '102' and struserid = @char1
  36. update userdata set class = '203' where class = '103' and struserid = @char1
  37. update userdata set class = '204' where class = '104' and struserid = @char1
  38. update userdata set class = '212' where class = '112' and struserid = @char1
  39. update userdata set class = '206' where class = '106' and struserid = @char1
  40. update userdata set class = '208' where class = '108' and struserid = @char1
  41. update userdata set class = '210' where class = '110' and struserid = @char1
  42. update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char1
  43. delete from knights where chief = @char1
  44. delete from knights_user where sidnum = @clannumber1
  45. delete from knights_rating where shindex = @clannumber1
  46. update userdata set knights = 0, fame = 0 where knights = @clannumber1
  47. update userdata set nation = '2' where nation = '1' and struserid = @char2
  48. update userdata set race = '11' where race = '1' and class in ('101','105','106') and struserid = @char2
  49. Update userdata set race = '12' where race = '2' and class in ('107','111','102','104','112','108') and struserid = @char2
  50. update userdata set race = '13' where race = '3' and class in ('103','109','110') and struserid = @char2
  51. update userdata set race = '13' where race = '4' and class in ('104','111','112') and struserid = @char2
  52. update userdata set class = '205' where class = '105' and struserid = @char2
  53. update userdata set class = '207' where class = '107' and struserid = @char2
  54. update userdata set class = '209' where class = '109' and struserid = @char2
  55. update userdata set class = '211' where class = '111' and struserid = @char2
  56. update userdata set class = '201' where class = '101' and struserid = @char2
  57. update userdata set class = '202' where class = '102' and struserid = @char2
  58. update userdata set class = '203' where class = '103' and struserid = @char2
  59. update userdata set class = '204' where class = '104' and struserid = @char2
  60. update userdata set class = '212' where class = '112' and struserid = @char2
  61. update userdata set class = '206' where class = '106' and struserid = @char2
  62. update userdata set class = '208' where class = '108' and struserid = @char2
  63. update userdata set class = '210' where class = '110' and struserid = @char2
  64. update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char2
  65. delete from knights where chief = @char2
  66. delete from knights_user where sidnum = @clannumber2
  67. delete from knights_rating where shindex = @clannumber2
  68. update userdata set knights = 0, fame = 0 where knights = @clannumber2
  69. update userdata set nation = '2' where nation = '1' and struserid = @char3
  70. update userdata set race = '11' where race = '1' and class in ('101','105','106') and struserid = @char3
  71. Update userdata set race = '12' where race = '2' and class in ('107','111','102','104','112','108') and struserid = @char3
  72. update userdata set race = '13' where race = '3' and class in ('103','109','110') and struserid = @char3
  73. update userdata set race = '13' where race = '4' and class in ('104','111','112') and struserid = @char3
  74. update userdata set class = '205' where class = '105' and struserid = @char3
  75. update userdata set class = '207' where class = '107' and struserid = @char3
  76. update userdata set class = '209' where class = '109' and struserid = @char3
  77. update userdata set class = '211' where class = '111' and struserid = @char3
  78. update userdata set class = '201' where class = '101' and struserid = @char3
  79. update userdata set class = '202' where class = '102' and struserid = @char3
  80. update userdata set class = '203' where class = '103' and struserid = @char3
  81. update userdata set class = '204' where class = '104' and struserid = @char3
  82. update userdata set class = '212' where class = '112' and struserid = @char3
  83. update userdata set class = '206' where class = '106' and struserid = @char3
  84. update userdata set class = '208' where class = '108' and struserid = @char3
  85. update userdata set class = '210' where class = '110' and struserid = @char3
  86. update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char3
  87. delete from knights where chief = @char3
  88. delete from knights_user where sidnum = @clannumber3
  89. delete from knights_rating where shindex = @clannumber3
  90. update userdata set knights = 0, fame = 0 where knights = @clannumber3
  91. update userdata set knights = 0, fame = 0 where struserid = @char1
  92. update userdata set knights = 0, fame = 0 where struserid = @char2
  93. update userdata set knights = 0, fame = 0 where struserid = @char3
  94. Update knights set vicechief_1 = '' where vicechief_1 = @char1
  95. Update knights set vicechief_2 = '' where vicechief_2 = @char1
  96. Update knights set vicechief_3 = '' where vicechief_3 = @char1
  97. Update knights set vicechief_1 = '' where vicechief_1 = @char2
  98. Update knights set vicechief_2 = '' where vicechief_2 = @char2
  99. Update knights set vicechief_3 = '' where vicechief_3 = @char2
  100. Update knights set vicechief_1 = '' where vicechief_1 = @char3
  101. Update knights set vicechief_2 = '' where vicechief_2 = @char3
  102. Update knights set vicechief_3 = '' where vicechief_3 = @char3
  103. delete from knights_user where struserid = @char1
  104. delete from knights_user where struserid = @char2
  105. delete from knights_user where struserid = @char3
  106. commit tran
复制代码

4 回复

ctgwglzc
2008-8-20 21:28:07
楼主

Karus NT,兽族转换

点击查看详情
  1. USE [KN_online]
  2. GO
  3. /****** Object:  StoredProcedure [dbo].[karusNT]    Script Date: 08/18/2008 09:50:56 ******/
  4. SET ANSI_NULLS ON
  5. GO
  6. SET QUOTED_IDENTIFIER ON
  7. GO


  8. CREATE procedure [dbo].[karusNT]
  9. @Account char(30)

  10. AS DECLARE @clannumber smallint, @length int,@row int,@i int,@dwid int,@pos int,@dur int,@dur1 int,@ext int,@StackSize1 int,@strName varchar(30),@strExtName varchar(30),@Cdwid varbinary(4),@cdur varchar(2),@cstack varchar(2)

  11. begin tran

  12. declare @char1 varchar(21)
  13. set @char1 = (select strcharid1 from account_char where straccountid = @account)
  14. declare @char2 varchar(21)
  15. set @char2 = (select strcharid2 from account_char where straccountid = @account)
  16. declare @char3 varchar(21)
  17. set @char3 = (select strcharid3 from account_char where straccountid = @account)
  18. declare @clannumber1 smallint
  19. set @clannumber1 = (select idnum from knights where chief = @char1)
  20. declare @clannumber2 smallint
  21. set @clannumber2 = (select idnum from knights where chief = @char2)
  22. declare @clannumber3 smallint
  23. set @clannumber3 = (select idnum from knights where chief = @char3)

  24. update account_char set bnation = '1' where bnation = '2' and straccountid = @Account

  25. update userdata set nation = '1' where nation = '2' and struserid = @char1
  26. Update userdata set race = '1' where race = '11' and class in ('201','205','206') and struserid = @char1
  27. Update userdata set race = '1' where race = '12' and class in ('201','205','206') and struserid = @char1
  28. Update userdata set race = '1' where race = '13' and class in ('201','205','206') and struserid = @char1
  29. Update userdata set race = '2' where race = '12' and class in ('207','211','202','204','212','208') and struserid = @char1
  30. update userdata set race = '2' where race = '13' and class in ('202','207','208') and struserid = @char1
  31. update userdata set race = '3' where race = '12' and class in ('203','209','210') and struserid = @char1
  32. update userdata set race = '3' where race = '13' and class in ('203','209','210') and struserid = @char1
  33. update userdata set race = '4' where race = '13' and class in ('204','211','212') and struserid = @char1
  34. update userdata set class = '105' where class = '205' and struserid = @char1
  35. update userdata set class = '107' where class = '207' and struserid = @char1
  36. update userdata set class = '109' where class = '209' and struserid = @char1
  37. update userdata set class = '111' where class = '211' and struserid = @char1
  38. update userdata set class = '101' where class = '201' and struserid = @char1
  39. update userdata set class = '102' where class = '202' and struserid = @char1
  40. update userdata set class = '103' where class = '203' and struserid = @char1
  41. update userdata set class = '104' where class = '204' and struserid = @char1
  42. update userdata set class = '112' where class = '212' and struserid = @char1
  43. update userdata set class = '106' where class = '206' and struserid = @char1
  44. update userdata set class = '108' where class = '208' and struserid = @char1
  45. update userdata set class = '110' where class = '210' and struserid = @char1
  46. update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char1
  47. delete from knights where chief = @char1
  48. delete from knights_user where sidnum = @clannumber1
  49. delete from knights_rating where shindex = @clannumber1
  50. update userdata set knights = 0, fame = 0 where knights = @clannumber1

  51. update userdata set nation = '1' where nation = '2' and struserid = @char2
  52. Update userdata set race = '1' where race = '11' and class in ('201','205','206') and struserid = @char2
  53. Update userdata set race = '1' where race = '12' and class in ('201','205','206') and struserid = @char2
  54. Update userdata set race = '1' where race = '13' and class in ('201','205','206') and struserid = @char2
  55. Update userdata set race = '2' where race = '12' and class in ('207','211','202','204','212','208') and struserid = @char2
  56. update userdata set race = '2' where race = '13' and class in ('202','207','208') and struserid = @char2
  57. update userdata set race = '3' where race = '12' and class in ('203','209','210') and struserid = @char2
  58. update userdata set race = '3' where race = '13' and class in ('203','209','210') and struserid = @char2
  59. update userdata set race = '4' where race = '13' and class in ('204','211','212') and struserid = @char2
  60. update userdata set class = '105' where class = '205' and struserid = @char2
  61. update userdata set class = '107' where class = '207' and struserid = @char2
  62. update userdata set class = '109' where class = '209' and struserid = @char2
  63. update userdata set class = '111' where class = '211' and struserid = @char2
  64. update userdata set class = '101' where class = '201' and struserid = @char2
  65. update userdata set class = '102' where class = '202' and struserid = @char2
  66. update userdata set class = '103' where class = '203' and struserid = @char2
  67. update userdata set class = '104' where class = '204' and struserid = @char2
  68. update userdata set class = '112' where class = '212' and struserid = @char2
  69. update userdata set class = '106' where class = '206' and struserid = @char2
  70. update userdata set class = '108' where class = '208' and struserid = @char2
  71. update userdata set class = '110' where class = '210' and struserid = @char2
  72. update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char2
  73. delete from knights where chief = @char2
  74. delete from knights_user where sidnum = @clannumber2
  75. delete from knights_rating where shindex = @clannumber2
  76. update userdata set knights = 0, fame = 0 where knights = @clannumber2

  77. update userdata set nation = '1' where nation = '2' and struserid = @char3
  78. Update userdata set race = '1' where race = '11' and class in ('201','205','206') and struserid = @char3
  79. Update userdata set race = '1' where race = '12' and class in ('201','205','206') and struserid = @char3
  80. Update userdata set race = '1' where race = '13' and class in ('201','205','206') and struserid = @char3
  81. Update userdata set race = '2' where race = '12' and class in ('207','211','202','204','212','208') and struserid = @char3
  82. update userdata set race = '2' where race = '13' and class in ('202','207','208') and struserid = @char3
  83. update userdata set race = '3' where race = '12' and class in ('203','209','210') and struserid = @char3
  84. update userdata set race = '3' where race = '13' and class in ('203','209','210') and struserid = @char3
  85. update userdata set race = '4' where race = '13' and class in ('204','211','212') and struserid = @char3
  86. update userdata set class = '105' where class = '205' and struserid = @char3
  87. update userdata set class = '107' where class = '207' and struserid = @char3
  88. update userdata set class = '109' where class = '209' and struserid = @char3
  89. update userdata set class = '111' where class = '211' and struserid = @char3
  90. update userdata set class = '101' where class = '201' and struserid = @char3
  91. update userdata set class = '102' where class = '202' and struserid = @char3
  92. update userdata set class = '103' where class = '203' and struserid = @char3
  93. update userdata set class = '104' where class = '204' and struserid = @char3
  94. update userdata set class = '112' where class = '212' and struserid = @char3
  95. update userdata set class = '106' where class = '206' and struserid = @char3
  96. update userdata set class = '108' where class = '208' and struserid = @char3
  97. update userdata set class = '110' where class = '210' and struserid = @char3
  98. update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char3
  99. delete from knights where chief = @char3
  100. delete from knights_user where sidnum = @clannumber3
  101. delete from knights_rating where shindex = @clannumber3
  102. update userdata set knights = 0, fame = 0 where knights = @clannumber3
  103. update userdata set knights = 0, fame = 0 where struserid = @char1
  104. update userdata set knights = 0, fame = 0 where struserid = @char2
  105. update userdata set knights = 0, fame = 0 where struserid = @char3
  106. Update knights set vicechief_1 = '' where vicechief_1 = @char1
  107. Update knights set vicechief_2 = '' where vicechief_2 = @char1
  108. Update knights set vicechief_3 = '' where vicechief_3 = @char1
  109. Update knights set vicechief_1 = '' where vicechief_1 = @char2
  110. Update knights set vicechief_2 = '' where vicechief_2 = @char2
  111. Update knights set vicechief_3 = '' where vicechief_3 = @char2
  112. Update knights set vicechief_1 = '' where vicechief_1 = @char3
  113. Update knights set vicechief_2 = '' where vicechief_2 = @char3
  114. Update knights set vicechief_3 = '' where vicechief_3 = @char3
  115. delete from knights_user where struserid = @char1
  116. delete from knights_user where struserid = @char2
  117. delete from knights_user where struserid = @char3

  118. commit tran
复制代码
ctgwglzc
2008-8-20 21:32:05
楼主
[HOWTO]使用方法:
For example account: lol = Human, and u want it to be karus.
then execute this:
比如说,lol这个帐户是人族,你想转换为SS,可以使用如下程序:
  1. exec KarusNT 'lol'
复制代码
Same for karus but reversed like:
同样的对SS转RR,可以使用:
  1. exec HumanNT 'lol'
复制代码
Can also be easily put in a tool, i recommend a tool wich costs kc to execute, otherwise players will spam it and heave lag will occur...........
利用这个进程你很容易制作种族转换的程序或者网页~
ctgwglzc
2009-1-12 22:33:05
楼主

发个另外的转换种族存储,MYSTNT

  1. CREATE procedure [MystNT]
  2. @Account char(30)
  3. AS
  4. Declare @nation char(21), @char1 char(21), @char2 char(21), @char3 char(21), @char1Class char(21), @char2Class char(21), @char3Class char(21), @knights1 char(21), @knights2 char(21), @knights3 char(21)
  5. declare @evet char(21), @evet2 char(21)

  6. select @nation = bnation from account_char where straccountid = @account
  7. select @char1 = strcharid1, @char2 = strcharid2 , @char3 = strcharid3 from account_char where straccountid = @account

  8. declare @account2 varchar(21)
  9. declare @char varchar(21)
  10. set @account= @account

  11. Select @account2= straccountid from currentuser where straccountid = @account
  12. if @account2 is not null or @account2 != ''
  13. begin
  14. select @char = strcharid from currentuser where straccountid = @account
  15. print @char + ' Suan Oyunda'
  16. end

  17. if @account2 is null or @account2 = ''
  18. begin
  19. update userdata set knights = 0, fame = 0 where struserid = @char1
  20. update userdata set knights = 0, fame = 0 where struserid = @char2
  21. update userdata set knights = 0, fame = 0 where struserid = @char3
  22. delete * from knights_user where struserid = @char1 or struserid = @char3 or struserid = @char3
  23. if @nation = 1
  24. begin

  25. update account_char set bnation = 2 where straccountid = @account
  26. update userdata set race = 11, class = 205 where struserid in (@char1, @char2, @char3) and class = 105
  27. update userdata set race = 11, class = 206 where struserid in (@char1, @char2, @char3) and class = 106
  28. update userdata set race = 12, class = 207 where struserid in (@char1, @char2, @char3) and class = 107
  29. update userdata set race = 12, class = 208 where struserid in (@char1, @char2, @char3) and class = 108
  30. update userdata set race = 12, class = 209 where struserid in (@char1, @char2, @char3) and class = 109
  31. update userdata set race = 12, class = 210 where struserid in (@char1, @char2, @char3) and class = 110
  32. update userdata set race = 12, class = 211 where struserid in (@char1, @char2, @char3) and class = 111
  33. update userdata set race = 12, class = 212 where struserid in (@char1, @char2, @char3) and class = 112
  34. update userdata set zone = '21' where struserid in (@char1, @char2, @char3)
  35. -- update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char2
  36. -- update userdata set zone = '21',bind = '-1',px = '31900',pz = '40100',py = '0' where struserid = @char3
  37. update userdata set nation = 2 where struserid in (@char1, @char2, @char3)
  38. select 'Nation transfered to Elmorad'
  39. end
  40. else
  41. begin

  42. update account_char set bnation = 1 where straccountid = @account
  43. update userdata set race = 1, class = 105 where struserid in (@char1, @char2, @char3) and class = 205
  44. update userdata set race = 1, class = 106 where struserid in (@char1, @char2, @char3) and class = 206
  45. update userdata set race = 2, class = 107 where struserid in (@char1, @char2, @char3) and class = 207
  46. update userdata set race = 2, class = 108 where struserid in (@char1, @char2, @char3) and class = 208
  47. update userdata set race = 3, class = 109 where struserid in (@char1, @char2, @char3) and class = 209
  48. update userdata set race = 3, class = 110 where struserid in (@char1, @char2, @char3) and class = 210
  49. update userdata set race = 4, class = 111 where struserid in (@char1, @char2, @char3) and class = 211
  50. update userdata set race = 4, class = 112 where struserid in (@char1, @char2, @char3) and class = 212
  51. update userdata set zone = '21' where struserid in (@char1, @char2, @char3)
  52. update userdata set nation = 1 where struserid in (@char1, @char2, @char3)
  53. select 'Nation transfered to Karus'
  54. -- select 'disabled just for now'
  55. end
  56. end
  57. GO
复制代码
xz7323746
2009-6-7 01:41:16
看了半天没懂``角色名写在那里有效果?
高级模式
游客