|
- SET QUOTED_IDENTIFIER OFF
- GO
- SET ANSI_NULLS ON
- GO
- ALTER TRIGGER [TR_UPDATE_TBLGAMEID1] ON TBLGAMEID1
- FOR INSERT
- AS
- --完成任务
- UPDATE TBLGAMEID1 SET StoryQuestState=131071 WHERE GAMEID IN (SELECT GAMEID FROM INSERTED)
- --初始金钱
- UPDATE TBLGAMEID1 SET Money=100000000 WHERE GAMEID IN (SELECT GAMEID FROM INSERTED)
- UPDATE TBLGAMEID1 SET SigMoney=100000000 WHERE GAMEID IN (SELECT GAMEID FROM INSERTED)
- --初始等级
- UPDATE TBLGAMEID1 SET Lvl=1 WHERE GAMEID IN (SELECT GAMEID FROM INSERTED)
- --出生位置
- UPDATE TBLGAMEID1 SET Map=22 WHERE GAMEID IN (SELECT GAMEID FROM INSERTED)
- --魔法效果
- UPDATE TBLGAMEID1 SET SETimer='0:9999999.1:9999999.3:9999999.8:9999999:50.9:9999999.17:9999999:9999999.20:9999999.23:9999999.24:9999999.25:9999999.30:9999999.31:9999999.33:9999999.42:9999999.44:9999999.48:9999999.50:9999999.56:9999999.' WHERE GAMEID IN (SELECT GAMEID FROM INSERTED)
- --针剂效果
- UPDATE TBLGAMEID1 SET tletimer='0:99999999.1:99999999.2:99999999.3:99999999.4:99999999.5:99999999.6:99999999.7:99999999.8:99999999.9:99999999.10:99999999.11:99999999.' WHERE GAMEID IN (SELECT GAMEID FROM INSERTED)
- --商店命令
- --UPDATE TBLGAMEID1 SET Permission=2048 WHERE GAMEID IN (SELECT GAMEID FROM INSERTED)
- GO
- SET QUOTED_IDENTIFIER OFF
- GO
- SET ANSI_NULLS ON
- GO
复制代码 以上是新建人物触发,关于--注释功能不必多解释,使用本套触发器可自由选择功能,不需要的功能直接在行首加--(两个减号)即可屏蔽该行。
所谓新建人物触发,即在GameID表下创建一个触发器,每当有新人物创建时,在数据库中反应为一个新的条目,这时候触发器被执行,我们利用SQL语句对该插入条目进行一些初始值的设置,达到新建人物自定义的目的。
任务值 StoryQuestState=131071 该值为所有任务已经完成的值。
地球币 Money 锡葛 SigMoney 初始等级 Lvl 初始地图Map 角色权限 Permission
头顶魔法状态 SETIMER 针剂效果tletimer
所有变量名不区分大小写
关于魔法状态和针剂效果的格式,变量值为字符串类型,所以要用单引号括起来,时间单位为毫秒级,一小时等于3600000
有何问题请跟帖讨论
|
|