Skip to content

Commit 390801f

Browse files
committed
NpcDetailPage/Skinning Skill
* fix displayed skill requirement for non-standard skinning (engineering, herbalism)
1 parent 73f4a69 commit 390801f

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

includes/game.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ public static function getBreakpointsForSkill(int $skillId, int $reqLevel) : arr
468468
switch ($skillId)
469469
{
470470
case SKILL_SKINNING:
471+
$reqLevel /= 5; // we pass creature level * 5 (so, skill value), but formula depends on actual creature level
471472
if ($reqLevel < 10)
472473
$reqLevel = 0;
473474
else if ($reqLevel < 20)
@@ -479,15 +480,16 @@ public static function getBreakpointsForSkill(int $skillId, int $reqLevel) : arr
479480
case SKILL_JEWELCRAFTING:
480481
case SKILL_INSCRIPTION:
481482
case SKILL_MINING:
482-
$points = [$reqLevel]; // red/orange
483+
case SKILL_ENGINEERING:
484+
$points = [$reqLevel]; // red/orange
483485

484-
if ($reqLevel + 25 <= MAX_SKILL) // orange/yellow
486+
if ($reqLevel + 25 <= MAX_SKILL) // orange/yellow
485487
$points[] = $reqLevel + 25;
486488

487-
if ($reqLevel + 50 <= MAX_SKILL) // yellow/green
489+
if ($reqLevel + 50 <= MAX_SKILL) // yellow/green
488490
$points[] = $reqLevel + 50;
489491

490-
if ($reqLevel + 100 <= MAX_SKILL) // green/grey
492+
if ($reqLevel + 100 <= MAX_SKILL) // green/grey
491493
$points[] = $reqLevel + 100;
492494

493495
return $points;

pages/npc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ protected function generateContent()
744744
if ($note)
745745
$tabData['note'] = $note;
746746
else if ($lootTpl == LOOT_SKINNING)
747-
$tabData['note'] = '<b>'.Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill($skinTab[2], $this->subject->getField('maxLevel')), Lang::FMT_HTML).'</b>';
747+
$tabData['note'] = '<b>'.Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill($skinTab[2], $this->subject->getField('maxLevel') * 5), Lang::FMT_HTML).'</b>';
748748

749749
if ($hiddenCols)
750750
$tabData['hiddenCols'] = $hiddenCols;

0 commit comments

Comments
 (0)