Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2015, 06:00 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default Tradeskill Recipe Generator.

The following script generates a tradeskill_recipe entry and tradeskill_recipe entries (by this I mean it creates a .SQL file for insertion):
Code:
sub T {
    my $recipe_id = shift;
    my $recipe_name = shift;
    my $tradeskill = shift;
    my $tradeskill_level = shift;
    my $tradeskill_trivial = shift;
    my $failable = shift;
    my $data = shift;
    my @info = split(/ /, $data);
    open my $file, ">Recipe $recipe_id.sql";
    my $query = "INSERT INTO `tradeskill_recipe` VALUES ('$recipe_id', '$recipe_name', '$tradeskill', '$tradeskill_level', '$tradeskill_trivial', '$failable', '0', '', '0', '0', '1');\n";
    foreach my $entry (@info) {
        my @record = split(/\-/, $entry);
        chomp $record[$_] for (0..$#record);
        print "Adding item $record[0].\n";
        $query .= "INSERT INTO `tradeskill_recipe_entries` (`recipe_id`, `item_id`, `successcount`, `failcount`, `componentcount`, `salvagecount`, `iscontainer`) VALUES ('$recipe_id', '$record[0]', '$record[1]', '$record[2]', '$record[3]', '$record[4]', '$record[5]');\n";
    }
    say $file $query;
    close $file;
}
print "What is the recipe ID?\n";
my $recipe_id = int(<STDIN>);
print "What is the recipe name?\n";
my $recipe_name = <STDIN>;
chomp $recipe_name;
print "What is the tradeskill?\n";
my $tradeskill = int(<STDIN>);
print "What is the tradeskill level needed?\n";
my $tradeskill_level = int(<STDIN>);
print "What is the trivial level?\n";
my $tradeskill_trivial = int(<STDIN>);
print "Is it failable?\n";
my $failable = int(<STDIN>);
print "List the item id, component count, success count, failure count, salvage count, and if they are a container.\n";
my $data = <STDIN>;
T($recipe_id, $recipe_name, $tradeskill, $tradeskill_level, $tradeskill_trivial, $failable, $data);
Example of use:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 06:43 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3