Welcome to AC Web.
Results 1 to 10 of 10
  1. #1

    create a lot of items with different entry


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    hi all, i am still little new, i want to make hundreds of items, they can be same name, but i need different entry

    like i make item with

    INSERT INTO item_template (entry, class, subclass, name, displayid, Quality, Flags, BuyCount, BuyPrice, SellPrice, InventoryType, AllowableClass, ItemLevel, StatsCount, stat_type1, stat_value1, stat_type2, stat_value2, stat_type3, stat_value3, stat_type4, stat_value4, stat_type5, stat_value5, stat_type6, stat_value6, stat_type7, stat_value7, stat_type8, stat_value8, stat_type9, stat_value9, stat_type10, stat_value10, holy_res, fire_res, nature_res, frost_res, shadow_res, arcane_res, socketColor_1, socketContent_1)
    VALUES
    (61110, 4, 1, "Spell Power Cloak", 59028, 5, 0, 1, 0, 0, 16, 256, 291, 10, 31, 500, 0, 00, 32, 250, 7, 150, 5, 150, 6, 150, 45, 250, 35, 250, 0, 0, 0, 0, 20, 20, 20, 20, 20, 20, 1, 1),

    i want to make 200 of them... with entry between 61110 TO 61310
    so entry like 61110, then 61111, then 61112 and then 61113

    is query this possible or i need do manually? i know there is like +1 function but i try many things and all dont work...

  2. #2
    Web Developer

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    3,002
    Make a loop in sql. You can search on google how to do this. I have done it before but i dont remember exactly how i did it. I can look that up tho and send you an example

  3. #3
    K A P P A L O U N G E

    Join Date
    Sep 2011
    Location
    Germany
    Posts
    2,435
    Code:
    declare @loopDemo int = 1;
    
    while @loopDemo < 200
    begin
       INSERT INTO item_template (entry, class, subclass, name, displayid, Quality, Flags, BuyCount, BuyPrice, SellPrice, InventoryType, AllowableClass, ItemLevel, StatsCount, stat_type1, stat_value1, stat_type2, stat_value2, stat_type3, stat_value3, stat_type4, stat_value4, stat_type5, stat_value5, stat_type6, stat_value6, stat_type7, stat_value7, stat_type8, stat_value8, stat_type9, stat_value9, stat_type10, stat_value10, holy_res, fire_res, nature_res, frost_res, shadow_res, arcane_res, socketColor_1, socketContent_1)
        VALUES 
        (select max(entry)+1, 4, 1, "Spell Power Cloak", 59028, 5, 0, 1, 0, 0, 16, 256, 291, 10, 31, 500, 0, 00, 32, 250, 7, 150, 5, 150, 6, 150, 45, 250, 35, 250, 0, 0, 0, 0, 20, 20, 20, 20, 20, 20, 1, 1)
       set @loopDemo = @loopDemo + 1;
    end;
    Think this could do your job. U gotta rename tho and entry ids may not be ...61110 TO 61310 but your highest entryid in order like +1 200 times
    Last edited by Psykko; 08-12-2019 at 04:13 PM.

  4. #4
    Web Developer

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    3,002
    You could try this, It works for me atleast
    Code:
    drop procedure if exists doWhile;
    DELIMITER //  
    CREATE PROCEDURE doWhile()   
    BEGIN
    DECLARE i INT DEFAULT 1; 
    WHILE (i <= 10) DO
        INSERT INTO item_template (entry, class, subclass, name, displayid)
        VALUES (i, 4, 1, "Test Item", 12345);
        SET i = i+1;
    END WHILE;
    END;
    //  
    
    CALL doWhile();
    The green value 1 is what the entry should start as and the green value 10 what it should loop too.

    So, lets imagine your table is empty so you can start with entry 1 then you can run this query and it will make 10 items starting from entry 1 and ends on entry 10 but if you change 1 to 100000 and 10 to 100010 then it will also create 10 items starting from entry 100000 and ends on entry 100010

    - - - Updated - - -

    Just keep in mind to extend the query, you can run the query as it is if you just change the green values but it will only insert entry, class, subclass, name and displayid. So you can extend the query if you want to insert more data
    Last edited by Tok124; 08-12-2019 at 05:20 PM.

  5. #5
    http://YugoWoW.com/

    Join Date
    Feb 2014
    Location
    http://yugowow.com
    Posts
    2,412
    Not sure but maybe this is what you want :


    download from https://ac.jadadev.com/Trinity%20Full%20SET%20Maker.rar

  6. #6
    Quote Originally Posted by Tok124 View Post
    You could try this, It works for me atleast
    Code:
    drop procedure if exists doWhile;
    DELIMITER //  
    CREATE PROCEDURE doWhile()   
    BEGIN
    DECLARE i INT DEFAULT 1; 
    WHILE (i <= 10) DO
        INSERT INTO item_template (entry, class, subclass, name, displayid)
        VALUES (i, 4, 1, "Test Item", 12345);
        SET i = i+1;
    END WHILE;
    END;
    //  
    
    CALL doWhile();
    The green value 1 is what the entry should start as and the green value 10 what it should loop too.

    So, lets imagine your table is empty so you can start with entry 1 then you can run this query and it will make 10 items starting from entry 1 and ends on entry 10 but if you change 1 to 100000 and 10 to 100010 then it will also create 10 items starting from entry 100000 and ends on entry 100010

    - - - Updated - - -

    Just keep in mind to extend the query, you can run the query as it is if you just change the green values but it will only insert entry, class, subclass, name and displayid. So you can extend the query if you want to insert more data

    hi! it worked! thank you very much!

    Quote Originally Posted by JadaDev View Post
    Not sure but maybe this is what you want :


    download from https://ac.jadadev.com/Trinity%20Full%20SET%20Maker.rar
    hi jada i will check this out looks like it could save many hours ! ty
    Last edited by wowserver3; 08-13-2019 at 12:16 PM.

  7. #7
    Web Developer

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    3,002
    Quote Originally Posted by wowserver3 View Post
    hi! it worked! thank you very much!



    hi jada i will check this out looks like it could save many hours ! ty
    No problem, Enjoy

  8. #8


    Join Date
    Oct 2012
    Location
    Portugal / Lisbon
    Posts
    1,151
    But you want the items with the same stats wtf??

  9. #9
    Web Developer

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    3,002
    Quote Originally Posted by Kyanaga View Post
    But you want the items with the same stats wtf??
    He asked me in PM to edit the query so that the stat values increase by 1 each time it loops through the query. So i sent him an update. He have not replied yet tho ^^

  10. #10
    K A P P A L O U N G E

    Join Date
    Sep 2011
    Location
    Germany
    Posts
    2,435

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by Tok124 View Post
    He asked me in PM to edit the query so that the stat values increase by 1 each time it loops through the query. So i sent him an update. He have not replied yet tho ^^
    step by step

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •