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!

[SQL] Query to add Unique spot very fast

Master Summoner
Joined
Nov 18, 2011
Messages
529
Reaction score
345
I dont recommend put identity in the table tactics because it works without numerical sequence see the spawn of jupiter works from 10 to 10 ^^
 
Junior Spellweaver
Joined
Feb 16, 2009
Messages
168
Reaction score
7
can release for add mobs (normal) not unique only?
 
Junior Spellweaver
Joined
Feb 16, 2009
Messages
168
Reaction score
7
i change this :
PHP:
USE SRO_VT_SHARD /* Add Unique Spot By Arabianfox */

DECLARE @UNIQUE VARCHAR (129)
DECLARE @CHARNAME VARCHAR (64)
DECLARE @mindealy INT
DECLARE @maxdelay int
DECLARE @INITRADIUS INT
DECLARE @RADIUS int
DECLARE @MAXNEST int = (SELECT MAX (dwNestID) FROM Tab_RefNest)+1
DECLARE @MAXHIVE int = (SELECT MAX (dwHiveID) FROM Tab_RefHive)+1
DECLARE @MAXTACTICS int = (SELECT MAX (dwTacticsID) FROM Tab_RefTactics)+1

/* put your settings here */
SET @UNIQUE = 'MOB_JUPITER_IMMOTAL_GUARD' -- Unique code name from _RefobjCommon table
SET @CHARNAME = 'Alibaba' -- Character name from _Char table to get mob position X Y Z
SET @mindealy = 60  -- Minimum time before appears in seconds
SET @maxdelay = 120  -- Maximum time before appears in seconds
SET @INITRADIUS = 100  -- Radius around spot unique can generated at
SET @RADIUS = 500  -- Radius around spot Unique can move in
/* end of settings area */

/* get ID of mob by code name */
Declare @MOBID int SET @MOBID = (SELECT ID FROM _RefObjCommon WHERE CodeName128 = @UNIQUE)

SET IDENTITY_INSERT Tab_RefTactics ON
INSERT INTO Tab_RefTactics (dwTacticsID,dwObjID,btAIQoS,nMaxStamina,btMaxStaminaVariance,nSightRange,btAggressType,AggressData,btChangeTarget,btHelpRequestTo,btHelpResponseTo,btBattleStyle,BattleStyleData,btDiversionBasis,DiversionBasisData1,DiversionBasisData2,DiversionBasisData3,DiversionBasisData4,DiversionBasisData5,DiversionBasisData6,DiversionBasisData7,DiversionBasisData8,btDiversionKeepBasis,DiversionKeepBasisData1,DiversionKeepBasisData2,DiversionKeepBasisData3,DiversionKeepBasisData4,DiversionKeepBasisData5,DiversionKeepBasisData6,DiversionKeepBasisData7,DiversionKeepBasisData8,btKeepDistance,KeepDistanceData,btTraceType,btTraceBoundary,TraceData,btHomingType,HomingData,btAggressTypeOnHoming,btFleeType,dwChampionTacticsID,AdditionOptionFlag,szDescString128) VALUES
(@MAXTACTICS,@MOBID,0,500,50,200,0,0,2,2,2,0,0,5,0,0,0,0,0,30,0,0,4,0,0,0,0,0,0,0,0,0,0,0,1,500,0,0,2,0,0,112,@UNIQUE)
SET IDENTITY_INSERT Tab_RefTactics OFF

SET IDENTITY_INSERT Tab_RefHive ON
INSERT INTO Tab_RefHive (dwHiveID,btKeepMonsterCountType,dwOverwriteMaxTotalCount,fMonsterCountPerPC,dwSpawnSpeedIncreaseRate,dwMaxIncreaseRate,btFlag,GameWorldID,HatchObjType,szDescString128) VALUES
(@MAXHIVE,0,1,0,0,0,0,1,1,@UNIQUE)
SET IDENTITY_INSERT Tab_RefHive OFF

/* get position coordinates of your character */

DECLARE @REGION INT SET @REGION = (SELECT (LatestRegion) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSX INT SET @POSX = (SELECT (POSX) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSY INT SET @POSY = (SELECT (POSY) FROM _Char WHERE CharName16 = @CHARNAME)
DECLARE @POSZ INT SET @POSZ = (SELECT (POSZ) FROM _Char WHERE CharName16 = @CHARNAME)

SET IDENTITY_INSERT Tab_RefNest ON
INSERT INTO Tab_RefNest (dwNestID,dwHiveID,dwTacticsID,nRegionDBID,fLocalPosX,fLocalPosY,fLocalPosZ,wInitialDir,nRadius,nGenerateRadius,nChampionGenPercentage,dwDelayTimeMin,dwDelayTimeMax,dwMaxTotalCount,btFlag,btRespawn,btType) VALUES
(@MAXNEST,@MAXHIVE,@MAXTACTICS,@REGION,@POSX,@POSY,@POSZ,0,@RADIUS,@INITRADIUS,0,@mindealy,@maxdelay,1,0,1,0)
SET IDENTITY_INSERT Tab_RefNest OFF


print ''
print ''
print 'Done!'

and get error :
PHP:
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 27
Must declare the scalar variable "@MAXTACTICS".
Msg 137, Level 15, State 2, Line 32
Must declare the scalar variable "@MAXHIVE".
Msg 137, Level 15, State 2, Line 44
Must declare the scalar variable "@MAXNEST".

Please help
 
Initiate Mage
Joined
Jun 14, 2012
Messages
16
Reaction score
3
Great release,

tried --> For the people have Identity error

Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 27
Must declare the scalar variable "@MAXTACTICS".
Msg 137, Level 15, State 2, Line 32
Must declare the scalar variable "@MAXHIVE".
Msg 137, Level 15, State 2, Line 44
Must declare the scalar variable "@MAXNEST".

Still got this error.. any solutions?
 
Initiate Mage
Joined
Feb 12, 2012
Messages
29
Reaction score
1
i get this Stupid errror.Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 27
Must declare the scalar variable "@MAXTACTICS".
Msg 137, Level 15, State 2, Line 32
Must declare the scalar variable "@MAXHIVE".
Msg 137, Level 15, State 2, Line 44
Must declare the scalar variable "@MAXNEST".
 
Initiate Mage
Joined
May 10, 2012
Messages
50
Reaction score
6
Thanks for this release, can you tell me when exactly this mob or unique appear ? and how we can change the time for make it appear for example every 1 hour
 
Experienced Elementalist
Joined
Nov 22, 2011
Messages
255
Reaction score
111
Thanks for this release, can you tell me when exactly this mob or unique appear ? and how we can change the time for make it appear for example every 1 hour

SET @mindealy = 3600 >> (3600 seconds = 60 min = 1 hour)
SET @maxdelay = 5400 >> (5400 seconds = 90 min = 1.5 hours)

with this settings Unique will appears every 1 to 1.5 hours but not less than 1 hour and not more than 1.5 hours.
 
Initiate Mage
Joined
Mar 21, 2012
Messages
15
Reaction score
1
hi guy's

i am a little noob in SQL can any1 tell me how i can fix the SQL ERROR MSG

Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 27
Must declare the scalar variable "@MAXTACTICS".
Msg 137, Level 15, State 2, Line 32
Must declare the scalar variable "@MAXHIVE".
Msg 137, Level 15, State 2, Line 44
Must declare the scalar variable "@MAXNEST".


?
 
Junior Spellweaver
Joined
Mar 5, 2012
Messages
190
Reaction score
14
How Fix? Sadadin título - [SQL] Query to add Unique spot very fast - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Experienced Elementalist
Joined
Apr 3, 2012
Messages
239
Reaction score
20
can i make it spawn like demon or lord
spawn every 2~3h and 4~6h .....etc
 
Initiate Mage
Joined
Nov 21, 2011
Messages
84
Reaction score
6
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 9
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near '+'.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '('.
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near '+'.
Msg 137, Level 15, State 2, Line 27
Must declare the scalar variable "@MAXTACTICS".
Msg 137, Level 15, State 2, Line 32
Must declare the scalar variable "@MAXHIVE".
Msg 137, Level 15, State 2, Line 44
Must declare the scalar variable "@MAXNEST".


How to fix?
 
Initiate Mage
Joined
Mar 8, 2012
Messages
4
Reaction score
1
lol at all the responses xD

The query is good if you wanna add 1 spawn for each monster you wanna have on your server, but if you do it with Uniques then there will be 1 unique on every spawn point you use..

A simple explanation about how the spawns work:

on Tab_RefTactics you will find some basic info about the mob you want to add as a spawn (doesnt need to be added every time you add a spawn).
on Tab_RefHive you will find all the groups of spawns in the game (1 group for each location was created by Joymax, but you can create one group and assign multiple spawns to it).
on Tab_RefNest you will find the spawns themselves, which are linked to the Tactics (dwTacticsID) and to the Hive (dwHiveID)..

This means that if your monster exists on Tactics, you can use it's tactics to create a new spawn, or new spawns..How to find out?

use SRO_VT_SHARD

Select * from Tab_RefTactics where dwObjID = (select ID from _RefObjCommon where CodeName128 like '%Monster Name%')

DwTacticsID is the ID of Tab_RefTactics, a little self explanatory (as if the chinese wanted anybody to edit their db)..

Use your head and look around, you will find a way to change the stuff on your own then ^^ and not use queries that could preety much faq up your db.
 
Back
Top