Doublexp doubleskill.png Double Exp & Skill: Matar monstros rende o dobro de pontos de experiência. O progresso de skills é duas vezes mais rápido! Doublexp doubleskill.png
Bone Overlord.gif The Roost of the Graveborn Quest Spoiler!
Domine Graveborn: todos os bosses e mecânicas ilustradas!
Saiba mais ➔
Winter Tree.png Winter Update 2025
Acompanhe tudo sobre o Winter Update 2025!
Saiba mais ➔
Stag.gif The Order of the Stag Quest Spoiler!
Conheça Isle of Ada: sua quest, missões secundárias e todos os bosses!
Saiba mais ➔

Tibia Wiki:Imbuing/Codigo: mudanças entre as edições

De Tibia Wiki - A Enciclopédia do Tibia
Ir para navegação Ir para pesquisar
 
(58 revisões intermediárias por 5 usuários não estão sendo mostradas)
Linha 1: Linha 1:
<pre id="imbuing_html">
<pre id="imbuing_html">
<table class="imbuing_main_table">
<div class="imbuement-tool-panel">
  <tr>
     <label class="imbument-tool-version-label">v3.0.0</label>
     <td style="height: 30px;" colspan="2">
    <div class="imbument-tool-loading">
      <div class="titulo">Imbuing System</div>
        <img src="https://www.tibiawiki.com.br/images/c/ce/The_Epic_Wisdom.gif" /><br />
    </td>
        <label>Loading...</label>
  </tr>
         <span>@TibiaWiki</span>
  <tr>
    </div>
    <td>
    <div class="imbument-tool-menu-side">
         <table style="width:100%;height:40px;">
        <h2>Imbuement Tool</h2>
          <tr>
        <div class="imbument-tool-radio-box">
            <td style="width:35%;">Categoria:
            <input type="radio" id="imbument-tool-items" value="Items" name="imbuement-options">
              <select id="categoria">
            <label for="imbument-tool-items">Items</label>
                <option value="nenhum"></option>
        </div>
                <option value="1">Armaduras</option>
        <div class="imbument-tool-radio-box">
                <option value="11">Backpacks</option>
            <input type="radio" id="imbument-tool-scrolls" value="Scrolls" name="imbuement-options">
                <option value="3">Botas</option>
            <label for="imbument-tool-scrolls">Scrolls</label>
                <option value="7">Capacetes</option>
        </div>
                <option value="6">Clavas</option>
        <span class="imbument-tool-divisor-line"></span>
                <option value="9">Distância</option>
        <div id="imbument-tool-items-container">
                <option value="2">Escudos</option>
            <div class="imbument-tool-category-box">
                <option value="4">Espadas</option>
                 <label for="">Categoria:</label>
                 <option value="5">Machados</option>
                 <select id="imbuement-tool-items-category">
                 <option value="10">Spellbooks</option>
                 </select>
                 <option value="8">Wands e Rods</option>
             </div>
              </select>
             <div class="imbument-tool-category-box">
             </td>
                <label for="">Items:</label>
             <td class="no" id="armaduras" style="width:40%;">Item:
                 <div class="imbument-tool-search-box">
              <select id="itemcat1">
                    <input id="imbument-tool-input-search" type="text" placeholder="buscar por item...">
                 <option value="none"></option>
                    <div><i>&#x1F50D;</i></div>
                <option value="2">Albino Plate</option>
                 </div>
                <option value="2">Amazon Armor</option>
                 <select id="imbuement-tool-items-list" size="10">
                <option value="1">Bear Skin</option>
                </select>
                <option value="2">Blue Robe</option>
            </div>
                 <option value="2">Chain Armor</option>
        </div>
                 <option value="1">Crown Armor</option>
        <div class="imbument-tool-items">
                <option value="2">Demon Armor</option>
            <div class="imbument-tool-items-data-box">
                <option value="2">Depth Lorica</option>
                 <div class="imbument-tool-items-data-image-box">
                <option value="1">Dragon Scale Mail</option>
                    <img id="imbument-tool-items-image" src="" alt="item-image">
                 <option value="1">Dream Shroud</option>
                </div>
                <option value="2">Dwarven Armor</option>
                 <div class="imbument-tool-items-data-box-data">
                <option value="2">Elite Draken Mail</option>
                    <label id="imbument-tool-items-name"><span class="label">Item:</span> Dauntless Dragon Scale Armor</label>
                <option value="3">Elven Mail</option>
                    <label id="imbument-tool-items-slots"><span class="label">Slots:</span> 2</label>
                 <option value="1">Embrace of Nature</option>
                 </div>
                <option value="2">Falcon Plate</option>
            </div>
<option value="2">Ghost Chestplate</option>
        </div>
                <option value="2">Gnome Armor</option>
    </div>
                <option value="2">Golden Armor</option>
    <div class="imbument-tool-imbuements-panel">
                <option value="2">Heat Core</option>
        <div class="imbument-tool-imbuements-level-box">
                <option value="2">Heavy Metal T-Shirt</option>
            <h2>Nível do Imbuement</h2>
                 <option value="2">Knight Armor</option>
            <div class="imbuement-tool-level-list">
                <option value="2">Leopard Armor</option>
            </div>
                <option value="2">Lion Plate</option>
        </div>
                <option value="2">Magic Plate Armor</option>
        <span class="imbument-tool-divisor-line"></span>
                <option value="2">Mammoth Fur Cape</option>
        <div class="imbument-tool-imbuements-data-box">
                <option value="1">Master Archer's Armor</option>
            <h2>Imbuements</h2>
                <option value="2">Mooh'tah Plate</option>
            <div class="imbuement-tool-data-table">
                <option value="2">Noble Armor</option>
            </div>
                <option value="2">Ornate Chestplate</option>
        </div>
                <option value="1">Paladin Armor</option>
        <span class="imbument-tool-divisor-line"></span>
                <option value="1">Prismatic Armor</option>
        <div class="imbument-tool-imbuements-data-box">
                <option value="2">Soulmantle</option>
            <h2>Imbuements Items</h2>
                <option value="2">Soulshell</option>
            <h3 id="imbuement-tool-selected-imbuement-description"></h3>
                <option value="2">Soulshroud</option>
            <div class="imbuement-tool-list-items">
                <option value="1">Toga Mortis</option>
            </div>
              </select>
        </div>
            </td>
        <span class="imbument-tool-divisor-line"></span>
             <td class="no" id="escudos" style="width:44%;">Item:
        <div class="imbument-tool-imbuements-data-box">
              <select id="itemcat2">
            <h2>Informações</h2>
                 <option value="none"></option>
             <div class="imbuement-tool-prices">
                <option value="1">Amazon Shield</option>
                <div class="imbuement-tool-prices-items">
                <option value="1">Bonelord Shield</option>
                </div>
                <option value="1">Carapace Shield</option>
                 <div class="imbuement-tool-prices-taxas-info">
                <option value="1">Castle Shield</option>
                    <h3>Valores</h3>
                <option value="1">Crown Shield</option>
                    <!-- <span class="imbument-tool-divisor-line"></span> -->
                 <option value="1">Death Gaze</option>
                    <div class="imbuement-tool-prices-taxas-info-items">  
                <option value="1">Demon Shield</option>
                    </div>
                <option value="1">Dragon Shield</option>
                    <span class="imbument-tool-divisor-line"></span>
                <option value="1">Falcon Escutcheon</option>
                    <label id="lbl-total-gold-token">Total com Gold Token: 500000 GPs</label>
                <option value="1">Ectoplasmic Shield</option>
                    <label id="lbl-total-items">Total com os Items: 0 GPs</label>
                <option value="1">Falcon Shield</option>
                 </div>
                <option value="1">Gnome Shield</option>
            </div>
                <option value="1">Great Shield</option>
        </div>
                <option value="1">Griffin Shield</option>
    </div>
                <option value="1">Haunted Mirror Piece</option>
</div>  
                <option value="1">Lion Shield</option>
</pre>
                <option value="1">Mastermind Shield</option>
 
                <option value="1">Meat Shield</option>
<pre id="imbuing_css">
                <option value="1">Medusa Shield</option>
    .imbuement-tool-panel {
                <option value="1">Necromancer Shield</option>
        display: flex;
                <option value="1">Nightmare Shield</option>
        max-width: 870px;
                <option value="1">Norse Shield</option>
        position: relative;
                <option value="1">Ornamented Shield</option>
        border: 2px solid #a2a9b1;
                <option value="1">Ornate Shield</option>
        background: #ffffff;
                <option value="1">Phoenix Shield</option>
        border-radius: 5px;
                <option value="1">Rift Shield</option>
        -webkit-box-shadow: 0px 0px 10px 2px rgba(255, 255, 255, 1);
                <option value="1">Runic Ice Shield</option>
        -moz-box-shadow: 0px 0px 10px 2px rgba(255, 255, 255, 1);
                <option value="1">Sentinel Shield</option>
        box-shadow: 0px 0px 10px 2px rgba(255, 255, 255, 1);
                <option value="1">Shield of Care</option>
        font-family: Verdana, Arial, Times New Roman, sans-serif;
                <option value="1">Shield of Corruption</option>
        font-size: 13px;
                <option value="1">Shield of the White Knight</option>
        color: black;
                <option value="1">Soulbastion</option>
    }
                <option value="1">Steel Shield</option>
    .imbument-tool-loading {
                <option value="1">Tempest Shield</option>
        z-index: 9999;
                <option value="1">Tower Shield</option>
        background-color: rgba(255, 255, 255, 0.98);
                <option value="1">Vampire Shield</option>
        display: inline-block;
                <option value="1">Viking Shield</option>
        border-radius: 3px;
                <option value="1">Warrior's Shield</option>
        position: absolute;
              </select>
        height: 100%;
            </td>
        width: 100%;
            <td class="no" id="botas" style="width:39%;">Item:
        top: 0;
              <select id="itemcat3">
        left: 0;
                <option value="none"></option>
        align-content: center;
                <option value="1">Badger Boots</option>
        text-align: center;
                <option value="1">Boots of Haste</option>
    }
                <option value="1">Bunnyslippers</option>
 
                <option value="1">Cobra Boots</option>
    .imbument-tool-loading>label {
                <option value="1">Coconut Shoes</option>
        position: relative;
                <option value="1">Crocodile Boots</option>
        bottom: 0px;
                <option value="1">Crystal Boots</option>
        text-align: center;   
                <option value="1">Depth Calcei</option>
        font-size: math;
                <option value="1">Dragon Scale Boots</option>
        background: transparent;
                <option value="1">Draken Boots</option>
    }
                <option value="1">Fur Boots</option>
    .imbument-tool-loading > span {
                <option value="1">Glacier Shoes</option>
        text-align: center;
                <option value="1">Golden Boots</option>
        align-content: center;
                <option value="1">Guardian Boots</option>
        background-color: #c7451d;
                <option value="1">Leather Boots</option>
        height: 32px;
                <option value="1">Lightning Boots</option>
        width: 100%;
                <option value="1">Make-do Boots</option>
        position: absolute;
                <option value="1">Makeshift Boots</option>
        bottom: 0px;
                <option value="1">Magma Boots</option>
        left: 0px;
                <option value="1">Metal Spats</option>
        text-align: center;   
                <option value="1">Oriental Shoes</option>
        font-size: math;
                <option value="1">Pair of Dreamwalkers</option>
        border-bottom-left-radius: 3px;
                <option value="1">Pair of Nightmare Boots</option>
        border-bottom-right-radius: 3px;
                <option value="1">Pair of Soulstalkers</option>
    }
                <option value="1">Pair of Soulwalkers</option>
    .imbument-tool-menu-side {
                <option value="1">Patched Boots</option>
        width: 320px;
                <option value="1">Pirate Boots</option>
        background-color: #c7451d;
                <option value="1">Prismatic Boots</option>
        padding: 5px;
                <option value="1">Sandals</option>
        color: white;
                <option value="1">Steel Boots</option>
        border-top-left-radius: 3px;
                <option value="1">Terra Boots</option>
        border-bottom-left-radius: 3px;
                <option value="1">Treader of Torment</option>
    }
                <option value="1">Vampire Silk Slippers</option>
    .imbument-tool-menu-side > h2 {
                <option value="1">Winged Boots</option>
        width: 100%;
                <option value="1">Zaoan Shoes</option>
        text-align: center;
              </select>
        padding-bottom: 15px;
            </td>
        border-bottom: 1px solid black;
            <td class="no" id="espadas" style="width:38%;">Item:
        font-family: Verdana, Arial, Times New Roman, sans-serif;
              <select id="itemcat4">
        font-weight: bold;
                <option value="none"></option>
        color: white;
                <option value="2">Assassin Dagger</option>
    }
                <option value="3">Berserker</option>
    .imbument-tool-radio-box {
                <option value="3">Blacksteel Sword</option>
        margin-top: 15px;
                <option value="2">Blade of Corruption</option>
        display: flex;
                <option value="3">Blade of Destruction</option>
        margin-top: 2px;
                <option value="2">Bloody Edge</option>
    }
                <option value="2">Bright Sword</option>
    .imbument-tool-radio-box > label {
                <option value="3">Broadsword</option>
        font-size: 15px;
                <option value="2">Cobra Sword</option>
        font-weight: bold;
                <option value="2">Crimson Sword</option>
    }
                <option value="3">Demonrage Sword</option>
    .imbument-tool-category-box {
                <option value="3">Dragon Slayer</option>
        margin-top: 15px;
                <option value="2">Djinn Blade</option>
        width: 100%;
                <option value="2">Emerald Sword</option>
        display: block;
                <option value="2">Epee</option>
    }
                <option value="2">Falcon Longsword</option>
    .imbument-tool-category-box > label {
                <option value="3">Giant Sword</option>
        width: 100%;
                <option value="2">Gnome Sword</option>
        margin-left: 2px;
                <option value="3">Haunted Blade</option>
        font-weight: bold;
                <option value="3">Havoc Blade</option>
    }
                <option value="2">Lion Longsword</option>
    .imbument-tool-category-box > select {
                <option value="2">Magic Sword</option>
        margin-top: 5px;
                <option value="2">Mystic Blade</option>
        width: 100%;
                <option value="2">Nightmare Blade</option>
        min-height: 32px;
                <option value="2">Relic Sword</option>
        font-weight: bold;
                <option value="2">Runed Sword</option>
        border-radius: 5px;
                <option value="3">Slayer of Destruction</option>
        border: 1px solid black;
                <option value="1">Shiny Blade</option>
    }
                <option value="2">Soulcutter</option>
    .imbument-tool-search-box {
                <option value="3">Soulshredder</option>
        margin-top: 5px;
                <option value="2">Spike Sword</option>
        width: 100%;
                <option value="2">Sword</option>
        display: flex;
                <option value="2">Summerblade</option>
    }
                <option value="2">Tagralt Blade</option>
    .imbument-tool-search-box > input {
                <option value="3">Thaian Sword</option>
        width: calc(100% - 25px);
                <option value="2">The Avenger</option>
        height: 28px;
                <option value="1">The Epiphany</option>
        border: 1px solid black;
                <option value="3">Twiceslicer</option>
        border-bottom-left-radius: 5px;
                <option value="3">Twin Hooks</option>
        border-top-left-radius: 5px;
                <option value="1">Umbral Blade</option>
    }
                <option value="1">Umbral Masterblade</option>
    .imbument-tool-search-box > div {
                <option value="2">Umbral Master Slayer</option>
        width: 25px;
                <option value="1">Umbral Slayer</option>
        height: 30px;
                <option value="2">Winterblade</option>
        background-color: white;
                <option value="2">Wyvern Fang</option>
        border-left: none;
                <option value="2">Zaoan Sword</option>
        border-right: 1px solid black;
              </select>
        border-top: 1px solid black;
            </td>
        border-bottom: 1px solid black;
            <td class="no" id="machados" style="width:41%;">Item:
        border-bottom-right-radius: 5px;
              <select id="itemcat5">
        border-top-right-radius: 5px;
                <option value="none"></option>
        align-content: center;
                <option value="3">Axe of Destruction</option>
        text-align: center;
                <option value="2">Barbarian Axe</option>
    }
                <option value="2">Beastslayer Axe</option>
    .imbument-tool-imbuements-panel {
                <option value="2">Butcher's Axe</option>
        display: block;
                <option value="3">Chopper of Destruction</option>
        width: calc(100% - 330px);
                <option value="2">Cobra Axe</option>
        padding: 5px;
                <option value="1">Crystalline Axe</option>
    }
                <option value="2">Demonwing Axe</option>
    .imbument-tool-items {
                <option value="3">Dragon Lance</option>
        width: 100%;
                <option value="3">Drakinata</option>
        margin-top: 15px;
                <option value="2">Dreaded Cleaver</option>
    }
                <option value="2">Dwarven Axe</option>
    .imbument-tool-items-data-box {
                <option value="2">Executioner</option>
        display: flex;
                <option value="2">Falcon Battleaxe</option>
    }
                <option value="2">Great Axe</option>
    .imbument-tool-items-data-box > .imbument-tool-items-data-image-box {
                <option value="3">Guardian Halberd</option>
        width: 50px;
                <option value="3">Headchopper</option>
        height: 50px;
                <option value="1">Hellforged Axe</option>
        background-color: white;
                <option value="2">Heroic Axe</option>
        border: 1px solid black;
                <option value="2">Hive Scythe</option>
        border-radius: 5px;
                <option value="2">Impaler</option>
        align-content: center;
                <option value="2">Knight Axe</option>
        text-align: center;
                <option value="2">Lion Axe</option>
    }
                <option value="2">Mythril Axe</option>
    .imbument-tool-items-data-box-data {
                <option value="2">Noble Axe</option>
        margin-left: 5px;
                <option value="2">Phantasmal Axe</option>
    }
                <option value="3">Ravager's Axe</option>
    .imbument-tool-items-data-box-data > label {
                <option value="3">Rift Lance</option>
        width: 100%;
                <option value="2">Royal Axe</option>
        display: block;
                <option value="2">Ruthless Axe</option>
        margin-bottom: 7px;
                <option value="1">Solar Axe</option>
        font-weight: bold;
                <option value="2">Soulbiter Axe</option>
        font-size: 15px;
                <option value="2">Souleater (Axe)</option>
        text-align: left;
                <option value="1">Stonecutter Axe</option>
    }
                <option value="1">Throwing Axe</option>
    .imbument-tool-divisor-line {
                <option value="3">Twin Axe</option>
        display: flex;
                <option value="1">Umbral Axe</option>
        flex-flow: row wrap;
                <option value="1">Umbral Chopper</option>
        justify-content: center;
                <option value="1">Umbral Master Axe</option>
        align-items: center;
                <option value="2">Umbral Master Chopper</option>
        gap: 0.5rem;
                <option value="2">Warrior's Axe</option>
        border-bottom: 1px solid black;
                <option value="3">Zaoan Halberd</option>
        padding: 0.25rem;
              </select>
        width: calc(100% - 15px);
            </td>
    }
            <td class="no" id="clavas" style="width:41%;">Item:
 
              <select id="itemcat6">
    .imbument-tool-version-label {
                <option value="none"></option>
        font-size: 14px;
                <option value="3">Abyss Hammer</option>
        font-weight: bold;
                <option value="3">Amber Staff</option>
        text-align: center;
                <option value="2">Arcane Staff</option>
        display: block;
                <option value="2">Blessed Sceptre</option>
        position: absolute;
                <option value="2">Clerical Mace</option>
        top: 5px;
                <option value="2">Cobra Club</option>
        left: 5px;
                <option value="2">Cranial Basher</option>
        color: white;
                <option value="2">Crystal Mace</option>
    }
                <option value="2">Deepling Squelcher</option>
    #imbument-tool-items-container {
                <option value="2">Demonbone</option>
        display: block;
                <option value="2">Dragonbone Staff</option>
    }
                <option value="2">Falcon Mace</option>
 
                <option value="2">Glooth Whip</option>
    .imbument-tool-imbuements-level-box {
                <option value="3">Hammer of Destruction</option>
        width: 100%;
                <option value="3">Hammer of Wrath</option>
    }
                <option value="3">Heavy Mace</option>
    .imbument-tool-imbuements-level-box > h2 {
                <option value="2">Jungle Flail</option>
        width: 100%;
                <option value="2">Life Preserver</option>
        text-align: center;
                <option value="2">Lion Hammer</option>
        font-family: Verdana, Arial, Times New Roman, sans-serif;
                <option value="3">Lunar Staff</option>
        font-weight: bold;
                <option value="3">Mace of Destruction</option>
        border: none;
                <option value="1">Maimer</option>
    }
                <option value="1">Mortal Mace</option>
    .imbuement-tool-level-list {
                <option value="1">Mycological Mace</option>
        display: flex;
                <option value="1">Obsidian Truncheon</option>
        width: 100%;
                <option value="2">Onyx Flail</option>
        justify-content: center;
                <option value="2">Orcish Maul</option>
        align-items: center;
                <option value="2">Ornate Mace</option>
    }
                <option value="2">Resizer</option>
 
                <option value="2">Soulcrusher</option>
    .imbuement-tool-level-list-item {
                <option value="3">Soulmaimer</option>
        display: flex;
                <option value="2">Queen's Sceptre</option>
        width: 100px;
                <option value="2">Sapphire Hammer</option>
        height: 50px;
                <option value="2">Shadow Sceptre</option>
        margin: 5px;
                <option value="2">Silver Mace</option>
        flex-shrink: 0;
                <option value="2">Skull Staff</option>
        align-content: center;
                <option value="2">Skullcrusher</option>
        text-align: center;
                <option value="2">Snake God's Sceptre</option>
        border-radius: 5px;
                <option value="3">Spiked Squelcher</option>
        border: 1px solid black;
                <option value="2">The Stomper</option>
        justify-content: center;
                <option value="2">Thunder Hammer</option>
        align-items: center;
                <option value="1">Umbral Hammer</option>
    }
                <option value="1">Umbral Mace</option>
    .imbuement-tool-level-list-item:hover {
                <option value="2">Umbral Master Hammer</option>
        background-color: #c04e2b;
                <option value="1">Umbral Master Mace</option>
    }
                <option value="3">War Hammer</option>
    .imbuement-tool-level-list-item.selected {
              </select>
        background-color: #c7451d;
            </td>
    }
            <td class="no" id="capacetes" style="width:44%;">Item:
    .imbuement-tool-level-list-item > label {
              <select id="itemcat7">
        font-weight: bold;
                <option value="none"></option>
        flex-shrink: 0;
                <option value="2">Amazon Helmet</option>
        margin-right: 5px;
                <option value="2">Ancient Tiara</option>
    }
                <option id="mage" value="1">Batwing Hat</option>
    .imbuement-tool-level-list-item > div {
                <option value="2">Bonelord Helmet</option>
        font-weight: bold;
                <option value="1">Chain Helmet</option>
        flex-shrink: 0;
                <option value="2">Cobra Hood</option>
    }
                <option value="2">Crown Helmet</option>
    .imbuement-tool-level-list-item-level {
                <option value="2">Crusader Helmet</option>
        display: flex;
                <option value="2">Dark Whispers</option>
        justify-content: center;
                <option value="2">Demon Helmet</option>
        align-items: center;
                <option value="2">Dwarven Helmet</option>
    }
<option value="1">Elite Draken Helmet</option>
    .imbuement-tool-level-list-item-level > img {
                <option value="2">Falcon Circlet</option>
        flex-shrink: 0;
                <option id="mage" value="2">Falcon Coif</option>
        width: 10px;
                <option value="2">Fur Cap</option>
        scale: 150%;
                <option id="mage" value="2">Galea Mortis</option>
    }
                <option id="mage" value="2">Gnome Helmet</option>
 
                <option value="2">Golden Helmet</option>
    .imbument-tool-imbuements-data-box {
                <option value="2">Golden Helmet</option>
        width: 100%;
                <option id="mage" value="1">Hat of the Mad</option>
        min-height: 140px;
                <option value="2">Helmet of Nature</option>
        display: block;
                <option value="2">Helmet of The Lost</option>
    }
                <option value="2">Helmet of Ultimate Terror</option>
    .imbument-tool-imbuements-data-box > h2, .imbument-tool-imbuements-data-box > h3 {
                <option id="mage" value="1">Jade Hat</option>
        width: 100%;
                <option value="2">Lion Spangenhelm</option>
        text-align: center;
                <option id="mage" value="2">Mage Hat</option>
        align-content: center;
                <option value="2">Magician Hat</option>
        font-family: Verdana, Arial, Times New Roman, sans-serif;
                <option value="2">Odd Hat</option>
        font-weight: bold;
                <option value="2">Royal Helmet</option>
        border: none;
                <option value="2">Shamanic Mask</option>
    }
                <option value="2">Skull Helmet</option>
    .imbuement-tool-data-table {
                <option value="2">Terra Helmet</option>
        display: block;
                <option value="2">Visage of the End Days</option>
        width: 100%;
                <option value="2">Warrior Helmet</option>
        max-height: 200px;
                <option id="mage" value="1">Witch Hat</option>
        overflow-y: auto;
                <option id="mage" value="1">Yalahari Mask</option>
    }
                <option value="1">Zaoan Helmet</option>
    .imbuement-tool-data-table-line {
              </select>
        display: block;
            </td>
        width: 100%;
            <td class="no" id="wandserods" style="width:42%;">Item:
    }
              <select id="itemcat8">
    .imbuement-tool-data-list {
                <option value="none"></option>
        width: 100%;
                <option id="strike" value="2">Cobra Rod</option>
        display: flex;
                <option value="2">Cobra Wand</option>
        justify-content: center;
                <option value="2">Deepling Ceremonial Dagger</option>
        align-items: center;
                <option value="2">Deepling Fork</option>
    }
                <option value="2">Dream Blossom Staff</option>
    .imbuement-tool-data-list-item {
                <option value="2">Energized Limb</option>
        width: 64px;
                <option id="strike" value="2">Falcon Rod</option>
        height: 64px;
                <option id="strike" value="2">Falcon Wand</option>
        margin: 5px;
                <option value="2">Jungle Rod</option>
        border-radius: 5px;
                <option value="2">Jungle Wand</option>
        /* border: 2px solid black; */
                <option value="2">Lion Rod</option>
    }
                <option id="strike" value="2">Lion Wand</option>
    .imbuement-tool-data-list-item.selected {
                <option value="2">Northwind Rod</option>
        width: 66px;
                <option value="2">Ogre Scepta</option>
        height: 66px;
                <option id="strike" value="2">Rod of Destruction</option>
        filter: brightness(1.75);
                <option id="strike" value="2">Soulhexer</option>
        border: 0.15rem solid chocolate;
                <option id="strike" value="2">Soultainter</option>
    }
                <option value="2">Underworld Rod</option>
    .imbuement-tool-data-list-item.selected > img {
                <option id="strike" value="2">Wand of Destruction</option>
        border-radius: 2px;
                <option value="2">Wand of Draconia</option>
    }
                <option value="2">Wand of Dragonbreath</option>
    .imbuement-tool-data-list-item > img {
                <option value="2">Wand of Starstorm</option>
        width: 100%;
                <option value="2">Wand of Voodoo</option>
        scale: 100%;
              </select>
        border-radius: 5px;
            </td>
    }
            <td class="no" id="distancias" style="width:42%;">Item:
    .imbuement-tool-data-list-item:hover {
              <select id="itemcat9">
        width: 66px;
                <option value="none"></option>
        height: 66px;
                <option value="3">Bow&nbsp;of&nbsp;Cataclysm</option>
        filter: brightness(1.25);
                <option value="3">Bow of Destruction</option>
    }
                <option value="3">Chain Bolter</option>
    .imbuement-tool-list-items {
                <option value="2">Cobra&nbsp;Crossbow</option>
        width: 100%;
                <option value="3">Composite Hornbow</option>
        display: flex;
                <option value="3">Crossbow</option>
        justify-content: center;
                <option value="3">Crossbow of Destruction</option>
        align-items: center;
                <option value="3">Elvish Bow</option>
    }
                <option value="3">Falcon Bow</option>
    .imbuement-tool-list-items-box {
                <option value="3">Hive Bow</option>
        background-color: #f3f3f3;
                <option value="3">Icicle Bow</option>
        margin: 5px;
                <option value="2">Jungle Bow</option>
        width: 64px;
                <option value="3">Lion&nbsp;Longbow</option>
        height: 64px;
                <option value="3">Living&nbsp;Vine&nbsp;Bow</option>
        border: 1px solid black;
                <option value="3">Modified Crossbow</option>
        border-radius: 5px;
                <option value="3">Musician's Bow</option>
        display: block;
                <option value="3">Mycological Bow</option>
        flex-shrink: 0;
                <option value="3">Rift Bow</option>
        text-align: center;
                <option value="3">Rift Crossbow</option>
        align-content: center;
                <option value="3">Royal Crossbow</option>
    }
                <option value="3">Silkweaver Bow</option>
    .imbuement-tool-list-items-box > div {
                <option value="3">Soulbleeder</option>
        width: 100%;
                <option value="2">Soulpiercer</option>
        height: 44px;
                <option value="3">The Devileye</option>
        text-align: center;
                <option value="3">The Ironworker</option>
        align-content: center;
                <option value="3">Thorn Spitter</option>
    }
                <option value="3">Triple Bolt Crossbow</option>
    .imbuement-tool-list-items-box > div > img {
                <option value="1">Umbral Bow</option>
        width: 32px;
                <option value="1">Umbral Crossbow</option>
    }
                <option value="2">Umbral Master Bow</option>
    .imbuement-tool-list-items-box > label {
                <option value="2">Umbral Master Crossbow</option>
        display: block;
                <option value="3">Warsinger Bow</option>
        font-weight: bold;
              </select>
        color: white;
            </td>
        width: 100%;
            <td class="no" id="spellbooks" style="width:46%;">Item:
        height: 20px;
              <select id="itemcat10">
        text-align: center;
                <option value="none"></option>
        align-content: center;
                <option value="1">Book of Lies</option>
        border-top: 1px solid black;
                <option value="1">Brain in a Jar</option>
        background-color: #c7451d;
                <option value="1">Depth Scutum</option>
        border-bottom-left-radius: 5px;
                <option value="1">Lion Spellbook</option>
        border-bottom-right-radius: 5px;
                <option value="1">Shoulder Plate</option>
    }
                <option value="1">Spellbook</option>
 
                <option value="1">Spellbook of Enlightenment</option>
    .imbuement-tool-prices {
                <option value="1">Spellbook of Warding</option>
        width: 100%;
                <option value="1">Spirit Guide</option>
        display: flex;
                <option value="1">Umbral Master Spellbook</option>
        justify-content: center;
                <option value="1">Umbral Spellbook</option>
        align-items: center;
                <option value="1">Wooden Spellbook</option>
    }
              </select>
 
            </td>
    .imbuement-tool-prices-items {
            <td class="no" id="backpacks" style="width:46%;">Item:
        width: 50%;
              <select id="itemcat11">
        margin-left: 10px;
                <option value="none"></option>
        display: block;
                <option value="1">Anniversary Backpack</option>
        flex-shrink: 0;
                <option value="1">Backpack</option>
    }
                <option value="1">Backpack of Holding</option>
 
                <option value="1">Beach Backpack</option>
    .imbuement-tool-prices-items-box {
                <option value="1">Birthday Backpack</option>
        width: 100%;
                <option value="1">Blue Backpack</option>
        height: 55px;
                <option value="1">Book Backpack</option>
        display: flex;
                <option value="1">Brocade Backpack</option>
        justify-content: center;
                <option value="1">Buggy Backpack</option>
        align-items: center;
                <option value="1">Cake Backpack</option>
    }
                <option value="1">Camouflage Backpack</option>
 
                <option value="1">Crown Backpack</option>
    .imbuement-tool-prices-items-box > a {
                <option value="1">Crystal Backpack</option>
        height: 100%;
                <option value="1">Deepling Backpack</option>
        text-align: center;
                <option value="1">Demon Backpack</option>
        align-content: end;
                <option value="1">Dragon Backpack</option>
    }
                <option value="1">Energetic Backpack</option>
    .imbuement-tool-prices-items-box > a > img {
                <option value="1">Expedition Backpack</option>
        width: 32px;
                <option value="1">Feedbag</option>
        border: 1px solid black;
                <option value="1">Festive&nbsp;Backpack</option>
        border-radius: 5px;
                <option value="1">Fur Backpack</option>
    }
                <option value="1">Glooth Backpack</option>
    .imbuement-tool-prices-items-box > div {
                <option value="1">Golden Backpack</option>
        height: 40px;
                <option value="1">Ghost&nbsp;Backpack</option>
      margin: 0px 5px 0px 5px;   
                <option value="1">Green Backpack</option>
    }
                <option value="1">Grey Backpack</option>
    .imbuement-tool-prices-items-box > div > label {
                <option value="1">Heart Backpack</option>
        font-weight: bold;
                <option value="1">Jewelled Backpack</option>
        font-size: 10px;
                <option value="1">Minotaur Backpack</option>
        white-space: nowrap;
                <option value="1">Moon Backpack</option>
        overflow: hidden;
                <option value="1">Mushroom Backpack</option>
        text-overflow: ellipsis;
                <option value="1">Old and Used Backpack</option>
    }
                <option value="1">Orange Backpack</option>
    .imbuement-tool-prices-items-box > div > input {
                <option value="1">Pannier Backpack</option>
        width: 90%;
                <option value="1">Pillow Backpack</option>
        text-align: center;
                <option value="1">Pirate Backpack</option>
        border: 1px solid black;
                <option value="1">Purple Backpack</option>
        border-radius: 3px;
                <option value="1">Raccoon Backpack</option>
        height: 23px;
                <option value="1">Red Backpack</option>
    }
                <option value="1">Santa Backpack</option>
 
                <option value="1">Winged&nbsp;Backpack</option>
    .imbuement-tool-prices-taxas-info {
                <option value="1">Wolf Backpack</option>
        width: 50%;
                <option value="1">Yellow Backpack</option>
        min-height: 200px;
              </select>
        padding: 5px;
            </td>
        border-left: 1px solid black;
            <td style="width:10%;"><span class="no" id="slots">Slots: 1</span> </td>
        display: block;
            <td> <span class="itemimg"><img src="./Imbuement Tool - Tibia Wiki_files/Trans.gif" id="imagem" align="right"></span> </td>
        flex-shrink: 0;
          </tr>
    }
        </table>
 
      </td>
    .imbuement-tool-prices-taxas-info > h3 {
    </tr>
        width: 100%;
    <tr>
        margin: 0px 0px 15px 0px;
      <td style="height: 30px;" colspan="2">
        text-align: center;
        <div class="titulo">Opções para Imbuir</div>
        align-content: center;
      </td>
    }
    </tr>
    .imbuement-tool-prices-taxas-info > div {
    <tr>
        width: 100%;
      <td style="vertical-align: top; height: 127px;">
        display: block;
        <table>
        margin-top: 5px;
          <tr style="height:104px">
    }
            <td>
    .imbuement-tool-prices-taxas-info > label {
              <table class="tabela_opcoes">
        display: block;
                <tr>
        width: 100%;
                  <td>
        height: 20px;
                    <select id="elemento" multiple="" style="overflow:hidden;">
        margin-top: 5px;
                      <option id="msg" class="">Selecione uma categoria...</option>
        font-weight: bold;
                      <option class="no" id="msg3">Selecione um item...</option>
        text-align: left;
                      <option class="no" id="deathd">Aumento do dano de Death</option>
    }
                      <option class="no" id="earthd">Aumento do dano de Earth</option>
    .imbuement-tool-prices-taxas-info > div > label {
                      <option class="no" id="fired">Aumento do dano de Fire</option>
        display: block;
                      <option class="no" id="iced">Aumento do dano de Ice</option>
        width: 100%;
                      <option class="no" id="energyd">Aumento do dano de Energy</option>
        height: 20px;
                      <option class="no" id="holyd">Aumento do dano de Holy</option>
        font-weight: bold;
                      <option class="no" id="life">Life Leech</option>
        text-align: left;
                      <option class="no" id="mana">Mana Leech</option>
    }
                      <option class="no" id="critical">Hit Crítico</option>
 
                      <option class="no" id="deathp">Redução no dano de Death</option>
    .mg-top-35px {
                      <option class="no" id="earthp">Redução no dano de Earth</option>
        margin-top: 35px;
                      <option class="no" id="firep">Redução no dano de Fire</option>
    }
                      <option class="no" id="icep">Redução no dano de Ice</option>
    .label {
                      <option class="no" id="energyp">Redução no dano de Energy</option>
        font-weight: bold;
                      <option class="no" id="holyp">Redução no dano de Holy</option>
        font-size: 15px;
                      <option class="no" id="axe">Aumento de Axe Fighting</option>
    }
                      <option class="no" id="sword">Aumento de Sword Fighting</option>
    /* Extra small devices (phones, less than 576px) */
                      <option class="no" id="club">Aumento de Club Fighting</option>
    @media (max-width: 575.98px) {
                      <option class="no" id="distance">Aumento de Distance Fighting</option>
        .imbuement-tool-panel {
                      <option class="no" id="shield">Aumento de Shielding</option>
            width: calc(100% - 5px);
                      <option class="no" id="magic">Aumento de Magic Level</option>
            display: block;
                      <option class="no" id="speed">Aumento de Speed</option>
                      <option class="no" id="vibrancy">Remoção de Paralisia</option>
                      <option class="no" id="capacity">Aumento de Capacidade</option>
                    </select>
                  </td>
                </tr>
              </table>
            </td>
            <td>
              <table class="tabela_opcoes">
                <tr>
                  <td>
                    <select id="tipo" multiple="multiple" style="overflow:hidden;">
                      <option id="msg1" class="">Selecione uma categoria...</option>
                      <option class="no" id="msg2">Selecione um item...</option>
                      <option class="no" id="basic">Basic Lich Shroud</option>
                      <option class="no" id="intricate">Intricate Lich Shroud (premium)</option>
                      <option class="no" id="powerful">Powerful Lich Shroud (premium)</option>
                    </select>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td colspan="2">
              <span class="no" id="boost">Aumenta sua habilidade em <span id="skill"></span> by <span id="skillval">1</span>.</span>
              <span class="no" id="damage">Converte <span id="damageval">10%</span> de dano físico para <span id="damages"></span> dan..</span>
              <span class="no" id="boost">Aumenta sua habilidade <span id="skill"></span> by <span id="skillval">1</span>.</span>
              <span class="no" id="damage">Converte <span id="damageval">10%</span> de dano físico para <span id="damages"></span> dan..</span>
              <span class="no" id="lleech">Converte <span id="lifeval">35%</span> do dano para hit points com chance de 50%.</span>
              <span class="no" id="protect">Reduz <span id="damages2"></span> dano <span id="protectval">3%</span>.</span>
              <span class="no" id="protectdeath">Reduz dano de death em <span id="protectdeathval">2%</span>.</span>
              <span class="no" id="mleech">Converte <span id="manaval">10%</span> do dano para mana com chance de 30%.</span>
              <span class="no" id="chit">Dano extra de crítico: <span id="criticalval">15%</span>.Chance de acerto crítico: 10%.</span>
              <span class="no" id="paralisia">Chance de remover paralisia em <span id="vibrval">15%</span>.</span>
              <span class="no" id="velocidade">Aumenta sua velocidade em <span id="speedval">10%</span>.</span>
              <span class="no" id="capacidade">Aumenta sua capacidade em <span id="capval">3%</span>.</span>
              <br> Dura por 20h 0min enquanto equipado </td>
          </tr>
          <tr>
            <td> Requer as seguintes fontes astrais: </td>
            <td valign="bottom" style="text-align:right;"> Taxa de sucesso: <span id="chance" style="color: rgb(178, 168, 152);">0%</span><span class="no" id="chancecharm" style="color:green;">100%</span>
              <br> </td>
          </tr>
        </table>
    </td></tr>
    <tr>
      <td colspan="2">
        <table style="width:100%;">
          <tr>
            <td style="width:18%;">
              <div class="source1"><span class="tooltip"><img src="./Imbuement Tool - Tibia Wiki_files/Trans.gif"></span><span class="tip2" id="fonte1" style="display: none;"></span></div>
            </td>
            <td style="width:18%;">
              <div class="source2"><span class="tooltip"><img src="./Imbuement Tool - Tibia Wiki_files/Trans.gif"></span><span class="tip2" id="fonte2" style="display:none"></span></div>
            </td>
            <td style="width:17%;">
              <div class="source3"><span class="tooltip"><img src="./Imbuement Tool - Tibia Wiki_files/Trans.gif"></span><span class="tip2" id="fonte3" style="display:none"></span></div>
            </td>
            <td style="width:25%;">
              <div style="margin:0 auto;width:137px;">
                <div id="charmoff" style="height:22px" class="">Protection Charm</div>
                <div class="no" id="charm" style="height:22px;">Protection Charm</div>
              </div>
            </td>
            <td style="text-align:center;"> Custo total: </td>
          </tr>
          <tr>
            <td class="titulo"> <span id="source1">0</span> </td>
            <td class="titulo"> <span id="source2">0</span> </td>
            <td class="titulo"> <span id="source3">0</span> </td>
            <td class="titulo"> <span id="preco">0</span> gps </td>
            <td class="titulo"> <span id="total">0</span><span class="no" id="totalcharm">15,000</span> gps </td>
          </tr>
        </table>
      </td>
      <td>
    </td></tr>
  </table>
</div><div class="imbuing_js"><script type="text/javascript">$(document).ready(function() {
    $("#categoria").change(function() {
      var cat = $("#categoria").children("option").filter(":selected").val();
      var itemcat = '#itemcat' + $(this).val();
      if (cat == '1') {
        $('#armaduras, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#escudos, #backpacks, #botas, #espadas, #machados, #clavas, #capacetes, #wandserods, #distancias, #spellbooks, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '2') {
        $('#escudos, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #backpacks, #botas, #espadas, #machados, #clavas, #capacetes, #wandserods, #distancias, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '3') {
        $('#botas, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #escudos, #backpacks, #espadas, #machados, #clavas, #capacetes, #wandserods, #distancias, #spellbooks, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '4') {
        $('#espadas, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #escudos, #backpacks, #botas, #machados, #clavas, #capacetes, #wandserods, #distancias, #spellbooks, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '5') {
        $('#machados, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #escudos, #backpacks, #botas, #espadas, #clavas, #capacetes, #wandserods, #distancias, #spellbooks, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '6') {
        $('#clavas, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #escudos, #backpacks, #botas, #espadas, #machados, #capacetes, #wandserods, #distancias, #spellbooks, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '7') {
        $('#capacetes, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #escudos, #backpacks, #botas, #espadas, #machados, #clavas, #wandserods, #distancias, #spellbooks, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '8') {
        $('#wandserods, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #escudos, #backpacks, #botas, #espadas, #machados, #clavas, #capacetes, #distancias, #spellbooks, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '9') {
        $('#distancias, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #escudos, #backpacks, #botas, #espadas, #machados, #clavas, #capacetes, #wandserods, #spellbooks, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '10') {
        $('#spellbooks, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #backpacks, #botas, #espadas, #machados, #clavas, #capacetes, #wandserods, #distancias, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == '11') {
        $('#backpacks, #msg2, #msg3, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #botas, #escudos, #espadas, #machados, #clavas, #capacetes, #wandserods, #spellbooks, #distancias, #msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
      } else if (cat == 'nenhum') {
        $('#msg, #msg1, #charmoff, #chance, #total').removeClass("no");
        $('#armaduras, #escudos, #backpacks, #botas, #espadas, #machados, #clavas, #capacetes, #wandserods, #distancias, #spellbooks, #msg2, #msg3, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm').addClass("no");
        $('#elemento').css({
          "overflow": "hidden"
        });
      }
      $(itemcat).change(function() {
        var setimg = $(itemcat).children("option").filter(":selected").text();
        var slot = $(itemcat).children("option").filter(":selected").val();
        $(".itemimg img").attr("src", "https://www.tibiawiki.com.br/wiki/Especial:Redirecionar/file/" + setimg + ".gif");
        $('#slots').removeClass("no").text('Slots: ' + slot);
        $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        $('#source2, #source3').text('0');
        $("#tipo").children("option[id='basic']").prop('selected', true);
        $("#tipo").children("option[id='intricate']").prop('selected', false);
        $("#tipo").children("option[id='powerful']").prop('selected', false);
        $('#chance').text('90%').css({
          "color": "#B2A898"
        });
        $('#skillval').text('1');
        $('#damageval').text('10%');
        $('#lifeval').text('35%');
        $('#protectval').text('3%');
        $('#manaval').text('10%');
        $('#criticalval').text('15%');
        $('#speedval').text('10%');
        $('#vibrval').text('15%');
        $('#capval').text('3%');
        $('#preco').text('10,000');
        $('#total').text('5,000');
        $('#totalcharm').text('15,000');
        $('#fonte2').css({
          "display": "none"
        });
        $('#fonte3').css({
          "display": "none"
        });
        if (slot == "none") {
          $(".itemimg img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#msg2, #msg3, #charmoff').removeClass("no");
          $('#msg, #msg1, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #holyd, #axe, #sword, #club, #distance, #shield, #magic, #speed, #vibrancy, #life, #mana, #critical, #basic, #intricate, #powerful, #charm, #totalcharm, #chancecharm, #slots, #boost, #damage, #lleech, #protect, #mleech, #chit, #velocidade, #paralisia, #capacidade, #capval').addClass("no");
          $('#elemento').css({
            "overflow": "hidden"
          });
          $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source1').text('0');
          $('#preco').text('0');
          $('#total').text('0');
          $('#chance').text('0%').css({
            "color": "#B2A898"
          });
        } else if (cat == '2') {
          $('#shield, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#life, #deathd, #earthd, #fired, #iced, #energyd, #axe, #sword, #club, #distance, #magic, #capacity, #speed, #vibrancy, #mana, #critical, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '1') {
          $('#life, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathd, #earthd, #fired, #iced, #energyd, #axe, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #mana, #critical, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '3') {
          $('#speed, #vibrancy, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #axe, #sword, #club, #distance, #shield, #magic, #life, #mana, #capacity, #critical, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '7') {
          $('#mana, #axe, #sword, #club, #distance, #shield, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #magic, #speed, #vibrancy, #life, #capacity, #critical, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '6') {
          $('#deathd, #earthd, #fired, #iced, #energyd, #life, #mana, #critical, #club, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathp, #earthp, #firep, #icep, #energyp, #holyp, #axe, #sword, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '9') {
          $('#life, #mana, #critical, #distance, #basic, #intricate, #powerful, #charm, #deathd, #earthd, #fired, #iced, #energyd').removeClass("no");
          $('#deathp, #earthp, #firep, #icep, #energyp, #holyp, #axe, #sword, #club, #shield, #magic, #capacity, #speed, #vibrancy, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '4') {
          $('#deathd, #earthd, #fired, #iced, #energyd, #sword, #life, #mana, #critical, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathp, #earthp, #firep, #icep, #energyp, #holyp, #axe, #club, #distance, #shield, #magic, #capacity, #speed, #vibrancy, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '5') {
          $('#deathd, #earthd, #fired, #iced, #energyd, #axe, #life, #mana, #critical, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathp, #earthp, #firep, #icep, #energyp, #holyp, #sword, #club, #distance, #shield, #magic, #capacity, #speed, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '10') {
          $('#shield, #deathp, #earthp, #firep, #icep, #energyp, #holyp, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathd, #earthd, #fired, #life, #iced, #energyd, #axe, #sword, #club, #distance, #magic, #speed, #vibrancy, #mana, #capacity, #critical, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '8') {
          $('#life, #mana, #magic, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #axe, #sword, #club, #distance, #shield, #speed, #vibrancy, #capacity, #critical, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == '11') {
          $('#capacity, #basic, #intricate, #powerful, #charm').removeClass("no");
          $('#deathp, #earthp, #firep, #icep, #energyp, #holyp, #deathd, #earthd, #fired, #iced, #energyd, #axe, #sword, #club, #distance, #shield, #speed, #vibrancy, #mana, #magic, #critical, #msg2, #msg3, #charmoff, #totalcharm, #chancecharm').addClass("no");
          $('#elemento').removeAttr("style");
        } else if (cat == 'nenhum') {
          $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".itemimg img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source1, #source2, #source3').text('0');
          $('#slots').addClass("no");
         }
         }
      });
 
      $("#itemcat7").change(function() {
        .imbument-tool-menu-side {
        var item = $("#itemcat7").children("option").filter(":selected").attr("id");
            width: calc(100% - 10px);
        if (item == 'mage') {
            border-top-left-radius: 3px;
          $('#magic').removeClass("no");
            border-top-right-radius: 3px;
        } else {
          $('#magic').addClass("no");
         }
         }
      });
 
      $("#itemcat8").change(function() {
        .imbument-tool-imbuements-panel {
        var item = $("#itemcat8").children("option").filter(":selected").attr("id");
            width: 100%;
        if (item == 'strike') {
          $('#critical').removeClass("no");
        } else {
          $('#critical').addClass("no");
         }
         }
      });
 
      $("#itemcat1, #itemcat2, #itemcat3, #itemcat4, #itemcat5, #itemcat6, #itemcat7, #itemcat8, #itemcat9, #itemcat10, #itemcat11").children("option[value='none']").prop('selected', true);
         .imbuement-tool-prices {
      $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
            display: block;
      $('#source1').text('0');
      $('#fonte1').text('');
      $(".itemimg img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
      $('#slots, #boost, #damage, #lleech, #protect, #mleech, #chit, #velocidade, #paralisia, #capacidade').addClass("no");
      $('#preco').text('0');
      $('#total').text('0');
      $('#chance').text('0%').css({
         "color": "#B2A898"
      });
      $("#itemcat1, #itemcat2, #itemcat3, #itemcat4, #itemcat5, #itemcat6, #itemcat7, #itemcat8, #itemcat9, #itemcat10, #itemcat11").children("option[value='none']").prop('selected', true);
      $('#fonte1').css({
        "display": "none"
      });
    });
    $("#elemento, #tipo").change(function() {
      var tipo = $("#tipo").children("option").filter(":selected").attr("id");
      var ele = $("#elemento").children("option").filter(":selected").attr("id");
      if (ele == 'deathd') {
        $('#damage').removeClass("no");
        $('#boost, #lleech, #protect, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
        $('#damages').text('death');
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/6/65/Pile_of_Grave_Earth.gif");
        $('#source1').text('25');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Pile_of_Grave_Earth" target="_blank">Pile of Grave Earth</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
         }
         }
         if (tipo == 'intricate') {
         .imbuement-tool-prices-items, .imbuement-tool-prices-taxas-info {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/8/8f/Demonic_Skeletal_Hand.gif");
            width: calc(100% - 20px);
          $('#source2').text('20');
            border-left: none;
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Demonic_Skeletal_Hand" target="_blank">Demonic Skeletal Hand</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source3').text('0');
        } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/8/8f/Demonic_Skeletal_Hand.gif");
          $('#source2').text('20');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Demonic_Skeletal_Hand" target="_blank">Demonic Skeletal Hand</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/0/0f/Petrified_Scream.gif");
          $('#source3').text('5');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Petrified_Scream" target="_blank">Petrified Scream</a>');
         }
         }
      } else if (ele == 'earthd') {
         .imbuement-tool-data-list-item, .imbuement-tool-data-list-item.selected {
         $('#damage').removeClass("no");
            height: 100%;
        $('#boost, #lleech, #protect, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
        $('#damages').text('earth');
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/6/6f/Swamp_Grass.gif");
        $('#source1').text('25');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Swamp_Grass" target="_blank">Swamp Grass</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
         }
         }
        if (tipo == 'intricate') {
    }
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/b/b9/Poisonous_Slime.gif");
</pre>
          $('#source2').text('20');
 
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Poisonous_Slime" target="_blank">Poisonous Slime</a>');
<pre id="imbuing_js">
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
const version = "3.0.1";
          $('#source3').text('0');
    var categories = new Object();
        } else if (tipo == 'powerful') {
    var selectedImbuementLevel = "";
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/b/b9/Poisonous_Slime.gif");
    var imbuementScrolls = {
          $('#source2').text('20');
        "Blank Imbuement Scroll": {
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Poisonous_Slime" target="_blank">Poisonous Slime</a>');
            "slots": 1,
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/6/65/Slime_Heart.gif");
            "imbuements": {
          $('#source3').text('2');
                "Vampirism": ["Intricate", "Powerful"],
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Slime_Heart" target="_blank">Slime Heart</a>');
                "Void": ["Intricate", "Powerful"],
                "Strike": ["Intricate", "Powerful"],
                "Featherweight": ["Intricate", "Powerful"],
                "Swiftness": ["Intricate", "Powerful"],
                "Vibrancy": ["Intricate", "Powerful"],
                "Reap": ["Intricate", "Powerful"],
                "Venom": ["Intricate", "Powerful"],
                "Scorch": ["Intricate", "Powerful"],
                "Frost": ["Intricate", "Powerful"],
                "Electrify": ["Intricate", "Powerful"],
                "Cloud Fabric": ["Intricate", "Powerful"],
                "Demon Presence": ["Intricate", "Powerful"],
                "Dragon Hide": ["Intricate", "Powerful"],
                "Lich Shroud": ["Intricate", "Powerful"],
                "Quara Scale": ["Intricate", "Powerful"],
                "Snake Skin": ["Intricate", "Powerful"],
                "Bash": ["Intricate", "Powerful"],
                "Blockade": ["Intricate", "Powerful"],
                "Chop": ["Intricate", "Powerful"],
                "Epiphany": ["Intricate", "Powerful"],
                "Precision": ["Intricate", "Powerful"],
                "Slash": ["Intricate", "Powerful"],
                "Punch": ["Intricate", "Powerful"]
            }
         }
         }
      } else if (ele == 'fired') {
    }
         $('#damage').removeClass("no");
    var goldToken = {
         $('#boost, #lleech, #protect, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
        "name": "Gold Token",
        $('#damages').text('fire');
        "quantity": 6,
         $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/7/7d/Fiery_Heart.gif");
        "link": "https://www.tibiawiki.com.br/wiki/Gold_Token",
         $('#source1').text('25');
        "image": "https://www.tibiawiki.com.br/images/0/0b/Gold_Token.gif"
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Fiery_Heart" target="_blank">Fiery Heart</a>');
    }
        if (tipo == 'basic') {
 
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
    var loadAllItens = async () => {
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        let baseURL = '';
          $('#source2, #source3').text('0');
         $('.imbument-tool-loading label').text('Loading Imbuements and Itens for You, Adventurer!...');
         await Promise.all([
            loadData(baseURL, 'imbuements', 'Imbuements'),
            loadData(baseURL, 'armors', 'Armors'),
            loadData(baseURL, 'backpacks', 'Backpacks'),
            loadData(baseURL, 'boots', 'Boots'),
            loadData(baseURL, 'fists', 'Fists'),
            loadData(baseURL, 'helmets', 'Helmets'),
            loadData(baseURL, 'clubs', 'Clubs'),
            loadData(baseURL, 'distance', 'Distance'),
            loadData(baseURL, 'shields', 'Shields'),
            loadData(baseURL, 'swords', 'Swords'),
            loadData(baseURL, 'axes', 'Axes'),
            loadData(baseURL, 'spellbooks', 'Spellbooks'),
            loadData(baseURL, 'wandsRods', 'WandsRods')
         ]).then((results) => {
            categories = {
                "Armaduras": armors,
                "Backpacks": backpacks,
                "Botas": boots,
                "Capacetes": helmets,
                "Clavas": clubs,
                "Distância": distance,
                "Escudos": shields,
                "Espadas": swords,
                "Machados": axes,
                "Punhos": fists,
                "Spellbooks": spellbooks,
                "Wands e Rods": wandsRods
            }
            loadCategories();
            $('.imbument-tool-loading')[0].style.display = 'none';
            console.log("Load Done!");
         }).catch((error) => {
            showAlert();
            console.error('Error:', error);
        });
    }
 
    var loadData = async (baseURL, varName, path) => {
         return new Promise((resolve, reject) => {
            $.ajax({
                contentType: 'text/plain; charset=utf-8',
                url: baseURL + '/index.php?title=Tibia_Wiki:' + path + '/json&action=raw',
                type: 'GET',
                success: function(data) {
                    callbacks(data.replace(/<pre id="[^"]*">/gi, '').replace(/<\/pre>/gi, ''), varName);
                    resolve('Loaded: ' + varName);
                },
                error: function(error) {
                    console.error(error);
                    callbacks(null, varName);
                }
            });
        });
    }
 
    var callbacks = (codigo, varName) => {
        if (codigo == null) {
            codigo = "";
        } else {
            console.log('Loaded:', varName);
            window[varName] = JSON.parse(codigo);
         }
         }
        if (tipo == 'intricate') {
    }
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/a/ac/Green_Dragon_Scale.gif");
 
          $('#source2').text('5');
    var loadCategories = () => {
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Green_Dragon_Scale" target="_blank">Green Dragon Scale</a>');
        const categoriesSelect = document.getElementById('imbuement-tool-items-category');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
         if (Object.keys(categories).length === 0 || categoriesSelect == null) {
          $('#source3').text('0');
            showAlert();
         } else if (tipo == 'powerful') {
            return;
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/a/ac/Green_Dragon_Scale.gif");
          $('#source2').text('5');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Green_Dragon_Scale" target="_blank">Green Dragon Scale</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/b/b8/Demon_Horn.gif");
          $('#source3').text('5');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Demon_Horn" target="_blank">Demon Horn</a>');
         }
         }
      } else if (ele == 'iced') {
         Object.keys(categories).forEach(category => {
         $('#damage').removeClass("no");
            let option = document.createElement('option');
        $('#boost, #lleech, #protect, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
            option.value = category;
        $('#damages').text('ice');
            option.innerHTML = category;
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/3/3e/Frosty Heart.gif");
            categoriesSelect.appendChild(option);
        $('#source1').text('5');
         });
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Frosty Heart" target="_blank">Polar Bear Paw</a>');
         if (categoriesSelect.children.length > 0) {
         if (tipo == 'basic') {
            categoriesSelect.children[0].setAttribute('selected', true);
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
            loadItemList();
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
         }
         }
        if (tipo == 'intricate') {
    }
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/8/83/Frosty_Heart.gif");
 
          $('#source2').text('25');
    var loadItemList = (listItems) => {
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Frosty_Heart" target="_blank">Frosty Heart</a>');
        const category = getSelectedCategory();
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        const itemsList = document.getElementById('imbuement-tool-items-list');
          $('#source3').text('0');
        if (Object.keys(categories[category]).length === 0 || itemsList == null) {
         } else if (tipo == 'powerful') {
            showAlert();
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/8/83/Frosty_Heart.gif");
            return;
          $('#source2').text('25');
        }       
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Frosty_Heart" target="_blank">Frosty Heart</a>');
        itemsList.innerHTML = '';
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/6/6e/Seacrest_Hair.gif");
         const listOfItems = (listItems == null) ? categories[category] : listItems;
          $('#source3').text('10');
        Object.keys(listOfItems).forEach(item => {
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Seacrest_Hair" target="_blank">Seacrest Hair</a>');
            let option = document.createElement('option');
            option.value = item;
            option.innerHTML = item;
            itemsList.appendChild(option);
        });
 
        if (itemsList.children.length > 0) {
            itemsList.children[0].setAttribute('selected', true);
            selectItem();
         }
         }
      } else if (ele == 'energyd') {
    }
         $('#damage').removeClass("no");
 
         $('#boost, #lleech, #protect, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
    var selectItem = () => {
         $('#damages').text('energy');
        const selectedCategory = document.getElementById('imbuement-tool-items-category').value;
         $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/b/b8/Rorc_Feather.gif");
         const selectedItem = document.getElementById('imbuement-tool-items-list').value;
         $('#source1').text('25');
 
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Rorc_Feather" target="_blank">Rorc Feather</a>');
         const itemNameLabel = document.getElementById('imbument-tool-items-name');
         if (tipo == 'basic') {
         const itemSlotsLabel = document.getElementById('imbument-tool-items-slots');
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        const itemImage = document.getElementById('imbument-tool-items-image');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $('#source2, #source3').text('0');
         itemNameLabel.innerHTML = `<span class="label">Item:</span> ${getSelectedItemName()}`;
        itemSlotsLabel.innerHTML = `<span class="label">Slots:</span> ${getSelectedItemObject().slots}`;
        itemImage.setAttribute('src', "https://www.tibiawiki.com.br/wiki/Especial:Redirecionar/file/" + getSelectedItemName() + ".gif");
 
         loadImbuementsLevel();
        createImbuementsLine();
    }
 
    var selectImbuementLevel = (component) => {
         cleanSelectedImbuementLevel();
        component.classList.add("selected");
         selectedImbuementLevel = component.getAttribute('level');
        createImbuementsLine();
    }
 
    var loadImbuementsLevel = () => {
       
        const imbuementLevelLists = document.getElementsByClassName("imbuement-tool-level-list");
        if (imbuementLevelLists == null || imbuementLevelLists.length === 0) {
            showAlert();
            return;
         }
         }
         if (tipo == 'intricate') {
         const componentList = imbuementLevelLists[0];
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/f/fc/Peacock_Feather_Fan.gif");
        componentList.innerHTML = "";
          $('#source2').text('5');
 
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Peacock_Feather_Fan" target="_blank">Peacock Feather Fan</a>');
        const selectedItem = getSelectedItemObject();
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        const selectedItemImbuements = selectedItem.imbuements;
          $('#source3').text('0');
 
         } else if (tipo == 'powerful') {
        selectedItemImbuements[Object.keys(selectedItemImbuements)[0]].forEach(level => {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/f/fc/Peacock_Feather_Fan.gif");
            const componentLevel = createImbuementLevelButton(level);
          $('#source2').text('5');
            componentList.appendChild(componentLevel);
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Peacock_Feather_Fan" target="_blank">Peacock Feather Fan</a>');
         });
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/d/dc/Energy_Vein.gif");
        const mostLevelImbuement = document.getElementsByClassName("imbuement-tool-level-list-item");
          $('#source3').text('1');
        if (mostLevelImbuement == null || mostLevelImbuement.length === 0) {
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Energy_Vein" target="_blank">Energy Vein</a>');
            showAlert();
            return;
         }
         }
      } else if (ele == 'deathp') {
        if (selectedImbuementLevel.length === 0) {
        $('#protectdeath').removeClass("no");
            mostLevelImbuement[mostLevelImbuement.length - 1].classList.add("selected");
        $('#boost, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia,  #protect').addClass("no");
            selectedImbuementLevel = mostLevelImbuement[mostLevelImbuement.length - 1].getAttribute('level');
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/c/c2/Flask_of_Embalming_Fluid.gif");
         } else {
        $('#source1').text('25');
            const indexes = Object.keys(mostLevelImbuement).filter(index => mostLevelImbuement[index].getAttribute('level') === selectedImbuementLevel);
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Flask_of_Embalming_Fluid" target="_blank">Flask of Embalming Fluid</a>');
            mostLevelImbuement[indexes[0]].classList.add('selected');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
         }
         }
        if (tipo == 'intricate') {
    }
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/f/ff/Gloom_Wolf_Fur.gif");
 
          $('#source2').text('20');
    var createImbuementLevelButton = (level) => {
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Gloom_Wolf_Fur" target="_blank">Gloom Wolf Fur</a>');
 
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        const btn = document.createElement("div");
          $('#source3').text('0');
        btn.classList.add("imbuement-tool-level-list-item");
         } else if (tipo == 'powerful') {
        btn.setAttribute("level", level);
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/f/ff/Gloom_Wolf_Fur.gif");
        btn.addEventListener('click', function() {
          $('#source2').text('20');
            selectImbuementLevel(this);
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Gloom_Wolf_Fur" target="_blank">Gloom Wolf Fur</a>');
         }, false);
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/0/08/Mystical_Hourglass.gif");
 
          $('#source3').text('5');
        const imgBox = document.createElement("div");
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Mystical_Hourglass" target="_blank">Mystical Hourglass</a>');
        imgBox.classList.add("imbuement-tool-level-list-item-level");
 
        const label = document.createElement("label");
        label.innerText = level;
 
        let indexLevel = 1;
        switch (level) {
            case("Intricate"): {
                indexLevel = 2;
                break;
            }
            case("Powerful"): {
                indexLevel = 3;
                break;
            }
            default: {
                indexLevel = 1;
                break;
            }
         }
         }
      } else if (ele == 'earthp') {
        for(let i = 0; i < indexLevel; i++) {
        $('#protect').removeClass("no");
            const img = document.createElement('img');
        $('#boost, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
            img.setAttribute('src', 'https://www.tibiawiki.com.br/images/2/2f/The_Heart_of_the_Sea.gif');
        $('#damages2').text('earth');
            img.setAttribute('alt', 'level');
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/f/f6/Piece_of_Swampling_Wood.gif");
            imgBox.appendChild(img);
        $('#source1').text('25');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Piece_of_Swampling_Wood" target="_blank">Piece of Swampling Wood</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
         }
         }
         if (tipo == 'intricate') {
         btn.appendChild(imgBox);
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/3e/Snake_Skin.gif");
        btn.appendChild(label);
          $('#source2').text('20');
        return btn;
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Snake_Skin" target="_blank">Snake Skin</a>');
    }
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $('#source3').text('0');
    var createImbuementsLine = () => {
         } else if (tipo == 'powerful') {
        const selectedItem = getSelectedItemObject();
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/3e/Snake_Skin.gif");
        const selectedItemImbuements = selectedItem.imbuements;
          $('#source2').text('20');
 
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Snake_Skin" target="_blank">Snake Skin</a>');
        const tables = document.getElementsByClassName('imbuement-tool-data-table');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/7/7a/Brimstone_Fangs.gif");
         if (tables == null || tables.length === 0) {
          $('#source3').text('10');
            showAlert();
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Brimstone_Fangs" target="_blank">Brimstone Fangs</a>');
            return;
         }
         }
      } else if (ele == 'firep') {
        const table = tables[0];
         $('#protect').removeClass("no");
         table.innerHTML = "";
         $('#boost, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
         let indexLine = 0;
        $('#damages2').text('fire');
        let tableLine = null;
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/d/d9/Green_Dragon_Leather.gif");
        let tableDataLineList = null;
        $('#source1').text('20');
        Object.keys(selectedItemImbuements).forEach(imbuement => {
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Green_Dragon_Leather" target="_blank">Green Dragon Leather</a>');
            if (indexLine === 0) {
        if (tipo == 'basic') {
                tableLine = document.createElement("div");
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
                tableLine.classList.add("imbuement-tool-data-table-line");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $('#source2, #source3').text('0');
                tableDataLineList = document.createElement("div");
                tableDataLineList.classList.add("imbuement-tool-data-list");
 
                tableLine.appendChild(tableDataLineList);
            }
 
            const itemList = createImbuementsItem(imbuement);
            if (itemList) {
                tableDataLineList.appendChild(itemList);
            }
 
            indexLine++;
            if (indexLine === 6 || indexLine === Object.keys(selectedItemImbuements).length) {
                table.append(tableLine);
                indexLine = 0;
            }
        });
 
        const imbuementComponent = document.getElementsByClassName("imbuement-tool-data-list-item")[0];
        selectImbuementCell(imbuementComponent);
    }
 
    var createImbuementsItem = (imbuementName) => {
        const imbuement = imbuements[imbuementName];
        const imbuementLevel = getSelectedImbuementLevel();
        const selectedItem = getSelectedItemObject();
        if (!selectedItem.imbuements[imbuementName].includes(imbuementLevel)) {
            return;
         }
         }
         if (tipo == 'intricate') {
 
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/0/01/Blazing_Bone.gif");
         const divItem = document.createElement('div');
          $('#source2').text('10');
        divItem.classList.add("imbuement-tool-data-list-item");
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Blazing_Bone" target="_blank">Blazing Bone</a>');
        divItem.setAttribute("imbuement-name", imbuementName);
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        divItem.setAttribute("imbuement-level", imbuementLevel);
          $('#source3').text('0');
        divItem.setAttribute("title", imbuementName.concat(" | ").concat(imbuement.name));
         } else if (tipo == 'powerful') {
 
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/0/01/Blazing_Bone.gif");
        const img = document.createElement('img');
          $('#source2').text('10');
         img.setAttribute('src', imbuement.level[imbuementLevel].image);
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Blazing_Bone" target="_blank">Blazing Bone</a>');
 
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/5/51/Draken_Sulphur.gif");
        divItem.appendChild(img);
          $('#source3').text('5');
 
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Draken_Sulphur" target="_blank">Draken Sulphur</a>');
        divItem.addEventListener('click', function() {
            selectImbuementCell(this);
        }, false);
 
        return divItem;
    }
 
    var loadImbuementsItems = () => {
        const listItems = document.getElementsByClassName("imbuement-tool-list-items");
        if (listItems == null || Object.keys(listItems).length === 0) {
            showAlert();
            return;
         }
         }
      } else if (ele == 'icep') {
        const itemList = listItems[0];
         $('#protect').removeClass("no");
        itemList.innerHTML = "";
         $('#boost, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade,#paralisia, #protectdeath').addClass("no");
 
         $('#damages2').text('ice');
        const imbuement = getSelectedImbuementObject();
         $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/f/fa/Winter_Wolf_Fur.gif");
        imbuement.itens.forEach(item => {
         $('#source1').text('25');
            const itemSlot = createImbuementItemSlot(item);
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Winter_Wolf_Fur" target="_blank">Winter Wolf Fur</a>');
            itemList.appendChild(itemSlot);
         if (tipo == 'basic') {
        });
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
    }
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $('#source2, #source3').text('0');
    var createImbuementItemSlot = (imbuementItem) => {
 
         const divBox = document.createElement("div");
        divBox.classList.add("imbuement-tool-list-items-box");
         divBox.setAttribute("title", new String(imbuementItem.quantity).concat("x ").concat(imbuementItem.name));
 
        const divImg = document.createElement("div");
        const a = document.createElement("a");
         a.setAttribute('href', imbuementItem.link);
        a.setAttribute('target', "_blank");
         const img = document.createElement("img");
        img.setAttribute('src', imbuementItem.image);
        const label = document.createElement("label");
        label.innerText = imbuementItem.quantity;
 
        a.appendChild(img);
        divImg.appendChild(a);
        divBox.appendChild(divImg);
        divBox.appendChild(label);
 
        return divBox;
    }
 
    var selectImbuementCell = (component) => {
        cleanSelectedImbuementCell();
         component.classList.add('selected');
        const imbuementDescription = document.getElementById('imbuement-tool-selected-imbuement-description');
         imbuementDescription.innerText = imbuements[component.getAttribute('imbuement-name')].level[component.getAttribute('imbuement-level')].description;
 
         loadImbuementsItems();
        loadImbuementItemsInfos();
        loadItemsInfosLine();
        updateTotal();
    }
 
    var loadImbuementItemsInfos = () => {
 
 
        const itemsInfosList = document.getElementsByClassName('imbuement-tool-prices-items');
        if (itemsInfosList == null || Object.keys(itemsInfosList).length === 0) {
            showAlert();
            return;
         }
         }
         if (tipo == 'intricate') {
         const itemsInfosListComponent = itemsInfosList[0];
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/f/fc/Thick_Fur.gif");
        itemsInfosListComponent.innerHTML = "";
          $('#source2').text('15');
 
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Thick_Fur" target="_blank">Thick Fur</a>');
        const imbuement = getSelectedImbuementObject();
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
         if (imbuement.gold_token) {
          $('#source3').text('0');
            goldToken.quantity = getGoldTokenQuantity();
         } else if (tipo == 'powerful') {
            const goldTokenBox = createImbuementItemInfoBox(goldToken, 0);
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/f/fc/Thick_Fur.gif");
            itemsInfosListComponent.appendChild(goldTokenBox);
          $('#source2').text('15');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Thick_Fur" target="_blank">Thick Fur</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/5/54/Deepling_Warts.gif");
          $('#source3').text('10');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Deepling_Warts" target="_blank">Deepling Warts</a>');
         }
         }
      } else if (ele == 'energyp') {
        let index = 1;
         $('#protect').removeClass("no");
        imbuement.itens.forEach(item => {
         $('#boost, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
            const itemInfoBox = createImbuementItemInfoBox(item, index);
         $('#damages2').text('energy');
            itemsInfosListComponent.appendChild(itemInfoBox);
         $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/a/a3/Wyvern_Talisman.gif");
            index++;
         $('#source1').text('20');
        });
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Wyvern_Talisman" target="_blank">Wyvern Talisman</a>');
    }
         if (tipo == 'basic') {
 
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
    var createImbuementItemInfoBox = (item, indexId) => {
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $('#source2, #source3').text('0');
        const img = document.createElement('img');
         img.setAttribute('src', item.image);
        img.setAttribute('alt', 'imbuement item');
 
         const a = document.createElement('a');
        a.setAttribute('href', item.link);
         a.setAttribute('target', '_blank');
        a.setAttribute('title', item.name);
         a.appendChild(img);
 
        const labelQuantity = document.createElement('label');
        labelQuantity.innerText = "Quantidade:";
 
        const inputQuantity = document.createElement('input');
        inputQuantity.setAttribute('value', item.quantity);
        inputQuantity.setAttribute('min', '0');
         inputQuantity.setAttribute('type', 'number');
        inputQuantity.setAttribute('id', 'input-quantity-'.concat(indexId));
         inputQuantity.addEventListener('input', function () {
            updateValues(this, 'quantity', indexId);
        });
 
        const divQuantity = document.createElement('div');
        divQuantity.appendChild(labelQuantity);
        divQuantity.appendChild(inputQuantity);
 
        const labelPrice = document.createElement('label');
        labelPrice.innerText = "Valor Unitário (GPs):";
 
        const inputPrice = document.createElement('input');
         inputPrice.setAttribute('value', 0);
        inputPrice.setAttribute('min', '0');
        inputPrice.setAttribute('type', 'number');
        inputPrice.setAttribute('id', 'input-price-'.concat(indexId));
        inputPrice.addEventListener('input', function () {
            updateValues(this, 'price', indexId);
        });
 
        const divPrice = document.createElement('div');
        divPrice.appendChild(labelPrice);
        divPrice.appendChild(inputPrice);
 
        const divBox = document.createElement('div');
        divBox.classList.add('imbuement-tool-prices-items-box');
        divBox.appendChild(a);
        divBox.appendChild(divQuantity);
        divBox.appendChild(divPrice);
       
        return divBox;
    }
 
    var loadItemsInfosLine = () => {
 
        const itemsInfoDivs = document.getElementsByClassName('imbuement-tool-prices-taxas-info-items');
        if (itemsInfoDivs == null || Object.keys(itemsInfoDivs).length === 0) {
            showAlert();
            return;
         }
         }
         if (tipo == 'intricate') {
         const itemsInfo = itemsInfoDivs[0];
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/b/be/Crawler_Head_Plating.gif");
        itemsInfo.innerHTML = "";
          $('#source2').text('15');
 
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Crawler_Head_Plating" target="_blank">Crawler Head Plating</a>');
        const imbuement = getSelectedImbuementObject();
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
         if (imbuement.gold_token) {
          $('#source3').text('0');
            const goldTokenBox = createItemInfoLabel(goldToken, 0);
         } else if (tipo == 'powerful') {
            itemsInfo.appendChild(goldTokenBox);
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/b/be/Crawler_Head_Plating.gif");
          $('#source2').text('15');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Crawler_Head_Plating" target="_blank">Crawler Head Plating</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/d/de/Wyrm_Scale.gif");
          $('#source3').text('10');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Wyrm_Scale" target="_blank">Wyrm Scale</a>');
         }
         }
      } else if (ele == 'holyp') {
        document.getElementById("lbl-total-gold-token").style.display = imbuement.gold_token ? 'block' : 'none';
        $('#protect').removeClass("no");
        let index = 1;
         $('#boost, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
        imbuement.itens.forEach(item => {
         $('#damages2').text('holy');
            const itemLabel = createItemInfoLabel(item, index);
         $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/3/38/Cultish_Robe.gif");
            itemsInfo.appendChild(itemLabel);
         $('#source1').text('25');
            index++;
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Cultish_Robe" target="_blank">Cultish Robe</a>');
         });
         if (tipo == 'basic') {
    }
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
    var createItemInfoLabel = (item, indexId) => {
          $('#source2, #source3').text('0');
        const label = document.createElement('label');
         label.setAttribute('id', "lbl-item-".concat(indexId));
         label.innerText = "Total ".concat(item.name).concat(": 0 GPs");
         return label;
    }
 
    var getGoldTokenQuantity = () => {
         switch(getSelectedImbuementLevel()) {
            case ("Powerful"): {
                return 6;
            }
            case ("Intricate"): {
                return 4;
            }
            default: {
                return 2;
            }
         }
         }
         if (tipo == 'intricate') {
    }
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/4/4c/Cultish_Mask.gif");
    var getSelectedImbuementLevel = () => {
          $('#source2').text('25');
         return selectedImbuementLevel;
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Cultish_Mask" target="_blank">Cultish Mask</a>');
    }
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $('#source3').text('0');
    var getSelectedCategory = () => {
        } else if (tipo == 'powerful') {
        return document.getElementById('imbuement-tool-items-category').value;
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/4/4c/Cultish_Mask.gif");
    }
          $('#source2').text('25');
    var getSelectedItemName = () => {
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Cultish_Mask" target="_blank">Cultish Mask</a>');
        return (getSelectedImbuementOption() === "Items") ? document.getElementById('imbuement-tool-items-list').value : Object.keys(imbuementScrolls)[0];
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/a/a3/Hellspawn_Tail.gif");
    }
          $('#source3').text('20');
    var getSelectedItemObject = () => {
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Hellspawn_Tail" target="_blank">Hellspawn Tail</a>');
        return (getSelectedImbuementOption() === "Items") ? categories[getSelectedCategory()][getSelectedItemName()] : imbuementScrolls[getSelectedItemName()];
    }
    var getItemList = () => {
        return categories[getSelectedCategory()];
    }
    var getSelectedImbuementObject = () => {
        const selectedComponent = document.querySelector('.imbuement-tool-data-list-item.selected');
        const imbuementName = selectedComponent.getAttribute('imbuement-name');
        const imbuementLevel = selectedComponent.getAttribute('imbuement-level');
        imbuements[imbuementName].level[imbuementLevel]["gold_token"] = imbuements[imbuementName].gold_token;
        return imbuements[imbuementName].level[imbuementLevel];
    }
 
    // Limpa Campos.
    var cleanSearchField = () => {
        let searchInput = document.getElementById('imbument-tool-input-search');
        searchInput.value = '';
    }
    var cleanSelectedImbuementLevel = () => {
        const selectedComponent = document.querySelector('.imbuement-tool-level-list-item.selected');
        if (selectedComponent == null) {
            return;
         }
         }
      } else if (ele == 'axe') {
         selectedComponent.classList.remove("selected");
         $('#boost').removeClass("no");
         selectedImbuementLevel = "";
         $('#protect, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
 
         $('#skill').text('axe fighting');
         cleanSelectedImbuementCell();
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/7/70/Orc_Tooth.gif");
    }
        $('#source1').text('20');
    var cleanSelectedImbuementCell = () => {
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Orc_Tooth" target="_blank">Orc Tooth</a>');
         const selectedComponent = document.querySelector('.imbuement-tool-data-list-item.selected');
         if (tipo == 'basic') {
         if (selectedComponent == null) {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
            return;
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
         }
         }
         if (tipo == 'intricate') {
         selectedComponent.classList.remove("selected");
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/1/10/Battle_Stone.gif");
 
          $('#source2').text('25');
        const imbuementDescription = document.getElementById('imbuement-tool-selected-imbuement-description');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Battle_Stone" target="_blank">Battle Stone</a>');
        imbuementDescription.innerText = "";
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $('#source3').text('0');
        const listItems = document.getElementsByClassName("imbuement-tool-list-items");
         } else if (tipo == 'powerful') {
         if (listItems == null || Object.keys(listItems).length === 0) {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/1/10/Battle_Stone.gif");
            showAlert();
          $('#source2').text('25');
            return;
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Battle_Stone" target="_blank">Battle Stone</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/0/0f/Moohtant_Horn.gif");
          $('#source3').text('20');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Moohtant_Horn" target="_blank">Moohtant Horn</a>');
         }
         }
      } else if (ele == 'sword') {
        const itemList = listItems[0];
         $('#boost').removeClass("no");
         itemList.innerHTML = "";
        $('#protect, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
    }
        $('#skill').text('sword fighting');
 
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/0/04/Lion%27s_Mane.gif");
    var showSelectedOption = () => {
         $('#source1').text('25');
         const selectedImbuementOption = getSelectedImbuementOption();
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Lion%27s_Mane" target="_blank">Lion%27s Mane</a>');
         const itemsContainer = document.getElementById('imbument-tool-items-container');
         if (tipo == 'basic') {
         if (itemsContainer == null) {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
            showAlert();
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
            return;
          $('#source2, #source3').text('0');
         }
         }
         if (tipo == 'intricate') {
         itemsContainer.style.display = (selectedImbuementOption === "Items") ? 'block' : 'none';
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/b/b2/Mooh%27tah_Shell.gif");
        cleanSelectedImbuementLevel();
          $('#source2').text('25');
    }
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Mooh%27tah_Shell" target="_blank">Mooh%27tah Shell</a>');
 
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
    // Busca Item na lista de Items.
          $('#source3').text('0');
    var searchItems = (input) => {
         } else if (tipo == 'powerful') {
         let items = getItemList();
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/b/b2/Mooh%27tah_Shell.gif");
        let filteredKeys = Object.keys(items).filter(name => name.toLowerCase().includes(input.value.toLowerCase()));
          $('#source2').text('25');
        if (filteredKeys.length === 0) {
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Mooh%27tah_Shell" target="_blank">Mooh%27tah Shell</a>');
            return
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/4/41/War_Crystal.gif");
          $('#source3').text('5');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/War_Crystal" target="_blank">War Crystal</a>');
         }
         }
      } else if (ele == 'club') {
        let filteredItems = new Object();
         $('#boost').removeClass("no");
        filteredKeys.forEach(itemName => {
        $('#protect, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
            filteredItems[itemName] = items[itemName];
         $('#skill').text('club fighting');
        });
         $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/b/bd/Cyclops_Toe.gif");
         loadItemList(filteredItems);
         $('#source1').text('20');
    }
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Cyclops_Toe" target="_blank">Cyclops Toe</a>');
 
         if (tipo == 'basic') {
    var updateValues = (component, type, indexId) => {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
        const value = component.value;
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
 
          $('#source2, #source3').text('0');
         const multiplier = document.getElementById(`input-${(type === 'quantity') ? 'price' : 'quantity'}-${indexId}`).value;
 
        const total = value * multiplier;
        const imbuement = getSelectedImbuementObject();
         const imbuementItemName = (indexId === 0) ? goldToken.name : imbuement.itens[indexId - 1].name;
         document.getElementById(`lbl-item-${indexId}`).innerText = `Total ${imbuementItemName}: ${total.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")} GPs`;
 
         updateTotal();
    }
 
    var updateTotal = () => {
        const imbuement = getSelectedImbuementObject();
 
        let totalGoldTotken = 0;
        if (imbuement.gold_token) {
            const quantityGoldToken = document.getElementById('input-quantity-0').value;
            const priceGoldToken = document.getElementById('input-price-0').value;
            totalGoldTotken = quantityGoldToken * priceGoldToken;
         }
         }
         if (tipo == 'intricate') {
 
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/9/9b/Ogre_Nose_Ring.gif");
         let totalItens = 0;
          $('#source2').text('15');
        for (let i = 1; i <= imbuement.itens.length; i++) {
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Ogre_Nose_Ring" target="_blank">Ogre Nose Ring</a>');
            const quantityItem = document.getElementById(`input-quantity-${i}`).value;
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
            const priceItem = document.getElementById(`input-price-${i}`).value;
          $('#source3').text('0');
            totalItens += quantityItem * priceItem;
        } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/9/9b/Ogre_Nose_Ring.gif");
          $('#source2').text('15');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Ogre_Nose_Ring" target="_blank">Ogre Nose Ring</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/4/48/Warmaster%27s_Wristguards.gif");
          $('#source3').text('10');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Warmaster%27s_Wristguards" target="_blank">Warmaster%27s Wristguards</a>');
         }
         }
      } else if (ele == 'distance') {
        const taxa = getTaxPrice();
        $('#boost').removeClass("no");
         if (imbuement.gold_token) {
         $('#protect, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
            document.getElementById('lbl-total-gold-token').innerText = `Total com Gold Token: ${(totalGoldTotken + taxa).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")} GPs`;
        $('#skill').text('distance fighting');
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/c/cf/Elven_Scouting_Glass.gif");
        $('#source1').text('25');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Elven_Scouting_Glass" target="_blank">Elven Scouting Glass</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
         }
         }
         if (tipo == 'intricate') {
         document.getElementById('lbl-total-items').innerText = `Total com os Items: ${(totalItens + taxa).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")} GPs`;
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/c/ca/Elven_Hoof.gif");
    }
          $('#source2').text('20');
 
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Elven_Hoof" target="_blank">Elven Hoof</a>');
    var getTaxPrice = () => {
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
         switch(getSelectedImbuementLevel()) {
          $('#source3').text('0');
            case('Powerful'): {
         } else if (tipo == 'powerful') {
                return 250000;
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/c/ca/Elven_Hoof.gif");
            }
          $('#source2').text('20');
            case('Intricate'): {
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Elven_Hoof" target="_blank">Elven Hoof</a>');
                return 60000;
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/c/cf/Metal_Spike.gif");
            }
          $('#source3').text('10');
            default: {
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Metal_Spike" target="_blank">Metal Spike</a>');
                return 7500;
            }
         }
         }
      } else if (ele == 'shield') {
    }
         $('#boost').removeClass("no");
 
         $('#protect, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
    /**
         $('#skill').text('shielding');
    * Adiciona Evento para quando houver interação nos selects, disparar uma ação/função.
         $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/4/45/Piece_of_Scarab_Shell.gif");
    */
        $('#source1').text('20');
    var addEventListeners = () => {
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Piece_of_Scarab_Shell" target="_blank">Piece of Scarab Shell</a>');
        // Category Select
         if (tipo == 'basic') {
        document.getElementById('imbuement-tool-items-category').addEventListener('change', function() {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
            cleanSearchField();
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
            loadItemList();
          $('#source2, #source3').text('0');
            createImbuementsLine();
         }, false);
 
        // Item Select
        document.getElementById('imbuement-tool-items-list').addEventListener('change', function() {
            selectItem();
        }, false);
 
         // Imbuement Option Select
        document.getElementById('imbument-tool-items').addEventListener('click', function() {
            showSelectedOption();
            selectItem();
        }, false);
         document.getElementById('imbument-tool-scrolls').addEventListener('click', function() {
            showSelectedOption();
            selectItem();
         }, false);
 
        let searchInput = document.getElementById('imbument-tool-input-search');
        searchInput.addEventListener('input', () => {
            searchItems(searchInput);
        });
 
        // // ImbuementSelect
        // document.getElementById('imbuementSelect').addEventListener('change', function() {
         //    let option = getSelectedValueFromSelect('imbuementSelect');
        //    selectImbuement(option);
        //    loadSelectImbuementLevel(option);
        // }, false);
 
        // // Imbuement Level Select
        // document.getElementById('imbuementLevelSelect').addEventListener('change', function() {
        //     let option = getSelectedValueFromSelect('imbuementLevelSelect');
         //    selectImbuementLevel(option);
        // }, false);
    }
 
    var showAlert = (message) => {
        alert(message || "Desculpe pela inconveniência!\n\nAlgo deu errado. Por favor, recarregue a página.");
    }
 
    var getSelectedImbuementOption = () => {
        return document.querySelector('input[name="imbuement-options"]:checked').value;
    }
 
    $(document).ready(function () {
 
        $(".imbument-tool-version-label").text("v" + version);
        const radioItems = document.getElementById('imbument-tool-items');
        if (radioItems == null) {
            showAlert();
            return;
         }
         }
         if (tipo == 'intricate') {
         radioItems.setAttribute('checked', true);
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/d/d9/Brimstone_Shell.gif");
         // Adiona os eventos aos componentes.
          $('#source2').text('25');
         addEventListeners();
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Brimstone_Shell" target="_blank">Brimstone Shell</a>');
 
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
         loadAllItens();
          $('#source3').text('0');
 
        } else if (tipo == 'powerful') {
         showSelectedOption();
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/d/d9/Brimstone_Shell.gif");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Brimstone_Shell" target="_blank">Brimstone Shell</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/d/d6/Frazzle_Skin.gif");
          $('#source3').text('25');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Frazzle_Skin" target="_blank">Frazzle Skin</a>');
        }
      } else if (ele == 'magic') {
        $('#boost').removeClass("no");
        $('#protect, #lleech, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
        $('#skill').text('magic level');
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/a/a4/Elvish_Talisman.gif");
        $('#source1').text('25');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Elvish_Talisman" target="_blank">Elvish Talisman</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
        }
        if (tipo == 'intricate') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/2/29/Broken_Shamanic_Staff.gif");
          $('#source2').text('15');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Broken_Shamanic_Staff" target="_blank">Broken Shamanic Staff</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source3').text('0');
         } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/2/29/Broken_Shamanic_Staff.gif");
          $('#source2').text('15');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Broken_Shamanic_Staff" target="_blank">Broken Shamanic Staff</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/5/57/Strand_of_Medusa_Hair.gif");
          $('#source3').text('15');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Strand_of_Medusa_Hair" target="_blank">Strand of Medusa Hair</a>');
         }
      } else if (ele == 'speed') {
        $('#velocidade').removeClass("no");
        $('#protect, #lleech, #damage, #mleech, #chit, #capacidade, #boost, #protectdeath, #paralisia').addClass("no");
         $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/8/84/Damselfly_Wing.gif");
        $('#source1').text('15');
         $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Damselfly_Wing" target="_blank">Damselfly Wing</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
        }
        if (tipo == 'intricate') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/1/1c/Compass.gif");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Compass" target="_blank">Compass</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source3').text('25');
        } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/1/1c/Compass.gif");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Compass" target="_blank">Compass</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/6/69/Waspoid_Wing.gif");
          $('#source3').text('20');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Waspoid_Wing" target="_blank">Waspoid Wing</a>');
        }
      } else if (ele == 'vibrancy') {
        $('#paralisia').removeClass("no");
        $('#protect, #lleech, #damage, #mleech, #chit, #capacidade, #boost, #protectdeath ,#velocidade').addClass("no");
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/0/0d/Wereboar_Hooves.gif");
        $('#source1').text('15');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Wereboar_Hooves" target="_blank">Wereboar Hooves</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
        }
        if (tipo == 'intricate') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/wiki/Crystallized_Anger");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Crystallized_Anger" target="_blank">Crystallized Anger</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source3').text('25');
        } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/wiki/Crystallized_Anger");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Crystallized_Anger" target="_blank">Crystallized Anger</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/f/fd/Quill.gif");
          $('#source3').text('20');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Quill" target="_blank">Quill</a>');
        }
      } else if (ele == 'life') {
        $('#lleech').removeClass("no");
        $('#protect, #boost, #damage, #mleech, #chit, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/f/f1/Vampire_Teeth.gif");
        $('#source1').text('25');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Vampire_Teeth" target="_blank">Vampire Teeth</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
        }
        if (tipo == 'intricate') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/1/1d/Bloody_Pincers.gif");
          $('#source2').text('15');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Bloody_Pincers" target="_blank">Bloody Pincers</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source3').text('0');
        } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/1/1d/Bloody_Pincers.gif");
          $('#source2').text('15');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Bloody_Pincers" target="_blank">Bloody Pincers</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/8/85/Piece_of_Dead_Brain.gif");
          $('#source3').text('5');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Piece_of_Dead_Brain" target="_blank">Piece of Dead Brain</a>');
        }
      } else if (ele == 'mana') {
        $('#mleech').removeClass("no");
        $('#protect, #lleech, #damage, #boost, #chit, #capacidade, #velocidade, #paralisia,  #protectdeath').addClass("no");
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/6/69/Rope_Belt.gif");
        $('#source1').text('25');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Rope_Belt" target="_blank">Rope Belt</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
        }
        if (tipo == 'intricate') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/d/d6/Silencer_Claws.gif");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Silencer_Claws" target="_blank">Silencer Claws</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source3').text('0');
        } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/d/d6/Silencer_Claws.gif");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Silencer_Claws" target="_blank">Silencer Claws</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/8/8c/Some_Grimeleech_Wings.gif");
          $('#source3').text('5');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Some_Grimeleech_Wings" target="_blank">Some Grimeleech Wings</a>');
        }
      } else if (ele == 'critical') {
        $('#chit').removeClass("no");
        $('#protect, #lleech, #damage, #mleech, #boost, #capacidade, #velocidade, #paralisia, #protectdeath').addClass("no");
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/f/fb/Protective_Charm.gif");
        $('#source1').text('20');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Protective_Charm" target="_blank">Protective Charm</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
        }
        if (tipo == 'intricate') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/d/dd/Sabretooth.gif");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Sabretooth" target="_blank">Sabretooth</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source3').text('0');
        } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/d/dd/Sabretooth.gif");
          $('#source2').text('25');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Sabretooth" target="_blank">Sabretooth</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/f/f7/Vexclaw_Talon.gif");
          $('#source3').text('5');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Vexclaw_Talon" target="_blank">Vexclaw Talon</a>');
        }
      } else if (ele == 'capacity') {
        $('#capacidade').removeClass("no");
        $('#protect, #lleech, #damage, #mleech, #boost, #velocidade, #paralisia, #protectdeath').addClass("no");
        $(".source1 img").attr("src", "https://www.tibiawiki.com.br/images/1/1d/Fairy_Wings.gif");
        $('#source1').text('20');
        $('#fonte1').html('<a href="https://www.tibiawiki.com.br/wiki/Fairy_Wings" target="_blank">Fairy Wings</a>');
        if (tipo == 'basic') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source2, #source3').text('0');
        }
        if (tipo == 'intricate') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/38/Little_Bowl_of_Myrrh.gif");
          $('#source2').text('10');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Little_Bowl_of_Myrrh" target="_blank">Little Bowl of Myrrh</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
          $('#source3').text('0');
        } else if (tipo == 'powerful') {
          $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/38/Little_Bowl_of_Myrrh.gif");
          $('#source2').text('10');
          $('#fonte2').html('<a href="https://www.tibiawiki.com.br/wiki/Little_Bowl_of_Myrrh" target="_blank">Little Bowl of Myrrh</a>');
          $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/0/06/Goosebump_Leather.gif");
          $('#source3').text('5');
          $('#fonte3').html('<a href="https://www.tibiawiki.com.br/wiki/Goosebump_Leather" target="_blank">Goosebump Leather</a>');
        }
      }
    });
    $("#elemento, #categoria").change(function() {
      $("#tipo").children("option[id='basic']").prop('selected', true);
      $("#tipo").children("option[id='intricate']").prop('selected', false);
      $("#tipo").children("option[id='powerful']").prop('selected', false);
      $(".source2 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
      $(".source3 img").attr("src", "https://www.tibiawiki.com.br/images/3/35/Trans.gif");
      $('#source2, #source3').text('0');
      $('#fonte2, #fonte3').text('');
    });
    $("#tipo, #elemento, #itemcat1, #itemcat2, #itemcat3, #itemcat4, #itemcat5, #itemcat6, #itemcat7, #itemcat8, #itemcat9, #itemcat10, #itemcat11").change(function() {
      var tipo = $("#tipo").children("option").filter(":selected").attr("id");
      var ele = $("#elemento").children("option").filter(":selected").attr("id");
      if (ele == "msg") {
        $('#chance').text('0%').css({
          "color": "#B2A898"
        });
        $('#preco').text('0');
        $('#total').text('0');
      } else if (tipo == 'basic') {
        $('#chance').text('90%').css({
          "color": "#B2A898"
        });
        $('#skillval').text('1');
        $('#damageval').text('10%');
        $('#lifeval').text('5%');
        $('#protectval').text('3%');
        $('#protectdeathval').text('2%');
        $('#manaval').text('3%');
        $('#criticalval').text('15%');
        $('#speedval').text('10');
        $('#vibrval').text('15%');
        $('#capval').text('3%');
        $('#preco').text('10,000');
        $('#total').text('5,000');
        $('#totalcharm').text('15,000');
        $('#fonte1').removeAttr("style");
        $('#fonte2').css({
          "display": "none"
        });
        $('#fonte3').css({
          "display": "none"
        });
      } else if (tipo == 'intricate') {
        $('#chance').text('70%').css({
          "color": "#B2A898"
        });
        $('#skillval').text('2');
        $('#damageval').text('25%');
        $('#lifeval').text('10%');
        $('#protectval').text('8%');
        $('#protectdeathval').text('5%');
        $('#manaval').text('5%');
        $('#criticalval').text('25%');
        $('#speedval').text('15');
        $('#vibrval').text('25%');
        $('#capval').text('8%');
        $('#preco').text('30,000');
        $('#total').text('25,000');
        $('#totalcharm').text('55,000');
        $('#fonte2').removeAttr("style");
        $('#fonte3').css({
          "display": "none"
        });
      } else if (tipo == 'powerful') {
        $('#chance').text('50%').css({
          "color": "red"
        });
        $('#skillval').text('4');
        $('#damageval').text('50%');
        $('#lifeval').text('25%');
        $('#protectval').text('15%');
        $('#protectdeathval').text('10%');
        $('#manaval').text('8%');
        $('#criticalval').text('50%');
        $('#speedval').text('30');
        $('#vibrval').text('50%');
        $('#capval').text('15%');
        $('#preco').text('50,000');
        $('#total').text('100,000');
        $('#totalcharm').text('150,000');
        $('#fonte2').removeAttr("style");
        $('#fonte3').removeAttr("style");
      }
    });
    $("#charm").click(function() {
      $('#chance, #chancecharm, #total, #totalcharm').toggleClass("no");
     });
     });
  });
</pre>
</pre>

Edição atual tal como às 03h11min de 28 de julho de 2025

<div class="imbuement-tool-panel">
    <label class="imbument-tool-version-label">v3.0.0</label>
    <div class="imbument-tool-loading">
        <img src="https://www.tibiawiki.com.br/images/c/ce/The_Epic_Wisdom.gif" /><br />
        <label>Loading...</label>
        <span>@TibiaWiki</span>
    </div>
    <div class="imbument-tool-menu-side">
        <h2>Imbuement Tool</h2>
        <div class="imbument-tool-radio-box">
            <input type="radio" id="imbument-tool-items" value="Items" name="imbuement-options">
            <label for="imbument-tool-items">Items</label>
        </div>
        <div class="imbument-tool-radio-box">
            <input type="radio" id="imbument-tool-scrolls" value="Scrolls" name="imbuement-options">
            <label for="imbument-tool-scrolls">Scrolls</label>
        </div>
        <span class="imbument-tool-divisor-line"></span>
        <div id="imbument-tool-items-container">
            <div class="imbument-tool-category-box">
                <label for="">Categoria:</label>
                <select id="imbuement-tool-items-category">
                </select>
            </div>
            <div class="imbument-tool-category-box">
                <label for="">Items:</label>
                <div class="imbument-tool-search-box">
                    <input id="imbument-tool-input-search" type="text" placeholder="buscar por item...">
                    <div><i>🔍</i></div>
                </div>
                <select id="imbuement-tool-items-list" size="10">
                </select>
            </div>
        </div>
        <div class="imbument-tool-items">
            <div class="imbument-tool-items-data-box">
                <div class="imbument-tool-items-data-image-box">
                    <img id="imbument-tool-items-image" src="" alt="item-image">
                </div>
                <div class="imbument-tool-items-data-box-data">
                    <label id="imbument-tool-items-name"><span class="label">Item:</span> Dauntless Dragon Scale Armor</label>
                    <label id="imbument-tool-items-slots"><span class="label">Slots:</span> 2</label>
                </div>
            </div>
        </div>
    </div>
    <div class="imbument-tool-imbuements-panel">
        <div class="imbument-tool-imbuements-level-box">
            <h2>Nível do Imbuement</h2>
            <div class="imbuement-tool-level-list">
            </div>
        </div>
        <span class="imbument-tool-divisor-line"></span>
        <div class="imbument-tool-imbuements-data-box">
            <h2>Imbuements</h2>
            <div class="imbuement-tool-data-table">
            </div>
        </div>
        <span class="imbument-tool-divisor-line"></span>
        <div class="imbument-tool-imbuements-data-box">
            <h2>Imbuements Items</h2>
            <h3 id="imbuement-tool-selected-imbuement-description"></h3>
            <div class="imbuement-tool-list-items">
            </div>
        </div>
        <span class="imbument-tool-divisor-line"></span>
        <div class="imbument-tool-imbuements-data-box">
            <h2>Informações</h2>
            <div class="imbuement-tool-prices">
                <div class="imbuement-tool-prices-items">
                </div>
                <div class="imbuement-tool-prices-taxas-info">
                    <h3>Valores</h3>
                    <!-- <span class="imbument-tool-divisor-line"></span> -->
                    <div class="imbuement-tool-prices-taxas-info-items">   
                    </div>
                    <span class="imbument-tool-divisor-line"></span>
                    <label id="lbl-total-gold-token">Total com Gold Token: 500000 GPs</label>
                    <label id="lbl-total-items">Total com os Items: 0 GPs</label>
                </div>
            </div>
        </div>
    </div>
</div>   
    .imbuement-tool-panel {
        display: flex;
        max-width: 870px;
        position: relative;
        border: 2px solid #a2a9b1;
        background: #ffffff;
        border-radius: 5px;
        -webkit-box-shadow: 0px 0px 10px 2px rgba(255, 255, 255, 1);
        -moz-box-shadow: 0px 0px 10px 2px rgba(255, 255, 255, 1);
        box-shadow: 0px 0px 10px 2px rgba(255, 255, 255, 1);
        font-family: Verdana, Arial, Times New Roman, sans-serif;
        font-size: 13px;
        color: black;
    }
    .imbument-tool-loading {
        z-index: 9999;
        background-color: rgba(255, 255, 255, 0.98);
        display: inline-block;
        border-radius: 3px;
        position: absolute;
        height: 100%;
        width: 100%;
        top: 0;
        left: 0;
        align-content: center;
        text-align: center;
    }

    .imbument-tool-loading>label {
        position: relative;
        bottom: 0px;
        text-align: center;     
        font-size: math;
        background: transparent;
    }
    .imbument-tool-loading > span {
        text-align: center;
        align-content: center;
        background-color: #c7451d;
        height: 32px;
        width: 100%;
        position: absolute;
        bottom: 0px;
        left: 0px;
        text-align: center;     
        font-size: math;
        border-bottom-left-radius: 3px;
        border-bottom-right-radius: 3px;
    }
    .imbument-tool-menu-side {
        width: 320px;
        background-color: #c7451d;
        padding: 5px;
        color: white;
        border-top-left-radius: 3px;
        border-bottom-left-radius: 3px;
    }
    .imbument-tool-menu-side > h2 {
        width: 100%;
        text-align: center;
        padding-bottom: 15px;
        border-bottom: 1px solid black;
        font-family: Verdana, Arial, Times New Roman, sans-serif;
        font-weight: bold;
        color: white;
    }
    .imbument-tool-radio-box {
        margin-top: 15px;
        display: flex;
        margin-top: 2px;
    }
    .imbument-tool-radio-box > label {
        font-size: 15px;
        font-weight: bold;
    }
    .imbument-tool-category-box {
        margin-top: 15px;
        width: 100%;
        display: block;
    }
    .imbument-tool-category-box > label {
        width: 100%;
        margin-left: 2px;
        font-weight: bold;
    }
    .imbument-tool-category-box > select {
        margin-top: 5px;
        width: 100%;
        min-height: 32px;
        font-weight: bold;
        border-radius: 5px;
        border: 1px solid black;
    }
    .imbument-tool-search-box {
        margin-top: 5px;
        width: 100%;
        display: flex;
    }
    .imbument-tool-search-box > input {
        width: calc(100% - 25px);
        height: 28px;
        border: 1px solid black;
        border-bottom-left-radius: 5px;
        border-top-left-radius: 5px;
    }
    .imbument-tool-search-box > div {
        width: 25px;
        height: 30px;
        background-color: white;
        border-left: none;
        border-right: 1px solid black;
        border-top: 1px solid black;
        border-bottom: 1px solid black;
        border-bottom-right-radius: 5px;
        border-top-right-radius: 5px;
        align-content: center;
        text-align: center;
    }
    .imbument-tool-imbuements-panel {
        display: block;
        width: calc(100% - 330px);
        padding: 5px;
    }
    .imbument-tool-items {
        width: 100%;
        margin-top: 15px;
    }
    .imbument-tool-items-data-box {
        display: flex;
    }
    .imbument-tool-items-data-box > .imbument-tool-items-data-image-box {
        width: 50px;
        height: 50px;
        background-color: white;
        border: 1px solid black;
        border-radius: 5px;
        align-content: center;
        text-align: center;
    }
    .imbument-tool-items-data-box-data {
        margin-left: 5px;
    }
    .imbument-tool-items-data-box-data > label {
        width: 100%;
        display: block;
        margin-bottom: 7px;
        font-weight: bold;
        font-size: 15px;
        text-align: left;
    }
    .imbument-tool-divisor-line {
        display: flex;
        flex-flow: row wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        border-bottom: 1px solid black;
        padding: 0.25rem;
        width: calc(100% - 15px);
    }

    .imbument-tool-version-label {
        font-size: 14px;
        font-weight: bold;
        text-align: center;
        display: block;
        position: absolute;
        top: 5px;
        left: 5px;
        color: white;
    }
    #imbument-tool-items-container {
        display: block;
    }

    .imbument-tool-imbuements-level-box {
        width: 100%;
    }
    .imbument-tool-imbuements-level-box > h2 {
        width: 100%;
        text-align: center;
        font-family: Verdana, Arial, Times New Roman, sans-serif;
        font-weight: bold;
        border: none;
    }
    .imbuement-tool-level-list {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
    }

    .imbuement-tool-level-list-item {
        display: flex;
        width: 100px;
        height: 50px;
        margin: 5px;
        flex-shrink: 0;
        align-content: center;
        text-align: center;
        border-radius: 5px;
        border: 1px solid black;
        justify-content: center;
        align-items: center;
    }
    .imbuement-tool-level-list-item:hover {
        background-color: #c04e2b;
    }
    .imbuement-tool-level-list-item.selected {
        background-color: #c7451d;
    }
    .imbuement-tool-level-list-item > label {
        font-weight: bold;
        flex-shrink: 0;
        margin-right: 5px;
    }
    .imbuement-tool-level-list-item > div {
        font-weight: bold;
        flex-shrink: 0;
    }
    .imbuement-tool-level-list-item-level {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .imbuement-tool-level-list-item-level > img {
        flex-shrink: 0;
        width: 10px;
        scale: 150%;
    }

    .imbument-tool-imbuements-data-box {
        width: 100%;
        min-height: 140px;
        display: block;
    }
    .imbument-tool-imbuements-data-box > h2, .imbument-tool-imbuements-data-box > h3 {
        width: 100%;
        text-align: center;
        align-content: center;
        font-family: Verdana, Arial, Times New Roman, sans-serif;
        font-weight: bold;
        border: none;
    }
    .imbuement-tool-data-table {
        display: block;
        width: 100%;
        max-height: 200px;
        overflow-y: auto;
    }
    .imbuement-tool-data-table-line {
        display: block;
        width: 100%;
    }
    .imbuement-tool-data-list {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .imbuement-tool-data-list-item {
        width: 64px;
        height: 64px;
        margin: 5px;
        border-radius: 5px;
        /* border: 2px solid black; */
    }
    .imbuement-tool-data-list-item.selected {
        width: 66px;
        height: 66px;
        filter: brightness(1.75);
        border: 0.15rem solid chocolate;
    }
    .imbuement-tool-data-list-item.selected > img {
        border-radius: 2px;
    }
    .imbuement-tool-data-list-item > img {
        width: 100%;
        scale: 100%;
        border-radius: 5px;
    }
    .imbuement-tool-data-list-item:hover {
        width: 66px;
        height: 66px;
        filter: brightness(1.25);
    }
    .imbuement-tool-list-items {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .imbuement-tool-list-items-box {
        background-color: #f3f3f3;
        margin: 5px;
        width: 64px;
        height: 64px;
        border: 1px solid black;
        border-radius: 5px;
        display: block;
        flex-shrink: 0;
        text-align: center;
        align-content: center;
    }
    .imbuement-tool-list-items-box > div {
        width: 100%;
        height: 44px;
        text-align: center;
        align-content: center;
    }
    .imbuement-tool-list-items-box > div > img {
        width: 32px;
    }
    .imbuement-tool-list-items-box > label {
        display: block;
        font-weight: bold;
        color: white;
        width: 100%;
        height: 20px;
        text-align: center;
        align-content: center;
        border-top: 1px solid black;
        background-color: #c7451d;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
    }

    .imbuement-tool-prices {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .imbuement-tool-prices-items {
        width: 50%;
        margin-left: 10px;
        display: block;
        flex-shrink: 0;
    }

    .imbuement-tool-prices-items-box {
        width: 100%;
        height: 55px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .imbuement-tool-prices-items-box > a {
        height: 100%;
        text-align: center;
        align-content: end;
    }
    .imbuement-tool-prices-items-box > a > img {
        width: 32px;
        border: 1px solid black;
        border-radius: 5px;
    }
    .imbuement-tool-prices-items-box > div {
        height: 40px;
       margin: 0px 5px 0px 5px;    
    }
    .imbuement-tool-prices-items-box > div > label {
        font-weight: bold;
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; 
    }
    .imbuement-tool-prices-items-box > div > input {
        width: 90%;
        text-align: center;
        border: 1px solid black;
        border-radius: 3px;
        height: 23px;
    }

    .imbuement-tool-prices-taxas-info {
        width: 50%;
        min-height: 200px;
        padding: 5px;
        border-left: 1px solid black;
        display: block;
        flex-shrink: 0;
    }

    .imbuement-tool-prices-taxas-info > h3 {
        width: 100%;
        margin: 0px 0px 15px 0px;
        text-align: center;
        align-content: center;
    }
    .imbuement-tool-prices-taxas-info > div {
        width: 100%;
        display: block;
        margin-top: 5px;
    }
    .imbuement-tool-prices-taxas-info > label {
        display: block;
        width: 100%;
        height: 20px;
        margin-top: 5px;
        font-weight: bold;
        text-align: left;
    }
    .imbuement-tool-prices-taxas-info > div > label {
        display: block;
        width: 100%;
        height: 20px;
        font-weight: bold;
        text-align: left;
    }

    .mg-top-35px {
        margin-top: 35px;
    }
    .label {
        font-weight: bold;
        font-size: 15px;
    }
    /* Extra small devices (phones, less than 576px) */
    @media (max-width: 575.98px) {
        .imbuement-tool-panel {
            width: calc(100% - 5px);
            display: block;
        }

        .imbument-tool-menu-side {
            width: calc(100% - 10px);
            border-top-left-radius: 3px;
            border-top-right-radius: 3px;
        }

        .imbument-tool-imbuements-panel {
            width: 100%;
        }

        .imbuement-tool-prices {
            display: block;
        }
        .imbuement-tool-prices-items, .imbuement-tool-prices-taxas-info {
            width: calc(100% - 20px);
            border-left: none;
        }
        .imbuement-tool-data-list-item, .imbuement-tool-data-list-item.selected {
            height: 100%;
        }
    }
const version = "3.0.1";
    var categories = new Object();
    var selectedImbuementLevel = "";
    var imbuementScrolls = {
        "Blank Imbuement Scroll": {
            "slots": 1,
            "imbuements": {
                "Vampirism": ["Intricate", "Powerful"],
                "Void": ["Intricate", "Powerful"],
                "Strike": ["Intricate", "Powerful"],
                "Featherweight": ["Intricate", "Powerful"],
                "Swiftness": ["Intricate", "Powerful"],
                "Vibrancy": ["Intricate", "Powerful"],
                "Reap": ["Intricate", "Powerful"],
                "Venom": ["Intricate", "Powerful"],
                "Scorch": ["Intricate", "Powerful"],
                "Frost": ["Intricate", "Powerful"],
                "Electrify": ["Intricate", "Powerful"],
                "Cloud Fabric": ["Intricate", "Powerful"],
                "Demon Presence": ["Intricate", "Powerful"],
                "Dragon Hide": ["Intricate", "Powerful"],
                "Lich Shroud": ["Intricate", "Powerful"],
                "Quara Scale": ["Intricate", "Powerful"],
                "Snake Skin": ["Intricate", "Powerful"],
                "Bash": ["Intricate", "Powerful"],
                "Blockade": ["Intricate", "Powerful"],
                "Chop": ["Intricate", "Powerful"],
                "Epiphany": ["Intricate", "Powerful"],
                "Precision": ["Intricate", "Powerful"],
                "Slash": ["Intricate", "Powerful"],
                "Punch": ["Intricate", "Powerful"]
            }
        }
    }
    var goldToken = {
        "name": "Gold Token",
        "quantity": 6,
        "link": "https://www.tibiawiki.com.br/wiki/Gold_Token",
        "image": "https://www.tibiawiki.com.br/images/0/0b/Gold_Token.gif"
    }

    var loadAllItens = async () => {
        let baseURL = '';
        $('.imbument-tool-loading label').text('Loading Imbuements and Itens for You, Adventurer!...');
        await Promise.all([
            loadData(baseURL, 'imbuements', 'Imbuements'),
            loadData(baseURL, 'armors', 'Armors'),
            loadData(baseURL, 'backpacks', 'Backpacks'),
            loadData(baseURL, 'boots', 'Boots'),
            loadData(baseURL, 'fists', 'Fists'),
            loadData(baseURL, 'helmets', 'Helmets'),
            loadData(baseURL, 'clubs', 'Clubs'),
            loadData(baseURL, 'distance', 'Distance'),
            loadData(baseURL, 'shields', 'Shields'),
            loadData(baseURL, 'swords', 'Swords'),
            loadData(baseURL, 'axes', 'Axes'),
            loadData(baseURL, 'spellbooks', 'Spellbooks'),
            loadData(baseURL, 'wandsRods', 'WandsRods')
        ]).then((results) => {
            categories = {
                "Armaduras": armors,
                "Backpacks": backpacks,
                "Botas": boots,
                "Capacetes": helmets,
                "Clavas": clubs,
                "Distância": distance,
                "Escudos": shields,
                "Espadas": swords,
                "Machados": axes,
                "Punhos": fists,
                "Spellbooks": spellbooks,
                "Wands e Rods": wandsRods
            }
            loadCategories();
            $('.imbument-tool-loading')[0].style.display = 'none';
            console.log("Load Done!");
        }).catch((error) => {
            showAlert();
            console.error('Error:', error);
        });
    }

    var loadData = async (baseURL, varName, path) => {
        return new Promise((resolve, reject) => {
            $.ajax({
                contentType: 'text/plain; charset=utf-8',
                url: baseURL + '/index.php?title=Tibia_Wiki:' + path + '/json&action=raw',
                type: 'GET',
                success: function(data) {
                    callbacks(data.replace(/<pre id="[^"]*">/gi, '').replace(/<\/pre>/gi, ''), varName);
                    resolve('Loaded: ' + varName);
                },
                error: function(error) {
                    console.error(error);
                    callbacks(null, varName);
                }
            });
        });
    }

    var callbacks = (codigo, varName) => {
        if (codigo == null) {
            codigo = "";
        } else {
            console.log('Loaded:', varName);
            window[varName] = JSON.parse(codigo);
        }
    }

    var loadCategories = () => {
        const categoriesSelect = document.getElementById('imbuement-tool-items-category');
        if (Object.keys(categories).length === 0 || categoriesSelect == null) {
            showAlert();
            return;
        }
        Object.keys(categories).forEach(category => {
            let option = document.createElement('option');
            option.value = category;
            option.innerHTML = category;
            categoriesSelect.appendChild(option);
        });
        if (categoriesSelect.children.length > 0) {
            categoriesSelect.children[0].setAttribute('selected', true);
            loadItemList();
        }
    }

    var loadItemList = (listItems) => {
        const category = getSelectedCategory();
        const itemsList = document.getElementById('imbuement-tool-items-list');
        if (Object.keys(categories[category]).length === 0 || itemsList == null) {
            showAlert();
            return;
        }        
        itemsList.innerHTML = '';
        const listOfItems = (listItems == null) ? categories[category] : listItems;
        Object.keys(listOfItems).forEach(item => {
            let option = document.createElement('option');
            option.value = item;
            option.innerHTML = item;
            itemsList.appendChild(option);
        });

        if (itemsList.children.length > 0) {
            itemsList.children[0].setAttribute('selected', true);
            selectItem();
        }
    }

    var selectItem = () => {
        const selectedCategory = document.getElementById('imbuement-tool-items-category').value;
        const selectedItem = document.getElementById('imbuement-tool-items-list').value;

        const itemNameLabel = document.getElementById('imbument-tool-items-name');
        const itemSlotsLabel = document.getElementById('imbument-tool-items-slots');
        const itemImage = document.getElementById('imbument-tool-items-image');

        itemNameLabel.innerHTML = `<span class="label">Item:</span> ${getSelectedItemName()}`;
        itemSlotsLabel.innerHTML = `<span class="label">Slots:</span> ${getSelectedItemObject().slots}`;
        itemImage.setAttribute('src', "https://www.tibiawiki.com.br/wiki/Especial:Redirecionar/file/" + getSelectedItemName() + ".gif");

        loadImbuementsLevel();
        createImbuementsLine();
    }

    var selectImbuementLevel = (component) => {
        cleanSelectedImbuementLevel();
        component.classList.add("selected");
        selectedImbuementLevel = component.getAttribute('level');
        createImbuementsLine();
    }

    var loadImbuementsLevel = () => {
        
        const imbuementLevelLists = document.getElementsByClassName("imbuement-tool-level-list");
        if (imbuementLevelLists == null || imbuementLevelLists.length === 0) {
            showAlert();
            return;
        }
        const componentList = imbuementLevelLists[0];
        componentList.innerHTML = "";

        const selectedItem = getSelectedItemObject();
        const selectedItemImbuements = selectedItem.imbuements;

        selectedItemImbuements[Object.keys(selectedItemImbuements)[0]].forEach(level => {
            const componentLevel = createImbuementLevelButton(level);
            componentList.appendChild(componentLevel);
        });
        const mostLevelImbuement = document.getElementsByClassName("imbuement-tool-level-list-item");
        if (mostLevelImbuement == null || mostLevelImbuement.length === 0) {
            showAlert();
            return;
        }
        if (selectedImbuementLevel.length === 0) {
            mostLevelImbuement[mostLevelImbuement.length - 1].classList.add("selected");
            selectedImbuementLevel = mostLevelImbuement[mostLevelImbuement.length - 1].getAttribute('level');
        } else {
            const indexes = Object.keys(mostLevelImbuement).filter(index => mostLevelImbuement[index].getAttribute('level') === selectedImbuementLevel);
            mostLevelImbuement[indexes[0]].classList.add('selected');
        }
    }

    var createImbuementLevelButton = (level) => {

        const btn = document.createElement("div");
        btn.classList.add("imbuement-tool-level-list-item");
        btn.setAttribute("level", level);
        btn.addEventListener('click', function() {
            selectImbuementLevel(this);
        }, false);

        const imgBox = document.createElement("div");
        imgBox.classList.add("imbuement-tool-level-list-item-level");

        const label = document.createElement("label");
        label.innerText = level;

        let indexLevel = 1;
        switch (level) {
            case("Intricate"): {
                indexLevel = 2;
                break;
            }
            case("Powerful"): {
                indexLevel = 3;
                break;
            }
            default: {
                indexLevel = 1;
                break;
            }
        }
        for(let i = 0; i < indexLevel; i++) {
            const img = document.createElement('img');
            img.setAttribute('src', 'https://www.tibiawiki.com.br/images/2/2f/The_Heart_of_the_Sea.gif');
            img.setAttribute('alt', 'level');
            imgBox.appendChild(img);
        }
        btn.appendChild(imgBox);
        btn.appendChild(label);
        return btn;
    }

    var createImbuementsLine = () => {
        const selectedItem = getSelectedItemObject();
        const selectedItemImbuements = selectedItem.imbuements;

        const tables = document.getElementsByClassName('imbuement-tool-data-table');
        if (tables == null || tables.length === 0) {
            showAlert();
            return;
        }
        const table = tables[0];
        table.innerHTML = "";
        let indexLine = 0;
        let tableLine = null;
        let tableDataLineList = null;
        Object.keys(selectedItemImbuements).forEach(imbuement => {
            if (indexLine === 0) {
                tableLine = document.createElement("div");
                tableLine.classList.add("imbuement-tool-data-table-line");

                tableDataLineList = document.createElement("div");
                tableDataLineList.classList.add("imbuement-tool-data-list");

                tableLine.appendChild(tableDataLineList);
            }

            const itemList = createImbuementsItem(imbuement);
            if (itemList) {
                tableDataLineList.appendChild(itemList);
            }

            indexLine++;
            if (indexLine === 6 || indexLine === Object.keys(selectedItemImbuements).length) {
                table.append(tableLine);
                indexLine = 0;
            }
        });

        const imbuementComponent = document.getElementsByClassName("imbuement-tool-data-list-item")[0];
        selectImbuementCell(imbuementComponent);
    }

    var createImbuementsItem = (imbuementName) => {
        const imbuement = imbuements[imbuementName];
        const imbuementLevel = getSelectedImbuementLevel();
        const selectedItem = getSelectedItemObject();
        if (!selectedItem.imbuements[imbuementName].includes(imbuementLevel)) {
            return;
        }

        const divItem = document.createElement('div');
        divItem.classList.add("imbuement-tool-data-list-item");
        divItem.setAttribute("imbuement-name", imbuementName);
        divItem.setAttribute("imbuement-level", imbuementLevel);
        divItem.setAttribute("title", imbuementName.concat(" | ").concat(imbuement.name));

        const img = document.createElement('img');
        img.setAttribute('src', imbuement.level[imbuementLevel].image);

        divItem.appendChild(img);

        divItem.addEventListener('click', function() {
            selectImbuementCell(this);
        }, false);

        return divItem;
    }

    var loadImbuementsItems = () => {
        const listItems = document.getElementsByClassName("imbuement-tool-list-items");
        if (listItems == null || Object.keys(listItems).length === 0) {
            showAlert();
            return;
        }
        const itemList = listItems[0];
        itemList.innerHTML = "";

        const imbuement = getSelectedImbuementObject();
        imbuement.itens.forEach(item => {
            const itemSlot = createImbuementItemSlot(item);
            itemList.appendChild(itemSlot);
        });
    }

    var createImbuementItemSlot = (imbuementItem) => {

        const divBox = document.createElement("div");
        divBox.classList.add("imbuement-tool-list-items-box");
        divBox.setAttribute("title", new String(imbuementItem.quantity).concat("x ").concat(imbuementItem.name));

        const divImg = document.createElement("div");
        const a = document.createElement("a");
        a.setAttribute('href', imbuementItem.link);
        a.setAttribute('target', "_blank");
        const img = document.createElement("img");
        img.setAttribute('src', imbuementItem.image);
        const label = document.createElement("label");
        label.innerText = imbuementItem.quantity;

        a.appendChild(img);
        divImg.appendChild(a);
        divBox.appendChild(divImg);
        divBox.appendChild(label);

        return divBox;
    }

    var selectImbuementCell = (component) => {
        cleanSelectedImbuementCell();
        component.classList.add('selected');
        const imbuementDescription = document.getElementById('imbuement-tool-selected-imbuement-description');
        imbuementDescription.innerText = imbuements[component.getAttribute('imbuement-name')].level[component.getAttribute('imbuement-level')].description;

        loadImbuementsItems();
        loadImbuementItemsInfos();
        loadItemsInfosLine();
        updateTotal();
    }

    var loadImbuementItemsInfos = () => {


        const itemsInfosList = document.getElementsByClassName('imbuement-tool-prices-items');
        if (itemsInfosList == null || Object.keys(itemsInfosList).length === 0) {
            showAlert();
            return;
        }
        const itemsInfosListComponent = itemsInfosList[0];
        itemsInfosListComponent.innerHTML = "";

        const imbuement = getSelectedImbuementObject();
        if (imbuement.gold_token) {
            goldToken.quantity = getGoldTokenQuantity();
            const goldTokenBox = createImbuementItemInfoBox(goldToken, 0);
            itemsInfosListComponent.appendChild(goldTokenBox);
        }
        let index = 1;
        imbuement.itens.forEach(item => {
            const itemInfoBox = createImbuementItemInfoBox(item, index);
            itemsInfosListComponent.appendChild(itemInfoBox);
            index++;
        });
    }

    var createImbuementItemInfoBox = (item, indexId) => {

        const img = document.createElement('img');
        img.setAttribute('src', item.image);
        img.setAttribute('alt', 'imbuement item');

        const a = document.createElement('a');
        a.setAttribute('href', item.link);
        a.setAttribute('target', '_blank');
        a.setAttribute('title', item.name);
        a.appendChild(img);

        const labelQuantity = document.createElement('label');
        labelQuantity.innerText = "Quantidade:";

        const inputQuantity = document.createElement('input');
        inputQuantity.setAttribute('value', item.quantity);
        inputQuantity.setAttribute('min', '0');
        inputQuantity.setAttribute('type', 'number');
        inputQuantity.setAttribute('id', 'input-quantity-'.concat(indexId));
        inputQuantity.addEventListener('input', function () {
            updateValues(this, 'quantity', indexId);
        });

        const divQuantity = document.createElement('div');
        divQuantity.appendChild(labelQuantity);
        divQuantity.appendChild(inputQuantity);

        const labelPrice = document.createElement('label');
        labelPrice.innerText = "Valor Unitário (GPs):";

        const inputPrice = document.createElement('input');
        inputPrice.setAttribute('value', 0);
        inputPrice.setAttribute('min', '0');
        inputPrice.setAttribute('type', 'number');
        inputPrice.setAttribute('id', 'input-price-'.concat(indexId));
        inputPrice.addEventListener('input', function () {
            updateValues(this, 'price', indexId);
        });

        const divPrice = document.createElement('div');
        divPrice.appendChild(labelPrice);
        divPrice.appendChild(inputPrice);

        const divBox = document.createElement('div');
        divBox.classList.add('imbuement-tool-prices-items-box');
        divBox.appendChild(a);
        divBox.appendChild(divQuantity);
        divBox.appendChild(divPrice);
        
        return divBox;
    }

    var loadItemsInfosLine = () => {

        const itemsInfoDivs = document.getElementsByClassName('imbuement-tool-prices-taxas-info-items');
        if (itemsInfoDivs == null || Object.keys(itemsInfoDivs).length === 0) {
            showAlert();
            return;
        }
        const itemsInfo = itemsInfoDivs[0];
        itemsInfo.innerHTML = "";

        const imbuement = getSelectedImbuementObject();
        if (imbuement.gold_token) {
            const goldTokenBox = createItemInfoLabel(goldToken, 0);
            itemsInfo.appendChild(goldTokenBox);
        }
        document.getElementById("lbl-total-gold-token").style.display = imbuement.gold_token ? 'block' : 'none';
        let index = 1;
        imbuement.itens.forEach(item => {
            const itemLabel = createItemInfoLabel(item, index);
            itemsInfo.appendChild(itemLabel);
            index++;
        });
    }

    var createItemInfoLabel = (item, indexId) => {
        const label = document.createElement('label');
        label.setAttribute('id', "lbl-item-".concat(indexId));
        label.innerText = "Total ".concat(item.name).concat(": 0 GPs");
        return label;
    }

    var getGoldTokenQuantity = () => {
        switch(getSelectedImbuementLevel()) {
            case ("Powerful"): {
                return 6;
            }
            case ("Intricate"): {
                return 4;
            }
            default: {
                return 2;
            }
        }
    }
    var getSelectedImbuementLevel = () => {
        return selectedImbuementLevel;
    }

    var getSelectedCategory = () => {
        return document.getElementById('imbuement-tool-items-category').value;
    }
    var getSelectedItemName = () => {
        return (getSelectedImbuementOption() === "Items") ? document.getElementById('imbuement-tool-items-list').value : Object.keys(imbuementScrolls)[0];
    }
    var getSelectedItemObject = () => {
        return (getSelectedImbuementOption() === "Items") ? categories[getSelectedCategory()][getSelectedItemName()] : imbuementScrolls[getSelectedItemName()];
    }
    var getItemList = () => {
        return categories[getSelectedCategory()];
    }
    var getSelectedImbuementObject = () => {
        const selectedComponent = document.querySelector('.imbuement-tool-data-list-item.selected');
        const imbuementName = selectedComponent.getAttribute('imbuement-name');
        const imbuementLevel = selectedComponent.getAttribute('imbuement-level');
        imbuements[imbuementName].level[imbuementLevel]["gold_token"] = imbuements[imbuementName].gold_token;
        return imbuements[imbuementName].level[imbuementLevel];
    }

    // Limpa Campos.
    var cleanSearchField = () => {
        let searchInput = document.getElementById('imbument-tool-input-search');
        searchInput.value = '';
    }
    var cleanSelectedImbuementLevel = () => {
        const selectedComponent = document.querySelector('.imbuement-tool-level-list-item.selected');
        if (selectedComponent == null) {
            return;
        }
        selectedComponent.classList.remove("selected");
        selectedImbuementLevel = "";

        cleanSelectedImbuementCell();
    }
    var cleanSelectedImbuementCell = () => {
        const selectedComponent = document.querySelector('.imbuement-tool-data-list-item.selected');
        if (selectedComponent == null) {
            return;
        }
        selectedComponent.classList.remove("selected");

        const imbuementDescription = document.getElementById('imbuement-tool-selected-imbuement-description');
        imbuementDescription.innerText = "";

        const listItems = document.getElementsByClassName("imbuement-tool-list-items");
        if (listItems == null || Object.keys(listItems).length === 0) {
            showAlert();
            return;
        }
        const itemList = listItems[0];
        itemList.innerHTML = "";
    }

    var showSelectedOption = () => {
        const selectedImbuementOption = getSelectedImbuementOption();
        const itemsContainer = document.getElementById('imbument-tool-items-container');
        if (itemsContainer == null) {
            showAlert();
            return;
        }
        itemsContainer.style.display = (selectedImbuementOption === "Items") ? 'block' : 'none';
        cleanSelectedImbuementLevel();
    }

    // Busca Item na lista de Items.
    var searchItems = (input) => {
        let items = getItemList();
        let filteredKeys = Object.keys(items).filter(name => name.toLowerCase().includes(input.value.toLowerCase()));
        if (filteredKeys.length === 0) {
            return
        }
        let filteredItems = new Object();
        filteredKeys.forEach(itemName => {
            filteredItems[itemName] = items[itemName];
        });
        loadItemList(filteredItems);
    }

    var updateValues = (component, type, indexId) => {
        const value = component.value;

        const multiplier = document.getElementById(`input-${(type === 'quantity') ? 'price' : 'quantity'}-${indexId}`).value;

        const total = value * multiplier;
        const imbuement = getSelectedImbuementObject();
        const imbuementItemName = (indexId === 0) ? goldToken.name : imbuement.itens[indexId - 1].name;
        document.getElementById(`lbl-item-${indexId}`).innerText = `Total ${imbuementItemName}: ${total.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")} GPs`;

        updateTotal();
    }

    var updateTotal = () => {
        const imbuement = getSelectedImbuementObject();

        let totalGoldTotken = 0;
        if (imbuement.gold_token) {
            const quantityGoldToken = document.getElementById('input-quantity-0').value;
            const priceGoldToken = document.getElementById('input-price-0').value;
            totalGoldTotken = quantityGoldToken * priceGoldToken;
        }

        let totalItens = 0;
        for (let i = 1; i <= imbuement.itens.length; i++) {
            const quantityItem = document.getElementById(`input-quantity-${i}`).value;
            const priceItem = document.getElementById(`input-price-${i}`).value;
            totalItens += quantityItem * priceItem;
        }
        const taxa = getTaxPrice();
        if (imbuement.gold_token) {
            document.getElementById('lbl-total-gold-token').innerText = `Total com Gold Token: ${(totalGoldTotken + taxa).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")} GPs`;
        }
        document.getElementById('lbl-total-items').innerText = `Total com os Items: ${(totalItens + taxa).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")} GPs`;
    }

    var getTaxPrice = () => {
        switch(getSelectedImbuementLevel()) {
            case('Powerful'): {
                return 250000;
            }
            case('Intricate'): {
                return 60000;
            }
            default: {
                return 7500;
            }
        }
    }

    /**
     * Adiciona Evento para quando houver interação nos selects, disparar uma ação/função.
     */
    var addEventListeners = () => {
        // Category Select
        document.getElementById('imbuement-tool-items-category').addEventListener('change', function() {
            cleanSearchField();
            loadItemList();
            createImbuementsLine();
        }, false);

        // Item Select
        document.getElementById('imbuement-tool-items-list').addEventListener('change', function() {
            selectItem();
        }, false);

        // Imbuement Option Select
        document.getElementById('imbument-tool-items').addEventListener('click', function() {
            showSelectedOption();
            selectItem();
        }, false);
        document.getElementById('imbument-tool-scrolls').addEventListener('click', function() {
            showSelectedOption();
            selectItem();
        }, false);

        let searchInput = document.getElementById('imbument-tool-input-search');
        searchInput.addEventListener('input', () => {
            searchItems(searchInput);
        });

        // // ImbuementSelect
        // document.getElementById('imbuementSelect').addEventListener('change', function() {
        //     let option = getSelectedValueFromSelect('imbuementSelect');
        //     selectImbuement(option);
        //     loadSelectImbuementLevel(option);
        // }, false);

        // // Imbuement Level Select
        // document.getElementById('imbuementLevelSelect').addEventListener('change', function() {
        //     let option = getSelectedValueFromSelect('imbuementLevelSelect');
        //     selectImbuementLevel(option);
        // }, false);
    }

    var showAlert = (message) => {
        alert(message || "Desculpe pela inconveniência!\n\nAlgo deu errado. Por favor, recarregue a página.");
    }

    var getSelectedImbuementOption = () => {
        return document.querySelector('input[name="imbuement-options"]:checked').value;
    }

    $(document).ready(function () {

        $(".imbument-tool-version-label").text("v" + version);
        const radioItems = document.getElementById('imbument-tool-items');
        if (radioItems == null) {
            showAlert();
            return;
        }
        radioItems.setAttribute('checked', true);
        // Adiona os eventos aos componentes.
        addEventListeners();

        loadAllItens();

        showSelectedOption();
    });