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

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2015, 05:57 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default Loot Generator Script.

This script creates a loottable entry, loottable_entries entry, lootdrop entry, and lootdrop_entries entry/entries (by this I mean it writes a .SQL file for insertion):
Code:
sub L {
    my $loottable_info = shift;
    my $lootdrop_info = shift;
    my $item_info = shift;
    my @lti = split(/-/, $loottable_info);
    chomp $lti[$#lti];
    my @ldi = split(/-/, $lootdrop_info);
    chomp $ldi[1];
    my @ii = split(/ /, $item_info);
    chomp $ii[$#ii];
    open my $file, ">Loottable $lti[0].sql";
    my $query = "INSERT INTO `loottable` VALUES ('$lti[0]', '$lti[1]', '$lti[2]', '$lti[3]', '0', '1');\n";
    $query .= "INSERT INTO `loottable_entries` VALUES ('$lti[0]', '$ldi[0]', '1', '1', '0', '100');\n";
    $query .= "INSERT INTO `lootdrop` VALUES ('$ldi[0]', '$ldi[1]');\n";
    foreach my $item (@ii) {
        my @data = split(/-/, $item);
        print "Adding item $data[0].\n";
        $query .= "INSERT INTO `lootdrop_entries` VALUES ('$ldi[0]', '$data[0]', '$data[1]', '$data[2]', '$data[3]', '0', '$data[4]', '127', '$data[5]');\n";
    }
    say $file $query;
    close $file;
}
print "What is the loottable info (id-name-mincash-maxcash)?\n";
my $loottable_info = <STDIN>;
print "What is the lootdrop info (id-name)?\n";
my $lootdrop_info = <STDIN>;
print "List the items' id, charges, whether they're equipped or not, chance, minimum level, and multiplier.\n";
my $item_info = <STDIN>;
L($loottable_info, $lootdrop_info, $item_info);
Here is an 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 07:50 PM.


 

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