Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Private Server > SRO PServer Guides & Releases
You last visited: Today at 14:19

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

Advertisement



[RELEASE] Query to create a new non-player character (NPC) + shop

Discussion on [RELEASE] Query to create a new non-player character (NPC) + shop within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
[RELEASE] Query to create a new non-player character (NPC) + shop

Hello,

i decided to release a part of my "create a new non-player character" query

till now i was too lazy to create comments and print messages and i also removed "create npc tab", "create npc group", "item mall support", "client support (export client files from sql)"

anyway here we go

Code:
/**
version : 1
author : syloxx
created date : 2015-07-30
description : Create a new non-player character, shop tab or shop group.
**/

USE SRO_VT_SHARD

SET NOCOUNT ON
SET XACT_ABORT ON

DECLARE @vcPrintMessage varchar(1024)
----------------------------------------------------------------------------------------------------
--  , @inyType tinyint = 1 /*_# */
    , @vcShopCodeName varchar(128) = 'CH_SMITH' /*_# */
    , @vcShopModel varchar(512) = 'npc\npc\EastEuropeSystem_HunterUnion.bsr' /*_# */
    , @vcShopFortress varchar(32) = 'FORTRESS_JANGAN' /*_# */
    , @vcTargetCharName varchar(64) = 'Syloxx' /*_# */
    , @insRotation smallint = 90 /*_# */
    , @intGameWorldID int = 1 /*_# */
    , @vcShopTabCodeName varchar(32) = 'WEAPON' /*_# */
--  , @inyShopGroupID tinyint = 1 /*_# */
----------------------------------------------------------------------------------------------------

/*_# */
IF XACT_STATE() = -1
BEGIN
    SET @vcPrintMessage = ''
    GOTO ErrorHandler
END

BEGIN TRY
    /*_# */
--  IF @inyType = 1
--  BEGIN
        DECLARE @insRegionID smallint
            , @rlPosX real
            , @rlPosY real
            , @rlPosZ real
            , @intObjLink int
            , @intObjID int
            , @intTacticsID int
            , @intHiveID int
        
        /*_# */
        IF EXISTS (SELECT * FROM _RefObjCommon WHERE CodeName128 = 'NPC_' + @vcShopCodeName)
        BEGIN
            SET @vcPrintMessage = '1'
            GOTO ErrorHandler
        END
        
        /*_# */
        IF @vcShopModel NOT LIKE '%.bsr'
        BEGIN
            SET @vcPrintMessage = '2'
            GOTO ErrorHandler
        END
        
        /*_# */
        IF @vcShopFortress NOT IN ('FORTRESS_BIJEOKDAN', 'FORTRESS_CONSTANTINOPLE', 'FORTRESS_DONWHANG', 'FORTRESS_EVILORDER', 'FORTRESS_HEUKMAKDAN', 'FORTRESS_HOTAN', 'FORTRESS_JANGAN', 'FORTRESS_SAMARKAND', 'xxx')
        BEGIN
            SET @vcPrintMessage = '3'
            GOTO ErrorHandler
        END
        
        /*_# */
        IF @insRotation NOT BETWEEN 0 AND 360
        BEGIN
            SET @vcPrintMessage = '4'
            GOTO ErrorHandler
        END
        
        /*_# */
        IF @intGameWorldID NOT IN (SELECT ID FROM _RefGame_World)
        BEGIN
            SET @vcPrintMessage = '5'
            GOTO ErrorHandler
        END
        
        /*_# */
        SELECT @insRegionID = LatestRegion
            , @rlPosX = PosX
            , @rlPosY = PosY
            , @rlPosZ = PosZ
        FROM dbo._Char
        WHERE CharName16 = @vcTargetCharName
        
        /*_# */
        IF @insRegionID IS NULL
        BEGIN
            SET @vcPrintMessage = '6'
            GOTO ErrorHandler
        END
        
        BEGIN TRANSACTION
        
        /*_# */
        INSERT dbo._RefObjChar
        VALUES (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 @intObjLink = SCOPE_IDENTITY()
        
        /*_# */
        INSERT dbo._RefObjCommon
        VALUES (1, 'NPC_' + @vcShopCodeName, 'xxx', 'xxx', 'SN_NPC_' + @vcShopCodeName, '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, @vcShopModel, 'xxx', 'xxx', @vcShopFortress, 'xxx', @intObjLink)
            SET @intObjID = SCOPE_IDENTITY()
        
        /*_# */
        INSERT dbo._RefShop
        VALUES (1, 15, 'STORE_' + @vcShopCodeName, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx')
        
        /*_# */
        INSERT dbo._RefShopGroup
        VALUES (1, 15, 'GROUP_STORE_' + @vcShopCodeName, 'NPC_' + @vcShopCodeName, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx')
        
        /*_# */
        INSERT dbo._RefShopItemGroup
        VALUES (1, 'STORE_' + @vcShopCodeName + '_GROUP1', 'SN_STORE_' + @vcShopCodeName + '_GROUP1')
        
        /*_# */
        INSERT dbo._RefShopTab
        VALUES (1, 15, 'STORE_' + @vcShopCodeName + '_TAB1', 'STORE_' + @vcShopCodeName + '_GROUP1', 'SN_TAB_' + @vcShopTabCodeName)
        
        /*_# */
        INSERT dbo._RefShopTabGroup
        VALUES (1, 15, 'STORE_' + @vcShopCodeName + '_GROUP1', 'SN_STORE_' + @vcShopCodeName + '_GROUP1')
        
        /*_# */
        INSERT dbo._RefMappingShopGroup
        VALUES (1, 15, 'GROUP_STORE_' + @vcShopCodeName, 'STORE_' + @vcShopCodeName)
        
        /*_# */
        INSERT dbo._RefMappingShopWithTab
        VALUES (1, 15, 'STORE_' + @vcShopCodeName, 'STORE_' + @vcShopCodeName + '_GROUP1')
        
        /*_# */
        SELECT @intTacticsID = MAX(dwTacticsID) + 10
        FROM dbo.Tab_RefTactics
        
        /*_# */
        INSERT dbo.Tab_RefTactics
        VALUES (@intTacticsID, @intObjID, 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_' + @vcShopCodeName)
        
        /*_# */
        INSERT dbo.Tab_RefHive
        VALUES (0, 0, 0, 0, 0, 0, @intGameWorldID, 2, 'NPC_' + @vcShopCodeName)
            SET @intHiveID = SCOPE_IDENTITY()
        
        /*_# */
        INSERT dbo.Tab_RefNest
        VALUES (@intHiveID, @intTacticsID, @insRegionID, @rlPosX, @rlPosY, @rlPosZ, CEILING(POWER(2, 15) * (-1) + ((CONVERT(float, POWER(2, 16) - 1) / 360) * ((@insRotation + 90) % 360))), 0, 0, 0, 0, 0, 1, 0, 1, 0)

        COMMIT TRANSACTION
--  END
END TRY
BEGIN CATCH
    GOTO ErrorHandler
END CATCH

PRINT '0'
RETURN

ErrorHandler:
IF XACT_STATE() <> 0
    ROLLBACK TRANSACTION

PRINT @vcPrintMessage
RETURN
if you guys want the full query or similar queries you can find my service in my signature
Syloxx is offline  
Old 07/30/2015, 19:54   #2
 
Eslam Galull's Avatar
 
elite*gold: 85
Join Date: Aug 2010
Posts: 1,278
Received Thanks: 524
Explain & some screens ! would be great
Eslam Galull is offline  
Old 07/30/2015, 19:59   #3
 
elite*gold: 1
Join Date: Jul 2015
Posts: 207
Received Thanks: 60
non-player character (NPC)

y u know too match

Quote:
Originally Posted by Syloxx View Post
if you guys want the full query or similar queries you can find my service in my signature
you support night services? no ****
B1Q B0SS is offline  
Old 07/30/2015, 20:01   #4
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
Quote:
Originally Posted by its.soul View Post
Explain & some screens ! would be great
its actually self-explanatory
Syloxx is offline  
Thanks
1 User
Old 07/30/2015, 20:09   #5
 
elite*gold: 0
Join Date: May 2015
Posts: 1
Received Thanks: 0
Amazing work clean and tested it already with Syloxx on my private server
Clean, easy to read even for beginners like myself
tohamey is offline  
Old 07/30/2015, 20:41   #6
 
Eslam Galull's Avatar
 
elite*gold: 85
Join Date: Aug 2010
Posts: 1,278
Received Thanks: 524
Quote:
Originally Posted by Syloxx View Post
its actually self-explanatory
yea i see
Eslam Galull is offline  
Old 07/31/2015, 03:44   #7
 
synsroadmin's Avatar
 
elite*gold: 100
Join Date: Jul 2015
Posts: 27
Received Thanks: 2
thanks about NPC query
synsroadmin is offline  
Old 07/31/2015, 07:37   #8

 
XxGhostSpiriTxX's Avatar
 
elite*gold: 53
Join Date: Jul 2012
Posts: 541
Received Thanks: 190
Mens. 213, Level 16, State 1, Line 147
The column name or the specified values do not correspond to the definition of the table.

pliss help
XxGhostSpiriTxX is offline  
Old 07/31/2015, 12:18   #9
 
Syloxx's Avatar
 
elite*gold: 56
Join Date: Oct 2013
Posts: 1,165
Received Thanks: 774
Quote:
Originally Posted by esteve458 View Post
Mens. 213, Level 16, State 1, Line 147
The column name or the specified values do not correspond to the definition of the table.

pliss help
looks like your DB have modified tables so i wont support you

don't modify Joymax tables and you are just fine
Syloxx is offline  
Reply


Similar Threads Similar Threads
[Source Release] Jobauswahl bei Character Create
11/11/2016 - Flyff PServer Guides & Releases - 148 Replies
Hier erkläre ich euch wie ihr im Source eine Jobauswahl beim Character erstellen einbaut. ../NEUZ/Versioncommon.h Tragt hier im oberen bereich einfach dies ein: #define __JOB_CREATE_CHAR ../_Interface/WndTitle.cpp Hier geht ihr in die Function void CWndCreateChar::OnInitialUpdate()
[Release] Send uppgraded items at create of character
06/30/2013 - 4Story - 8 Replies
Those functions will send to all created characters (by letter) equipement at max level of uppgrade (+24) with options on them - random effects, cloak, accessory and weapons also included. Some items are missing, so add them yourself. 1 Step - Do a backup of TCreateChar if you would revert it. 2 Step - duplicate twice the function TMagicItemGive, rename them with TMagicItemGive2 and TMagicItemGive3. 3 Step - Replace the following functions with this code. TMagicItemGive2 sends...
[RELEASE] Character(s) Statistics Query
12/23/2012 - Shaiya PServer Guides & Releases - 4 Replies
What this query does: Calculates a character(s) total statistics and displays them one row per character. What this query does not account for: Skills that passively add attack power. Currently applied buffs and nostrums. Characters with no items are left out of the results of this query. Multiple of the same lapis in a single item (like if an item was GM linked with two or more Craft 7s in it, only one would be counted). Any lapis GM linked to your mount. Anything I forgot to account...
[Release] How to Ban Player by Character Name [Database]
05/12/2012 - SRO PServer Guides & Releases - 10 Replies
Anyways... it's easier than SMC, just a quick copy+paste query and then your good to go. You only need to enter the name of the char & time of the ban (I recommend leaving like this) Ban reason --By Leandro ( nukertube ) -- USE GO
Sql query for create character got lv 170
02/04/2012 - Dekaron Private Server - 21 Replies
stop saying nonsense words to me , i need help with sql query of create new character and login game got lv 170 .



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


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.