Register for your free account! | Forgot your password?

You last visited: Today at 14:48

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[RELEASE - QUERY] Clone Mob and Item

Discussion on [RELEASE - QUERY] Clone Mob and Item within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
yoneh1's Avatar
 
elite*gold: 0
Join Date: Dec 2011
Posts: 72
Received Thanks: 42
[RELEASE - QUERY] Clone Mob and Item

Hey Guys,
I wanted to be able to clone mobs and items and keep the original stats so I can do my modifications 1 by 1.

It takes the ID of the MOB or ITEM in RefObjCommon and clones it with new Link and ID in refobj Item/Char

Usage

Exec _CloneItem ID, NEWCODENAME128

exec _CloneMob ID,NEWCODENAME128

Enjoy!

PHP Code:
USE [Y0GI]
GO
/****** Object:  StoredProcedure [dbo].[_CloneItem]    Script Date: 6/17/2024 11:42:07 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE 
[dbo].[_CloneItem]
    @
OriginalItemID INT,
    @
NewCodeName128 VARCHAR(129)
AS
BEGIN
    SET NOCOUNT ON
;

    DECLARE @
NewCommonID INT;
    DECLARE @
NewItemID INT;

    -- 
Step 1Get the new IDs for _RefObjCommon and _RefObjItem
    SELECT 
@NewCommonID MAX(ID) + 1 FROM [SRO_VT_SHARD].[dbo].[_RefObjCommon];
    
SELECT @NewItemID MAX(ID) + 1 FROM [SRO_VT_SHARD].[dbo].[_RefObjItem];

    -- 
Step 2Insert the new row into _RefObjCommon
    INSERT INTO 
[SRO_VT_SHARD].[dbo].[_RefObjCommon] (
        [
ID], [Service], [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], [webNumber], [webName]
    )
    
SELECT 
        
@NewCommonID, [Service], @NewCodeName128, [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], @NewItemID, [webNumber], [webName]
    
FROM [SRO_VT_SHARD].[dbo].[_RefObjCommon]
    
WHERE [ID] = @OriginalItemID

    
-- Step 3Insert the new row into _RefObjItem
    INSERT INTO 
[SRO_VT_SHARD].[dbo].[_RefObjItem] (
        [
ID], [MaxStack], [ReqGender], [ReqStr], [ReqInt], [ItemClass], [SetID], [Dur_L], [Dur_U], [PD_L], 
        [
PD_U], [PDInc], [ER_L], [ER_U], [ERInc], [PAR_L], [PAR_U], [PARInc], [BR_L], [BR_U], [MD_L], 
        [
MD_U], [MDInc], [MAR_L], [MAR_U], [MARInc], [PDStr_L], [PDStr_U], [MDInt_L], [MDInt_U], 
        [
Quivered], [Ammo1_TID4], [Ammo2_TID4], [Ammo3_TID4], [Ammo4_TID4], [Ammo5_TID4], [SpeedClass], 
        [
TwoHanded], [Range], [PAttackMin_L], [PAttackMin_U], [PAttackMax_L], [PAttackMax_U], [PAttackInc], 
        [
MAttackMin_L], [MAttackMin_U], [MAttackMax_L], [MAttackMax_U], [MAttackInc], [PAStrMin_L], 
        [
PAStrMin_U], [PAStrMax_L], [PAStrMax_U], [MAInt_Min_L], [MAInt_Min_U], [MAInt_Max_L], [MAInt_Max_U], 
        [
HR_L], [HR_U], [HRInc], [CHR_L], [CHR_U], [Param1], [Desc1_128], [Param2], [Desc2_128], [Param3], 
        [
Desc3_128], [Param4], [Desc4_128], [Param5], [Desc5_128], [Param6], [Desc6_128], [Param7], 
        [
Desc7_128], [Param8], [Desc8_128], [Param9], [Desc9_128], [Param10], [Desc10_128], [Param11], 
        [
Desc11_128], [Param12], [Desc12_128], [Param13], [Desc13_128], [Param14], [Desc14_128], [Param15], 
        [
Desc15_128], [Param16], [Desc16_128], [Param17], [Desc17_128], [Param18], [Desc18_128], [Param19], 
        [
Desc19_128], [Param20], [Desc20_128], [MaxMagicOptCount], [ChildItemCount], [Link]
    )
    
SELECT 
        
@NewItemID, [MaxStack], [ReqGender], [ReqStr], [ReqInt], [ItemClass], [SetID], [Dur_L], [Dur_U], [PD_L], 
        [
PD_U], [PDInc], [ER_L], [ER_U], [ERInc], [PAR_L], [PAR_U], [PARInc], [BR_L], [BR_U], [MD_L], 
        [
MD_U], [MDInc], [MAR_L], [MAR_U], [MARInc], [PDStr_L], [PDStr_U], [MDInt_L], [MDInt_U], 
        [
Quivered], [Ammo1_TID4], [Ammo2_TID4], [Ammo3_TID4], [Ammo4_TID4], [Ammo5_TID4], [SpeedClass], 
        [
TwoHanded], [Range], [PAttackMin_L], [PAttackMin_U], [PAttackMax_L], [PAttackMax_U], [PAttackInc], 
        [
MAttackMin_L], [MAttackMin_U], [MAttackMax_L], [MAttackMax_U], [MAttackInc], [PAStrMin_L], 
        [
PAStrMin_U], [PAStrMax_L], [PAStrMax_U], [MAInt_Min_L], [MAInt_Min_U], [MAInt_Max_L], [MAInt_Max_U], 
        [
HR_L], [HR_U], [HRInc], [CHR_L], [CHR_U], [Param1], [Desc1_128], [Param2], [Desc2_128], [Param3], 
        [
Desc3_128], [Param4], [Desc4_128], [Param5], [Desc5_128], [Param6], [Desc6_128], [Param7], 
        [
Desc7_128], [Param8], [Desc8_128], [Param9], [Desc9_128], [Param10], [Desc10_128], [Param11], 
        [
Desc11_128], [Param12], [Desc12_128], [Param13], [Desc13_128], [Param14], [Desc14_128], [Param15], 
        [
Desc15_128], [Param16], [Desc16_128], [Param17], [Desc17_128], [Param18], [Desc18_128], [Param19], 
        [
Desc19_128], [Param20], [Desc20_128], [MaxMagicOptCount], [ChildItemCount], [Link]
    
FROM [SRO_VT_SHARD].[dbo].[_RefObjItem]
    
WHERE [ID] = (SELECT Link FROM [SRO_VT_SHARD].[dbo].[_RefObjCommonWHERE [ID] = @OriginalItemID)
END
PHP Code:
USE [Y0GI]
GO
/****** Object:  StoredProcedure [dbo].[_CloneMob]    Script Date: 6/17/2024 11:42:24 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE 
[dbo].[_CloneMob]
    @
OriginalMobID INT,
    @
NewCodeName128 VARCHAR(129)
AS
BEGIN
    SET NOCOUNT ON
;

    DECLARE @
NewCommonID INT;
    DECLARE @
NewMobID INT;

    -- 
Step 1Get the new IDs for _RefObjCommon and _RefObjChar
    SELECT 
@NewCommonID MAX(ID) + 1 FROM [SRO_VT_SHARD].[dbo].[_RefObjCommon];
    
SELECT @NewMobID MAX(ID) + 1 FROM [SRO_VT_SHARD].[dbo].[_RefObjChar];

    -- 
Step 2Insert the new row into _RefObjCommon
    INSERT INTO 
[SRO_VT_SHARD].[dbo].[_RefObjCommon] (
        [
ID], [Service], [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], [webNumber], [webName]
    )
    
SELECT 
        
@NewCommonID, [Service], @NewCodeName128, [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], @NewMobID, [webNumber], [webName]
    
FROM [SRO_VT_SHARD].[dbo].[_RefObjCommon]
    
WHERE [ID] = @OriginalMobID

    
-- Step 3Insert the new row into _RefObjChar
    INSERT INTO 
[SRO_VT_SHARD].[dbo].[_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]
    )
    
SELECT 
        
@NewMobID, [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]
    
FROM [SRO_VT_SHARD].[dbo].[_RefObjChar]
    
WHERE [ID] = (SELECT Link FROM [SRO_VT_SHARD].[dbo].[_RefObjCommonWHERE [ID] = @OriginalMobID)
END
If you find this usefull, please hit thanks!
yoneh1 is offline  
Thanks
2 Users
Old 06/18/2024, 11:36   #2
 
elite*gold: 0
Join Date: Jul 2020
Posts: 234
Received Thanks: 230
Thanks for sharing, however you forgot about other important tables:

General tables:
Tactics Table
Hive Table
Skills Table
Extra Skills Table
AI Skills table

Autospawn table:
Nest Table

You also did not make sure, that you use a reference to the old mob. If you do not add it, you cannot use ingame sounds and skilleffect with your clone mob. Your mob will use a charmodel instead, using human sounds / size / animations.

You can find a txt file attached. This will give almost every information, you only need to query for AI Skills and Extra Skills. I am sure, this will help you to enhance your query to use all needed tables.

To create a reference you need to put the original mob name into RefCommon "Basic_Original" column. Or you clone the entries for inside Skilleffect and sound files too.
Attached Files
File Type: txt Mob_Query.txt (1,014 Bytes, 30 views)
OKeks is offline  
Thanks
1 User
Old 06/18/2024, 15:37   #3
 
yoneh1's Avatar
 
elite*gold: 0
Join Date: Dec 2011
Posts: 72
Received Thanks: 42
Quote:
Originally Posted by OKeks View Post
Thanks for sharing, however you forgot about other important tables:

General tables:
Tactics Table
Hive Table
Skills Table
Extra Skills Table
AI Skills table

Autospawn table:
Nest Table

You also did not make sure, that you use a reference to the old mob. If you do not add it, you cannot use ingame sounds and skilleffect with your clone mob. Your mob will use a charmodel instead, using human sounds / size / animations.

You can find a txt file attached. This will give almost every information, you only need to query for AI Skills and Extra Skills. I am sure, this will help you to enhance your query to use all needed tables.

To create a reference you need to put the original mob name into RefCommon "Basic_Original" column. Or you clone the entries for inside Skilleffect and sound files too.
Hey Okeks !
Thanks for the reply. I’m just getting started!!

Although you may be correct that I am in fact completely missing refskill and tactics tables because my use for this proc was to clone a mob and keep everything identical except for the code name128 so I can change some things around.

What you did bring to light is the fact that I fully missed the skilleffect. But this would need some manual input.

The intended purpose for this tool is to have a working platform for a mob and then make all modifications on skilleffect / textdata object . (Or on the db if you know how)

It’s just a quick and dirty way to edit something and not break the original.

I think what I can do is add some skill customization options and the ability to add the spawn with a char name!
yoneh1 is offline  
Reply


Similar Threads Similar Threads
[Release][Query] Query _InvCOS Items WITH _Char Connection
12/29/2015 - SRO PServer Guides & Releases - 1 Replies
Ok, so i needed to write this query for a procedure im working on and not many people know how to connect the pet inventory table to the character table.... so this query will explain how its done... im not going to explain every single detail, like how there is no charcos when pet is despawned / dead... but yea you can probably figure that all out from this query... The code... USE SELECT pet_invo. ,pet_invo. PetSlot
[HOW TO] Mob proto.xml Mob Names - Mob Proto.txt Help me
03/25/2015 - Metin2 Private Server - 2 Replies
Hi Metin2 Dev Mob proto.xml How to Mob Names.txt - Mob Proto.txt Converts ? Help Me :( How Mob Names.txt - Mob Proto.txt ? help me :( <Mob vnum="34012" name="¾Æ±â ÆÒ´õ" locale_name="¾Æ±â ÆÒ´õ" type="1" rank="5" battle_type="0" level="1" size="0" gold_min="0" gold_max="0" exp="10" max_hp="120" regen_cycle="3" regen_percent="1" def="4" ai_flag="0" setRaceFlag="0" setImmuneFlag="43" st="0" dx="0" ht="0" iq="0" damage_min="0" damage_max="0" attack_speed="100" move_speed="100"...
★ Offshore Webspace 1 Year (Forum,Blog,FB-Clone,Shop,Youtube-Clone,OsTicket-System) ★
09/09/2012 - Social Media Trading - 11 Replies
Server Standort Romania (Offshore) ------------------------------------------------- -------------------------------------------------- ------------- ★ ★ !! Closed !! ★ ★ Kann auch auf 2 x Bezahlt werden geht aber nur bei PSC und LR die 2 zahlung muss bis 10.10.2012 bezahlt werden



All times are GMT +1. The time now is 14:49.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.