[Release] Upgrade Scroll/Message

09/04/2014 02:13 ​Exo#1
Since everyone acted like a pro.. and started commenting on the old shit..here's the Ready To Use Lines...
Simply this shit will get the RefID Of the items and compare them to a table if the ID exists it will change it to another one..
Table name in this example is Upgrade columns Are Req/Up
Code:
--Upgrade By #Khaled# --
DECLARE  @WepRefID INT,
         @ArenaRefID INT,
         @OptLevel INT,
         @Data INT,
         @UP INT,
         @WepRefID2 INT
         
         
         
         
         SELECT @WepRefID = I.RefItemID
         FROM SRO_VT_SHARD.._Inventory Inv
         INNER JOIN SRO_VT_SHARD.._Items I
         ON INV.ItemID =I.ID64
         WHERE CharID =@CharID AND Inv.Slot=13
         
         SELECT @WepRefID2 = I.ID64
         FROM SRO_VT_SHARD.._Inventory Inv
         INNER JOIN SRO_VT_SHARD.._Items I
         ON INV.ItemID =I.ID64
         WHERE CharID =@CharID AND Inv.Slot=13
         
         
         SELECT @ArenaRefID = I.RefItemID
         FROM SRO_VT_SHARD.._Inventory Inv
         INNER JOIN SRO_VT_SHARD.._Items I
         ON INV.ItemID =I.ID64
         WHERE CharID =@CharID AND Inv.Slot=15
         
         SELECT @OptLevel = I.OptLevel
         FROM SRO_VT_SHARD.._Inventory Inv
         INNER JOIN SRO_VT_SHARD.._Items I
         ON INV.ItemID =I.ID64
         WHERE CharID =@CharID AND Inv.Slot=13
         
         SELECT @Data = I.Data
         FROM SRO_VT_SHARD.._Inventory Inv
         INNER JOIN SRO_VT_SHARD.._Items I
         ON Inv.ItemID = I.ID64
         WHERE CharID = @CharID AND Inv.Slot=15
         
         SET @UP = (SELECT UP FROM Upgrade Where Req =@WepRefID)

IF EXISTS (SELECT * FROM SRO_VT_SHARD..Upgrade WHERE Req =@WepRefID)
BEGIN
If ( @OptLevel =8 And @Gold >=50000000000 AND @ArenaRefID='25834' AND @Data>=100)--Staff
BEGIN
UPDATE _Items SET RefItemID = @Up ,OptLevel=0 WHERE ID64=@WepRefID2
UPDATE _Char SET RemainGold =RemainGold-50000000000 WHERE CharID=@CharID
EXEC SRO_VT_SHARD.._STRG_DEL_ITEM_NoTX 1,@CharID,15
END
END
Edit this to match how you will use it.. but i guess you got the point..
09/04/2014 08:45 Syloxx#2
Hints:

-custom table
-TIDs

this query is a pain


and btw this is an better version of your variables:

PHP Code:
DECLARE @Arena        INT
        @
RefID        INT
        @
Data         INT
        @
Opt          INT 
         
        SELECT        
@RefID I.RefItemID
                      @
Opt I.OptLevel 
        FROM          _Inventory INV 
        INNER JOIN    _Items I 
        ON            INV
.ItemID I.ID64 
        WHERE         INV
.CharID = @CharID 
        
AND           INV.Slot 13 
         
        SELECT        
@Arena I.RefItemID
                      @
Data I.Data 
        FROM          _Inventory INV 
        INNER JOIN    _Items I 
        ON            INV
.ItemID I.ID64 
        WHERE         INV
.CharID = @CharID 
        
AND           INV.Slot 14 

@CharID will be declared / set by the procedure

anyway at least u used else if

btw, if someone wanna buy some professional queries / procedures let me know ;)
09/04/2014 10:33 IceAmStiel#3
If it's a teleport scroll you intend to use for it:

Use the scroll -> cancel the scroll -> drop one gold -> teleport -> the 50B weren't removed


Also, please don't delete the entry from _Inventory unless you're sure that your players won't mind the disconnects occuring whenever an item is being put into their second inventory slot :)

EDIT: Did you test this query? You'd normally encounter a foreign key violation by trying to delete an _Items entry that still exists at _ItemPool.

(You should use _STRG_DEL_ITEM_NoTX or an equivalent procedure)
09/04/2014 12:21 Syloxx#4
@IceAmStiel

how can you read this, I stoped after I have seen 3x IF clauses

about the scroll, if u set the Param1 = 0 u wont have this problem

anyway you are correct, rows from _Items can only be removed if the ID64 isnt existing in _Inventory and _ItemPool

@xExorcist

i didnt read your query but IceAmStiel is right

NEVER Delete something from _Inventory if u wanna remove a item you have to update the ItemID = 0

after u did that u dont have to remove the item from _Items everything is what you can still make is set item on unused in _ItemPool

just ask me how u came to the idea to release this
09/04/2014 13:59 ​Exo#5
Quote:
Originally Posted by IceAmStiel View Post
If it's a teleport scroll you intend to use for it:

Use the scroll -> cancel the scroll -> drop one gold -> teleport -> the 50B weren't removed


Also, please don't delete the entry from _Inventory unless you're sure that your players won't mind the disconnects occuring whenever an item is being put into their second inventory slot :)

EDIT: Did you test this query? You'd normally encounter a foreign key violation by trying to delete an _Items entry that still exists at _ItemPool.

(You should use _STRG_DEL_ITEM_NoTX or an equivalent procedure)
:facepalm: you don't have to say everything...it was meant to be a hint to how it should work ...
09/04/2014 14:03 Syloxx#6
Quote:
Originally Posted by xExorcist View Post
:facepalm: you don't have to say everything...it was meant to be a hint to how it should work ...
a hint? this query is completely useless what is the hint for the people here

how to use IF clauses ?
09/04/2014 14:06 ​Exo#7
Quote:
Originally Posted by IceAmStiel View Post
If it's a teleport scroll you intend to use for it:

Use the scroll -> cancel the scroll -> drop one gold -> teleport -> the 50B weren't removed


Also, please don't delete the entry from _Inventory unless you're sure that your players won't mind the disconnects occuring whenever an item is being put into their second inventory slot :)

EDIT: Did you test this query? You'd normally encounter a foreign key violation by trying to delete an _Items entry that still exists at _ItemPool.

(You should use _STRG_DEL_ITEM_NoTX or an equivalent procedure)
Quote:
Originally Posted by Syloxx View Post
a hint? this query is completely useless what is the hint for the people here

how to use IF clauses ?
Lets count how many member here know how this shit works..
40? it's for learning purposes.
Never said it's a ready to use query it was old so i though about sharing since lot of ppl asked for it
And lets face it it's better sharing something that maybe is useless for you but useful for others than not sharing anything...(you simply sell work you don't give anything for this community and ye you can judge if i had a title like "KRALL RELEASE Or shit its just a simple old stuff for learning purposes)
09/04/2014 14:40 Syloxx#8
[Release] Upgrade Scroll/Message

means a ready 2 use query and btw

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]
09/04/2014 14:45 IceAmStiel#9
Damn I was just trying to help, apologies ;D
(I'm 100% sure that you weren't aware of the flaws)

And how is this supposed to be something to learn from? You're using improperly choosen datatypes that should actually be based on the table columns you're referencing; you're querying tables more often than necessarily needed and you're using questionable implicit conversions which can lead to a huge performance impact for certain datatypes regarding indexes - let's not talk about readability.
Not to mention that it has logical flaws that will most likely ruin someones database.

That's just another reason why threads should be reviewed and approved my mods, preferably by mods that are familiar with the subject of the releases..
09/04/2014 15:20 gigola123#10
Quote:
Originally Posted by xExorcist View Post
Lets count how many member here know how this shit works..
40? it's for learning purposes.
Never said it's a ready to use query it was old so i though about sharing since lot of ppl asked for it
And lets face it it's better sharing something that maybe is useless for you but useful for others than not sharing anything...(you simply sell work you don't give anything for this community and ye you can judge if i had a title like "KRALL RELEASE Or shit its just a simple old stuff for learning purposes)
I think there is more than 40 members which can do that, also don't release something if it's buggued or unfinished. There is not any purpose in this release ^^'.
09/04/2014 15:32 InPanic Kev#11
SQL SkillzZz -100 ;)
09/04/2014 16:33 ​Exo#12
I wish i didn't stop proofing shits to people then i would release the ready one but simply i don't care..
Specially when people who are complaining are just some random people who are not releasing a shit (Exception Caipi)

What learning purposes i meant was how to change the Item.. it wasn't meant for all of you..[People with skills it was for beginners who don't know how to do so]

Anyway since everyone is acting cool i will add the ready one..

Okay here you got...
PHP Code:

DECLARE  @WepRefID INT,
         @
ArenaRefID INT,
         @
OptLevel INT,
         @
Data INT,
         @
UP INT,
         @
WepRefID2 INT
         
         
         
         
         SELECT 
@WepRefID I.RefItemID
         FROM SRO_VT_SHARD
.._Inventory Inv
         INNER JOIN SRO_VT_SHARD
.._Items I
         ON INV
.ItemID =I.ID64
         WHERE CharID 
=@CharID AND Inv.Slot=13
         
         SELECT 
@WepRefID2 I.ID64
         FROM SRO_VT_SHARD
.._Inventory Inv
         INNER JOIN SRO_VT_SHARD
.._Items I
         ON INV
.ItemID =I.ID64
         WHERE CharID 
=@CharID AND Inv.Slot=13
         
         
         SELECT 
@ArenaRefID I.RefItemID
         FROM SRO_VT_SHARD
.._Inventory Inv
         INNER JOIN SRO_VT_SHARD
.._Items I
         ON INV
.ItemID =I.ID64
         WHERE CharID 
=@CharID AND Inv.Slot=15
         
         SELECT 
@OptLevel I.OptLevel
         FROM SRO_VT_SHARD
.._Inventory Inv
         INNER JOIN SRO_VT_SHARD
.._Items I
         ON INV
.ItemID =I.ID64
         WHERE CharID 
=@CharID AND Inv.Slot=13
         
         SELECT 
@Data I.Data
         FROM SRO_VT_SHARD
.._Inventory Inv
         INNER JOIN SRO_VT_SHARD
.._Items I
         ON Inv
.ItemID I.ID64
         WHERE CharID 
= @CharID AND Inv.Slot=15
         
         SET 
@UP = (SELECT UP FROM Upgrade Where Req =@WepRefID)

IF 
EXISTS (SELECT FROM SRO_VT_SHARD..Upgrade WHERE Req =@WepRefID)
BEGIN
If ( @OptLevel =And @Gold >=50000000000 AND @ArenaRefID='25834' AND @Data>=100)--Staff
BEGIN
UPDATE _Items SET RefItemID 
= @Up ,OptLevel=0 WHERE ID64=@WepRefID2
UPDATE _Char SET RemainGold 
=RemainGold-50000000000 WHERE CharID=@CharID
EXEC SRO_VT_SHARD
.._STRG_DEL_ITEM_NoTX 1,@CharID,15
END
END 
Just Create a Table Here it was called Upgrade 2 Columns Req/Up ..
Thanks for ruining it..

Quote:
Originally Posted by Syloxx View Post
Hints:

-custom table
-TIDs

this query is a pain


and btw this is an better version of your variables:

PHP Code:
DECLARE @Arena        INT
        @
RefID        INT
        @
Data         INT
        @
Opt          INT 
         
        SELECT        
@RefID I.RefItemID
                      @
Opt I.OptLevel 
        FROM          _Inventory INV 
        INNER JOIN    _Items I 
        ON            INV
.ItemID I.ID64 
        WHERE         INV
.CharID = @CharID 
        
AND           INV.Slot 13 
         
        SELECT        
@Arena I.RefItemID
                      @
Data I.Data 
        FROM          _Inventory INV 
        INNER JOIN    _Items I 
        ON            INV
.ItemID I.ID64 
        WHERE         INV
.CharID = @CharID 
        
AND           INV.Slot 14 

@CharID will be declared / set by the procedure

anyway at least u used else if

btw, if someone wanna buy some professional queries / procedures let me know ;)
Just to make somethings clear [i dont have to but ye why not]
Mine had a table the ready to use one shared now..
The CharID and the gold were at the first version cuz i was testing it w/o implementing it at a procedure ..
09/04/2014 21:49 鳳凰城#13
Hey mr electronic enginner

He's helping out. instead of blaming him move your kral hand and release something.
09/04/2014 22:25 Syloxx#14
i released now..

1 Admin Query
1 Feature
1 Fix

i guess thats enougt ;)


Example how a Professional Query looks like

[Only registered and activated users can see links. Click Here To Register...]
09/05/2014 00:23 ​Exo#15
Quote:
Originally Posted by Syloxx View Post
i released now..

1 Admin Query
1 Feature
1 Fix

i guess thats enougt ;)


Example how a Professional Query looks like

[Only registered and activated users can see links. Click Here To Register...]
I don't really believe there's a ' Prof.Query' Check mine.. it does the same function.. you just made a procedure and i didn't ..