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!

[Help] Contour Script

Joined
Apr 12, 2013
Messages
897
Reaction score
481
So, i wanted to create a script that adds all armors into the mixinginfo table for the specific contour cards

Code:
WHILE((SELECT ItemNum FROM atum2_db_account.dbo.ti_Item WHERE Kind = 16 AND ReqUnitKind = 61440) <> NULL)BEGIN
INSERT INTO atum2_db_account.dbo.ti_ItemMixingInfo (TargetItemNum, MixingProbability, MixingCost, SourceItemNum1, SourceItemCount1, SourceItemNum2, SourceItemCount2)
VALUES (7031740, 10000 , 0 ,(SELECT ItemNum FROM atum2_db_account.dbo.ti_Item WHERE Kind = 16 AND ReqUnitKind = 61440), 1, 7031740, 1)
END

thats my query, but it don't work...maybe someone could help me
 
Newbie Spellweaver
Joined
May 23, 2012
Messages
98
Reaction score
16
i don't know how to use the script,but u can use this method.

first, you can Export the ti_item table to excel, and select all item about Kind = 16 AND ReqUnitKind = 61440
second, make the ti_ItemMixingInfo used excel about 7031740,then save the excel
third,import the excel u made from second part.
 
Upvote 0

hi5

Newbie Spellweaver
Joined
Aug 24, 2011
Messages
70
Reaction score
11
I dont understand what u really need, may be this?
DECLARE @Noob INT
SET @Noob = (SELECT ItemNum FROM atum2_db_account.dbo.ti_Item WHERE Kind = 16 AND ReqUnitKind = 61440)
INSERT INTO atum2_db_account.dbo.ti_ItemMixingInfo (TargetItemNum, MixingProbability, MixingCost, SourceItemNum1, SourceItemCount1, SourceItemNum2, SourceItemCount2)
VALUES (7031740, 10000 , 0 ,@Noob, 1, 7031740, 1)
???
 
Upvote 0
Experienced Elementalist
Joined
Oct 9, 2012
Messages
226
Reaction score
76
no, this will not work hi5.
That needs to use loop to insert all armors to MixingInfo

Read about making loops in T-SQL
should be smth like:


Code:
DECLARE @ID int
DECLARE IDs CURSOR LOCAL FOR SELECT ItemNum FROM atum2_db_account.dbo.ti_Item WHERE Kind = '16' AND ReqUnitKind = '61440'

OPEN IDs
FETCH NEXT FROM IDs into @ID
WHILE @@FETCH_STATUS = 0
BEGIN
    INSERT INTO atum2_db_account.dbo.ti_ItemMixingInfo (TargetItemNum, MixingProbability, MixingCost, SourceItemNum1, SourceItemCount1, SourceItemNum2, SourceItemCount2)
VALUES (7031740, 10000 , 0 ,@ID, 1, 7031740, 1) 

    FETCH NEXT FROM IDs into @ID
END

CLOSE IDs
DEALLOCATE IDs
 
Upvote 0
Retired (Goddamn idiots)
Joined
Dec 3, 2003
Messages
391
Reaction score
484
Holy hell you made some scary statements there.
Code:
INSERT INTO atum2_db_account.dbo.ti_ItemMixingInfo (TargetItemNum, MixingProbability, MixingCost, SourceItemNum1, SourceItemCount1, SourceItemNum2, SourceItemCount2)
SELECT 7031740, 10000 , 0 ,ItemNum, 1, 7031740, 1 FROM atum2_db_account.dbo.ti_Item WHERE Kind = 16 AND ReqUnitKind = 61440
No reason to use while loops or cursor loops for something this dead simple.
 
Upvote 0
Back
Top