美丽世界私服教程-新人奖励脚本

美丽世界私服教程-新人奖励脚本

学习教程tuzi2014-08-10 18:13:26A+A-

美丽世界私服教程 新人奖励脚本 技术文章 美丽世界私服脚本 美丽世界私服技术 美丽世界私服 学习教程 第1张

开服的人都知道,这个脚本是开美丽世界私服必备的东东。

美丽世界私服新人奖励脚本。

复制下面的文本到查询分析器里执行就行了。

他会自动建立LOGINLOG,ITEMTRADE表的触发器和存储过程

以及新人送点,送钱的存储过程!还有挂机奖励的存储过程!!

配合网站有以前发的[美丽世界N-age商业服务端]和[N-age美丽世界客户端]。

可以用这两套资源直接进入游戏。

有需要的拿去试试吧,很好用的。

USE NAGEBOARD

GO

IF EXISTS(SELECT name from sysobjects WHERE name='crttable' AND type='p')

DROP PROCEDURE crttable

GO

USE NAGEBOARD

GO

CREATE proc crttable

as

declare @nalja varchar(10)

declare @nalja1 varchar(10)

set @nalja= convert(varchar(30), getdate(),12)

set @nalja1= convert(varchar(30), getdate()-1,12)

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[itemtrade'+@nalja+']') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

  begin

    return

  end

else

  begin

    exec crttable_trade

  end

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[itemtrade'+@nalja1 +']') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

  begin

    exec deltable_item1

  end

GO

USE NAGEBOARD

GO

IF EXISTS(SELECT name from sysobjects WHERE name='crttable_trade' AND type='p')

DROP PROCEDURE crttable_trade

GO

USE NAGEBOARD

GO

CREATE proc crttable_trade

as

declare @sql1 varchar(200) 

declare @sql2 varchar(400) 

declare @sql3 varchar(200) 

declare @sql4 varchar(800) 

declare @nalja varchar(120) 

set @nalja= convert(varchar(30), getdate(),12)

set @sql1='CREATE TABLE itemtrade'+@nalja

set @sql2='([ii] [int] IDENTITY (1, 1) NOT NULL PRIMARY KEY, [logTime] [datetime] NOT NULL default (getdate()), [logCode] [int] NOT NULL, [nameChar] char(16) NOT NULL default (0), [propCharID] [int] NOT NULL, [recvCharID] [int] NOT NULL, [itemid] [int] NOT NULL, [prodid] [int] NOT NULL, [nMoney][int] NOT NULL default(0), [map] [int] NOT NULL )'

set @sql3=' ON [PRIMARY]'

set @sql4=@sql1+@sql2+@sql3

exec (@sql4)

declare @ix_code varchar(40) 

declare @ix_char varchar(40) 

declare @ix_sql varchar(200) 

set @ix_code = 'ix_code_1_'+@nalja

set @ix_char = 'ix_char_1_'+@nalja

set @ix_sql = 'create index '+@ix_code+ ' on '+ 'itemtrade'+@nalja+' (logCode)'

exec( @ix_sql)

set @ix_sql = 'create index '+@ix_char+ ' on '+ 'itemtrade'+@nalja+' (propCharID)'

exec( @ix_sql)

GO

USE NAGEBOARD

GO

IF EXISTS(SELECT name from sysobjects WHERE name='deltable_item1' AND type='p')

DROP PROCEDURE deltable_item1

GO

USE NAGEBOARD

GO

CREATE proc deltable_item1

as 

declare @nalja varchar(12) 

declare @sql varchar(120) 

set @nalja= convert(varchar(30), getdate()-1,12)

set @sql='drop table itemtrade'+@nalja 

exec (@sql)

GO

USE NAGEMEMBER

GO

IF EXISTS(SELECT name from sysobjects WHERE name='CreateTable_LoginLog' AND type='p')

DROP PROCEDURE CreateTable_LoginLog

GO

USE NAGEMEMBER

GO

CREATE proc CreateTable_LoginLog

as

declare @day3 datetime

declare @nalja3 varchar(10)

declare @sql1 varchar(255)

declare @sql2 varchar(255)

set @day3 = (select dateadd(day,0,getdate()))

set @nalja3=(select convert(varchar(4), datepart(yyyy, @day3))+convert(varchar(4), datepart(mm, @day3))+convert(varchar(4), datepart(dd, @day3)))

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Loginlog_'+@nalja3+']') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

  begin

    return

  end

else

  begin

    set @sql1=' CREATE TABLE Loginlog_'+@nalja3+' ( login_id varchar(20) Not Null, type int null, status int, time datetime,  '

    set @sql2=' ip varchar(20), propid int not null, kind tinyint ) '         

    exec (@sql1 + @sql2)

  end

GO

USE NAGEMEMBER

GO

IF EXISTS(SELECT name from sysobjects WHERE name='Delete_LoginLog' AND type='p')

DROP PROCEDURE Delete_LoginLog

GO

USE NAGEMEMBER

GO

CREATE proc Delete_LoginLog

as

declare @nalja varchar(10)

declare @sql1 varchar(255)

set @nalja=(select convert(varchar(4), datepart(yyyy, dateadd(dd,-1,getdate())))+convert(varchar(4), datepart(mm, dateadd(dd,-1,getdate())))+convert(varchar(4), datepart(dd, dateadd(dd,-1,getdate()))))

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Loginlog_'+@nalja+']') and OBJECTPROPERTY(id, N'IsUserTable') = 1)

begin

  set @sql1=' drop table Loginlog_'+@nalja+' '

  exec (@sql1)

end

GO

USE NAGEMEMBER

GO

IF EXISTS(SELECT name from sysobjects WHERE name='login_loginsert' AND type='TR')

DROP PROCEDURE login_loginsert

GO

USE NAGEMEMBER

GO

CREATE trigger login_loginsert

on login_log

for insert 

as 

exec CreateTable_LoginLog

exec Delete_LoginLog

exec nageboard.dbo.crttable

GO

USE NAGE

GO

IF EXISTS(SELECT name from sysobjects WHERE name='SetChrTime' AND type='p')

DROP PROCEDURE SetChrTime

GO

USE NAGE

GO

CREATE PROCEDURE SetChrTime

@id int,

@state tinyint

AS

declare @logintime datetime

declare @outtime datetime

declare @charname varchar(16)

declare @tmp int

declare @loginid varchar(16)

declare @int int

IF( @state = 1)

BEGIN

UPDATE CharInfo SET glogin = GetDate() WHERE charPropID = @id

END

ELSE

BEGIN

    select @logintime=glogin from charinfo where charPropID = @id

    set @outtime=getdate()+1

    select @charname=charname,@loginid=id_loginid from nagemember.dbo.charname_1 where charPropID = @id

   set @tmp=datediff(hh,@logintime,@outtime)

   set @int=1

   while @int<=@tmp

   begin

       update charinfo set money=money+50000000 where charPropID = @id and money<1940000000

       if(@int%2 =0)

       begin

           insert into nagemember.dbo.item_to_game(recv_charid,recv_name,recv_serv,recv_loginid,itemid) values(@id,@charname,11,@loginid,45516)

       end

       if (@int%3=0)

       begin

           insert into nagemember.dbo.item_to_game(recv_charid,recv_name,recv_serv,recv_loginid,itemid) values(@id,@charname,11,@loginid,43511)

       end

       if (@int%4=0)

       begin

           insert into nagemember.dbo.item_to_game(recv_charid,recv_name,recv_serv,recv_loginid,itemid) values(@id,@charname,11,@loginid,43528)

       end

       if (@int%5=0)

       begin

           insert into nagemember.dbo.item_to_game(recv_charid,recv_name,recv_serv,recv_loginid,itemid) values(@id,@charname,11,@loginid,43513)

       end

       if (@int%6=0)

       begin

           insert into nagemember.dbo.item_to_game(recv_charid,recv_name,recv_serv,recv_loginid,itemid) values(@id,@charname,11,@loginid,43520)

       end

       if (@int%7=0)

       begin

           insert into nagemember.dbo.item_to_game(recv_charid,recv_name,recv_serv,recv_loginid,itemid) values(@id,@charname,11,@loginid,43511)

       end

       set @int=@int+1

   end

    UPDATE CharInfo SET glogout = GetDate() WHERE charPropID = @id

END

GO

USE NAGE

GO

IF EXISTS(SELECT name from sysobjects WHERE name='SetChrValue' AND type='p')

DROP PROCEDURE SetChrValue

GO

USE NAGE

GO

CREATE PROCEDURE SetChrValue 

@id     int,

@lv     smallint,

@exp     bigint,

@eclv     tinyint,

@ecexp   int,

@hp     smallint,

@sp     smallint,

@stm     smallint,

@str     smallint,

@dex     smallint,

@esp     smallint,

@spt     smallint,

@int     smallint,

@mn     int,

@bmn     int,

@lic     tinyint,

@wth     tinyint,

@spend   tinyint,

@snext     int,

@flv     tinyint,

@fexp     int,

@tradestr   int,

@uid     smallint,

@omap   tinyint,

@otype   tinyint,

@restr     tinyint,

@radd     tinyint,

@rtime     int,

@rdec     int,

@cr     tinyint,

@crp     smallint,

@crd     int,

@pk     tinyint,

@cc     tinyint,

@cm     tinyint,

@wx     smallint,

@wz     smallint,

@bd     smallint,

@lay     tinyint,

@lvp     smallint,

@skp     smallint,

@natt     tinyint,

@ub     tinyint,

@hero     tinyint,

@chat     tinyint,

@exch     tinyint,

@hide     tinyint,

@pri     tinyint,

@fri     tinyint,

@mgage   tinyint,

@mprob   tinyint,

@mpnt     smallint

AS

if (@lv=1 and @lvp=0 and @mn=0 and @str=23 and @dex=22)

begin

  set @lvp=300

  set @mn=50000000

end

else if (@lv=1 and @lvp=0 and @mn=0 and @esp=23 and @spt=22)

begin

  set @lvp=300

  set @mn=50000000

end

UPDATE 

CharInfo

SET

Lv     = @lv,

Exp     = @exp,

eclv     = @eclv,

ecExp     = @ecExp,

HP     = @hp,

SP     = @sp,

STM     = @stm,

Str     = @str,

Dex     = @dex,

Esp     = @esp,

Spt     = @spt,

Int     = @int,

money     = @mn,

bankmoney   = @bmn,

lic     = @lic,

wth     = @wth,

spend     = @spend,

snext     = @snext,

flv     = @flv,

fexp     = @fexp,

tradestr     = @tradestr,

uid     =@uid,

omap     = @omap,

otype     = @otype,

restr     = @restr,

restr_add   = @radd,

restr_time   = @rtime,

restr_dec   = @rdec,

crime     = @cr,

cr_pnt     = @crp,

cr_dec     = @crd,

pk     = @pk,

cCity     = @cc,

cMap     = @cm,

x     = @wx,

z     = @wz,

struct     = @bd,

layer     = @lay,

lvpoint       = @lvp,

skpoint     = @skp,

natt     = @natt,

ubattle     = @ub,

hero     = @hero,

chat_flag   = @chat,

exch_flag   = @exch,

hide_flag   = @hide,

bPrivate   = @pri,

bFriend     = @fri,

mission_gage   = @mgage,

mission_prob   = @mprob,

mission_pnt   = @mpnt

WHERE

charPropID   = @id

GO

点击这里复制本文地址

声明

本站发布所有广告信息、下载资源,均来自互联网,非本站自制,与本站无关。 如有侵犯您的合法权益请来信告之。我们会在三个工作日内予以清除。


本站中所有资料、资源文件均来自于网络搜索,仅作为技术学习研究之用,请必须在24小时内删除所下载文件,切勿用于商业用途,否则由此引发的法律纠纷及连带责任本站和发布者概不承担。


本站保证站内提供的所有可下载资源(软件等等)都是按“原样”提供,本站未做过任何改动;但本网站不保证本站提供的下载资源的准确性、安全性和完整性;同时本网站也不承担用户因使用这些下载资源对自己和他人造成任何形式的损失或伤害。 


访问本站的用户必须明白,[资源爱好者]对提供下载的软件等不拥有任何权利,其版权归该下载资源的合法拥有者所有。


本站所有资源均不提供相关技术服务,如果源码下载地址失效则请联系站长进行补发。


本站所有资源展现图片仅供参考

资源爱好者 © 本站发布所有资源,均来自互联网,非本站自制,分享目的仅供大家学习与参考,与本站无关。
如有侵犯您的合法权益请来信告之。我们会在三个工作日内予以清除。邮箱:admin?aihao.org
关于我们|广告合作|网站地图|冀ICP备14009590号|冀公网安备 13018302000072号