PDA

View Full Version : Artisan Charm perl code


br0nc0n
07-24-2013, 08:01 AM
First time doing anything custom with EqEmu with peq database.
Not even sure if this is the right board.

Assuming the formula is correct, does the syntax in this perl script look correct for a charm?


sub EVENT_SCALE_CALC {
my $baking = $client->GetSkill(60);
my $tailoring = $client->GetSkill(61);
my $blacksmithing = $client->GetSkill(63);
my $jewelcrafting = $client->GetSkill(68);
my $brewing = $client->GetSkill(65);
my $pottery = $client->GetSkill(69);
my $fletching = $client->GetSkill(64);

my $tradeskills = ($baking + $tailoring + $blacksmithing + $jewelcrafting + $brewing + $pottery + $fletching)
my $scale = $tradeskills - 700

if($scale < 0) {
$scale = 0;
}

if($scale > 1400) {
$scale = 1400;
}

$questitem->SetScale($scale/1400);
}

joligario
07-24-2013, 08:04 PM
No chance to go deep and check, but you are missing two semicolons.

br0nc0n
07-24-2013, 08:05 PM
Ok, I fixed this and tested on my server.


sub EVENT_SCALE_CALC {
my $baking = $client->GetSkill(60);
my $tailoring = $client->GetSkill(61);
my $blacksmithing = $client->GetSkill(63);
my $jewelcrafting = $client->GetSkill(68);
my $brewing = $client->GetSkill(65);
my $pottery = $client->GetSkill(69);
my $fletching = $client->GetSkill(64);


my $tradeskills = $baking + $tailoring + $blacksmithing + $jewelcrafting + $brewing + $pottery + $fletching;
my $scale = $tradeskills - 700;

if($scale < 0) {
$scale = 0;
}

if($scale > 1400) {
$scale = 1400;
}

$questitem->SetScale($scale/1400);
}