Orna Assess

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey, Greasemonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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

คุณจะต้องติดตั้งส่วนขยาย เช่น Tampermonkey หรือ Violentmonkey เพื่อติดตั้งสคริปต์นี้

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.

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

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

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