From cc594e3415f6e3a2fe84b2eb7063cbf076ba1be4 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Tue, 15 Aug 2023 21:19:31 +0200 Subject: [PATCH] Skills/Requirements * fix requirements display for low level skinning * display fishing skill requirements on zone detail page in fishing tab --- includes/game.php | 16 +++++++++++++++- localization/locale_dede.php | 1 + localization/locale_enus.php | 1 + localization/locale_eses.php | 1 + localization/locale_frfr.php | 1 + localization/locale_ruru.php | 1 + localization/locale_zhcn.php | 1 + pages/npc.php | 2 +- pages/zone.php | 7 ++++++- 9 files changed, 28 insertions(+), 3 deletions(-) diff --git a/includes/game.php b/includes/game.php index 85fa9c9b..625c5356 100644 --- a/includes/game.php +++ b/includes/game.php @@ -486,13 +486,27 @@ class Game public static function getBreakpointsForSkill(int $skillId, int $reqLevel) : array { + if ($skillId == SKILL_FISHING) + return array( + round(sqrt(.25) * $reqLevel), // 25% valid catches + round(sqrt(.50) * $reqLevel), // 50% valid catches + round(sqrt(.75) * $reqLevel), // 75% valid catches + $reqLevel // 100% valid catches + ); + switch ($skillId) { + case SKILL_SKINNING: + if ($reqLevel < 10) + $reqLevel = 0; + else if ($reqLevel < 20) + $reqLevel = ($reqLevel - 10) * 10; + else + $reqLevel *= 5; case SKILL_HERBALISM: case SKILL_LOCKPICKING: case SKILL_JEWELCRAFTING: case SKILL_INSCRIPTION: - case SKILL_SKINNING: case SKILL_MINING: $points = [$reqLevel]; // red/orange diff --git a/localization/locale_dede.php b/localization/locale_dede.php index 1dbf18c6..f594b747 100644 --- a/localization/locale_dede.php +++ b/localization/locale_dede.php @@ -1181,6 +1181,7 @@ $lang = array( 'hcAvailable' => "Heroischer Modus verfügbar (%d)", 'numPlayers' => "Anzahl an Spielern", 'noMap' => "Für dieses Gebiet steht keine Karte zur Verfügung.", + 'fishingSkill' => "25 – 100% Chance einen gelisteten Fisch zu fangen.", 'instanceTypes' => ["Zone", "Durchgang", "Dungeon", "Schlachtzug", "Battleground", "Dungeon", "Arena", "Schlachtzug", "Schlachtzug"], 'territories' => ["Allianz", "Horde", "Umkämpft", "Sicheres Gebiet", "PvP", "Welt-PvP"], 'cat' => array( diff --git a/localization/locale_enus.php b/localization/locale_enus.php index 90024b72..e5824042 100644 --- a/localization/locale_enus.php +++ b/localization/locale_enus.php @@ -1181,6 +1181,7 @@ $lang = array( 'hcAvailable' => "Heroic mode available (%d)", 'numPlayers' => "Number of players", 'noMap' => "There is no map available for this zone.", + 'fishingSkill' => "25 – 100% chance to catch a listed fish.", 'instanceTypes' => ["Zone", "Transit", "Dungeon", "Raid", "Battleground", "Dungeon", "Arena", "Raid", "Raid"], 'territories' => ["Alliance", "Horde", "Contested", "Sanctuary", "PvP", "World PvP"], 'cat' => array( diff --git a/localization/locale_eses.php b/localization/locale_eses.php index 9676970d..5fd79218 100644 --- a/localization/locale_eses.php +++ b/localization/locale_eses.php @@ -1181,6 +1181,7 @@ $lang = array( 'hcAvailable' => "Modo heroico disponible (%di)", 'numPlayers' => "Número de jugadores", 'noMap' => "No hay mapa disponible para esta zona.", + 'fishingSkill' => "[25 – 100% chance to catch a listed fish.]", 'instanceTypes' => ["Zona", "Tránsito", "Mazmorra", "Banda", "Campo de batalla", "Mazmorra", "Arena", "Banda", "Banda"], 'territories' => ["Alianza", "Horda", "En disputa", "Santuario", "JcJ", "JcJ abierto"], 'cat' => array( diff --git a/localization/locale_frfr.php b/localization/locale_frfr.php index b35ab648..72e94c9d 100644 --- a/localization/locale_frfr.php +++ b/localization/locale_frfr.php @@ -1181,6 +1181,7 @@ $lang = array( 'hcAvailable' => "Mode héroïque disponible (%d)", 'numPlayers' => "Nombre de joueurs", 'noMap' => "Il n'y a aucune carte disponible pour cette zone.", + 'fishingSkill' => "[25 – 100% chance to catch a listed fish.]", 'instanceTypes' => ["Zone", "Transit", "Donjon", "Raid", "Champ de bataille", "Donjon", "Arène", "Raid", "Raid"], 'territories' => ["Alliance", "Horde", "Contesté", "Sanctuaire", "JcJ", "JcJ Global"], 'cat' => array( diff --git a/localization/locale_ruru.php b/localization/locale_ruru.php index 43acc4b5..766fff4f 100644 --- a/localization/locale_ruru.php +++ b/localization/locale_ruru.php @@ -1181,6 +1181,7 @@ $lang = array( 'hcAvailable' => "Доступен героический режим (%d)", 'numPlayers' => "Количество игроков", 'noMap' => "Для данной местности нет доступной карты.", + 'fishingSkill' => "[25 – 100% chance to catch a listed fish.]", 'instanceTypes' => ["Игровая зона", "Транзит", "Подземелье", "Рейд", "Поле боя", "Подземелье", "Арена", "Рейд", "Рейд"], 'territories' => ["Альянс", "Орда", "Оспариваемая", "Святилище", "PvP", "Мировое PvP"], 'cat' => array( diff --git a/localization/locale_zhcn.php b/localization/locale_zhcn.php index d1a459d7..d160e7e3 100644 --- a/localization/locale_zhcn.php +++ b/localization/locale_zhcn.php @@ -1180,6 +1180,7 @@ $lang = array( 'hcAvailable' => "英雄模式可用 (%d)", 'numPlayers' => "玩家人数", 'noMap' => "这个区域没有可用地图。", + 'fishingSkill' => "[25 – 100% chance to catch a listed fish.]", 'instanceTypes' => ["区域", "运送", "地下城", "团队副本", "战场", "地下城", "竞技场", "团队副本", "团队副本"], 'territories' => ["联盟", "部落", "争夺中", "安全区域", "PvP", "世界PvP"], 'cat' => array( diff --git a/pages/npc.php b/pages/npc.php index dbaa775a..fbb9f109 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -742,7 +742,7 @@ class NpcPage extends GenericPage if (!empty($sf['note'])) $tabData['note'] = $sf['note']; else if ($sf[0] == LOOT_SKINNING) - $tabData['note'] = ''.Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill($skinTab[2], $this->subject->getField('maxLevel') * 5), Lang::FMT_HTML).''; + $tabData['note'] = ''.Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill($skinTab[2], $this->subject->getField('maxLevel')), Lang::FMT_HTML).''; if ($sf[4]) $tabData['hiddenCols'] = $sf[4]; diff --git a/pages/zone.php b/pages/zone.php index 95853673..c1d4fd4f 100644 --- a/pages/zone.php +++ b/pages/zone.php @@ -639,12 +639,17 @@ class ZonePage extends GenericPage $lv['condition'][0][$this->typeId][] = [[CND_QUESTTAKEN, &$reqQuest[$lv['id']]]]; } + $note = ''; + if ($skill = DB::World()->selectCell('SELECT `skill` FROM skill_fishing_base_level WHERE `entry` = ?d', $this->typeId)) + $note = ''.Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill(SKILL_FISHING, $skill), Lang::FMT_HTML).''; + $this->lvTabs[] = ['item', array( 'data' => array_values($fish->getResult()), 'name' => '$LANG.tab_fishing', 'id' => 'fishing', 'extraCols' => array_unique($xCols), - 'hiddenCols' => ['side'] + 'hiddenCols' => ['side'], + 'note' => $note )]; }