• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

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

Junior Spellweaver
Joined
Nov 24, 2011
Messages
127
Reaction score
6
@Statiic,

EDIT: Found the fix, thanks statiic :)
 
Last edited:
Junior Spellweaver
Joined
Sep 12, 2011
Messages
135
Reaction score
15
An explicit value for the identity column in table 'dbo.Tab_RefHive' can only be specified when a column list is used and IDENTITY_INSERT is ON.

And did exactly how u explained :)
 
Newbie Spellweaver
Joined
Apr 1, 2012
Messages
5
Reaction score
0
An explicit value for the identity column in table 'dbo.Tab_RefHive' can only be specified when a column list is used and IDENTITY_INSERT is ON.

Same problem and did everything you wrote. Was searching on google also but nothing helped. But I noticed even if I want to add those lines manual, I can't add new line/ID ?

Best regards,
urrsha
 
Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
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
 
Newbie Spellweaver
Joined
Apr 1, 2012
Messages
5
Reaction score
0
Here are screenshots:
No.1 - NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^ - RaGEZONE Forums
No.2 - NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^ - RaGEZONE Forums

And with Tab_Hive you meant Tab_RefHive, right ?


Best regards,
urrsha
 

Attachments

You must be registered for see attachments list
Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
PHP:
DECLARE @CHARNAME VARCHAR (30)
DECLARE @NPCNAME VARCHAR (30)
DECLARE @ADDNEW VARCHAR (30)
DECLARE @GAMEWORDID INT
SET @CHARNAME = '[GM] TIEKO' --U Char Name
SET @NPCNAME = 'STATIC' --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')
SET IDENTITY_INSERT Tab_Nest ON
SET IDENTITY_INSERT Tab_Hive ON
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)
SET IDENTITY_INSERT Tab_Nest OFF
SET IDENTITY_INSERT Tab_Hive OFF
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
try now
 
Banned
Banned
Joined
Oct 6, 2011
Messages
238
Reaction score
141
Table '_RefObjCommon' does not have the identity property. Cannot perform SET operation. ^^
hmm done fixed thanks any way ^^

onther problem :D
Violation of PRIMARY KEY constraint 'PK__RefMappingShopGroup'. Cannot insert duplicate key in object 'dbo._RefMappingShopGroup'.
Violation of PRIMARY KEY constraint 'PK__RefMappingShopWithTab'. Cannot insert duplicate key in object 'dbo._RefMappingShopWithTab'.
 
Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
OFMG u mad ?
go to _RefMappingShopGroup,_RefMappingShopWithTab and delete the inserted lines
 
Banned
Banned
Joined
Oct 6, 2011
Messages
238
Reaction score
141
_RefObjCommon > Design > right click ID Column Set a primary key > Column Properties > Indetity Spercification > (Is Indetity) set "Yes" same with the others.
but i cant do that with other tab ^^
Statiic - NPC Query Add u own NPC in 3 Minutes + ADD New Tab and Group ^^ - RaGEZONE Forums
 
Back
Top