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:12 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,595
Default Ranked Item Generator.

This script will generate any number of ranked items (I recommend stopping at 2500 because eventually the Roman numerals don't show). This script was used for Leetsauce's Power Orb and Kimura's Powersource/Charm for examples:
Code:
use Roman;
sub CreateRanked {
    my $n = shift;
    $n =~ s/\'/\\'/ig;
    open my $file, ">$n.sql";
    my $r = shift;
    my $id = shift;
    my $q = "INSERT INTO `items` (";
    $q .= "`id`, `name`, ";
    $q .= "`ac`, `attack`, ";
    $q .= "`hp`, `mana`, `endur`, ";
    $q .= "`aagi`, `acha`, `adex`, `aint`, `asta`, `astr`, `awis`, ";
    $q .= "`heroic_agi`, `heroic_cha`, `heroic_dex`, `heroic_int`, `heroic_sta`, `heroic_str`, `heroic_wis`, ";
    $q .= "`cr`, `dr`, `fr`, `mr`, `pr`, `svcorruption`, ";
    $q .= "`heroic_cr`, `heroic_dr`, `heroic_fr`, `heroic_mr`, `heroic_pr`, `heroic_svcorrup`, ";
    $q .= "`spelldmg`, `healamt`, ";
    $q .= "`combateffects`, `damageshield`, `dotshielding`, `spellshield`, `strikethrough`, `stunresist`, `dsmitigation`, ";
    $q .= "`nodrop`, `norent`, `loregroup`, ";
    $q .= "`slots`, `unk132`, `classes`, `races`, `icon`, `idfile`, ";
    $q .= "`clickeffect`, `proceffect`, `worneffect`, `scrolleffect`, ";
    $q .= "`augslot" . $_ . "type`, `augslot" . $_ . "visible`, " for (1..5);
    $q .= "`lore`, `serialized`, `verified`, `serialization`, `created`) VALUES\n";
    for ($i = 1; $i <= $r; ++$i) {
        my $hme = GetHME($i);
        my $sdha = GetSDHA($i);
        my $cs = GetCS($i);
        my $s = GetS($i);
        my $sad = GetSAD($i);
        my $h = GetH($i);
        my $had = GetHAD($i);
        $q .= "('" . ($id + $i) . "', '$n " . Roman($i) . "', ";
        $q .= "'$i', '$i', ";
        $q .= "'$hme', '$hme', '$hme', ";
        $q .= "'$sad', '$s', '$sad', '$s', '$s', '$s', '$s', ";
        $q .= "'$had', '$h', '$had', '$h', '$h', '$h', '$h', ";
        $q .= "'$s', '$s', '$s', '$s', '$s', '$s', ";
        $q .= "'$h', '$h', '$h', '$h', '$h', '$h', ";
        $q .= "'$sdha', '$sdha', ";
        $q .= "'$cs', '$cs', '$cs', '$cs', '$cs', '$cs', '$cs', ";
        $q .= "'0', '1', '-1', ";
        if ($i != $r) {
            $q .= "'4194304', '-1', '65535', '65535', '2258', 'IT63', '-1', '-1' ,'-1', '-1', '0', '1', '0', '1', '0', '1', '0', '1', '0', '1', '', NOW(), NOW(), NOW(), NOW()),\n";
        } elsif ($i == $r) {
            $q .= "'4194304', '-1', '65535', '65535', '2258', 'IT63', '-1', '-1' ,'-1', '-1', '0', '1', '0', '1', '0', '1', '0', '1', '0', '1', '', NOW(), NOW(), NOW(), NOW());";
            say $file $q;
        }
    }
    close $file;
}

sub GetS {
    return (($_[0] > 127) ? 127 : $_[0]);
}

sub GetSAD {
    return (($_[0] > 10) ? 10 : $_[0]);
}

sub GetH {
    return 0 if $_[0] <= 250;
    return ((($_[0] - 250) > 100) ? 100 : ($_[0] - 250));
}

sub GetHAD {
    return 0 if $_[0] <= 250;
    return ((($_[0] - 250) > 10) ? 10 : ($_[0] - 250));
}

sub GetHME {
    my %h = (5 => [1..24],
    10 => [25..49],
    25 => [50..99],
    50 => [100..249],
    100 => [250..3000]);
    foreach my $key (keys %h) {
        return ($_[0] * $key) if ($_[0] ~~ @{$h{$key}});
    }
}

sub GetSDHA {
    my %h = (1 => [25..49],
    3 => [50..99],
    5 => [100..249],
    10 => [250..499],
    20 => [500..749],
    30 => [750..999],
    40 => [1000..1249],
    50 => [1250..1499],
    100 => [1500..1749],
    150 => [1750..1999],
    200 => [2000..2249],
    250 => [2250..2500],
    500 => [2500..3000]);
    return 0 if ($_[0] < 25);
    foreach my $key (keys %h) {
        return int($_[0] + $key) if ($_[0] ~~ @{$h{$key}});
    }
}

sub GetCS {
    my %h = (25 => [25..49],
    50 => [50..74],
    75 => [75..99],
    100 => [100..3000]);
    return 0 if ($_[0] < 25);
    foreach my $key (keys %h) {
        return $key if ($_[0] ~~ @{$h{$key}});
    }
}
print "Name?\n";
my $n = <STDIN>;
$n =~ s/\s+$//;
print "Ranks?\n";
my $r = int(<STDIN>);
print "Starting ID?\n";
my $id = int(<STDIN>);
CreateRanked($n, $r, $id);
Example of use:

Last edited by Kingly_Krab; 03-14-2022 at 01:25 PM..
Reply With Quote
  #2  
Old 07-18-2016, 12:12 PM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

Should let homies know they need roman.pm.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
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 04:26 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