EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Submissions (https://www.eqemulator.org/forums/forumdisplay.php?f=634)
-   -   Artisan Charm perl code (https://www.eqemulator.org/forums/showthread.php?t=37097)

br0nc0n 07-24-2013 08:01 AM

Artisan Charm perl code
 
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?

Code:

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.

Code:

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);
}



All times are GMT -4. The time now is 06:28 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.