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, PERFORMANCE] Add Equip to a char 80x faster!

Newbie Spellweaver
Joined
Dec 1, 2013
Messages
23
Reaction score
1
Royal can you give me Tip
i want to make this script from 1 til 8 Sun FB MAX 61% AND D9 items Seal oF moon
 
Master Summoner
Joined
Nov 9, 2009
Messages
579
Reaction score
238
Royal can you give me Tip
i want to make this script from 1 til 8 Sun FB MAX 61% AND D9 items Seal oF moon
thanks for this post, really!
you made my day a bit better today .. had a good laugh =)
 
Junior Spellweaver
Joined
Jan 14, 2013
Messages
167
Reaction score
59
Royal can you give me Tip
i want to make this script from 1 til 8 Sun FB MAX 61% AND D9 items Seal oF moon

Yes, i can give you a tip. However, first complete this:
After passing it with a positive result, you can ask again. Oh, I might ask you to visit another test page to check your english before I do actually help you.

In case you don't pass, there are multiple mental institutions in your city, just checked, those will take you in just after a quick look. There are many retards there, you can join em officially. At least, then I'll feel pity instead of disgust.
 
Newbie Spellweaver
Joined
Dec 1, 2013
Messages
23
Reaction score
1
Yes, i can give you a tip. However, first complete this:
After passing it with a positive result, you can ask again. Oh, I might ask you to visit another test page to check your english before I do actually help you.

In case you don't pass, there are multiple mental institutions in your city, just checked, those will take you in just after a quick look. There are many retards there, you can join em officially. At least, then I'll feel pity instead of disgust.

i quit vSRO developeing
 
Initiate Mage
Joined
May 18, 2014
Messages
1
Reaction score
0
thanks royal for that one really nice work you done there ...
i did fix it alil to work with all items since it was only working with only Clothes and Weapons and accessory's
here we go
USE [SRO_VT_SHARD]GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE _RoyalAddEquipment @CharID INT,
@ItemID INT, @Amount INT, @optLvl INT
AS
SET XACT_ABORT ON
DECLARE @FreeSlot TINYINT,
@link INT,
@TiD1 TINYINT,
@TiD2 TINYINT;

SELECT @link = Link,
@TiD1 = TypeID1,
@TiD2 = TypeID2
FROM _RefObjCommon
WHERE ID = @ItemID




IF @link IS NULL
BEGIN
PRINT 'Item doesn''t exist'
RETURN
END

IF NOT EXISTS(SELECT * FROM _Char WITH (NOLOCK) WHERE CharID = @CharID)
BEGIN
PRINT 'Char doesn''t exist'
RETURN
END




SELECT TOP 1 @FreeSlot = Slot
FROM _Inventory
WHERE CharID = @CharID
AND Slot > 12
AND ItemID = 0




IF @FreeSlot IS NULL
BEGIN
PRINT 'Inventory is full'
RETURN
END




DECLARE @NewItemID BIGINT = 0;

BEGIN TRAN
IF @TiD1 = 3 AND @TiD2 = 1
BEGIN
SELECT @Amount = Dur_L
FROM _RefObjItem
WHERE ID = @link

DECLARE @LatestItemSN BIGINT




UPDATE _LatestItemSerial SET LatestItemSerial += 1;

SELECT @LatestItemSN = LatestItemSerial
FROM _LatestItemSerial
WITH (UPDLOCK)




INSERT INTO _Items (RefItemID, OptLevel, Data, MagParamNum, Serial64)
VALUES (@ItemID, @optLvl, @Amount, 0, @LatestItemSN)
SELECT @NewItemID = @@IDENTITY




UPDATE _Inventory SET ItemID = @NewItemID WHERE CharID = @CharID AND Slot = @FreeSlot
END
ELSE
BEGIN
SELECT @Amount = MaxStack
FROM _RefObjItem
WHERE ID = @link

DECLARE @LatestItemSN_2 BIGINT




UPDATE _LatestItemSerial SET LatestItemSerial += 1;

SELECT @LatestItemSN_2 = LatestItemSerial
FROM _LatestItemSerial
WITH (UPDLOCK)




INSERT INTO _Items (RefItemID, OptLevel, Data, MagParamNum, Serial64)
VALUES (@ItemID, @optLvl, @Amount, 0, @LatestItemSN_2)
SELECT @NewItemID = @@IDENTITY




UPDATE _Inventory SET ItemID = @NewItemID WHERE CharID = @CharID AND Slot = @FreeSlot
END

IF @NewItemID = 0
BEGIN
ROLLBACK TRAN
PRINT 'Huge Error'
RETURN
END

COMMIT TRAN

Greeting
Divntos



But you will be dced if you sell that item to any npc.
 
Back
Top