Orna Assess

Adiciona opção de avaliar o item no codex oficial do Orna/Aethric

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         Orna Assess
// @namespace    http://tampermonkey.net/
// @version      1.2
// @description  Adiciona opção de avaliar o item no codex oficial do Orna/Aethric
// @author       Azmuth
// @match        https://playorna.com/codex/items/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=playorna.com
// @grant        none
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    console.clear = () => {}

    const Swal = Sweetalert2

    let attribute
    let original
    let compare

    window._qualify = function(value, att) {
        compare = Number(prompt(`Digite o atributo ${att.toUpperCase()} do seu item:`))
        Swal.fire({
            title: `${Number(compare*100/value).toFixed(2)}%`,
            text: "Esta é a qualidade aproximada do seu item",
            icon: "success"
        });
    }

    $('.codex-stat').each(
        function(i, data) {
            attribute = /\D+(?=\:)/.exec(data.innerText)
            original  = /[\-0-9]+/.exec(data.innerText)

            if (/^(Ataque|Magia|Resistencia|Defesa|Guarda|HP|Mana|Destreza)/.test(data.innerText)) {
                data.innerHTML += `<button onclick="_qualify(${Number(original)}, '${attribute}')">Assess</button>`
            }
        }
    )
})();