/**
version : 1
author : syloxx
created date : 2015-03-23
description : upgrade your items.
return value :
0 = There is no error.
-1 = The transaction is in an uncommittable state. Rolling back transaction.
-2 = Slot 13 is emptry.
-3 = Item in slot 13 is not in upgrade table.
**/
CREATE PROCEDURE dbo._UpgradeItem
@CharID int
, @Scroll varchar(129)
AS
SET NOCOUNT ON;
SET XACT_ABORT ON;
DECLARE @ReturnValue int
, @ItemID bigint
, @BeforeRefID int
, @BeforeOptLevel tinyint
, @UpgradeRefID int
, @UpgradeOptLevel tinyint;
IF XACT_STATE() = -1
BEGIN
SET @ReturnValue = -1;
GOTO ErrorHandler;
END
BEGIN TRY
/**_# Get ItemID of item in slot 13.*/
SELECT @ItemID = ItemID
FROM dbo._Inventory WITH (NOLOCK)
WHERE CharID = @CharID
AND Slot = 13;
/**_# Check if slot 13 is empty.*/
IF @ItemID IS NULL OR @ItemID = 0
BEGIN
SET @ReturnValue = -2;
GOTO ErrorHandler;
END
/**_# Get RefID and OptLevel of item in slot 13.*/
SELECT @BeforeRefID = RefItemID
, @BeforeOptLevel = OptLevel
FROM dbo._Items WITH (NOLOCK)
WHERE ID64 = @ItemID;
/**_# Get all required informations to upgrade the item.*/
SELECT TOP 1 @UpgradeRefID = UpgradeRefID
, @UpgradeOptLevel = UpgradeOptLevel
FROM _RefUpgradeConfig WITH (NOLOCK)
WHERE Service = 1
AND BeforeRefID = @BeforeRefID
AND BeforeOptLevel <= @BeforeOptLevel
ORDER BY BeforeOptLevel DESC;
/**_# Check if item in slot 13 exsits in upgrade table.*/
IF @UpgradeRefID IS NULL OR @UpgradeRefID = 0
BEGIN
SET @ReturnValue = -3;
GOTO ErrorHandler;
END
BEGIN TRANSACTION;
/**_# Upgrade your item.*/
UPDATE _Items
SET RefItemID = @UpgradeRefID
, OptLevel = @UpgradeOptLevel
WHERE ID64 = @ItemID;
COMMIT TRANSACTION;
END TRY
BEGIN CATCH
GOTO ErrorHandler;
END CATCH;
RETURN 0;
ErrorHandler:
IF XACT_STATE() <> 0
ROLLBACK TRANSACTION;
DECLARE @CharName varchar(16);
SELECT @CharName = CharName16
FROM _Char WITH (NOLOCK)
WHERE CharID = @CharID;
EXEC _ADD_ITEM_EXTERN @CharName, @Scroll, 1, 0;
RETURN @ReturnValue;
Table:
Code:
CREATE TABLE _RefUpgradeConfig
(
Service bit NOT NULL
, BeforeRefID int NOT NULL
, BeforeOptLevel tinyint NOT NULL
, UpgradeRefID int NOT NULL
, UpgradeOptLevel tinyint NOT NULL
);
i didn't tested this system so if something is wrong please lemme know.
TUTORIAL
you have to config the upgrade system first.
means you have to insert stuff in the _RefUpgradeConfig table in following format:
Service, BeforeRefID (olditem), BeforeOptLevel (required plus), UpgradeRefID (new item), UpgradeOptLevel (new plus)
dafuq, that was a query to fill yo ur table my bad then..
hahahaha. can you tell me who explained for you that this query will fill the table and it's not a procedure for upgrade ?
don't try to lie. i knew that you don't have any idea about sql coding.
added procedure succ + config table and i fill it with items codes + OPT level
now could anyone tell me how to use it to upgrade my weapons anyone answer please cuze i don't know how to do it
[Release] Quest Upgrade System 06/14/2016 - SRO PServer Guides & Releases - 26 Replies I had some free time and i was thinking to write a procedure that upgrades your items by quests instead of using scrolls, and i have made it and tested it. it worked so i decided to release it since i don't need it.
FAQ
How does this system work?
You have to collect a certain number of a weapon, and once gained you can upgrade that count of that weapon to a newer seal of that weapon from a quest.
But i don't have upgrade quest,how to make it?
MaDenGo released it before , it is not...
[Release] Upgrade System - 3 Lines only, Better performance 03/23/2015 - SRO PServer Guides & Releases - 5 Replies Hey guys,
Everybody here heard of this system, most of ya guys probably know it.
But unfortunately every release related to this system doesn't work properly or has a bad performance, so i decided to code a new one and release it.
FAQ
What is this?
-This is a system that will upgrade your weapon to a newer seal/degree.
How does it work?
-Simply put a +9 item in your first slot and use upgrade scroll or whatever you'll name it and you'll get a new weapon.
How can i configure it?
Guards-Online | Cap 120-12D | High Rates | Old job system | Play2Win | Upgrade System 11/21/2014 - SRO PServer Advertising - 62 Replies http://i.epvpimg.com/MVR9h.png
Hello elitepvpers,
I would like to introduce our new private server Guards..
◘Links
Website|Download|Registration|Facebook
http://i.epvpimg.com/nMCph.png|http://s14.directu pload.net/images/140122/wqc4kxi2.png|http://s14.di rectupload.net/images/140122/fnq6eumq.png|http://i .epvpimg.com/QNpqc.png|
Basic Information: