Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

Experienced Elementalist
Joined
Aug 13, 2010
Messages
248
Reaction score
108
Msg 8101, Level 16, State 1, Line 59
An explicit value for the identity column in table 'Tab_RefHive' can only be specified when a column list is used and IDENTITY_INSERT is ON.

its already ON :mad: :mad: :mad: :mad:
 
Initiate Mage
Joined
Jun 26, 2012
Messages
18
Reaction score
0
some help ples
Msg 8106, Level 16, State 1, Line 24
Table '_RefObjCommon' does not have the identity property. Cannot perform SET operation.
 
Initiate Mage
Joined
May 26, 2012
Messages
12
Reaction score
5
please help me

Query

PHP:
 DECLARE @CHARNAME VARCHAR (30)
DECLARE @NPCNAME VARCHAR (30)
DECLARE @ADDNEW VARCHAR (30)
DECLARE @TABNAME VARCHAR (30)
DECLARE @TABNUMBER VARCHAR (30) 
DECLARE @TABNEW VARCHAR (30)
DECLARE @GROUPNUMBER VARCHAR (30) 
DECLARE @GROUPNEW VARCHAR (30)
DECLARE @GAMEWORDID INT

SET @ADDNEW = 'NPC' -- 'NPC' to add a new npc, 'TAB' for add a new Tab, 'GROUP' for add a new group!
SET @CHARNAME = '[GM]Go_To_Hell' --U Char Name
SET @NPCNAME = 'STATIIC' --U NPC NAME
SET @GAMEWORDID = 1 --IMPORTANT! GET GAMEWORLD ID FROM THE LOCALY U WANT ADD THE NPC NORMAL CITYs = 1
SET @GROUPNUMBER  = 1
SET @TABNUMBER = 2
SET @TABNAME = 'DRESS'

--
IF @ADDNEW = 'NPC' BEGIN
DECLARE @MAXLINK VARCHAR (30) = (SELECT MAX (ID) FROM _RefObjChar)+1
DECLARE @MAXCOMMONID VARCHAR (30) = (SELECT MAX (ID) FROM _RefObjCommon)+1
SET IDENTITY_INSERT _RefObjCommon ON
INSERT INTO _RefObjCommon (Service,ID,CodeName128,ObjName128,OrgObjCodeName128,NameStrID128,DescStrID128,CashItem,Bionic,TypeID1,TypeID2,TypeID3,TypeID4,DecayTime,Country
,Rarity,CanTrade,CanSell,CanBuy,CanBorrow,CanDrop,CanPick,CanRepair,CanRevive,CanUse,CanThrow,Price,CostRepair,CostRevive,CostBorrow,KeepingFee,SellPrice,ReqLevelType1,ReqLevel1,ReqLevelType2,ReqLevel2,ReqLevelType3,ReqLevel3,ReqLevelType4,ReqLevel4,MaxContain,RegionID,Dir,OffsetX,OffsetY,OffsetZ,Speed1,Speed2,Scale,BCHeight,BCRadius
,EventID,AssocFileObj128,AssocFileDrop128,AssocFileIcon128,AssocFile1_128,AssocFile2_128,Link) VALUES
(1,@MAXCOMMONID,'NPC_'+@NPCNAME,'xxx','xxx','SN_NPC_'+@NPCNAME,'xxx',0,1,1,2,2,0,5000,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,-1,0,-1,0,-1,0,0,0,0,0,0,0,100,0,0,0,'npc\npc\chinawoman_Noblegirl_event.bsr','xxx','xxx','xxx','xxx',@MAXLINK)
SET IDENTITY_INSERT _RefObjCommon OFF
SET IDENTITY_INSERT _RefObjChar ON
INSERT INTO _RefObjChar (ID,Lvl,CharGender,MaxHP,MaxMP,ResistFrozen,ResistFrostbite,ResistBurn,ResistEShock,ResistPoison,ResistZombie,ResistSleep,ResistRoot,ResistSlow,ResistFear
,ResistMyopia,ResistBlood,ResistStone,ResistDark,ResistStun,ResistDisea,ResistChaos,ResistCsePD,ResistCseMD,ResistCseSTR,ResistCseINT,ResistCseHP,ResistCseMP,Resist24,ResistBomb,Resist26
,Resist27,Resist28,Resist29,Resist30,Resist31,Resist32,InventorySize,CanStore_TID1,CanStore_TID2,CanStore_TID3,CanStore_TID4,CanBeVehicle,CanControl,DamagePortion,MaxPassenger,AssocTactics,PD,MD,PAR,MAR,ER,BR,HR,CHR
,ExpToGive,CreepType,Knockdown,KO_RecoverTime,DefaultSkill_1,DefaultSkill_2,DefaultSkill_3,DefaultSkill_4,DefaultSkill_5,DefaultSkill_6,DefaultSkill_7,DefaultSkill_8,DefaultSkill_9,DefaultSkill_10,TextureType,Except_1
,Except_2,Except_3,Except_4,Except_5,Except_6,Except_7,Except_8,Except_9,Except_10,Link) VALUES
(@MAXLINK,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,336860180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
SET IDENTITY_INSERT _RefObjChar OFF
SET IDENTITY_INSERT _RefShop ON
DECLARE @ShopID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShop)+1
INSERT INTO _RefShop (Service,Country,ID,CodeName128,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
VALUES (1,15,@ShopID,'STORE_'+@NPCNAME,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
SET IDENTITY_INSERT _RefShop OFF
SET IDENTITY_INSERT _RefShopGroup ON
DECLARE @ShopGroupID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShopGroup)+1
INSERT INTO _RefShopGroup (Service,Country,ID,CodeName128,RefNPCCodeName,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
VALUES (1,15,@ShopGroupID,'GROUP_STORE_'+@NPCNAME,'NPC_'+@NPCNAME,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
SET IDENTITY_INSERT _RefShopGroup OFF
SET IDENTITY_INSERT _RefShopItemGroup ON
DECLARE @ShopItemID VARCHAR (30) = (SELECT MAX (GROUPID) FROM _RefShopItemGroup)+1
INSERT INTO _RefShopItemGroup (Service,GroupID,CodeName128,StrID128_Group)
VALUES (1,@ShopItemID,'STORE_'+@NPCNAME+'_GROUP1','SN_STORE_'+@NPCNAME+'_GROUP1')
SET IDENTITY_INSERT _RefShopItemGroup OFF
SET IDENTITY_INSERT _RefShopTab ON
DECLARE @ShopTabID VARCHAR (30)= (SELECT MAX (ID) FROM _RefShopTab)+1
INSERT INTO _RefShopTab (Service,Country,ID,CodeName128,RefTabGroupCodeName,StrID128_Tab)
VALUES (1,15,@ShopTabID,'STORE_'+@NPCNAME+'_TAB1','STORE_'+@NPCNAME+'_GROUP1','SN_TAB_WEAPON')
SET IDENTITY_INSERT _RefShopTab OFF
SET IDENTITY_INSERT _RefShopTabGroup ON
DECLARE @ShopTabGroupID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShopTabGroup)+1
INSERT INTO _RefShopTabGroup (Service,Country,ID,CodeName128,StrID128_Group)
VALUES (1,15,@ShopTabGroupID,'STORE_'+@NPCNAME+'_GROUP1','SN_STORE_'+@NPCNAME+'_GROUP1')
SET IDENTITY_INSERT _RefShopTabGroup OFF
INSERT INTO _RefMappingShopGroup VALUES (1,15,'GROUP_STORE_'+@NPCNAME,'STORE_'+@NPCNAME)
INSERT INTO _RefMappingShopWithTab VALUES (1,15,'STORE_'+@NPCNAME,'STORE_'+@NPCNAME+'_GROUP1')
DECLARE @TACTICSID INT SET @TACTICSID = (SELECT MAX (dwTacticsID) FROM Tab_RefTactics)+10
INSERT INTO Tab_RefTactics VALUES
(@TACTICSID,@MAXCOMMONID,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'NPC_'+@NPCNAME)
DECLARE @HIVEID INT  SET @HIVEID = (SELECT MAX (dwHiveID) FROM Tab_RefHive)+1
INSERT INTO Tab_RefHive VALUES
(@HIVEID,0,0,0,0,0,0,@GAMEWORDID,2,'NPC_'+@NPCNAME)
DECLARE @REGION VARCHAR (30) SET @REGION = (SELECT (LatestRegion) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSX VARCHAR (30) SET @POSX = (SELECT (POSX) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSY VARCHAR (30) SET @POSY = (SELECT (POSY) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSZ VARCHAR (30) SET @POSZ = (SELECT (POSZ) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @NESTID INT SET @NESTID = (SELECT MAX (dwNestID) FROM Tab_RefNest)+1
INSERT INTO Tab_RefNest VALUES
(@NESTID,@HIVEID,@TACTICSID,@REGION,@POSX,@POSY,@POSZ,0,0,0,0,0,0,1,0,1,0)
PRINT 'add this line to characterdata_45000 @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    '+@MAXCOMMONID+'    '+@NPCNAME+'    xxx    xxx    '+'SN_NPC_'+@NPCNAME+'    xxx    0    1    1    2    2    0    5000    3    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    -1    0    -1    0    -1    0    -1    0    -1    0    0    0    0    0    0    0    100    0    0    0    npc\npc\chinawoman_Noblegirl_event.bsr    xxx    xxx    xxx    xxx    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    336860180    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0'
PRINT ''
PRINT 'Add this line to refshop.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPID+'    '+'STORE_'+@NPCNAME+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
PRINT ''
PRINT 'Add this line to refshopgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPGROUPID+'    '+'GROUP_STORE_'+@NPCNAME+'    '+'NPC_'+@NPCNAME+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
PRINT ''
PRINT 'Add this line to shopgroupdata.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    '+@SHOPITEMID+'    '+'STORE_'+@NPCNAME+'_GROUP1    '+'SN_STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'Add this line to refshoptab.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPTABID+'    '+'STORE_'+@NPCNAME+'_TAB1    '+'STORE_'+@NPCNAME+'_GROUP1     SN_TAB_WEAPONS'
PRINT ''
PRINT 'Add this line to refshoptabgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPTABGROUPID+'    '+'STORE_'+@NPCNAME+'_GROUP1    '+'SN_STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'Add this line to refmappingshopgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+'GROUP_STORE_'+@NPCNAME+'    '+'STORE_'+@NPCNAME
PRINT ''
PRINT 'Add this line to refmappingshopwithtab.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+'STORE_'+@NPCNAME+'    '+'STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'A New NPC Has ADD Succesfuly Restart U Server and Login in '+@CHARNAME
END
IF @TABNUMBER = 2 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB2'
IF @TABNUMBER = 3 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB3'
IF @TABNUMBER = 4 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB4'
IF @GROUPNUMBER  = 2 SET @GROUPNEW = '_GROUP2'
IF @GROUPNUMBER  = 3 SET @GROUPNEW = '_GROUP3'
IF @GROUPNUMBER  = 4 SET @GROUPNEW = '_GROUP4'
IF @GROUPNUMBER  = 5 SET @GROUPNEW = '_GROUP5'
IF @GROUPNUMBER  = 6 SET @GROUPNEW = '_GROUP6'
IF @ADDNEW = 'GROUP' BEGIN 
SET IDENTITY_INSERT _RefShopTabGroup ON
SET @ShopTabGroupID = (SELECT MAX (ID) FROM _RefShopTabGroup)+1
INSERT INTO _RefShopTabGroup (Service,Country,ID,CodeName128,StrID128_Group)
VALUES (1,15,@ShopTabGroupID,'STORE_'+@NPCNAME+@GROUPNEW,'SN_STORE_'+@NPCNAME+@GROUPNEW)
SET IDENTITY_INSERT _RefShopTabGroup OFF
INSERT INTO _RefMappingShopWithTab VALUES (1,15,'STORE_'+@NPCNAME,'STORE_'+@NPCNAME+@GROUPNEW)
PRINT ''
PRINT 'New Group Added Succesfully '
PRINT 'add this new line to refshoptabgroup.txt @ server_dep\silkroad\textdata'
PRINT '1    15    '+@SHOPTABGROUPID+'    STORE_'+@NPCNAME+@GROUPNEW+'    SN_STORE_'+@NPCNAME+@GROUPNEW
PRINT ''
PRINT 'add this new line to refmappingshopwithtab.txt @ server_dep\silkroad\textdata'
PRINT '1    15    STORE_'+@NPCNAME+'    STORE_'+@NPCNAME+@GROUPNEW

END

IF @ADDNEW = 'TAB' BEGIN
IF @GROUPNUMBER = 1 SET @GROUPNEW = '_GROUP1'
SET IDENTITY_INSERT _RefShopTab ON
SET @ShopTabID = (SELECT MAX (ID) FROM _RefShopTab)+1
INSERT INTO _RefShopTab (Service,Country,ID,CodeName128,RefTabGroupCodeName,StrID128_Tab)
VALUES (1,15,@ShopTabID,@TABNEW,'STORE_'+@NPCNAME+@GROUPNEW,'SN_'+@TABNAME)
SET IDENTITY_INSERT _RefShopTab OFF
PRINT ''
PRINT 'New Tab added Sucessfully add this new line to refshoptab.txt @ server_dep\silkroad\textdata' 
PRINT '1    15    '+@SHOPTABID+'    STORE_'+@NPCNAME+@TABNEW+'    STORE_'+@NPCNAME+@GROUPNEW+'     SN_TAB_'+@TABNAME
END
IF @TABNUMBER > 4 BEGIN
PRINT '@TABNUMBER value does not exist. u must add 2 , 3 OR 4 Tabs Per NPC!'
END
IF @GROUPNUMBER > 8 BEGIN
PRINT '@GROUPNUMBER value does not exist. u must add  1 , 2 , 3 , 4 , 5 , 6 , 7 OR 8 Groups!'
END
IF @ADDNEW = '' BEGIN
PRINT '@ADDNEW value does not exist. u must set values NPC , TAB , GROUP'
END
/******************************* Best Query By Statiic don't Re-Release Under u Name*******************************/

messages

PHP:
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 12
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 12
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 17
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 25
Must declare the scalar variable "@MAXLINK".
Msg 102, Level 15, State 1, Line 28
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 28
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 30
Must declare the scalar variable "@ShopID".
Msg 102, Level 15, State 1, Line 33
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 33
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 35
Must declare the scalar variable "@ShopGroupID".
Msg 102, Level 15, State 1, Line 38
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 38
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 40
Must declare the scalar variable "@ShopItemID".
Msg 102, Level 15, State 1, Line 43
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 43
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 45
Must declare the scalar variable "@ShopTabID".
Msg 102, Level 15, State 1, Line 48
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 48
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 50
Must declare the scalar variable "@ShopTabGroupID".
Msg 137, Level 15, State 2, Line 58
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 73
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 77
Must declare the scalar variable "@SHOPID".
Msg 137, Level 15, State 2, Line 81
Must declare the scalar variable "@SHOPGROUPID".
Msg 137, Level 15, State 2, Line 85
Must declare the scalar variable "@SHOPITEMID".
Msg 137, Level 15, State 2, Line 89
Must declare the scalar variable "@SHOPTABID".
Msg 137, Level 15, State 2, Line 93
Must declare the scalar variable "@SHOPTABGROUPID".
 
Initiate Mage
Joined
May 26, 2012
Messages
12
Reaction score
5
please help me

Query

PHP:
 DECLARE @CHARNAME VARCHAR (30)
DECLARE @NPCNAME VARCHAR (30)
DECLARE @ADDNEW VARCHAR (30)
DECLARE @TABNAME VARCHAR (30)
DECLARE @TABNUMBER VARCHAR (30) 
DECLARE @TABNEW VARCHAR (30)
DECLARE @GROUPNUMBER VARCHAR (30) 
DECLARE @GROUPNEW VARCHAR (30)
DECLARE @GAMEWORDID INT

SET @ADDNEW = 'NPC' -- 'NPC' to add a new npc, 'TAB' for add a new Tab, 'GROUP' for add a new group!
SET @CHARNAME = '[GM]Go_To_Hell' --U Char Name
SET @NPCNAME = 'STATIIC' --U NPC NAME
SET @GAMEWORDID = 1 --IMPORTANT! GET GAMEWORLD ID FROM THE LOCALY U WANT ADD THE NPC NORMAL CITYs = 1
SET @GROUPNUMBER  = 1
SET @TABNUMBER = 2
SET @TABNAME = 'DRESS'

--
IF @ADDNEW = 'NPC' BEGIN
DECLARE @MAXLINK VARCHAR (30) = (SELECT MAX (ID) FROM _RefObjChar)+1
DECLARE @MAXCOMMONID VARCHAR (30) = (SELECT MAX (ID) FROM _RefObjCommon)+1
SET IDENTITY_INSERT _RefObjCommon ON
INSERT INTO _RefObjCommon (Service,ID,CodeName128,ObjName128,OrgObjCodeName128,NameStrID128,DescStrID128,CashItem,Bionic,TypeID1,TypeID2,TypeID3,TypeID4,DecayTime,Country
,Rarity,CanTrade,CanSell,CanBuy,CanBorrow,CanDrop,CanPick,CanRepair,CanRevive,CanUse,CanThrow,Price,CostRepair,CostRevive,CostBorrow,KeepingFee,SellPrice,ReqLevelType1,ReqLevel1,ReqLevelType2,ReqLevel2,ReqLevelType3,ReqLevel3,ReqLevelType4,ReqLevel4,MaxContain,RegionID,Dir,OffsetX,OffsetY,OffsetZ,Speed1,Speed2,Scale,BCHeight,BCRadius
,EventID,AssocFileObj128,AssocFileDrop128,AssocFileIcon128,AssocFile1_128,AssocFile2_128,Link) VALUES
(1,@MAXCOMMONID,'NPC_'+@NPCNAME,'xxx','xxx','SN_NPC_'+@NPCNAME,'xxx',0,1,1,2,2,0,5000,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,-1,0,-1,0,-1,0,0,0,0,0,0,0,100,0,0,0,'npc\npc\chinawoman_Noblegirl_event.bsr','xxx','xxx','xxx','xxx',@MAXLINK)
SET IDENTITY_INSERT _RefObjCommon OFF
SET IDENTITY_INSERT _RefObjChar ON
INSERT INTO _RefObjChar (ID,Lvl,CharGender,MaxHP,MaxMP,ResistFrozen,ResistFrostbite,ResistBurn,ResistEShock,ResistPoison,ResistZombie,ResistSleep,ResistRoot,ResistSlow,ResistFear
,ResistMyopia,ResistBlood,ResistStone,ResistDark,ResistStun,ResistDisea,ResistChaos,ResistCsePD,ResistCseMD,ResistCseSTR,ResistCseINT,ResistCseHP,ResistCseMP,Resist24,ResistBomb,Resist26
,Resist27,Resist28,Resist29,Resist30,Resist31,Resist32,InventorySize,CanStore_TID1,CanStore_TID2,CanStore_TID3,CanStore_TID4,CanBeVehicle,CanControl,DamagePortion,MaxPassenger,AssocTactics,PD,MD,PAR,MAR,ER,BR,HR,CHR
,ExpToGive,CreepType,Knockdown,KO_RecoverTime,DefaultSkill_1,DefaultSkill_2,DefaultSkill_3,DefaultSkill_4,DefaultSkill_5,DefaultSkill_6,DefaultSkill_7,DefaultSkill_8,DefaultSkill_9,DefaultSkill_10,TextureType,Except_1
,Except_2,Except_3,Except_4,Except_5,Except_6,Except_7,Except_8,Except_9,Except_10,Link) VALUES
(@MAXLINK,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,336860180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
SET IDENTITY_INSERT _RefObjChar OFF
SET IDENTITY_INSERT _RefShop ON
DECLARE @ShopID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShop)+1
INSERT INTO _RefShop (Service,Country,ID,CodeName128,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
VALUES (1,15,@ShopID,'STORE_'+@NPCNAME,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
SET IDENTITY_INSERT _RefShop OFF
SET IDENTITY_INSERT _RefShopGroup ON
DECLARE @ShopGroupID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShopGroup)+1
INSERT INTO _RefShopGroup (Service,Country,ID,CodeName128,RefNPCCodeName,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
VALUES (1,15,@ShopGroupID,'GROUP_STORE_'+@NPCNAME,'NPC_'+@NPCNAME,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
SET IDENTITY_INSERT _RefShopGroup OFF
SET IDENTITY_INSERT _RefShopItemGroup ON
DECLARE @ShopItemID VARCHAR (30) = (SELECT MAX (GROUPID) FROM _RefShopItemGroup)+1
INSERT INTO _RefShopItemGroup (Service,GroupID,CodeName128,StrID128_Group)
VALUES (1,@ShopItemID,'STORE_'+@NPCNAME+'_GROUP1','SN_STORE_'+@NPCNAME+'_GROUP1')
SET IDENTITY_INSERT _RefShopItemGroup OFF
SET IDENTITY_INSERT _RefShopTab ON
DECLARE @ShopTabID VARCHAR (30)= (SELECT MAX (ID) FROM _RefShopTab)+1
INSERT INTO _RefShopTab (Service,Country,ID,CodeName128,RefTabGroupCodeName,StrID128_Tab)
VALUES (1,15,@ShopTabID,'STORE_'+@NPCNAME+'_TAB1','STORE_'+@NPCNAME+'_GROUP1','SN_TAB_WEAPON')
SET IDENTITY_INSERT _RefShopTab OFF
SET IDENTITY_INSERT _RefShopTabGroup ON
DECLARE @ShopTabGroupID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShopTabGroup)+1
INSERT INTO _RefShopTabGroup (Service,Country,ID,CodeName128,StrID128_Group)
VALUES (1,15,@ShopTabGroupID,'STORE_'+@NPCNAME+'_GROUP1','SN_STORE_'+@NPCNAME+'_GROUP1')
SET IDENTITY_INSERT _RefShopTabGroup OFF
INSERT INTO _RefMappingShopGroup VALUES (1,15,'GROUP_STORE_'+@NPCNAME,'STORE_'+@NPCNAME)
INSERT INTO _RefMappingShopWithTab VALUES (1,15,'STORE_'+@NPCNAME,'STORE_'+@NPCNAME+'_GROUP1')
DECLARE @TACTICSID INT SET @TACTICSID = (SELECT MAX (dwTacticsID) FROM Tab_RefTactics)+10
INSERT INTO Tab_RefTactics VALUES
(@TACTICSID,@MAXCOMMONID,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'NPC_'+@NPCNAME)
DECLARE @HIVEID INT  SET @HIVEID = (SELECT MAX (dwHiveID) FROM Tab_RefHive)+1
INSERT INTO Tab_RefHive VALUES
(@HIVEID,0,0,0,0,0,0,@GAMEWORDID,2,'NPC_'+@NPCNAME)
DECLARE @REGION VARCHAR (30) SET @REGION = (SELECT (LatestRegion) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSX VARCHAR (30) SET @POSX = (SELECT (POSX) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSY VARCHAR (30) SET @POSY = (SELECT (POSY) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSZ VARCHAR (30) SET @POSZ = (SELECT (POSZ) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @NESTID INT SET @NESTID = (SELECT MAX (dwNestID) FROM Tab_RefNest)+1
INSERT INTO Tab_RefNest VALUES
(@NESTID,@HIVEID,@TACTICSID,@REGION,@POSX,@POSY,@POSZ,0,0,0,0,0,0,1,0,1,0)
PRINT 'add this line to characterdata_45000 @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    '+@MAXCOMMONID+'    '+@NPCNAME+'    xxx    xxx    '+'SN_NPC_'+@NPCNAME+'    xxx    0    1    1    2    2    0    5000    3    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    -1    0    -1    0    -1    0    -1    0    -1    0    0    0    0    0    0    0    100    0    0    0    npc\npc\chinawoman_Noblegirl_event.bsr    xxx    xxx    xxx    xxx    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    336860180    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0'
PRINT ''
PRINT 'Add this line to refshop.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPID+'    '+'STORE_'+@NPCNAME+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
PRINT ''
PRINT 'Add this line to refshopgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPGROUPID+'    '+'GROUP_STORE_'+@NPCNAME+'    '+'NPC_'+@NPCNAME+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
PRINT ''
PRINT 'Add this line to shopgroupdata.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    '+@SHOPITEMID+'    '+'STORE_'+@NPCNAME+'_GROUP1    '+'SN_STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'Add this line to refshoptab.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPTABID+'    '+'STORE_'+@NPCNAME+'_TAB1    '+'STORE_'+@NPCNAME+'_GROUP1     SN_TAB_WEAPONS'
PRINT ''
PRINT 'Add this line to refshoptabgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPTABGROUPID+'    '+'STORE_'+@NPCNAME+'_GROUP1    '+'SN_STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'Add this line to refmappingshopgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+'GROUP_STORE_'+@NPCNAME+'    '+'STORE_'+@NPCNAME
PRINT ''
PRINT 'Add this line to refmappingshopwithtab.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+'STORE_'+@NPCNAME+'    '+'STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'A New NPC Has ADD Succesfuly Restart U Server and Login in '+@CHARNAME
END
IF @TABNUMBER = 2 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB2'
IF @TABNUMBER = 3 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB3'
IF @TABNUMBER = 4 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB4'
IF @GROUPNUMBER  = 2 SET @GROUPNEW = '_GROUP2'
IF @GROUPNUMBER  = 3 SET @GROUPNEW = '_GROUP3'
IF @GROUPNUMBER  = 4 SET @GROUPNEW = '_GROUP4'
IF @GROUPNUMBER  = 5 SET @GROUPNEW = '_GROUP5'
IF @GROUPNUMBER  = 6 SET @GROUPNEW = '_GROUP6'
IF @ADDNEW = 'GROUP' BEGIN 
SET IDENTITY_INSERT _RefShopTabGroup ON
SET @ShopTabGroupID = (SELECT MAX (ID) FROM _RefShopTabGroup)+1
INSERT INTO _RefShopTabGroup (Service,Country,ID,CodeName128,StrID128_Group)
VALUES (1,15,@ShopTabGroupID,'STORE_'+@NPCNAME+@GROUPNEW,'SN_STORE_'+@NPCNAME+@GROUPNEW)
SET IDENTITY_INSERT _RefShopTabGroup OFF
INSERT INTO _RefMappingShopWithTab VALUES (1,15,'STORE_'+@NPCNAME,'STORE_'+@NPCNAME+@GROUPNEW)
PRINT ''
PRINT 'New Group Added Succesfully '
PRINT 'add this new line to refshoptabgroup.txt @ server_dep\silkroad\textdata'
PRINT '1    15    '+@SHOPTABGROUPID+'    STORE_'+@NPCNAME+@GROUPNEW+'    SN_STORE_'+@NPCNAME+@GROUPNEW
PRINT ''
PRINT 'add this new line to refmappingshopwithtab.txt @ server_dep\silkroad\textdata'
PRINT '1    15    STORE_'+@NPCNAME+'    STORE_'+@NPCNAME+@GROUPNEW

END

IF @ADDNEW = 'TAB' BEGIN
IF @GROUPNUMBER = 1 SET @GROUPNEW = '_GROUP1'
SET IDENTITY_INSERT _RefShopTab ON
SET @ShopTabID = (SELECT MAX (ID) FROM _RefShopTab)+1
INSERT INTO _RefShopTab (Service,Country,ID,CodeName128,RefTabGroupCodeName,StrID128_Tab)
VALUES (1,15,@ShopTabID,@TABNEW,'STORE_'+@NPCNAME+@GROUPNEW,'SN_'+@TABNAME)
SET IDENTITY_INSERT _RefShopTab OFF
PRINT ''
PRINT 'New Tab added Sucessfully add this new line to refshoptab.txt @ server_dep\silkroad\textdata' 
PRINT '1    15    '+@SHOPTABID+'    STORE_'+@NPCNAME+@TABNEW+'    STORE_'+@NPCNAME+@GROUPNEW+'     SN_TAB_'+@TABNAME
END
IF @TABNUMBER > 4 BEGIN
PRINT '@TABNUMBER value does not exist. u must add 2 , 3 OR 4 Tabs Per NPC!'
END
IF @GROUPNUMBER > 8 BEGIN
PRINT '@GROUPNUMBER value does not exist. u must add  1 , 2 , 3 , 4 , 5 , 6 , 7 OR 8 Groups!'
END
IF @ADDNEW = '' BEGIN
PRINT '@ADDNEW value does not exist. u must set values NPC , TAB , GROUP'
END
/******************************* Best Query By Statiic don't Re-Release Under u Name*******************************/


messges

PHP:
Msg 102, Level 15, State 1, Line 21
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 21
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 22
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 22
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 27
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 35
Must declare the scalar variable "@MAXLINK".
Msg 102, Level 15, State 1, Line 38
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 38
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 40
Must declare the scalar variable "@ShopID".
Msg 102, Level 15, State 1, Line 43
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 43
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 45
Must declare the scalar variable "@ShopGroupID".
Msg 102, Level 15, State 1, Line 48
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 48
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 50
Must declare the scalar variable "@ShopItemID".
Msg 102, Level 15, State 1, Line 53
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 53
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 55
Must declare the scalar variable "@ShopTabID".
Msg 102, Level 15, State 1, Line 58
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 58
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 60
Must declare the scalar variable "@ShopTabGroupID".
Msg 137, Level 15, State 2, Line 66
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 79
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 83
Must declare the scalar variable "@SHOPID".
Msg 137, Level 15, State 2, Line 87
Must declare the scalar variable "@SHOPGROUPID".
Msg 137, Level 15, State 2, Line 91
Must declare the scalar variable "@SHOPITEMID".
Msg 137, Level 15, State 2, Line 95
Must declare the scalar variable "@SHOPTABID".
Msg 137, Level 15, State 2, Line 99
Must declare the scalar variable "@SHOPTABGROUPID".
Msg 137, Level 15, State 1, Line 121
Must declare the scalar variable "@ShopTabGroupID".
Msg 137, Level 15, State 2, Line 123
Must declare the scalar variable "@ShopTabGroupID".
Msg 137, Level 15, State 2, Line 129
Must declare the scalar variable "@SHOPTABGROUPID".
Msg 137, Level 15, State 1, Line 139
Must declare the scalar variable "@ShopTabID".
Msg 137, Level 15, State 2, Line 141
Must declare the scalar variable "@ShopTabID".
Msg 137, Level 15, State 2, Line 145
Must declare the scalar variable "@SHOPTABID".
 
Initiate Mage
Joined
May 26, 2012
Messages
12
Reaction score
5
please help me

Query

PHP:
  DECLARE @CHARNAME VARCHAR (30)
DECLARE @NPCNAME VARCHAR (30)
DECLARE @ADDNEW VARCHAR (30)
DECLARE @TABNAME VARCHAR (30)
DECLARE @TABNUMBER VARCHAR (30) 
DECLARE @TABNEW VARCHAR (30)
DECLARE @GROUPNUMBER VARCHAR (30) 
DECLARE @GROUPNEW VARCHAR (30)
DECLARE @GAMEWORDID INT

SET @ADDNEW = 'NPC' -- 'NPC' to add a new npc, 'TAB' for add a new Tab, 'GROUP' for add a new group!
SET @CHARNAME = '[GM]Go_To_Hell' --U Char Name
SET @NPCNAME = 'STATIIC' --U NPC NAME
SET @GAMEWORDID = 1 --IMPORTANT! GET GAMEWORLD ID FROM THE LOCALY U WANT ADD THE NPC NORMAL CITYs = 1
SET @GROUPNUMBER  = 1
SET @TABNUMBER = 2
SET @TABNAME = 'DRESS'

--
IF @ADDNEW = 'NPC' BEGIN
DECLARE @MAXLINK VARCHAR (30) = (SELECT MAX (ID) FROM _RefObjChar)+1
DECLARE @MAXCOMMONID VARCHAR (30) = (SELECT MAX (ID) FROM _RefObjCommon)+1
SET IDENTITY_INSERT _RefObjCommon ON
INSERT INTO _RefObjCommon (Service,ID,CodeName128,ObjName128,OrgObjCodeName128,NameStrID128,DescStrID128,CashItem,Bionic,TypeID1,TypeID2,TypeID3,TypeID4,DecayTime,Country
,Rarity,CanTrade,CanSell,CanBuy,CanBorrow,CanDrop,CanPick,CanRepair,CanRevive,CanUse,CanThrow,Price,CostRepair,CostRevive,CostBorrow,KeepingFee,SellPrice,ReqLevelType1,ReqLevel1,ReqLevelType2,ReqLevel2,ReqLevelType3,ReqLevel3,ReqLevelType4,ReqLevel4,MaxContain,RegionID,Dir,OffsetX,OffsetY,OffsetZ,Speed1,Speed2,Scale,BCHeight,BCRadius
,EventID,AssocFileObj128,AssocFileDrop128,AssocFileIcon128,AssocFile1_128,AssocFile2_128,Link) VALUES
(1,@MAXCOMMONID,'NPC_'+@NPCNAME,'xxx','xxx','SN_NPC_'+@NPCNAME,'xxx',0,1,1,2,2,0,5000,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1,0,-1,0,-1,0,-1,0,0,0,0,0,0,0,100,0,0,0,'npc\npc\chinawoman_Noblegirl_event.bsr','xxx','xxx','xxx','xxx',@MAXLINK)
SET IDENTITY_INSERT _RefObjCommon OFF
SET IDENTITY_INSERT _RefObjChar ON
INSERT INTO _RefObjChar (ID,Lvl,CharGender,MaxHP,MaxMP,ResistFrozen,ResistFrostbite,ResistBurn,ResistEShock,ResistPoison,ResistZombie,ResistSleep,ResistRoot,ResistSlow,ResistFear
,ResistMyopia,ResistBlood,ResistStone,ResistDark,ResistStun,ResistDisea,ResistChaos,ResistCsePD,ResistCseMD,ResistCseSTR,ResistCseINT,ResistCseHP,ResistCseMP,Resist24,ResistBomb,Resist26
,Resist27,Resist28,Resist29,Resist30,Resist31,Resist32,InventorySize,CanStore_TID1,CanStore_TID2,CanStore_TID3,CanStore_TID4,CanBeVehicle,CanControl,DamagePortion,MaxPassenger,AssocTactics,PD,MD,PAR,MAR,ER,BR,HR,CHR
,ExpToGive,CreepType,Knockdown,KO_RecoverTime,DefaultSkill_1,DefaultSkill_2,DefaultSkill_3,DefaultSkill_4,DefaultSkill_5,DefaultSkill_6,DefaultSkill_7,DefaultSkill_8,DefaultSkill_9,DefaultSkill_10,TextureType,Except_1
,Except_2,Except_3,Except_4,Except_5,Except_6,Except_7,Except_8,Except_9,Except_10,Link) VALUES
(@MAXLINK,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,336860180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
SET IDENTITY_INSERT _RefObjChar OFF
SET IDENTITY_INSERT _RefShop ON
DECLARE @ShopID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShop)+1
INSERT INTO _RefShop (Service,Country,ID,CodeName128,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
VALUES (1,15,@ShopID,'STORE_'+@NPCNAME,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
SET IDENTITY_INSERT _RefShop OFF
SET IDENTITY_INSERT _RefShopGroup ON
DECLARE @ShopGroupID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShopGroup)+1
INSERT INTO _RefShopGroup (Service,Country,ID,CodeName128,RefNPCCodeName,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
VALUES (1,15,@ShopGroupID,'GROUP_STORE_'+@NPCNAME,'NPC_'+@NPCNAME,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
SET IDENTITY_INSERT _RefShopGroup OFF
SET IDENTITY_INSERT _RefShopItemGroup ON
DECLARE @ShopItemID VARCHAR (30) = (SELECT MAX (GROUPID) FROM _RefShopItemGroup)+1
INSERT INTO _RefShopItemGroup (Service,GroupID,CodeName128,StrID128_Group)
VALUES (1,@ShopItemID,'STORE_'+@NPCNAME+'_GROUP1','SN_STORE_'+@NPCNAME+'_GROUP1')
SET IDENTITY_INSERT _RefShopItemGroup OFF
SET IDENTITY_INSERT _RefShopTab ON
DECLARE @ShopTabID VARCHAR (30)= (SELECT MAX (ID) FROM _RefShopTab)+1
INSERT INTO _RefShopTab (Service,Country,ID,CodeName128,RefTabGroupCodeName,StrID128_Tab)
VALUES (1,15,@ShopTabID,'STORE_'+@NPCNAME+'_TAB1','STORE_'+@NPCNAME+'_GROUP1','SN_TAB_WEAPON')
SET IDENTITY_INSERT _RefShopTab OFF
SET IDENTITY_INSERT _RefShopTabGroup ON
DECLARE @ShopTabGroupID VARCHAR (30) = (SELECT MAX (ID) FROM _RefShopTabGroup)+1
INSERT INTO _RefShopTabGroup (Service,Country,ID,CodeName128,StrID128_Group)
VALUES (1,15,@ShopTabGroupID,'STORE_'+@NPCNAME+'_GROUP1','SN_STORE_'+@NPCNAME+'_GROUP1')
SET IDENTITY_INSERT _RefShopTabGroup OFF
INSERT INTO _RefMappingShopGroup VALUES (1,15,'GROUP_STORE_'+@NPCNAME,'STORE_'+@NPCNAME)
INSERT INTO _RefMappingShopWithTab VALUES (1,15,'STORE_'+@NPCNAME,'STORE_'+@NPCNAME+'_GROUP1')
DECLARE @TACTICSID INT SET @TACTICSID = (SELECT MAX (dwTacticsID) FROM Tab_RefTactics)+10
INSERT INTO Tab_RefTactics VALUES
(@TACTICSID,@MAXCOMMONID,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'NPC_'+@NPCNAME)
DECLARE @HIVEID INT  SET @HIVEID = (SELECT MAX (dwHiveID) FROM Tab_RefHive)+1
INSERT INTO Tab_RefHive VALUES
(@HIVEID,0,0,0,0,0,0,@GAMEWORDID,2,'NPC_'+@NPCNAME)
DECLARE @REGION VARCHAR (30) SET @REGION = (SELECT (LatestRegion) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSX VARCHAR (30) SET @POSX = (SELECT (POSX) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSY VARCHAR (30) SET @POSY = (SELECT (POSY) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSZ VARCHAR (30) SET @POSZ = (SELECT (POSZ) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @NESTID INT SET @NESTID = (SELECT MAX (dwNestID) FROM Tab_RefNest)+1
INSERT INTO Tab_RefNest VALUES
(@NESTID,@HIVEID,@TACTICSID,@REGION,@POSX,@POSY,@POSZ,0,0,0,0,0,0,1,0,1,0)
PRINT 'add this line to characterdata_45000 @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    '+@MAXCOMMONID+'    '+@NPCNAME+'    xxx    xxx    '+'SN_NPC_'+@NPCNAME+'    xxx    0    1    1    2    2    0    5000    3    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    -1    0    -1    0    -1    0    -1    0    -1    0    0    0    0    0    0    0    100    0    0    0    npc\npc\chinawoman_Noblegirl_event.bsr    xxx    xxx    xxx    xxx    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    336860180    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0'
PRINT ''
PRINT 'Add this line to refshop.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPID+'    '+'STORE_'+@NPCNAME+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
PRINT ''
PRINT 'Add this line to refshopgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPGROUPID+'    '+'GROUP_STORE_'+@NPCNAME+'    '+'NPC_'+@NPCNAME+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
PRINT ''
PRINT 'Add this line to shopgroupdata.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    '+@SHOPITEMID+'    '+'STORE_'+@NPCNAME+'_GROUP1    '+'SN_STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'Add this line to refshoptab.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPTABID+'    '+'STORE_'+@NPCNAME+'_TAB1    '+'STORE_'+@NPCNAME+'_GROUP1     SN_TAB_WEAPONS'
PRINT ''
PRINT 'Add this line to refshoptabgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+@SHOPTABGROUPID+'    '+'STORE_'+@NPCNAME+'_GROUP1    '+'SN_STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'Add this line to refmappingshopgroup.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+'GROUP_STORE_'+@NPCNAME+'    '+'STORE_'+@NPCNAME
PRINT ''
PRINT 'Add this line to refmappingshopwithtab.txt @ server_dep\silkroad\textdata'
PRINT ''
PRINT '1    15    '+'STORE_'+@NPCNAME+'    '+'STORE_'+@NPCNAME+'_GROUP1'
PRINT ''
PRINT 'A New NPC Has ADD Succesfuly Restart U Server and Login in '+@CHARNAME
END
IF @TABNUMBER = 2 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB2'
IF @TABNUMBER = 3 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB3'
IF @TABNUMBER = 4 SET @TABNEW = 'STORE_'+@NPCNAME+'_TAB4'
IF @GROUPNUMBER  = 2 SET @GROUPNEW = '_GROUP2'
IF @GROUPNUMBER  = 3 SET @GROUPNEW = '_GROUP3'
IF @GROUPNUMBER  = 4 SET @GROUPNEW = '_GROUP4'
IF @GROUPNUMBER  = 5 SET @GROUPNEW = '_GROUP5'
IF @GROUPNUMBER  = 6 SET @GROUPNEW = '_GROUP6'
IF @ADDNEW = 'GROUP' BEGIN 
SET IDENTITY_INSERT _RefShopTabGroup ON
SET @ShopTabGroupID = (SELECT MAX (ID) FROM _RefShopTabGroup)+1
INSERT INTO _RefShopTabGroup (Service,Country,ID,CodeName128,StrID128_Group)
VALUES (1,15,@ShopTabGroupID,'STORE_'+@NPCNAME+@GROUPNEW,'SN_STORE_'+@NPCNAME+@GROUPNEW)
SET IDENTITY_INSERT _RefShopTabGroup OFF
INSERT INTO _RefMappingShopWithTab VALUES (1,15,'STORE_'+@NPCNAME,'STORE_'+@NPCNAME+@GROUPNEW)
PRINT ''
PRINT 'New Group Added Succesfully '
PRINT 'add this new line to refshoptabgroup.txt @ server_dep\silkroad\textdata'
PRINT '1    15    '+@SHOPTABGROUPID+'    STORE_'+@NPCNAME+@GROUPNEW+'    SN_STORE_'+@NPCNAME+@GROUPNEW
PRINT ''
PRINT 'add this new line to refmappingshopwithtab.txt @ server_dep\silkroad\textdata'
PRINT '1    15    STORE_'+@NPCNAME+'    STORE_'+@NPCNAME+@GROUPNEW

END

IF @ADDNEW = 'TAB' BEGIN
IF @GROUPNUMBER = 1 SET @GROUPNEW = '_GROUP1'
SET IDENTITY_INSERT _RefShopTab ON
SET @ShopTabID = (SELECT MAX (ID) FROM _RefShopTab)+1
INSERT INTO _RefShopTab (Service,Country,ID,CodeName128,RefTabGroupCodeName,StrID128_Tab)
VALUES (1,15,@ShopTabID,@TABNEW,'STORE_'+@NPCNAME+@GROUPNEW,'SN_'+@TABNAME)
SET IDENTITY_INSERT _RefShopTab OFF
PRINT ''
PRINT 'New Tab added Sucessfully add this new line to refshoptab.txt @ server_dep\silkroad\textdata' 
PRINT '1    15    '+@SHOPTABID+'    STORE_'+@NPCNAME+@TABNEW+'    STORE_'+@NPCNAME+@GROUPNEW+'     SN_TAB_'+@TABNAME
END
IF @TABNUMBER > 4 BEGIN
PRINT '@TABNUMBER value does not exist. u must add 2 , 3 OR 4 Tabs Per NPC!'
END
IF @GROUPNUMBER > 8 BEGIN
PRINT '@GROUPNUMBER value does not exist. u must add  1 , 2 , 3 , 4 , 5 , 6 , 7 OR 8 Groups!'
END
IF @ADDNEW = '' BEGIN
PRINT '@ADDNEW value does not exist. u must set values NPC , TAB , GROUP'
END
/******************************* Best Query By Statiic don't Re-Release Under u Name*******************************/

messges

PHP:
 Msg 102, Level 15, State 1, Line 21
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 21
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 22
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 22
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 27
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 35
Must declare the scalar variable "@MAXLINK".
Msg 102, Level 15, State 1, Line 38
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 38
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 40
Must declare the scalar variable "@ShopID".
Msg 102, Level 15, State 1, Line 43
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 43
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 45
Must declare the scalar variable "@ShopGroupID".
Msg 102, Level 15, State 1, Line 48
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 48
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 50
Must declare the scalar variable "@ShopItemID".
Msg 102, Level 15, State 1, Line 53
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 53
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 55
Must declare the scalar variable "@ShopTabID".
Msg 102, Level 15, State 1, Line 58
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 58
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 60
Must declare the scalar variable "@ShopTabGroupID".
Msg 137, Level 15, State 2, Line 66
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 79
Must declare the scalar variable "@MAXCOMMONID".
Msg 137, Level 15, State 2, Line 83
Must declare the scalar variable "@SHOPID".
Msg 137, Level 15, State 2, Line 87
Must declare the scalar variable "@SHOPGROUPID".
Msg 137, Level 15, State 2, Line 91
Must declare the scalar variable "@SHOPITEMID".
Msg 137, Level 15, State 2, Line 95
Must declare the scalar variable "@SHOPTABID".
Msg 137, Level 15, State 2, Line 99
Must declare the scalar variable "@SHOPTABGROUPID".
Msg 137, Level 15, State 1, Line 121
Must declare the scalar variable "@ShopTabGroupID".
Msg 137, Level 15, State 2, Line 123
Must declare the scalar variable "@ShopTabGroupID".
Msg 137, Level 15, State 2, Line 129
Must declare the scalar variable "@SHOPTABGROUPID".
Msg 137, Level 15, State 1, Line 139
Must declare the scalar variable "@ShopTabID".
Msg 137, Level 15, State 2, Line 141
Must declare the scalar variable "@ShopTabID".
Msg 137, Level 15, State 2, Line 145
Must declare the scalar variable "@SHOPTABID".
 
Initiate Mage
Joined
Jul 3, 2012
Messages
14
Reaction score
0
hay static help me with this error
(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)
Msg 1088, Level 16, State 11, Line 55
Cannot find the object "Tab_Nest" because it does not exist or you do not have permissions.
its in your DB Ver 6.3 Plz Bro help
 
Initiate Mage
Joined
Jul 3, 2012
Messages
14
Reaction score
0
i maked every thing Static say but have this error

Msg 8107, Level 16, State 1, Line 13
IDENTITY_INSERT is already ON for table 'SRO_VT_SHARD.dbo.Tab_RefNest'. Cannot perform SET operation for table '_RefObjCommon'.
 
Skilled Illusionist
Joined
Apr 1, 2012
Messages
324
Reaction score
9
i execute the all in one but i get this :


Msg 8101, Level 16, State 1, Line 76
An explicit value for the identity column in table 'Tab_RefNest' can only be specified when a column list is used and IDENTITY_INSERT is ON.

Any Help Statiic ? Thanks dude i appreciate
 
Skilled Illusionist
Joined
Apr 1, 2012
Messages
324
Reaction score
9
same problem Statiic :'(

i did all of this :

1º set indentity propety in this tables
_RefObjCommon,_RefObjChar,_RefShop,_RefShopGroup,_RefShopItemGroup,_RefShopTab,_RefShopTabGroup,Tab_RefNest,Tab_Hive...

go Tools > Options... > Designers > and Clean "Prevent saving changes that require table re-creation" .
now
_RefObjCommon > Design > right click ID Column Set a primary key > Column Properties > Indetity Spercification > (Is Indetity) set "Yes" same with the others.
ok now u can exec the querys without any errro

and just keep getting > Msg 8101, Level 16, State 1, Line 65
An explicit value for the identity column in table 'Tab_RefTactics' can only be specified when a column list is used and IDENTITY_INSERT is ON.

Hope u helpme ! Pls! Regards !
 
Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
if u have eyes... search for Tab_RefTactics
>>> _RefObjCommon,_RefObjChar,_RefShop,_RefShopGroup,_RefShopItemGroup,_RefShopTab,_RefShopTabGroup,Tab_RefNest,Tab_Hive...
SET JUST THIS TABLES! Tab_RefTactics Work without IDENTITY !
 
Skilled Illusionist
Joined
Apr 1, 2012
Messages
324
Reaction score
9
now i get same but for RefHive bro :-/


Msg 8101, Level 16, State 1, Line 68
An explicit value for the identity column in table 'Tab_RefHive' can only be specified when a column list is used and IDENTITY_INSERT is ON.

also for RefNest, so i put : Identy : No for all of them and this work now but i get a final error :


(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)
Msg 8106, Level 16, State 1, Line 75
Table 'Tab_RefNest' does not have the identity property. Cannot perform SET operation.

i put again refnest identy property and well i get this now :( :


Msg 8101, Level 16, State 1, Line 76
An explicit value for the identity column in table 'Tab_RefNest' can only be specified when a column list is used and IDENTITY_INSERT is ON.

pfff now this : damn :/


(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)
Msg 2627, Level 14, State 1, Line 62
Violation of PRIMARY KEY constraint 'PK__RefMappingShopGroup'. Cannot insert duplicate key in object 'dbo._RefMappingShopGroup'.
The statement has been terminated.
Msg 2627, Level 14, State 1, Line 63
Violation of PRIMARY KEY constraint 'PK__RefMappingShopWithTab'. Cannot insert duplicate key in object 'dbo._RefMappingShopWithTab'.
The statement has been terminated.

(1 row(s) affected)

(1 row(s) affected)
Msg 8101, Level 16, State 1, Line 76
An explicit value for the identity column in table 'Tab_RefNest' can only be specified when a column list is used and IDENTITY_INSERT is ON.
 
Last edited:
Initiate Mage
Joined
Jan 23, 2012
Messages
17
Reaction score
1
Works fine, thanks ;)
For all those that can't make it to work.. READ THE FIRST POST :)
 
Junior Spellweaver
Joined
Oct 9, 2007
Messages
151
Reaction score
15
hmp, added the npc and everythin is fine, but i cant seem to add items to that npc.. im getting crashed each time i try.
 
Skilled Illusionist
Joined
Apr 1, 2012
Messages
324
Reaction score
9
NICE ! THIS IS WORKING FOR ME FINALLY !!

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)

(1 row(s) affected)
add this line to characterdata_45000 @ server_dep\silkroad\textdata

1 46377 JOAO xxx xxx SN_NPC_JOAO xxx 0 1 1 2 2 0 5000 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 0 -1 0 -1 0 -1 0 -1 0 0 0 0 0 0 0 100 0 0 0 npc\npc\chinawoman_Noblegirl_event.bsr xxx xxx xxx xxx 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 336860180 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Add this line to refshop.txt @ server_dep\silkroad\textdata

1 15 2645 STORE_JOAO -1 xxx -1 xxx -1 xxx -1 xxx

Add this line to refshopgroup.txt @ server_dep\silkroad\textdata

1 15 2818 GROUP_STORE_JOAO NPC_JOAO -1 xxx -1 xxx -1 xxx -1 xxx

Add this line to shopgroupdata.txt @ server_dep\silkroad\textdata

1 87 STORE_JOAO_GROUP1 SN_STORE_JOAO_GROUP1

Add this line to refshoptab.txt @ server_dep\silkroad\textdata

1 15 6434 STORE_JOAO_TAB1 STORE_JOAO_GROUP1 SN_TAB_WEAPONS

Add this line to refshoptabgroup.txt @ server_dep\silkroad\textdata

1 15 2837 STORE_JOAO_GROUP1 SN_STORE_JOAO_GROUP1

Add this line to refmappingshopgroup.txt @ server_dep\silkroad\textdata

1 15 GROUP_STORE_JOAO STORE_JOAO

Add this line to refmappingshopwithtab.txt @ server_dep\silkroad\textdata

1 15 STORE_JOAO STORE_JOAO_GROUP1

A New NPC Has ADD Succesfuly Restart U Server and Login in YacuZa

i added all lines in mediapk2 , but now my sroclient dont start, this just crash after click Start :S any help please?
 
Initiate Mage
Joined
Jan 23, 2012
Messages
17
Reaction score
1
NICE ! THIS IS WORKING FOR ME FINALLY !!



i added all lines in mediapk2 , but now my sroclient dont start, this just crash after click Start :S any help please?

For each line you have to use the key "TAB" as space not just the usual " ". + Characterdata info is not correct - add it on ur own.
Still can't find out why I can't add items or even names to this npc :) seems that I am going to rebuild it on the hard way.......
 
Skilled Illusionist
Joined
Apr 1, 2012
Messages
324
Reaction score
9
thanks proxy1997 and arabianfox for their help and statiic for query
 
Back
Top