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 ^^

Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
so guys my 2st Query i learning so i think it is better :)

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

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.
NOW DO THE SAME WITH Tab_RefHive and Tab_RefNest BUT SET INDENTITY OFF
ok now u can exec the querys without any errro




NPC

PHP:
DECLARE @CHARNAME VARCHAR (30) 
DECLARE @NPCNAME VARCHAR (30) 
DECLARE @ADDNEW VARCHAR (30) 
DECLARE @GAMEWORDID INT 
SET @CHARNAME = 'DW' --U Char Name 
SET @NPCNAME = '1' --U NPC NAME 
SET @GAMEWORDID = 1 --IMPORTANT! GET GAMEWORLD ID FROM THE LOCALY U WANT ADD THE NPC NORMAL CITYs = 1 
SET @ADDNEW = 'NPC' 
-- 
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) 
BEGIN
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) 
END
BEGIN
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) 
END
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

TAB

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)
--
SET @ADDNEW = 'TAB' -- 'NPC' to add a new npc, 'TAB' for add a new Tab, 'GROUP' for add a new group!
SET @CHARNAME = '[GM] STATIIC' --U Char Name
SET @NPCNAME = 'STATIIC' --U NPC NAME
SET @GROUPNUMBER  = 1
SET @TABNUMBER = 4
SET @TABNAME = 'TEST'
--
IF @TABNUMBER = 2 SET @TABNEW = '_TAB2'
IF @TABNUMBER = 3 SET @TABNEW = '_TAB3'
IF @TABNUMBER = 4 SET @TABNEW = '_TAB4'
IF @GROUPNUMBER = 1 SET @GROUPNEW = '_GROUP1'
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 = 'TAB' BEGIN
SET IDENTITY_INSERT _RefShopTab ON
DECLARE @ShopTabID VARCHAR (30) SET @ShopTabID = (SELECT MAX (ID) FROM _RefShopTab)+1
INSERT INTO _RefShopTab (Service,Country,ID,CodeName128,RefTabGroupCodeName,StrID128_Tab)
VALUES (1,15,@ShopTabID,'STORE_'+@NPCNAME+@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

GROUP

PHP:
DECLARE @CHARNAME VARCHAR (30)
DECLARE @NPCNAME VARCHAR (30)
DECLARE @ADDNEW VARCHAR (30)
DECLARE @GROUPNUMBER VARCHAR (30) 
DECLARE @GROUPNEW VARCHAR (30)
SET @CHARNAME = '[GM] TIEKO' --U Char Name
SET @NPCNAME = 'STATIC' --U NPC NAME
SET @GROUPNUMBER  = 2
SET @ADDNEW = 'GROUP'
--
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
DECLARE @ShopTabGroupID VARCHAR (30) 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

All in one
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] STATIIC' --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*******************************/


how to use
for add a new npc only...
fist go with u char to here u want add a new npc
after exec
SET @CHARNAME = '[GM] Statiic' --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 CITY's = 1
SET @ADDNEW = 'NPC'


a New Tab
SET @GROUPNUMBER = 1 --The Group want add a new tab
SET @TABNUMBER = 2 --Tab Number if u group already have 1 tab set 2 u must set 2,3,4!
SET @TABNAME = 'DRESS' --Tab Name
SET @ADDNEW = 'TAB'


New Group
SET @GROUPNUMBER = 2 -- SET 2 if u npc already have 1 group u must add 2-6 new groups
SET @TABNAME = 'DRESS'
SET @ADDNEW = 'GROUP'

Print
(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 44681 STATIIC xxx xxx SN_NPC_STATIIC 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 3042 STORE_STATIIC -1 xxx -1 xxx -1 xxx -1 xxx

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

1 15 3306 GROUP_STORE_STATIIC NPC_STATIIC -1 xxx -1 xxx -1 xxx -1 xxx

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

1 84 STORE_STATIIC_GROUP1 SN_STORE_STATIIC_GROUP1

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

1 15 7631 STORE_STATIIC_TAB1 STORE_STATIIC_GROUP1 SN_TAB_WEAPONS

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

1 15 3343 STORE_STATIIC_GROUP1 SN_STORE_STATIIC_GROUP1

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

1 15 GROUP_STORE_STATIIC STORE_STATIIC

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

1 15 STORE_STATIIC STORE_STATIIC_GROUP1

A New NPC Has ADD Succesfuly Restart U Server and Login in [GM] Tieko
Found a erro? post here thx!
Query by me :)
Have Fun! :laugh:
 
Last edited:
Junior Spellweaver
Joined
Dec 5, 2011
Messages
141
Reaction score
7
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

(1 row(s) affected)
Msg 8106, Level 16, State 1, Line 30
Table '_RefObjChar' does not have the identity property. Cannot perform SET operation.
 
Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

if u database dont have indenity do this in u tables

_RefObjCommon > Design > right click ID Column Set a primary key > Column Properties > Indetity Spercification > (Is Indetity) set "Yes" done. same with others tables like _RefObjChar And _RefObjItem

when u use a db created in mssql 2008 r2 and the owner convert to sql 2005 primary key and indexes is removed automatic
@edit
tables to set Indetity Spercification
_RefObjCommon,_RefObjChar,_RefShop,_RefShopGroup,_RefShopItemGroup,_RefShopTab,_RefShopTabGroup...
 
Last edited:
Newbie Spellweaver
Joined
Apr 16, 2012
Messages
28
Reaction score
1
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

If I try to change my Identify specifications,I get this error
Statiic - NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^ - RaGEZONE Forums


Mkay, Found solution by myself.
If anyone else got this error ,just untick that:
Statiic - NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^ - RaGEZONE Forums


Now my sro_client just closes after I start the game :/ Cant even come to loginscreen,just crashes at start

the error must be in the media,because when I use the unedited media again,then I can start the client...
 
Last edited:
Banned
Banned
Joined
Oct 11, 2011
Messages
222
Reaction score
252
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

good relese :D
 
Experienced Elementalist
Joined
Nov 14, 2011
Messages
260
Reaction score
54
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

Nice one :DD thanks
 
Newbie Spellweaver
Joined
Dec 4, 2011
Messages
10
Reaction score
1
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

Msg 8106, Level 16, State 1, Line 23
Table '_RefObjCommon' does not have the identity property. Cannot perform SET operation.

any idea ?
 
Joined
Nov 6, 2011
Messages
546
Reaction score
140
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

Very Nice Work My teacher :)

But i am very sad , Coz i just finished all my NPC " but i like ur share " will some ppl :thumbup:
 
Newbie Spellweaver
Joined
Mar 21, 2012
Messages
38
Reaction score
9
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

useful thank you
 
Newbie Spellweaver
Joined
May 10, 2012
Messages
50
Reaction score
6
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

Very useful , keep going guys with your perfect release that make our life more easier and save our time and a lot mistakes

Problem found when try to execute the sql query
Msg 208, Level 16, State 1, Line 11
Invalid object name '_RefObjChar'.

#Fixed by editing first line into the Query
USE [SRO_VT_SHARD_INIT]
==============================
Another problem
after done first query with media edit, got a msg
"CharID dont differ with link from RefObjChr
 
Last edited:
Newbie Spellweaver
Joined
Nov 25, 2011
Messages
20
Reaction score
0
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

lol its so awesome :D thx!
 
Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

I did this just for me to use then you try to learn the structure of that query ^^
 
Newbie Spellweaver
Joined
May 10, 2012
Messages
50
Reaction score
6
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

I did this just for me to use then you try to learn the structure of that query ^^

So its not a public Query Lol it has no sense if it will work only with you, not need to release it then!! Or at lease you can edit it for work on all database, better for me to do my query better than keep reading all your query and understand what all exactly!!
I hope im not rude couse im not , just your comment pissed me off.
P.S: "Found a erro? post here thx!" i did what you asked for !!
 
Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

lol its works but if u tables dont have Indetity Spercification u will get erros :D
what a mean with this " I did this just for me to use then you try to learn the structure of that query ^^"
1º Me
2° RageZone
lol :D
 
Last edited:
Newbie Spellweaver
Joined
Nov 25, 2011
Messages
20
Reaction score
0
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

So its not a public Query Lol it has no sense if it will work only with you, not need to release it then!! Or at lease you can edit it for work on all database, better for me to do my query better than keep reading all your query and understand what all exactly!!
I hope im not rude couse im not , just your comment pissed me off.
P.S: "Found a erro? post here thx!" i did what you asked for !!

u can create u owns querys too..
this works for me.
 
Experienced Elementalist
Joined
Jan 23, 2012
Messages
211
Reaction score
149
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

Very nice statiic :thumbup1:
 
Newbie Spellweaver
Joined
Dec 4, 2011
Messages
10
Reaction score
1
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

A New NPC Has ADD Succesfuly Restart U Server and Login
Thnak you Stattic
 
Junior Spellweaver
Joined
Dec 5, 2011
Messages
141
Reaction score
7
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

the media lines is worng guys cuz the client keep crashing ! ?
 
Junior Spellweaver
Joined
Feb 3, 2012
Messages
196
Reaction score
7
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

Thanks for the query

How I can add more than 1 page each tab? it only shows 1 page per tab, how I can make it 3 pages?
 
Newbie Spellweaver
Joined
Apr 16, 2012
Messages
28
Reaction score
1
Re: [RELEASE] NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^

did this work for anyone?
Because me and some friends tried it and none of us got it working,seems the media lines are wrong because if I change them in media my client crashes,if I use a normal media my client works until I go near the location of the npc,then i get a crash.....:/
 
Back
Top