Orna Assess

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

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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>`
            }
        }
    )
})();