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 16:27

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

Advertisement



[Release] Edit of Monster spawn time/rate edit to make it easy.

Discussion on [Release] Edit of Monster spawn time/rate edit to make it easy. within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old   #1
 
Mdarude's Avatar
 
elite*gold: 340
Join Date: Mar 2010
Posts: 106
Received Thanks: 43
[Release] Edit of Monster spawn time/rate edit to make it easy.

Hello all this is my first release and it's a remake of a other query in this one allows you only open the 3 tables and find more information of the monster.

and the second one you could edit things like this :
-- desired total count of mobs
-- desired minimum spawn delay
-- desired maximum spawn delay

I did not find one like this and wanted to make it easy for myself.
Since some monsters have 2 Id's this will find that also.

Code:
USE SRO_VT_SHARD;

DECLARE @MOB VARCHAR(64);
DECLARE @NESTID INT;
DECLARE @HiveID INT;

SET @MOB = 'MOB_RM_WINGTRIBE_CLON'; -- mob name

-- Temporary table to hold Tactics IDs
CREATE TABLE #TacticsIDs (dwTacticsID INT);

-- Fetch all Tactics IDs based on MOB
INSERT INTO #TacticsIDs (dwTacticsID)
SELECT dwTacticsID 
FROM Tab_RefTactics 
WHERE dwObjID = (SELECT ID FROM _RefObjCommon WHERE Codename128 = @MOB);

-- Fetch and display information for each Tactics ID
DECLARE @CurrentTacticsID INT;

DECLARE TacticsCursor CURSOR FOR 
SELECT dwTacticsID FROM #TacticsIDs;

OPEN TacticsCursor;

FETCH NEXT FROM TacticsCursor INTO @CurrentTacticsID;

WHILE @@FETCH_STATUS = 0
BEGIN
    -- Fetch Nest ID based on Tactics ID
    SET @NESTID = (SELECT TOP 1 dwNestID FROM Tab_RefNest WHERE dwTacticsID = @CurrentTacticsID);

    -- Fetch Hive ID based on Tactics ID
    SET @HiveID = (SELECT TOP 1 dwHiveID FROM Tab_RefNest WHERE dwTacticsID = @CurrentTacticsID);

    -- Select detailed information from relevant tables
    SELECT * FROM Tab_RefHive WHERE dwHiveID = @HiveID;
    SELECT * FROM Tab_RefTactics WHERE dwTacticsID = @CurrentTacticsID;
    SELECT * FROM Tab_RefNest WHERE dwTacticsID = @CurrentTacticsID;

    FETCH NEXT FROM TacticsCursor INTO @CurrentTacticsID;
END;

CLOSE TacticsCursor;
DEALLOCATE TacticsCursor;

-- Drop temporary table
DROP TABLE #TacticsIDs;
the second one.

Code:
USE SRO_VT_SHARD;

DECLARE @MOB VARCHAR(64);
DECLARE @NESTID INT;
DECLARE @HiveID INT;
DECLARE @MaxTotalCount INT;
DECLARE @DelayTimeMin INT;
DECLARE @DelayTimeMax INT;

SET @MOB = 'MOB_TK_BONELORD'; -- replace with your specific monster code name
SET @MaxTotalCount = 20; -- desired total count of mobs
SET @DelayTimeMin = 5;   -- desired minimum spawn delay
SET @DelayTimeMax = 10;  -- desired maximum spawn delay

-- Temporary table to hold Tactics IDs
CREATE TABLE #TacticsIDs (dwTacticsID INT);

-- Fetch all Tactics IDs based on MOB
INSERT INTO #TacticsIDs (dwTacticsID)
SELECT dwTacticsID 
FROM Tab_RefTactics 
WHERE dwObjID = (SELECT ID FROM _RefObjCommon WHERE Codename128 = @MOB);

-- Fetch and display information for each Tactics ID
DECLARE @CurrentTacticsID INT;

DECLARE TacticsCursor CURSOR FOR 
SELECT dwTacticsID FROM #TacticsIDs;

OPEN TacticsCursor;

FETCH NEXT FROM TacticsCursor INTO @CurrentTacticsID;

WHILE @@FETCH_STATUS = 0
BEGIN
    -- Fetch Nest ID based on Tactics ID
    SET @NESTID = (SELECT TOP 1 dwNestID FROM Tab_RefNest WHERE dwTacticsID = @CurrentTacticsID);

    -- Fetch Hive ID based on Tactics ID
    SET @HiveID = (SELECT TOP 1 dwHiveID FROM Tab_RefNest WHERE dwTacticsID = @CurrentTacticsID);

    -- Select detailed information from relevant tables
    SELECT * FROM Tab_RefHive WHERE dwHiveID = @HiveID;
    SELECT * FROM Tab_RefTactics WHERE dwTacticsID = @CurrentTacticsID;
    SELECT * FROM Tab_RefNest WHERE dwTacticsID = @CurrentTacticsID;

    -- Update the dwMaxTotalCount, dwDelayTimeMin, and dwDelayTimeMax fields
    UPDATE Tab_RefNest
    SET dwMaxTotalCount = @MaxTotalCount, -- Set the new number of mobs
        dwDelayTimeMin = @DelayTimeMin,    -- Set the new minimum spawn delay
        dwDelayTimeMax = @DelayTimeMax     -- Set the new maximum spawn delay
    WHERE dwTacticsID = @CurrentTacticsID;

    FETCH NEXT FROM TacticsCursor INTO @CurrentTacticsID;
END;

CLOSE TacticsCursor;
DEALLOCATE TacticsCursor;

-- Drop temporary table
DROP TABLE #TacticsIDs;
I hope you like it

Have a good Day.
Mdarude is offline  
Thanks
7 Users
Old 06/01/2024, 04:03   #2
 
elite*gold: 0
Join Date: Mar 2022
Posts: 62
Received Thanks: 12
thanks
johnnydung is offline  
Thanks
1 User
Old 06/03/2024, 02:05   #3
 
Worshiper's Avatar
 
elite*gold: 0
Join Date: May 2017
Posts: 1,085
Received Thanks: 225
thanks
Worshiper is online now  
Thanks
1 User
Old 06/08/2024, 05:36   #4
 
elite*gold: 100
Join Date: Sep 2017
Posts: 1,109
Received Thanks: 903
Why would you use a cursor for such a simple transaction, when you can just join the tables?

You have to think carefully before using cursors, because they're much slower, they use much more resources, unnecessary in your case.
#HB is offline  
Thanks
1 User
Old 06/11/2024, 16:34   #5
 
Mdarude's Avatar
 
elite*gold: 340
Join Date: Mar 2010
Posts: 106
Received Thanks: 43
Quote:
Originally Posted by #HB View Post
Why would you use a cursor for such a simple transaction, when you can just join the tables?

You have to think carefully before using cursors, because they're much slower, they use much more resources, unnecessary in your case.
in my opinion this is faster and less time consuming.
I do not have all day to work on my server in good day's i only have 1 hour making this saves me alot of time and i can adjusts per monster faster.
Mdarude is offline  
Old 06/13/2024, 10:57   #6
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 419
Received Thanks: 943
Quote:
Originally Posted by Mdarude View Post
Quote:
Originally Posted by #HB View Post
Why would you use a cursor for such a simple transaction, when you can just join the tables?
in my opinion this is faster and less time consuming.
I do not have all day to work on my server in good day's i only have 1 hour making this saves me alot of time and i can adjusts per monster faster.
I think what he mean to say, it's making use of JOIN statements on queries, and it's simpler than you think.
Taking your query as example (you don't even need to check Tab_RefHive by the way):
PHP Code:
USE SRO_VT_SHARD

-- Setup
DECLARE @CodeName128 VARCHAR(129) = 'MOB_TK_BONELORD'
DECLARE @MaxTotalCount INTEGER 20
DECLARE @DelayTimeMin INTEGER 5
DECLARE @DelayTimeMax INTEGER 10

-- Query
UPDATE Tab_RefNest
SET dwMaxTotalCount 
= @MaxTotalCount
    
dwDelayTimeMin = @DelayTimeMin
    
dwDelayTimeMax = @DelayTimeMax
FROM Tab_RefNest
INNER JOIN Tab_RefTactics ON Tab_RefTactics
.dwTacticsID Tab_RefNest.dwTacticsID
INNER JOIN _RefObjCommon ON _RefObjCommon
.ID Tab_RefTactics.dwObjID
WHERE _RefObjCommon
.CodeName128 LIKE @CodeName128 
This is something I was talking recently with my friends, in a ONLINE GAME like this MMORPG you should care a lot about performance otherwise you'll add unnecesary delay to the game, every increasing on PING counts!
JellyBitz is offline  
Thanks
1 User
Old 06/19/2024, 21:15   #7
 
Mdarude's Avatar
 
elite*gold: 340
Join Date: Mar 2010
Posts: 106
Received Thanks: 43
Thank you for the feedback i am still new at this and if i find someting or do it i just want to share it since this will give me some feedback on how to improve myself
Mdarude is offline  
Reply


Similar Threads Similar Threads
[Selling] 🦕Sentry🦕☢️ADMIN & GUILD EXPLOIT❤️Godmode💵Item Spawn🐼Pal Spawn+Edit✨Instant XP👽++
05/21/2024 - Palworld Trading - 219 Replies
We are no longer selling/taking more customers.
[Selling] cheap Lifetime sub sentry 🐼Pal Spawn+Edit🐼 Item Spawn✨Instant XP👽
02/16/2024 - Palworld Trading - 0 Replies
Resell my own lifetime sub for only 10$, bought for 19.5$ Steam version Only crypto Cheat thread & reviews: https://www.elitepvpers.com/forum/palworld-trading /5203453-sentry-admin-guild-exploit-godmode-item-s pawn-pal-spawn-edit-instant-xp.html
[Selling] Best Arma 3 Money spawn - Gear spawn - Vehicles spawn *ON EVERY SERVER*
12/26/2014 - ArmA Trading - 0 Replies
bojkastros Arma 3 Shop ist offen - Geld Spawn - Ausrüstungs Spawn- Fahrzeuge spawnen * auf jedem Server * Geld 2 mil = 1,50 euro 4 mil = 2,50 euro So viel geld wie ihr wollt = 8 euro
CekseSro xp rate and sp rate:600 DROP Rate: 50x SOX DROP Rate: 50%
01/29/2012 - SRO PServer Advertising - 9 Replies
110 cap !! Server rates: EXP & SP Rate: 600x PARTY EXP Rate: 600x DROP Rate: 50x GOLD DROP Rate: 70x SOX DROP Rate: 50 % homage page:CekseSro Online
CekseSro xp rate and sp rate:600 DROP Rate: 50x SOX DROP Rate: 50%
01/27/2012 - SRO PServer Advertising - 10 Replies
Server rates: EXP & SP Rate: 600x PARTY EXP Rate: 600x DROP Rate: 50x GOLD DROP Rate: 70x SOX DROP Rate: 50% homage page:CekseSro Online regist:CekseSro Online



All times are GMT +1. The time now is 16:28.


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.