Mudanças entre as edições de "Tibia Wiki:Outfiter/CodigoTeste"

De Tibia Wiki
Ir para: navegação, pesquisa
 
Linha 900: Linha 900:
  
 
// Lista de Montarias
 
// Lista de Montarias
montarias = [['Nenhuma', 'None', 'Ninguna', 'Brak'], 'Armoured_War_Horse', 'Arctic_Unicorn', 'Azudocus', 'Batcat', 'Black_Sheep', 'Black_Stag', 'Blackpelt', 'Blazing_Unicorn', 'Blazebringer', 'Bloodcurl', 'Blue Rolling Barrel', 'Boreal Owl', 'Bright_Percht_Sleigh', 'Bunny_Dray', 'Caped_Snowman', 'Carpacosaurus', 'Cave Tarantula', 'Cinderhoof', 'Cold_Percht_Sleigh', 'Cony_Cart', 'Cranium_Spider', 'Copper_Fly', 'Coralripper', 'Crimson_Ray', 'Crystal_Wolf', 'Dark_Percht_Sleigh', 'Death_Crawler', 'Desert_King', 'Donkey', 'Doombringer', 'Dragonling', 'Draptor', 'Dreadhare', 'Dromedary', 'Ebony Tiger', 'Eland', 'Ember Saurian', 'Emerald Sphinx', 'Emerald_Waccoon', 'Emperor_Deer', 'Ethereal_Spirit_Armour', 'Feral Tiger', 'Festive_Snowman', 'Flamesteed', 'Flitterkatzen', 'Floating_Kashmir', 'Flying_Book', 'Flying_Divan', 'Frostflare', 'Glacier_Vagabond', 'Gloom_Widow', 'Glooth_Glider', 'Gnarlhound', 'Gold Sphinx', 'Golden_Dragonfly', 'Gorongra‎', 'Green Rolling Barrel', 'Hailstorm_Fury', 'Hellgrip', 'Hibernal Moth', 'Highland_Yak', 'Ironblight', 'Ivory_Fang', 'Jackalope', 'Jade_Lion', 'Jade_Pincer', 'Jungle Saurian', 'Jungle Tiger', 'King_Scorpion', 'Kingly_Deer', 'Ladybug', 'Lagoon Saurian', 'Leafscuttler', 'Lacewing Moth', 'Magic_Carpet', 'Magma_Crawler', 'Manta_Ray', 'Marsh Toad', 'Midnight_Panther', 'Mole', 'Mouldpincer', 'Mould_Shell', 'Muffled_Snowman', 'Neon_Sparkid', 'Nethersteed', 'Night_Waccoon', 'Nightdweller', 'Nightmarish Crocovile', 'Nightstinger', 'Noble_Lion', 'Noctungra‎', 'Platesaurian', 'Plumfish', 'Poisonbane', 'Prismatic_Unicorn', 'Rabbit_Rickshaw', 'Racing_Bird', 'Rapid_Boar', 'Razorcreep', 'Red Rolling Barrel', 'Reed_Lurker', 'Rented_Horse_(A)', 'Rented_Horse_(B)', 'Rented_Horse_(C)', 'Rift_Runner', 'Ringtail_Waccoon', 'River Crocovile', 'Sanguine_Frog', 'Sea_Devil', 'Shadow_Claw', 'Shadow_Draptor', 'Shadow_Hart', 'Shadow Sphinx', 'Shock_Head', 'Siegebreaker', 'Silverneck', 'Slagsnare', 'Snow_Pelt', 'Snowy Owl', 'Sparkion', 'Stampor', 'Steel_Bee', 'Steelbeak', 'Stone_Rhino', 'Swamp Crocovile', 'Swamp_Snapper', 'Tamed_Panda', 'Tawny Owl', 'Tempest', 'Tiger_Slug', 'Tin_Lizzard', 'Titanica', 'Toxic_Toad', 'Tombstinger', 'Tundra_Rambler', 'Undead_Cavebear', 'Uniwheel', 'Ursagrodon', 'Venompaw', 'Vortexion', 'Walker', 'War_Bear', 'War_Horse', 'Water_Buffalo', 'Widow_Queen', 'Winter_King', 'Wolpertinger', 'Woodland_Prince'];
+
montarias = [['Nenhuma', 'None', 'Ninguna', 'Brak'], 'Armoured_War_Horse', 'Arctic_Unicorn', 'Azudocus', 'Batcat', 'Black_Sheep', 'Black_Stag', 'Blackpelt', 'Blazing_Unicorn', 'Blazebringer', 'Bloodcurl', 'Blue Rolling Barrel', 'Boreal Owl', 'Bright_Percht_Sleigh', 'Bunny_Dray', 'Caped_Snowman', 'Carpacosaurus', 'Cave Tarantula', 'Cerberus Champion', 'Cinderhoof', 'Cold_Percht_Sleigh', 'Cony_Cart', 'Cranium_Spider', 'Copper_Fly', 'Coralripper', 'Crimson_Ray', 'Crystal_Wolf', 'Dark_Percht_Sleigh', 'Death_Crawler', 'Desert_King', 'Donkey', 'Doombringer', 'Dragonling', 'Draptor', 'Dreadhare', 'Dromedary', 'Ebony Tiger', 'Eland', 'Ember Saurian', 'Emerald Sphinx', 'Emerald_Waccoon', 'Emperor_Deer', 'Ethereal_Spirit_Armour', 'Feral Tiger', 'Festive_Snowman', 'Flamesteed', 'Flitterkatzen', 'Floating_Kashmir', 'Flying_Book', 'Flying_Divan', 'Frostflare', 'Glacier_Vagabond', 'Gloom_Widow', 'Glooth_Glider', 'Gnarlhound', 'Gold Sphinx', 'Golden_Dragonfly', 'Gorongra‎', 'Green Rolling Barrel', 'Hailstorm_Fury', 'Hellgrip', 'Hibernal Moth', 'Highland_Yak', 'Ironblight', 'Ivory_Fang', 'Jackalope', 'Jade_Lion', 'Jade_Pincer', 'Jousting Eagle', 'Jungle Saurian', 'Jungle Tiger', 'King_Scorpion', 'Kingly_Deer', 'Ladybug', 'Lagoon Saurian', 'Leafscuttler', 'Lacewing Moth', 'Magic_Carpet', 'Magma_Crawler', 'Manta_Ray', 'Marsh Toad', 'Midnight_Panther', 'Mole', 'Mouldpincer', 'Mould_Shell', 'Muffled_Snowman', 'Neon_Sparkid', 'Nethersteed', 'Night_Waccoon', 'Nightdweller', 'Nightmarish Crocovile', 'Nightstinger', 'Noble_Lion', 'Noctungra‎', 'Platesaurian', 'Plumfish', 'Poisonbane', 'Prismatic_Unicorn', 'Rabbit_Rickshaw', 'Racing_Bird', 'Rapid_Boar', 'Razorcreep', 'Red Rolling Barrel', 'Reed_Lurker', 'Rented_Horse_(A)', 'Rented_Horse_(B)', 'Rented_Horse_(C)', 'Rift_Runner', 'Ringtail_Waccoon', 'River Crocovile', 'Sanguine_Frog', 'Sea_Devil', 'Shadow_Claw', 'Shadow_Draptor', 'Shadow_Hart', 'Shadow Sphinx', 'Shock_Head', 'Siegebreaker', 'Silverneck', 'Slagsnare', 'Snow_Pelt', 'Snowy Owl', 'Sparkion', 'Stampor', 'Steel_Bee', 'Steelbeak', 'Stone_Rhino', 'Swamp Crocovile', 'Swamp_Snapper', 'Tamed_Panda', 'Tawny Owl', 'Tempest', 'Tiger_Slug', 'Tin_Lizzard', 'Titanica', 'Toxic_Toad', 'Tombstinger', 'Tundra_Rambler', 'Undead_Cavebear', 'Uniwheel', 'Ursagrodon', 'Venompaw', 'Vortexion', 'Walker', 'War_Bear', 'War_Horse', 'Water_Buffalo', 'Widow_Queen', 'Winter_King', 'Wolpertinger', 'Woodland_Prince'];
  
 
// Lista de Outfits Comuns
 
// Lista de Outfits Comuns
outfits_comuns =  ['Afflicted', 'Arena_Champion', 'Assassin', 'Barbarian', 'Battle Mage', 'Beastmaster', 'Beggar', 'Breezy Garb', 'Brotherhood', 'Cave_Explorer', 'Ceremonial_Garb', 'Champion', 'Chaos_Acolyte', 'Citizen', 'Conjurer', 'Crystal_Warlord', 'Death_Herald', 'Deepling', 'Demon', 'Demon_Hunter', 'Discoverer', 'Dream_Warden', 'Dream_Warrior', 'Druid', 'Elementalist', 'Entrepreneur', 'Evoker', 'Falconer', 'Festive', 'Glooth_Engineer', 'Golden Outfit', 'Grove Keeper', 'Guidon_Bearer', 'Herbalist', 'Hunter', 'Insectoid', 'Jersey', 'Jester', 'Knight', 'Lion_of_War', 'Lupine_Warden', 'Mage', 'Makeshift Warrior', 'Mercenary', 'Newly_Wed', 'Nightmare', 'Nobleman', 'Norseman', 'Orcsoberfest_Garb', 'Oriental', 'Owl_Keeper', 'Percht_Raider', 'Pharaoh', 'Philosopher', 'Pirate', 'Poltergeist', 'Pumpkin Mummy', 'Puppeteer', 'Ranger', 'Recruiter', 'Retro Citizen', 'Retro Hunter', 'Retro Knight', 'Retro Mage', 'Retro Nobleman', 'Retro Summoner', 'Retro Warrior', 'Rift_Warrior', 'Royal_Pumpkin', 'Sea_Dog', 'Seaweaver', 'Shaman', 'Siege Master', 'Sinister_Archer', 'Soil_Guardian', 'Spirit_Caller', 'Summoner', 'Sun Priest', 'Tomb Assassin', 'Trophy Hunter', 'Veteran_Paladin', 'Void_Master', 'Warmaster', 'Warrior', 'Wayfarer', 'Winter_Warden', 'Wizard', 'Yalaharian'];
+
outfits_comuns =  ['Afflicted', 'Arena_Champion', 'Assassin', 'Barbarian', 'Battle Mage', 'Beastmaster', 'Beggar', 'Breezy Garb', 'Brotherhood', 'Cave_Explorer', 'Ceremonial_Garb', 'Champion', 'Chaos_Acolyte', 'Citizen', 'Conjurer', 'Crystal_Warlord', 'Death_Herald', 'Deepling', 'Demon', 'Demon_Hunter', 'Discoverer', 'Dream_Warden', 'Dream_Warrior', 'Druid', 'Elementalist', 'Entrepreneur', 'Evoker', 'Falconer', 'Festive', 'Glooth_Engineer', 'Golden Outfit', 'Grove Keeper', 'Guidon_Bearer', 'Herbalist', 'Herder', 'Hunter', 'Insectoid', 'Jersey', 'Jester', 'Knight', 'Lion_of_War', 'Lupine_Warden', 'Mage', 'Makeshift Warrior', 'Mercenary', 'Newly_Wed', 'Nightmare', 'Nobleman', 'Norseman', 'Orcsoberfest_Garb', 'Oriental', 'Owl_Keeper', 'Percht_Raider', 'Pharaoh', 'Philosopher', 'Pirate', 'Poltergeist', 'Pumpkin Mummy', 'Puppeteer', 'Ranger', 'Recruiter', 'Retro Citizen', 'Retro Hunter', 'Retro Knight', 'Retro Mage', 'Retro Nobleman', 'Retro Summoner', 'Retro Warrior', 'Rift_Warrior', 'Royal_Pumpkin', 'Sea_Dog', 'Seaweaver', 'Shaman', 'Siege Master', 'Sinister_Archer', 'Soil_Guardian', 'Spirit_Caller', 'Summoner', 'Sun Priest', 'Tomb Assassin', 'Trophy Hunter', 'Veteran_Paladin', 'Void_Master', 'Warmaster', 'Warrior', 'Wayfarer', 'Winter_Warden', 'Wizard', 'Yalaharian'];
  
 
// Lista de Outfits Incomuns
 
// Lista de Outfits Incomuns
outfits_outros = ['Archdemon', 'Barb_Bloodwalker', 'Barb_Brutetamer', 'Barb_Headsplitter', 'Barb_Skullhunter', 'Black_Sphinx_Acolyte', 'Book', 'Carnivor', 'CM', 'Cobra', 'Crazed_A', 'Corym_Charlatan', 'Corym_Skirmisher', 'Corym_Vanguard', 'Cultist', 'Demon_Hellfire', 'Demon_Ram', 'Destroyer_From_Beyond', 'Dragonking', 'Dwarf', 'Elf', 'Energy_Wisp', 'Falcon_A', 'Faun', 'Frog', 'Galvanic_Terror', 'Gnome', 'Lamassu', 'Manticore', 'Orclops_Ravager', 'Pit_Demon', 'Priestess_of_the_Wild_Sun', 'ProspectorSoul', 'Spectre', 'Sphinx', 'Squid', 'True_Asura', 'Twisted_Shaper', 'Undead_Warrior_Armor', 'Undead_Warrior_Cape', 'Undead_Warrior_Shield'];
+
outfits_outros = ['Archdemon', 'Barb_Bloodwalker', 'Barb_Brutetamer', 'Barb_Headsplitter', 'Barb_Skullhunter', 'Black_Sphinx_Acolyte', 'Book', 'Carnivor', 'CM', 'Cobra', 'Crazed_A', 'Corym_Charlatan', 'Corym_Skirmisher', 'Corym_Vanguard', 'Cultist', 'Demon_Hellfire', 'Demon_Ram', 'Destroyer_From_Beyond', 'Dragonking', 'Dwarf', 'Elf', 'Energy_Wisp', 'Falcon_A', 'Faun', 'Frog', 'Galvanic_Terror', 'Gnome', 'Lamassu', 'Manticore', 'Ogre', 'Orclops_Ravager', 'Pit_Demon', 'Priestess_of_the_Wild_Sun', 'ProspectorSoul', 'Spectre', 'Sphinx', 'Squid', 'True_Asura', 'Twisted_Shaper', 'Undead_Warrior_Armor', 'Undead_Warrior_Cape', 'Undead_Warrior_Shield'];
 
outfits = outfits_comuns.concat(outfits_outros);
 
outfits = outfits_comuns.concat(outfits_outros);
  
Linha 978: Linha 978:
 
   "Lamassu",
 
   "Lamassu",
 
   "Manticore",
 
   "Manticore",
 +
  "Ogre",
 
   "Orclops_Ravager",
 
   "Orclops_Ravager",
 
   "Pit_Demon",
 
   "Pit_Demon",

Edição atual tal como às 12h09min de 2 de dezembro de 2019

<table height="243" class="outfiter_main_table">
  <tr>
    <td style="height: 30px;" colspan="6">
      <div class="titulo">Outfiter<div class="bandeira" id="br"><span>Português</span></div><div class="bandeira" id="en"><span>English</span></div><div class="bandeira" id="es"><span>Español</span></div><div class="bandeira" id="pl"><span>Polski</span></div>
    </td>
  </tr>
  <tr>
    <td class="janela" rowspan="6">
      <div class="icone_janela_outfit"></div><div class="titulo_janela">Outfits</div>
      <div class="janela_outfits"><form id="form_outfits"></form></div>
    </td>
  </tr>
  <tr>
    <td style="width: 138px; height: 120px;" rowspan="3">
      <div class="esquerda">
        <table style="width: 97%; margin: 2px 2px 2px 2px">
          <tr style="height: 127px; text-align: right; vertical-align: bottom;">
            <td style="position: relative;">
              <div class="carregando"></div>
              <canvas id="tela" width="128" height="128"></canvas></td></tr>
          <tr><td>
            <table style="margin-top: -4px; line-height: 12px;">
              <tr>
                <td><div class="botao_e" id="out_e"></div></td>
                <td style="width: 100%"><div class="outfit_nome"></div></td>
                <td><div class="botao_d" id="out_d"></div></td></tr>
            </table>
          </td></tr>
          <tr><td>
            <table style="margin-top: -3px; line-height: 12px;"><tr>
                <td><div class="botao_e" id="mount_e"></div></td>
                <td style="width: 100%"><div class="montaria_nome"></div></td>
                <td><div class="botao_d" id="mount_d"></div></td>
              </tr></table>
          </td></tr>
        </table>
      </div>
    </td>
    <td style="vertical-align: top; height: 127px;" colspan="3">
      <table class="direita">
        <tr style="height:20px;"><td>
          <table class="tabela_seletores">
            <tr>
              <td class="seletores" id="head">Head</td>
              <td class="seletores" id="primary">Primary</td>
              <td class="seletores" id="secondary">Secondary</td>
              <td class="seletores" id="detail">Detail</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr style="height:104px">
        <td>
          <table class="tabela_cores"><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
        </td>
      </tr>
    </table>
      <td class="janela" rowspan="5">
        <div class="icone_janela_mount"></div><div class="titulo_janela"><span class="lingua"><span class="br">Montarias</span><span class="en">Mounts</span><span class="es">Monturas</span><span class="pl">Wierzchowce</span></span></div>
      <div class="janela_montarias"><form id="form_montarias"></form></div>
    </td>
  </tr>
  <tr>
    <td rowspan="3"><div class="orientacao">
      <div class="seta_cima"></div>
      <div class="seta_direita"></div>
      <div class="seta_baixo"></div>
      <div class="seta_esquerda"></div>
          </div>
          </td>
        <td colspan="2" style="height: 25px;">
          <table style="width: 100%; margin-left: -1px;">
            <tr>
              <td style="width: 77px;"><div class="check"><input type="checkbox" id="addon_1" name="addon_1" />  <label for="addon_1"></label><span>Addon 1</span></div></td>
              <td style="width: 77px;"><div class="check"><input type="checkbox" value="None" id="addon_2" name="addon_2" /> <label for="addon_2"></label><span>Addon 2</span></div></td>
              <td><div class="botao_sexo"><div id="sexo" class="sexo_f"></div></div></td>
        </tr>
    </table>
        <tr style="height: 25px;">
          <td style="width: 77px;"><div class="check"><input type="checkbox" value="None" id="animar" name="animar" />  <label for="animar"></label><span class="lingua"><span class="br">Animar</span><span class="en">Animate</span><span class="es">Animar</span><span class="pl">Animuj</span></span></div></td>
          <td style="width: 130px;">
            <div class="check"><input type="checkbox" value="None" id="vida" name="vida" /> <label for="vida"></label><span class="lingua"><span class="br">Barra de Vida</span><span class="en">Life Bar</span><span class="es">Barra de Vida</span><span class="pl">Pasek Życia</span></span></div></td>
          </td>
      </tr>
    </td>
  </tr>
  <tr style="height: 25px;">
    <td>
      <table style="width: 100%;">
        <tr>
          <td><div class="check"><input type="checkbox" value="None" id="suavizar" name="suavizar" /> <label for="suavizar"></label><span class="lingua"><span class="br">Suavizar Imagem</span><span class="en">Smooth Image</span><span class="es">Suavizar Imagen</span><span class="pl">Zmiękcz Obraz</span></span></div>
        </tr>
      </table>
    </td>
    <td style="width: 77px;"><div class="check"><input type="checkbox" value="None" id="quadros" name="quadros" />  <label for="quadros"></label><span class="lingua"><span class="br">Quadros</span><span class="en">Steps</span><span class="es">Pasos</span><span class="pl">Chód</span></span></div></td>
    <td style="padding-left: 4px;">
      <input type="text" size="14" class="nome_char" maxlength="29" style="width: 116px;">
    </td>
  </tr>
  <tr style="height: 25px; white-space: nowrap;">
    <td colspan="4" style="padding-left: 3px;">Link: <input type="text" size="51" value="" class="link" onClick="this.select();" readonly="true"></td>
  </tr>
</table>

  <table class="quadros" style="display: none; border-collapse: separate;">
    <tr><td>
      <canvas class="quadro" id="q0" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q1" width="64" height="64"></canvas>
      <canvas class="quadro" id="q2" width="64" height="64"></canvas>
      <canvas class="quadro" id="q3" width="64" height="64"></canvas>
    </td></tr>
    <tr><td>
      <canvas class="quadro" id="q4" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q5" width="64" height="64"></canvas>
      <canvas class="quadro" id="q6" width="64" height="64"></canvas>
      <canvas class="quadro" id="q7" width="64" height="64"></canvas>
    </td></tr>
    <tr><td>
      <canvas class="quadro" id="q8" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q9" width="64" height="64"></canvas>
      <canvas class="quadro" id="q10" width="64" height="64"></canvas>
      <canvas class="quadro" id="q11" width="64" height="64"></canvas>
    </td></tr>
    <tr><td>
      <canvas class="quadro" id="q12" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q13" width="64" height="64"></canvas>
      <canvas class="quadro" id="q14" width="64" height="64"></canvas>
      <canvas class="quadro" id="q15" width="64" height="64"></canvas>
    </td></tr>
    <tr><td>
      <canvas class="quadro" id="q16" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q17" width="64" height="64"></canvas>
      <canvas class="quadro" id="q18" width="64" height="64"></canvas>
      <canvas class="quadro" id="q19" width="64" height="64"></canvas>
    </td></tr>
    <tr><td>
      <canvas class="quadro" id="q20" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q21" width="64" height="64"></canvas>
      <canvas class="quadro" id="q22" width="64" height="64"></canvas>
      <canvas class="quadro" id="q23" width="64" height="64"></canvas>
    </td></tr>
    <tr><td>
      <canvas class="quadro" id="q24" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q25" width="64" height="64"></canvas>
      <canvas class="quadro" id="q26" width="64" height="64"></canvas>
      <canvas class="quadro" id="q27" width="64" height="64"></canvas>
    </td></tr>
    <tr><td>
      <canvas class="quadro" id="q28" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q29" width="64" height="64"></canvas>
      <canvas class="quadro" id="q30" width="64" height="64"></canvas>
      <canvas class="quadro" id="q31" width="64" height="64"></canvas>
    </td></tr>
    <tr><td>
      <canvas class="quadro" id="q32" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q33" width="64" height="64"></canvas>
      <canvas class="quadro" id="q34" width="64" height="64"></canvas>
      <canvas class="quadro" id="q35" width="64" height="64"></canvas>
    </td></tr><tr style="display: inline;"><td>
      <canvas class="quadro" id="q36" width="64" height="64" style="margin-left: 2px;"></canvas>
      <canvas class="quadro" id="q37" width="64" height="64"></canvas>
      <canvas class="quadro" id="q38" width="64" height="64"></canvas>
      <canvas class="quadro" id="q39" width="64" height="64"></canvas>
    </td></tr>
  </table>

<img class="invisivel" id="img_letras" src="/wiki/Especial:Redirecionar/file/Outfiter_Letras.png">
<div class="invisivel" id="preload"></div>
<canvas class="invisivel" id="tela_cor" width="64" height="64"></canvas>
<canvas class="invisivel" id="montagem" width="2560" height="128"></canvas>
.outfiter {
  min-width: 692px;
  font-family: Verdana, Arial, Times New Roman, sans-serif;
  font-size: 11px;
  color: #B2A898;
  cursor: default;
  unselectable: on;
  -moz-user-select: -moz-none;
  -moz-user-select: none;
  -o-user-select: none;
  -khtml-user-select: none;
  -webkit-user-select: none;
  -ms-user-select:none;
  -user-select:none;
  position: absolute;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  z-index: 10;
}

.outfiter_main_table {
  border:#7B6E4C 1px solid;
  background:#181E23;
  color:#C9BDAB; margin: 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);
}

.outfiter table {
  border-collapse: collapse;
}

.titulo {
  position: relative;
  margin: 1px 2px 0 2px;
  border: #7B6E4C 1px solid;
  background: #11161A;
  padding: 0 auto;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-weight: bold;
  font-size: 12px;
  cursor: default;
}

.janela {
  width: 136px;
  min-width: 136px;
  background: url('/wiki/Especial:Redirecionar/file/Outfiter Janela Fundo.png');
  background-repeat: no-repeat;
  position: relative;
  vertical-align: top;
}

.icone_janela_outfit {
  position:absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 19px;
  background: url('/wiki/Especial:Redirecionar/file/Outfiter_Janela_Icone_Outfit.png');
}

.icone_janela_mount {
  position:absolute;
  top: 2px;
  left: 2px;
  width: 23px;
  height: 19px;
  background: url('/wiki/Especial:Redirecionar/file/Outfiter_Janela_Icone_Montaria.png');
}

.titulo_janela {
  position:absolute;
  top: 0px;
  left: 42px;
  height: 23px;
  line-height: 23px;
  color: #BDB4A3;
}

.janela_outfits, .janela_montarias {
  position: absolute;
  top: 26px;
  left: 4px;
  width: 128px;
  height: 193px;
  color: #C8BCAB;
  font-size: 10px;
  overflow: auto;
}

.janela div::-webkit-scrollbar { width: 18px;}
.janela div::-webkit-scrollbar-button:start { background: url('/wiki/Especial:Redirecionar/file/Outfiter_Scrollbar_Seta_Cima.png'); border: black 1px solid; border-radius: 2px; height: 18px;}
.janela div::-webkit-scrollbar-button:start:hover { background: url('/wiki/Especial:Redirecionar/file/Outfiter_Scrollbar_Seta_Cima_Hover.png');}
.janela div::-webkit-scrollbar-button:start:active { background: url('/wiki/Especial:Redirecionar/file/Outfiter_Scrollbar_Seta_Cima_Active.png');}
.janela div::-webkit-scrollbar-button:end { background: url('/wiki/Especial:Redirecionar/file/Outfiter_Scrollbar_Seta_Baixo.png'); border: black 1px solid; border-radius: 2px; height: 18px;}
.janela div::-webkit-scrollbar-button:end:hover { background: url('/wiki/Especial:Redirecionar/file/Outfiter_Scrollbar_Seta_Baixo_Hover.png');}
.janela div::-webkit-scrollbar-button:end:active { background: url('/wiki/Especial:Redirecionar/file/Outfiter_Scrollbar_Seta_Baixo_Active.png');}
.janela div::-webkit-scrollbar-track {  background: url('/wiki/Especial:Redirecionar/file/Outfiter_Scrollbar_Caminho.png');}
.janela div::-webkit-scrollbar-thumb { background: url('/wiki/Especial:Redirecionar/file/Outfiter_Scrollbar_Barra.png'); border: black 1px solid; border-radius: 2px; -webkit-box-shadow: inset 0px 1px 0px 0px rgba(100,106,108,1), inset 0px -1px 0px 0px rgba(23,28,29,1); }

.janela div { 
  scrollbar-arrow-color: #A0A0A0;
  scrollbar-base-color: #242C2F;
  scrollbar-track-color: #262F32;
  scrollbar-face-color: #242C2F;
  scrollbar-shadow-color: #131719;
}

.janela_opcao_out,
.janela_opcao_mount {
  position: relative;
  padding: 4px 0 4px 0;
  line-height: 12px;
}

.janela_opcao_out_dif,
.janela_opcao_mount_dif {
  position: relative;
  padding: 4px 0 4px 0;
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mPQsPVsAAACbgEva9+ddQAAAABJRU5ErkJggg==');
  line-height: 12px;
}

.janela label {
    display: inline-block;
    cursor: pointer;
    position: relative;
    padding-left: 14px;
}

.janela input[type=radio] {
    display: none;
}

.janela label:before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  position: absolute;
  left: 0;
  top: 1px;
  background: -webkit-linear-gradient(top, #BBBCBE 0%, #616364 100%);
  background: -moz-linear-gradient(top, #BBBCBE 0%, #616364 100%);
  background: -o-linear-gradient(top, #BBBCBE 0%, #616364 100%);
  background: -ms-linear-gradient(top, #BBBCBE 0%, #616364 100%);
  background: linear-gradient(top, #BBBCBE 0%, #616364 100%);
}

.janela label:before {
    border-radius: 7px;
}

.janela input[type=radio]:checked + label:before {
    content: "\2022";
    color: #2B333C;
    font-size: 11px;
    text-align: center;
    line-height: 12px;
}

.esquerda {
  margin: 0 1px 2px -2px;
  height: 179px;
  border: #7B6E4C 1px solid;
  background: #1D262D;
}

.carregando {
  background: url('/wiki/Especial:Redirecionar/file/Outfiter_Carregando.gif');
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  position: absolute;
  top: 50%;
  left: 50%;
  display: none;
}

/* Botões Outfit e Montaria */

.botao_e {
  width: 12px;
  height: 21px;
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Esquerda.png');
  display: inline-block;
  cursor: pointer;
}

.botao_e:hover {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Esquerda_Hover.png');
}

.botao_e:active {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Esquerda_Active.png');
}

.outfit_nome {
  border: #000 1px solid;
  background: #1F2A31;
  width: 100%;
  height: 18px;
  line-height: 18px;
  text-align: center;
  display: inline-block;
  vertical-align: top;
  white-space: nowrap;
}

.botao_d {
  width: 13px;
  height: 21px;
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Direita.png');
  display: inline-block;
  cursor: pointer;
}

.botao_d:hover {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Direita_Hover.png');
}

.botao_d:active {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Direita_Active.png');
}

.montaria_nome {
  border: #000 1px solid;
  background: #1F2A31;
  width: 100%;
  height: 18px;
  line-height: 18px;
  text-align: center;
  vertical-align: top;
  white-space: nowrap;
}

.direita {
  width: 271px;
  margin: -1px 0 0 -2px;
  vertical-align: top;
}

/* Seletores */

.tabela_seletores {
  width: 201px;
  height: 21px;
  border-top: #7B6E4C 1px solid;
  border-left: #7B6E4C 1px solid;
  border-right: #7B6E4C 1px solid;
  line-height: 12px;
}

.seletores {
  border-left: #7B6E4C 1px solid;
  color: #F2AF4E;
  font-weight: bold;
  text-align: center;
  font-size: 10px;
  background: #1D262D;
}

.selecionado {
  font-weight: bold;
  text-align: center;
  font-size: 10px;
  background: #11161A;
  color: #B2A898;
  padding-top: 3px;
  border-top: #CBB47A 1px solid;
  border-left: #CBB47A 1px solid;
  border-right: #CBB47A 1px solid;
}

/* Tabela de Cores */

table.tabela_cores {
  background: #11161A;
  width: 272px;
  margin-top: -2px;
  padding: 1px 1px 1px 1px;
  border: #CBB47A 1px solid;
  border-collapse: separate;
}

table.tabela_cores td {
  width: 10px;
  height: 10px;
}

.tabela_cores td:hover {
  -webkit-box-shadow: inset 0 0 0 1px rgba(200,188,170,1), inset 0 0 0 2px rgba(34, 34, 34, 0.65);
  -moz-box-shadow: inset 0 0 0 1px rgba(200,188,170,1), inset 0 0 0 2px rgba(34, 34, 34, 0.65);
  box-shadow: inset 0 0 0 1px rgba(200,188,170,1), inset 0 0 0 2px rgba(34, 34, 34, 0.65);
}

.cor_selecionada {
  -webkit-box-shadow: inset 0 0 0 1px rgba(200,188,170,1), inset 0 0 0 2px rgba(34, 34, 34, 0.65);
  -moz-box-shadow: inset 0 0 0 1px rgba(200,188,170,1), inset 0 0 0 2px rgba(34, 34, 34, 0.65);
  box-shadow: inset 0 0 0 1px rgba(200,188,170,1), inset 0 0 0 2px rgba(34, 34, 34, 0.65);
}

/* Orientação */

.orientacao {
  position: relative;
  width: 63px;
  height: 63px;
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Fundo_Orientacao.png');
}

.seta_cima {
  width: 21px;
  height: 12px;
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Cima.png');
  position:absolute;
  top: 6px;
  left: 21px;
  cursor: pointer;
}

.seta_cima:hover {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Cima_Hover.png');
}

.seta_cima:active {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Cima_Active.png');
}

.seta_direita {
  width: 14px;
  height: 21px;
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Direita.png');
  position:absolute;
  top: 21px;
  left: 44px;
  cursor: pointer;
}

.seta_direita:hover {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Direita_Hover.png');
}

.seta_direita:active {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Direita_Active.png');
}

.seta_baixo {
  width: 21px;
  height: 12px;
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Baixo.png');
  position:absolute;
  top: 46px;
  left: 21px;
  cursor: pointer;
}

.seta_baixo:hover {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Baixo_Hover.png');
}

.seta_baixo:active {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Baixo_Active.png');
}

.seta_esquerda {
  width: 14px;
  height: 21px;
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Esquerda.png');
  position: absolute;
  top: 21px;
  left: 6px;
  cursor: pointer;
}

.seta_esquerda:hover {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Esquerda_Hover.png');
}

.seta_esquerda:active {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Seta_Esquerda_Active.png');
}

/* Nome do Char */

.nome_char {
  border: #000 1px solid;
  background: #1D262D;
  width: 116px;
  height: 16px;
  color: #B2A898;
  padding-left: 3px;
  width: 112px;
}

/* Botão Sexo */

.botao_sexo {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Botao_Sexo.png');
  width: 27px;
  height: 22px;
  line-height: 22px;
  text-align: center;
  margin: 0 auto;
  cursor: pointer;
}

.botao_sexo:hover {
  background-image: url('/wiki/Especial:Redirecionar/file/Outfiter_Botao_Sexo_Hover.png');
}

.sexo_m {
  width: 27px;
  height: 22px;
  background: url('/wiki/Especial:Redirecionar/file/Outfiter_Botao_Sexo_Masculino.png');
}

.sexo_f {
  width: 27px;
  height: 22px;
  background: url('/wiki/Especial:Redirecionar/file/Outfiter_Botao_Sexo_Feminino.png');
}

/* Checkboxes */

input[type=checkbox] {
  visibility: hidden;
}

.check {
  position: relative;
  height: 14px;
  margin: -12px 0 0 -4px;
}

.check span {
  margin-left: 3px;
  display: inline-block;
}

.check label {
  cursor: pointer;
  position: absolute;
  width: 12px;
  height: 12px;
  top: 0;
  margin: 5px 0 0 -16px;
  border: 1px solid transparent;
    -moz-border-image: -moz-linear-gradient(top, #7B6E4C 0%, #413A28 100%);
    -webkit-border-image: -webkit-linear-gradient(top, #7B6E4C 0%, #413A28 100%);
    -webkit-border-image: -webkit-gradient(linear, 0 0, 0 100%, from(#7B6E4C), to(#413A28)) 100%;
    -o-border-image: -o-linear-gradient(top, #7B6E4C 0%, #413A28 100%);
    border-image: linear-gradient(to bottom, #7B6E4C 0%, #413A28 100%);
    border-image-slice: 1;
  background: -webkit-linear-gradient(top, #BDC0C1 0%, #64676B 100%);
  background: -moz-linear-gradient(top, #BDC0C1 0%, #64676B 100%);
  background: -o-linear-gradient(top, #BDC0C1 0%, #64676B 100%);
  background: -ms-linear-gradient(top, #BDC0C1 0%, #64676B 100%);
  background: linear-gradient(top, #BDC0C1 0%, #64676B 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#BDC0C1', endColorstr='#64676B',GradientType=0 );
}

.check label:after {
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
  opacity: 0;
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: url('/wiki/Especial:Redirecionar/file/Outfiter_Tick.png');
  top: 0;
  left: 0;
}

.check label:hover::after {
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
  filter: alpha(opacity=50);
  background: #FFF;
  width: 14px;
  height: 14px;
  margin: -1px 0 0 -1px;
  opacity: 0.5;
}

.check input[type=checkbox]:checked + label:after {
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  filter: alpha(opacity=100);
  opacity: 1;
}

.check input[type=checkbox]:checked + label:hover::after {
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
  filter: alpha(opacity=50);
  opacity: .5;
}

.check input[type=checkbox]:disabled + label {
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
  filter: alpha(opacity=50);
  opacity: .5;
  cursor: default;
}

.check input[type=checkbox]:disabled + label:hover::after {
  background: none;
}

.check input[type=checkbox]:checked:disabled + label:hover::after {
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  filter: alpha(opacity=100);
  opacity: 1;
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: url('/wiki/Especial:Redirecionar/file/Outfiter_Tick.png');
  top: 1px;
  left: 1px;
}

/* Link */

.outfiter input {
  font-family: Verdana, Arial, Times New Roman, sans-serif;
  font-size: 11px;
}

.link {
  border: #000 1px solid;
  background: #1D262D;
  width: 370px;
  height: 16px;
  color: #B2A898;
  margin-right: 1px;
  padding-left: 3px;
}

::-moz-selection { /* Code for Firefox */
  color: white;
  background: black;
}

::selection {
  color: white;
  background: black;
}

#tela {
  margin-top: -3px;
}

.invisivel {
  display: none;
  visibility: hidden;
  overflow: hidden;
  width: 0;
  height: 0;
}

.quadros {
  border:#7B6E4C 1px solid;
  border-spacing: 0;
  border-collapse: separate;
  line-height: 12px;
  background:#181E23;
  margin-left: 5px;
  margin-top: 7px;
  max-width: 100%;
  white-space: nowrap;
  -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);
}

.quadro {
  border:#7B6E4C 1px solid;
  background:#181E23;
  
}

#q0, #q1, #q2, #q3 {
  margin: 2px 2px 0 -2px;
}

#q4, #q5, #q6, #q7 {
  margin: 0 2px 0 -2px;
}

/* Ocultar Objetos de Revisão */

#mw-fr-reviewform,
#mw-fr-revisiontag {
  display: none;
}

/* Idiomas */

.bandeira {
  position: absolute;
  top: 4px;
  width: 24px;
  height: 16px;
  display: inline-block;
  cursor: pointer;
  -moz-transition: .2s linear;
  -webkit-transition: .2s ease-out;
  transition: .2s linear;
}

.bandeira:hover {
  -webkit-box-shadow: inset 0px 0px 0px 24px rgba(255,255,255,0.4);
  -moz-box-shadow: inset 0px 0px 0px 24px rgba(255,255,255,0.4);
  box-shadow: inset 0px 0px 0px 24px rgba(255,255,255,0.4);
}

.bandeira > span {
  display: none;
  position: absolute;
  top: 18px;
  left: 12px;
  z-index: 10;
  font-weight: normal;
  font-size: 0.8em;
  border: #7B6E4C 1px solid;
  background: #11161A;
  padding: 0 6px;
}

.bandeira:hover > span {
  display:block;
}

#br {
  right: 88px;
  background: url('https://www.tibiawiki.com.br/wiki/Especial:Redirecionar/file/Outfiter_Flag_BR.png');
}

#en {
  right: 60px;
  background: url('https://www.tibiawiki.com.br/wiki/Especial:Redirecionar/file/Outfiter_Flag_EN.png');
}

#es {
  right: 32px;
  background: url('https://www.tibiawiki.com.br/wiki/Especial:Redirecionar/file/Outfiter_Flag_ES.png');
}

#pl {
  right: 4px;
  background: url('https://www.tibiawiki.com.br/wiki/Especial:Redirecionar/file/Outfiter_Flag_PL.png');
}

.lingua > span {
  display: none;
  margin-left: 0;
}

/* Artworks*/

.artwork_td {
  vertical-align: top;
}

#artwork_e,
#artwork_d {
  position: relative;
  height: 400px;
  -moz-transition: .8s linear;
  -webkit-transition: .8s ease-out;
  transition: .8s linear;
}

@media screen and (max-width: 1200px) {
  #artwork_e,
  #artwork_d {
    opacity: 0;
  }
}

@media screen and (min-width: 1200px) and (max-width: 1320px) {
  #artwork_e,
  #artwork_d {
    height: 350px;
  }
}

@media screen and (min-width: 1380px) {
  #artwork_e,
  #artwork_d {
    height: 450px;
  }
}

.artwork {
  position: absolute;
}

#artwork_B {
  right: 0;
}

#artwork_C,
#artwork_D {
  bottom: 0;
}
/* Variáveis */

loop = "";
c = $('#tela')[0];
ctx = c.getContext("2d");
ccor = $('#tela_cor')[0];
cctx = ccor.getContext("2d");
cm = $('#montagem')[0];
mctx = cm.getContext("2d");
img_letras = $('#img_letras')[0];
letras = {" ": [0, 0, 4], A: [1, 0, 9], B: [2, 0, 8], C: [3, 0, 8], D: [4, 0, 9], E: [5, 0, 8], F: [6, 0, 8], G: [7, 0, 9], H: [8, 0, 9], I: [9, 0, 6], J: [10, 0, 7], K: [11, 0, 8], L: [12, 0, 8], M: [13, 0, 10], N: [14, 0, 9], O: [15, 0, 9], P: [16, 0, 8], Q: [17, 0, 9], R: [18, 0, 9], S: [19, 0, 8], T: [20, 0, 10], U: [21, 0, 9], V: [22, 0, 8], W: [23, 0, 10], X: [24, 0, 8], Y: [25, 0, 8], Z: [26, 0, 8], "'": [0, 1, 4], a: [1, 1, 8], b: [2, 1, 8], c: [3, 1, 7], d: [4, 1, 8], e: [5, 1, 8], f: [6, 1, 7], g: [7, 1, 8], h: [8, 1, 8], i: [9, 1, 4], j: [10, 1, 6], k: [11, 1, 8], l: [12, 1, 4], m: [13, 1, 10], n: [14, 1, 8], o: [15, 1, 8], p: [16, 1, 8], q: [17, 1, 8], r: [18, 1, 7], s: [19, 1, 7], t: [20, 1, 7], u: [21, 1, 8], v: [22, 1, 8], w: [23, 1, 10], x: [24, 1, 8], y: [25, 1, 8], z: [26, 1, 7], "0": [0, 2, 9], "1": [1, 2, 8], "2": [2, 2, 8], "3": [3, 2, 9], "4": [4, 2, 8], "5": [5, 2, 8], "6": [6, 2, 9], "7": [7, 2, 9], "8": [8, 2, 8], "9": [9, 2, 8], "-": [10, 2, 9], ",": [11, 2, 4]};

// Lista de Montarias
montarias = [['Nenhuma', 'None', 'Ninguna', 'Brak'], 'Armoured_War_Horse', 'Arctic_Unicorn', 'Azudocus', 'Batcat', 'Black_Sheep', 'Black_Stag', 'Blackpelt', 'Blazing_Unicorn', 'Blazebringer', 'Bloodcurl', 'Blue Rolling Barrel', 'Boreal Owl', 'Bright_Percht_Sleigh', 'Bunny_Dray', 'Caped_Snowman', 'Carpacosaurus', 'Cave Tarantula', 'Cerberus Champion', 'Cinderhoof', 'Cold_Percht_Sleigh', 'Cony_Cart', 'Cranium_Spider', 'Copper_Fly', 'Coralripper', 'Crimson_Ray', 'Crystal_Wolf', 'Dark_Percht_Sleigh', 'Death_Crawler', 'Desert_King', 'Donkey', 'Doombringer', 'Dragonling', 'Draptor', 'Dreadhare', 'Dromedary', 'Ebony Tiger', 'Eland', 'Ember Saurian', 'Emerald Sphinx', 'Emerald_Waccoon', 'Emperor_Deer', 'Ethereal_Spirit_Armour', 'Feral Tiger', 'Festive_Snowman', 'Flamesteed', 'Flitterkatzen', 'Floating_Kashmir', 'Flying_Book', 'Flying_Divan', 'Frostflare', 'Glacier_Vagabond', 'Gloom_Widow', 'Glooth_Glider', 'Gnarlhound', 'Gold Sphinx', 'Golden_Dragonfly', 'Gorongra‎', 'Green Rolling Barrel', 'Hailstorm_Fury', 'Hellgrip', 'Hibernal Moth', 'Highland_Yak', 'Ironblight', 'Ivory_Fang', 'Jackalope', 'Jade_Lion', 'Jade_Pincer', 'Jousting Eagle', 'Jungle Saurian', 'Jungle Tiger', 'King_Scorpion', 'Kingly_Deer', 'Ladybug', 'Lagoon Saurian', 'Leafscuttler', 'Lacewing Moth', 'Magic_Carpet', 'Magma_Crawler', 'Manta_Ray', 'Marsh Toad', 'Midnight_Panther', 'Mole', 'Mouldpincer', 'Mould_Shell', 'Muffled_Snowman', 'Neon_Sparkid', 'Nethersteed', 'Night_Waccoon', 'Nightdweller', 'Nightmarish Crocovile', 'Nightstinger', 'Noble_Lion', 'Noctungra‎', 'Platesaurian', 'Plumfish', 'Poisonbane', 'Prismatic_Unicorn', 'Rabbit_Rickshaw', 'Racing_Bird', 'Rapid_Boar', 'Razorcreep', 'Red Rolling Barrel', 'Reed_Lurker', 'Rented_Horse_(A)', 'Rented_Horse_(B)', 'Rented_Horse_(C)', 'Rift_Runner', 'Ringtail_Waccoon', 'River Crocovile', 'Sanguine_Frog', 'Sea_Devil', 'Shadow_Claw', 'Shadow_Draptor', 'Shadow_Hart', 'Shadow Sphinx', 'Shock_Head', 'Siegebreaker', 'Silverneck', 'Slagsnare', 'Snow_Pelt', 'Snowy Owl', 'Sparkion', 'Stampor', 'Steel_Bee', 'Steelbeak', 'Stone_Rhino', 'Swamp Crocovile', 'Swamp_Snapper', 'Tamed_Panda', 'Tawny Owl', 'Tempest', 'Tiger_Slug', 'Tin_Lizzard', 'Titanica', 'Toxic_Toad', 'Tombstinger', 'Tundra_Rambler', 'Undead_Cavebear', 'Uniwheel', 'Ursagrodon', 'Venompaw', 'Vortexion', 'Walker', 'War_Bear', 'War_Horse', 'Water_Buffalo', 'Widow_Queen', 'Winter_King', 'Wolpertinger', 'Woodland_Prince'];

// Lista de Outfits Comuns
outfits_comuns =  ['Afflicted', 'Arena_Champion', 'Assassin', 'Barbarian', 'Battle Mage', 'Beastmaster', 'Beggar', 'Breezy Garb', 'Brotherhood', 'Cave_Explorer', 'Ceremonial_Garb', 'Champion', 'Chaos_Acolyte', 'Citizen', 'Conjurer', 'Crystal_Warlord', 'Death_Herald', 'Deepling', 'Demon', 'Demon_Hunter', 'Discoverer', 'Dream_Warden', 'Dream_Warrior', 'Druid', 'Elementalist', 'Entrepreneur', 'Evoker', 'Falconer', 'Festive', 'Glooth_Engineer', 'Golden Outfit', 'Grove Keeper', 'Guidon_Bearer', 'Herbalist', 'Herder', 'Hunter', 'Insectoid', 'Jersey', 'Jester', 'Knight', 'Lion_of_War', 'Lupine_Warden', 'Mage', 'Makeshift Warrior', 'Mercenary', 'Newly_Wed', 'Nightmare', 'Nobleman', 'Norseman', 'Orcsoberfest_Garb', 'Oriental', 'Owl_Keeper', 'Percht_Raider', 'Pharaoh', 'Philosopher', 'Pirate', 'Poltergeist', 'Pumpkin Mummy', 'Puppeteer', 'Ranger', 'Recruiter', 'Retro Citizen', 'Retro Hunter', 'Retro Knight', 'Retro Mage', 'Retro Nobleman', 'Retro Summoner', 'Retro Warrior', 'Rift_Warrior', 'Royal_Pumpkin', 'Sea_Dog', 'Seaweaver', 'Shaman', 'Siege Master', 'Sinister_Archer', 'Soil_Guardian', 'Spirit_Caller', 'Summoner', 'Sun Priest', 'Tomb Assassin', 'Trophy Hunter', 'Veteran_Paladin', 'Void_Master', 'Warmaster', 'Warrior', 'Wayfarer', 'Winter_Warden', 'Wizard', 'Yalaharian'];

// Lista de Outfits Incomuns
outfits_outros = ['Archdemon', 'Barb_Bloodwalker', 'Barb_Brutetamer', 'Barb_Headsplitter', 'Barb_Skullhunter', 'Black_Sphinx_Acolyte', 'Book', 'Carnivor', 'CM', 'Cobra', 'Crazed_A', 'Corym_Charlatan', 'Corym_Skirmisher', 'Corym_Vanguard', 'Cultist', 'Demon_Hellfire', 'Demon_Ram', 'Destroyer_From_Beyond', 'Dragonking', 'Dwarf', 'Elf', 'Energy_Wisp', 'Falcon_A', 'Faun', 'Frog', 'Galvanic_Terror', 'Gnome', 'Lamassu', 'Manticore', 'Ogre', 'Orclops_Ravager', 'Pit_Demon', 'Priestess_of_the_Wild_Sun', 'ProspectorSoul', 'Spectre', 'Sphinx', 'Squid', 'True_Asura', 'Twisted_Shaper', 'Undead_Warrior_Armor', 'Undead_Warrior_Cape', 'Undead_Warrior_Shield'];
outfits = outfits_comuns.concat(outfits_outros);

// Outfits com 8 quadros de animação (PARADO)
OutQuadrosParado = {
  Chaos_Acolyte: 8,
  Evoker: 8
}

// Outfits com 2 quadros de animação (ANDANDO)
OutQuadrosAndando = {
  Barb_Bloodwalker: 2,
  Barb_Brutetamer: 2,
  Barb_Skullhunter: 2,
  CM: 2,
  Corym_Vanguard: 2,
  Gnome: 2
}

// Montarias com vários quadros de animação (PARADO)
MountQuadrosParado = {
  Batcat: 8,
  Cinderhoof: 8,
  Copper_Fly: 10,
  Coralripper: 8,
  Flamesteed: 8,
  Flitterkatzen: 8,
  Floating_Kashmir: 8,
  Flying_Divan: 8,
  Frostflare: 8,
  Glooth_Glider: 10,
  Golden_Dragonfly: 10,
  Magic_Carpet: 8,
  Nethersteed: 8,
  Nightdweller: 8,
  Plumfish: 8,
  Sea_Devil: 8,
  Steel_Bee: 10,
  Tempest: 8,
  Venompaw: 8
}

// Outfits sem gênero
semGenero = new Array(
  "Archdemon",
  "Barb_Bloodwalker",
  "Barb_Brutetamer",
  "Barb_Headsplitter",
  "Barb_Skullhunter",
  "Black_Sphinx_Acolyte",
  "Book",
  "Carnivor",
  "CM",
  "Cobra",
  "Crazed_A", 
  "Corym_Charlatan",
  "Corym_Skirmisher",
  "Corym_Vanguard",
  "Cultist",
  "Demon_Hellfire",
  "Demon_Ram",
  "Destroyer_From_Beyond",
  "Dragonking",
  "Dwarf",
  "Elf",
  "Energy_Wisp",
  "Falcon_A",
  "Faun",
  "Frog",
  "Galvanic_Terror",
  "Lamassu",
  "Manticore",
  "Ogre",
  "Orclops_Ravager",
  "Pit_Demon",
  "Priestess_of_the_Wild_Sun",
  "ProspectorSoul",
  "Spectre",
  "Sphinx",
  "Squid",
  "True_Asura",
  "Twisted_Shaper",
  "Undead_Warrior_Armor",
  "Undead_Warrior_Cape",
  "Undead_Warrior_Shield",
);

// Outfits sem Addons
OutSemAddon = new Array(
  "Jersey",
  "Newly_Wed",
  "Retro Citizen",
  "Retro Hunter", 
  "Retro Knight", 
  "Retro Mage", 
  "Retro Nobleman", 
  "Retro Summoner",
  "Retro Warrior",
  "Archdemon",
  "Barb_Bloodwalker",
  "Barb_Brutetamer",
  "Barb_Headsplitter",
  "Barb_Skullhunter",
  "Book",
  "CM",
  "Corym_Charlatan",
  "Corym_Skirmisher",
  "Corym_Vanguard",
  "Cultist",
  "Dwarf",
  "Elf",
  "Energy_Wisp",
  "Faun",
  "Frog",
  "Gnome",
  "Lamassu",
  "Manticore",
  "Orclops_Ravager",
  "ProspectorSoul",
  "Spectre",
  "Squid", 
  "Twisted_Shaper",
);

// Outfits com Addons excludentes
OutAddonExcludente = new Array(
  "Yalaharian"
);

quadrado_cor = $('.tabela_cores').children('tbody').children('tr').children('td');
cor = new Array([255, 255, 255], [255, 212, 191], [255, 233, 191], [255, 255, 191], [233, 255, 191], [212, 255, 191], [191, 255, 191], [191, 255, 212], [191, 255, 233], [191, 255, 255], [191, 233, 255], [191, 212, 255], [191, 191, 255], [212, 191, 255], [233, 191, 255], [255, 191, 255], [255, 191, 233], [255, 191, 212], [255, 191, 191], [218, 218, 218], [191, 159, 143], [191, 175, 143], [191, 191, 143], [175, 191, 143], [159, 191, 143], [143, 191, 143], [143, 191, 159], [143, 191, 175], [143, 191, 191], [143, 175, 191], [143, 159, 191], [143, 143, 191], [159, 143, 191], [175, 143, 191], [191, 143, 191], [191, 143, 175], [191, 143, 159], [191, 143, 143], [182, 182, 181], [191, 127, 95], [191, 159, 95], [191, 191, 95], [159, 191, 95], [127, 191, 95], [95, 191, 95], [95, 191, 127], [95, 191, 159], [95, 191, 191], [95, 159, 191], [95, 127, 191], [95, 95, 191], [127, 95, 191], [159, 95, 191], [191, 95, 191], [191, 95, 159], [191, 95, 127], [191, 95, 95], [145, 145, 144], [191, 106, 63], [191, 148, 63], [191, 191, 63], [148, 191, 63], [106, 191, 63], [63, 191, 63], [63, 191, 106], [63, 191, 148], [63, 191, 191], [63, 148, 191], [63, 106, 191], [63, 63, 191], [106, 63, 191], [148, 63, 191], [191, 63, 191], [191, 63, 148], [191, 63, 106], [191, 63, 63], [109, 109, 109], [255, 85, 0], [255, 170, 0], [255, 255, 0], [170, 255, 0], [84, 255, 0], [0, 255, 0], [0, 255, 84], [0, 255, 170], [0, 255, 255], [0, 169, 255], [0, 85, 255], [0, 0, 255], [85, 0, 255], [169, 0, 255], [254, 0, 255], [255, 0, 170], [255, 0, 85], [255, 0, 0], [72, 72, 68], [191, 63, 0], [191, 127, 0], [191, 191, 0], [127, 191, 0], [63, 191, 0], [0, 191, 0], [0, 191, 63], [0, 191, 127], [0, 191, 191], [0, 127, 191], [0, 63, 191], [0, 0, 191], [63, 0, 191], [127, 0, 191], [191, 0, 191], [191, 0, 127], [191, 0, 63], [191, 0, 0], [36, 36, 36], [127, 42, 0], [127, 85, 0], [127, 127, 0], [85, 127, 0], [42, 127, 0], [0, 127, 0], [0, 127, 42], [0, 127, 85], [0, 127, 127], [0, 84, 127], [0, 42, 127], [0, 0, 127], [42, 0, 127], [84, 0, 127], [127, 0, 127], [127, 0, 85], [127, 0, 42], [127, 0, 0]);

opc = {
  lingua: "br",
  outfit: outfits.indexOf('Citizen'),
  montaria: 0,
  sexo: 'Male',
  lado: 2,
  addon1: false,
  addon2: false,
  h: 78,
  p: 69,
  s: 58,
  d: 76,
  aa: false,
  animar: false,
  quadros: false,
  hp: false,
  nome: '',
  num_q: 1,
  num_qa: 8
}

/* Funções */

function preload() {
  setTimeout(function() {
    for (o = 0; o < outfits.length; o++) {
      if (semGenero.indexOf(outfits[o]) == -1) {
        $('#preload').append('<link href="/wiki/Especial:Redirecionar/file/Outfiter_'+outfits[o]+'_Male.png">');
        $('#preload').append('<link href="/wiki/Especial:Redirecionar/file/Outfiter_'+outfits[o]+'_Female.png">');
      } else {
        $('#preload').append('<link href="/wiki/Especial:Redirecionar/file/Outfiter_'+outfits[o]+'.png">');
      }
    }
    for (m = 0; m < montarias.length; m++) {
      $('#preload').append('<link href="/wiki/Especial:Redirecionar/file/Outfiter_Montaria_'+montarias[m]+'.png">');
    }
  }, 1500);
}

function atualizar() {
	debugger;
	
  clearInterval(loop);
  $('.carregando').show();
  ctx.clearRect(0, 0, 128, 128);
  excecoes();
  imprimirNome();
  buscarArquivo();
  if (opc.montaria === 0) {
    img_out.onload = function(){
      $('.carregando').hide();
      montar();
      ampliar();
      i = largura();
      imprimir();
      quadros();
    }
  } else {
    var load = 0;
    img_out.onload = function(){
      load++;
      if (load == 2) {
        $('.carregando').hide();
        montar();
        ampliar();
        i = largura();
        imprimir();
        quadros();
      }
    }
    img_mount.onload = function(){
      load++;
      if (load == 2) {
        $('.carregando').hide();
        montar();
        ampliar();
        i = largura();
        imprimir();
        quadros();
      }
    }
  }
  gerarlink();
}

function excecoes() {
  if ($.isArray(outfits[opc.outfit])) {
    if (OutSemAddon.indexOf(outfits[opc.outfit][0]) != -1) {
      opc.addon1 = false;
      opc.addon2 = false;
      $("#addon_1").prop("disabled", true);
      $("#addon_2").prop("disabled", true);
      $("#addon_1").attr("checked", false);
      $("#addon_2").attr("checked", false);
      var addons = false;
    } else if (!addons) {
      $("#addon_1").prop("disabled", false);
      $("#addon_2").prop("disabled", false);
      var addons = true;
    }
    if (OutAddonExcludente.indexOf(outfits[opc.outfit][0]) != -1) {
      if (opc.addon1) {
        opc.addon2 = false;
        $("#addon_2").attr("checked", false);
      }
    }
  } else {
    if (OutSemAddon.indexOf(outfits[opc.outfit]) != -1) {
      opc.addon1 = false;
      opc.addon2 = false;
      $("#addon_1").prop("disabled", true);
      $("#addon_2").prop("disabled", true);
      $("#addon_1").attr("checked", false);
      $("#addon_2").attr("checked", false);
      var addons = false;
    } else if (!addons) {
      $("#addon_1").prop("disabled", false);
      $("#addon_2").prop("disabled", false);
      var addons = true;
    }
    if (OutAddonExcludente.indexOf(outfits[opc.outfit]) != -1) {
      if (opc.addon1) {
        opc.addon2 = false;
        $("#addon_2").attr("checked", false);
      }
    }
  }
  
}

function imprimirNome() {
  if ($.isArray(outfits[opc.outfit])) {
    $('.outfit_nome').text(outfits[opc.outfit][lingua].replace(/_/g," "));
  } else {
    $('.outfit_nome').text(outfits[opc.outfit].replace(/_/g," "));
  }
  if (opc.sexo == "Female") {
    var substF = {
      Nobleman: "Noblewoman",
      Norseman: "Norsewoman"
    }
  $('.outfit_nome').text($('.outfit_nome').text().replace(/Nobleman|Norseman/g, function(matched){return substF[matched];
}));
  }
  if (opc.outfit >= outfits_comuns.length) {
    opc.montaria = 0;
    $('input[value='+montarias[opc.montaria][0]+']').prop('checked', true);
  }
  var substMount = {
    Nenhuma: "Montaria",
    None: "Mount",
    Ninguna: "Montura",
    Brak: "Wierzchowiec",
    Armoured_War_Horse: "A. War Horse",
    Glacier_Vagabond: "G. Vagabond",
    Golden_Dragonfly: "G. Dragonfly",
    Undead_Cavebear: "U. Cavebear",
    "(": "",
    ")": "",
    _: " "
  }
  if ($.isArray(montarias[opc.montaria])) {
    $('.montaria_nome').text(montarias[opc.montaria][lingua].replace(/Nenhuma|None|Ninguna|Brak|Armoured_War_Horse|Glacier_Vagabond|Golden_Dragonfly|Undead_Cavebear|_|\(|\)/g, function(matched){return substMount[matched];
}));
  } else {
    $('.montaria_nome').text(montarias[opc.montaria].replace(/Nenhuma|None|Ninguna|Brak|Armoured_War_Horse|Glacier_Vagabond|Golden_Dragonfly|Undead_Cavebear|_|\(|\)/g, function(matched){return substMount[matched];
}));
  }
}

function buscarArquivo(){
  if (opc.montaria !== 0) {
    img_mount = $(document.createElement('img'));
    if ($.isArray(montarias[opc.montaria])) {
      img_mount.attr('src', '/wiki/Especial:Redirecionar/file/Outfiter_Montaria_'+montarias[opc.montaria][0]+'.png');
    } else {
      img_mount.attr('src', '/wiki/Especial:Redirecionar/file/Outfiter_Montaria_'+montarias[opc.montaria]+'.png');
    }
    img_mount = img_mount[0];
  }
  if ($.isArray(outfits[opc.outfit])) {
    if (semGenero.indexOf(outfits[opc.outfit][0]) != -1) {
      opc.sexo = "Nenhum";
    } else if (opc.sexo == "Nenhum") {
      opc.sexo = "Male";
    }
  } else {
    if (semGenero.indexOf(outfits[opc.outfit]) != -1) {
      opc.sexo = "Nenhum";
    } else if (opc.sexo == "Nenhum") {
      opc.sexo = "Male";
    }
  }
  
  img_out = $(document.createElement('img'));
  if (opc.sexo == "Nenhum") {
    if ($.isArray(outfits[opc.outfit])) {
      img_out.attr('src', '/wiki/Especial:Redirecionar/file/Outfiter_'+outfits[opc.outfit][0]+'.png');
    } else {
      img_out.attr('src', '/wiki/Especial:Redirecionar/file/Outfiter_'+outfits[opc.outfit]+'.png');
    }
    $('.botao_sexo').hide();
  } else {
    if ($.isArray(outfits[opc.outfit])) {
      img_out.attr('src', '/wiki/Especial:Redirecionar/file/Outfiter_'+outfits[opc.outfit][0]+'_'+opc.sexo+'.png');
    } else {
      img_out.attr('src', '/wiki/Especial:Redirecionar/file/Outfiter_'+outfits[opc.outfit]+'_'+opc.sexo+'.png');
    }
    $('.botao_sexo').show();
  }
  img_out = img_out[0];
}

function mmc(num1, num2) {
  var a = num1;
  var b = num2;
  do {
    var resto = a % b;
    a = b;
    b = resto;
  } while (resto !== 0);
  return (num1 * num2) / a;
}

function montar() {
  mctx.clearRect(0, 0, 2560, 128);
  if ($.isArray(outfits[opc.outfit])) {
    var out_nome = outfits[opc.outfit][0];
  } else {
    var out_nome = outfits[opc.outfit];
  }
  if ($.isArray(montarias[opc.montaria])) {
    var mount_nome = montarias[opc.montaria][0];
  } else {
    var mount_nome = montarias[opc.montaria];
  }
  if (OutQuadrosParado[out_nome] == undefined) {
    out_parado = 1;
  } else {
    out_parado = OutQuadrosParado[out_nome];
  }
  if (OutQuadrosAndando[out_nome] == undefined) {
    out_andando = 8;
  } else {
    out_andando = OutQuadrosAndando[out_nome];
  }
  if (MountQuadrosParado[mount_nome] == undefined) {
    mount_parado = 1;
  } else {
    mount_parado = MountQuadrosParado[mount_nome];
  }
  parado = mmc(out_parado, mount_parado);
  if (opc.outfit < outfits_comuns.length){
    if (OutSemAddon.indexOf(outfits[opc.outfit]) == -1) {
      var add = 6;
    } else {
      var add = 2;
    }
  } else {
    if (OutSemAddon.indexOf(outfits[opc.outfit]) == -1) {
      var add = 3;
    } else {
      var add = 1;
    }
  }
  var yo = - add;
  var ym = 0;
  if (opc.montaria !== 0) {
    if (OutSemAddon.indexOf(outfits[opc.outfit]) == -1) {
      yo += 3;
    } else {
      yo++;
    }
  }
  for (j = 0; j < parado; j++) {
    if (opc.montaria !== 0) {
      if (j < mount_parado) {
        mctx.drawImage(img_mount, opc.lado*64, 64*ym, 64, 64, 64*j, 0, 64, 64);
        ym++;
      } else {
        ym = j % mount_parado;
        mctx.drawImage(img_mount, opc.lado*64, 64*ym, 64, 64, 64*j, 0, 64, 64);
      }
    }
    if (j < out_parado) {
      yo += add;
      mctx.drawImage(img_out, opc.lado*128, 64*yo, 64, 64, 64*j, 0, 64, 64);
      cctx.globalCompositeOperation = 'copy';
      cctx.drawImage(img_out, opc.lado*128+64, 64*yo, 64, 64, 0, 0, 64, 64);
      colorir(0);
      if (opc.addon1) {
        addon(opc.lado, 1, 0, yo, 0, j);
      }
      if (opc.addon2) {
        addon(opc.lado, 2, 0, yo, 0, j);
      }
    } else {
      if (j % out_parado === 0) {
        yo -= add * out_parado;
      }
      yo += add;
      mctx.drawImage(img_out, opc.lado*128, 64*yo, 64, 64, 64*j, 0, 64, 64);
      cctx.globalCompositeOperation = 'copy';
      cctx.drawImage(img_out, opc.lado*128+64, 64*yo, 64, 64, 0, 0, 64, 64);
      colorir(0);
      if (opc.addon1) {
        addon(opc.lado, 1, 0, yo, 0, j);
      }
      if (opc.addon2) {
        addon(opc.lado, 2, 0, yo, 0, j);
      }
    }
  }
  for (j = 0; j < out_andando; j++) {
    if (opc.montaria !== 0) {
      mctx.drawImage(img_mount, opc.lado*64, 64*ym, 64, 64, 64*j, 64, 64, 64);
      ym++;
    }
    yo += add;
    mctx.drawImage(img_out, opc.lado*128, 64*yo, 64, 64, 64*j, 64, 64, 64);
    cctx.globalCompositeOperation = 'copy';
    cctx.drawImage(img_out, opc.lado*128+64, 64*yo, 64, 64, 0, 0, 64, 64);
    colorir(1);
    if (opc.addon1) {
      addon(opc.lado, 1, 0, yo, 1, j);
    }
    if (opc.addon2) {
      addon(opc.lado, 2, 0, yo, 1, j);
    }
  }
}

function colorir(m) {
  var i;
  var imgData = mctx.getImageData(64*j, 64*m, 64, 64);
  var corData = cctx.getImageData(0, 0, 64, 64);
  for (i = 0; i < corData.data.length; i += 4) {
    var r = corData.data[i];
    var g = corData.data[i+1];
    var b = corData.data[i+2];
    if ((r >= 240) && (g >= 240) && (b <= 15)){
      corData.data[i] = cor[opc.h][0];
      corData.data[i+1] = cor[opc.h][1];
      corData.data[i+2] = cor[opc.h][2];
    } else if ((r >= 240) && (g <= 15) && (b <= 15)){
      corData.data[i] = cor[opc.p][0];
      corData.data[i+1] = cor[opc.p][1];
      corData.data[i+2] = cor[opc.p][2];
    } else if ((r <= 15) && (g >= 240) && (b <= 15)){
      corData.data[i] = cor[opc.s][0];
      corData.data[i+1] = cor[opc.s][1];
      corData.data[i+2] = cor[opc.s][2];
    } else if ((r <= 15) && (g <= 15) && (b >= 240)){
      corData.data[i] = cor[opc.d][0];
      corData.data[i+1] = cor[opc.d][1];
      corData.data[i+2] = cor[opc.d][2];
    }
  }
  cctx.putImageData(corData, 0, 0);
    corData = cctx.getImageData(0, 0, ccor.width, ccor.height);
    for (i = 0; i < imgData.data.length; i+= 4) {
      if (corData.data[i+3] !== 0) {
        imgData.data[i] = imgData.data[i]*corData.data[i] / 255;
        imgData.data[i+1] = imgData.data[i+1]*corData.data[i+1] / 255;
        imgData.data[i+2] = imgData.data[i+2]*corData.data[i+2] / 255;
      }
    }
  mctx.putImageData(imgData, 64*j, 64*m, 0, 0, 64, 64);
}

function addon(lado, n, x, y, i, j) {
  mctx.globalCompositeOperation = 'source-over';
  mctx.drawImage(img_out, lado*128, 64*y + 64*n, 64, 64, 64*j, 64*i, 64, 64);
  cctx.drawImage(img_out, lado*128+64, 64*y + 64*n, 64, 64, 0, 0, 64, 64);
  colorir(i);
}

function imprimir() {
  clearInterval(loop);
  ctx.globalCompositeOperation = 'destination-over';
  x_animar = 1;
  ctx.imageSmoothingEnabled = opc.aa;
  ctx.mozImageSmoothingEnabled = opc.aa;
  ctx.oImageSmoothingEnabled = opc.aa;
  ctx.webkitImageSmoothingEnabled = opc.aa;
  ctx.scale(2, 2);
  if (opc.animar) {
    if (out_andando == 8) {
      loop = setInterval(function(){animar(true)}, 100);
    } else if (out_andando == 2) {
      loop = setInterval(function(){animar(true)}, 500);
    }
  } else {
    if (parado == 1) {
      ctx.globalCompositeOperation = 'copy';
      ctx.drawImage(cm, 0, 0, 64, 64, 0.5*i, 0, 64, 64);
      desenharnomehp();
    } else {
      loop = setInterval(function(){animar(false)}, 100);
    }
  }
}

function animar(estado) {
  ctx.clearRect(0, 0, 128, 128);
  if (estado) {
    if (x_animar < out_andando - 1) {
      x_animar += 1;
    } else {
      x_animar = 0;
    }
    ctx.drawImage(cm, 64*x_animar, 64, 64, 64, 0.5*i, 0, 64, 64);
  } else {
    if (x_animar < parado - 1) {
      x_animar += 1;
    } else {
      x_animar = 0;
    }
    ctx.drawImage(cm, 64*x_animar, 0, 64, 64, 0.5*i, 0, 64, 64);
  }
  desenharnomehp();
}

function ampliar() {
  //ctx.imageSmoothingEnabled = $('#suavizar').attr("checked");
  ctx.imageSmoothingEnabled = document.getElementById("suavizar").checked;
}

function largura() {
  var x_inicial = 0;
  if (opc.nome != char_name && opc.nome != "") {
    var nome = opc.nome.split("");
    var w = 0;
    var x_final = 0;
    var inicio = 0;
    for (x = 0; x < nome.length; x++) {
      if (letras[nome[x]] != undefined) {
        x_final += letras[nome[x]][2] - 1;
      } else {
        x_final += 3;
      }
    }
    var largura_texto = x_final;
    var x_inicial = 94 - Math.floor((largura_texto+1)/2);
    if (x_inicial < 0) {
      w += Math.abs(x_inicial);
    } else {
      var x_inicial = 0;
    }
    var x_final = 95 - Math.floor((largura_texto+1)/2) + largura_texto;
    w += x_final;
    if (opc.montaria !== 0) {
      w++;
    }
    if (x_final > 128) {
      $('#tela').attr("width", w);
    } else {
      $('#tela').attr("width", 128);
    }
  } else {
    $('#tela').attr("width", 128);
  }
  return Math.abs(x_inicial);
}

function desenharnomehp() {
  ctx.globalCompositeOperation = 'source-over';
  ctx.scale(0.5, 0.5);
  var j = 61;
  if (opc.montaria !== 0) {
    i += 1;
    j += 1;
  }
  if (opc.hp) {
    ctx.globalCompositeOperation = 'source-over';
    ctx.fillStyle="#000000";
    ctx.fillRect(i+80,j,27,4);
    ctx.fillStyle="#00B800";
    ctx.fillRect(i+81,j+1,25,2);
  }
  if (opc.nome != char_name && opc.nome != "") {
    var nome = opc.nome.split("");
    var w = 0;
    var inicio = 0;
    for (x = 0; x < nome.length; x++) {
      if (letras[nome[x]] != undefined) {
        w += letras[nome[x]][2] - 1;
      } else {
        w += 3;
      }
    }
    var w = 94 - Math.floor((w+1)/2) + i;
    for (x = 0; x < nome.length; x++) {
      if (letras[nome[x]] != undefined) {
        ctx.drawImage(img_letras, 16*letras[nome[x]][0], 16*letras[nome[x]][1], letras[nome[x]][2], 12, w, j-12, letras[nome[x]][2], 12);
        w += letras[nome[x]][2] - 1;
      } else {
        w += 3;
      }
    }
  }
  if (opc.montaria !== 0) {
    i--;
  }
  ctx.scale(2, 2);
}

function quadros() {
  if (opc.quadros) {
    $('.quadros').show();
    $('.quadro').hide();
    $('.quadro').parent().hide();
    if (opc.animar) {
      for (c = 0; c < out_andando; c++) {
        $('#q'+c).parent().show();
        $('#q'+c).show();
        var quadro = $('#q'+c)[0];
        var qtx =  quadro.getContext("2d");
        larguraquadros(c);
        qtx.clearRect(0, 0, quadro.width, quadro.height);
        $('#q'+c)[0].getContext("2d").drawImage(cm, 64*c, 64, 64, 64, qi, 0, 64, 64);
        nomehpquadros(qtx);
      }
    } else {
      for (c = 0; c < parado; c++) {
        $('#q'+c).parent().show();
        $('#q'+c).show();
        var quadro = $('#q'+c)[0];
        var qtx =  quadro.getContext("2d");
        larguraquadros(c);
        qtx.clearRect(0, 0, quadro.width, quadro.height);
        $('#q'+c)[0].getContext("2d").drawImage(cm, 64*c, 0, 64, 64, qi, 0, 64, 64);
        nomehpquadros(qtx);
      }
    }
  } else {
    $('.quadros').hide();
  }
}

function larguraquadros(q) {
  qi = 0;
  var x_inicial = 0;
  if (opc.nome != char_name && opc.nome != "") {
    var nome = opc.nome.split("");
    var w = 0;
    var x_final = 0;
    var inicio = 0;
    for (x = 0; x < nome.length; x++) {
      if (letras[nome[x]] != undefined) {
        x_final += letras[nome[x]][2] - 1;
      } else {
        x_final += 3;
      }
    }
    var largura_texto = x_final;
    var x_inicial = 49 - Math.floor((largura_texto+1)/2);
    if (x_inicial < 0) {
      w += Math.abs(x_inicial);
    } else {
      var x_inicial = 0;
    }
    var x_final = 50 - Math.floor((largura_texto+1)/2) + largura_texto;
    w += x_final;
    if (x_final > 64) {
      $('#q' + q).attr("width", w);
    } else {
      $('#q' + q).attr("width", 64);
    }
  } else {
    $('#q' + q).attr("width", 64);
  }
  qi = Math.abs(x_inicial);
  if (opc.montaria !== 0) {
    qi++;
  }
}

function nomehpquadros(qtx) {
  var qj = 29;
  if (opc.montaria !== 0) {
    qi --;
    qj --;
  }
  if (opc.hp) {
    qtx.fillStyle="#000000";
    qtx.fillRect(qi+35,qj,27,4);
    qtx.fillStyle="#00B800";
    qtx.fillRect(qi+36,qj+1,25,2);
  }
  if (opc.nome != char_name && opc.nome != "") {
    var nome = opc.nome.split("");
    var w = 0;
    var inicio = 0;
    for (x = 0; x < nome.length; x++) {
      if (letras[nome[x]] != undefined) {
        w += letras[nome[x]][2] - 1;
      } else {
        w += 3;
      }
    }
    w = 49 - Math.floor((w+1)/2) + qi;
    for (x = 0; x < nome.length; x++) {
      if (letras[nome[x]] != undefined) {
        qtx.drawImage(img_letras, 16*letras[nome[x]][0], 16*letras[nome[x]][1], letras[nome[x]][2], 12, w, qj-12, letras[nome[x]][2], 12);
        w += letras[nome[x]][2] - 1;
      } else {
        w += 3;
      }
    }
  }
}

function gerarlink() {
  var link = $('.link');
  link.val('https://www.tibiawiki.com.br/wiki/Outfiter?');
  if (opc.lingua != "br") {
    link.val(link.val() + opc.lingua + "&");
  }
  if (opc.outfit != outfits.indexOf('Citizen')) {
    link.val(link.val() + "o=" + opc.outfit + "&");
  }
  if (opc.montaria !== 0) {
    link.val(link.val() + "m=" + opc.montaria + "&");
  }
  if (opc.lado != 2) {
    link.val(link.val() + "l=" + opc.lado + "&");
  }
  if (opc.sexo == "Female") {
    link.val(link.val() + "f&");
  }
  if (opc.addon1) {
    link.val(link.val() + "1&");
  }
  if (opc.addon2) {
    link.val(link.val() + "2&");
  }
  if (opc.h != 78) {
    link.val(link.val() + "h=" + opc.h + "&");
  }
  if (opc.p != 69) {
    link.val(link.val() + "p=" + opc.p + "&");
  }
  if (opc.s != 58) {
    link.val(link.val() + "s=" + opc.s + "&");
  }
  if (opc.d != 76) {
    link.val(link.val() + "d=" + opc.d + "&");
  }
  if (opc.animar) {
    link.val(link.val() + "an&");
  }
  if (opc.quadros) {
    link.val(link.val() + "q&");
  }
  if (opc.aa) {
    link.val(link.val() + "aa&");
  }
  if (opc.hp) {
    link.val(link.val() + "hp&");
  }
  if (opc.nome != char_name && opc.nome != "") {
    link.val(link.val() + "n=" + opc.nome.replace(" ", "_") + "&");
  }
  link.val(link.val().substring(0, link.val().length - 1));
}

function parametro(param) {
  var URL = window.location.href.split('?')[1];
  if (URL != undefined) {
    var variaveisURL = URL.split('&');
    for (var i = 0; i < variaveisURL.length; i++) {
      var parametro = variaveisURL[i].split('=');
      if (parametro[0] == param) {
        if (parametro[1] != undefined) {
          return parametro[1];
        } else {
          return true;
        }
      }
    }
  } else {
    return undefined;
  }
}

function obterParametros () {
  if (parametro('en')) {
    opc.lingua = "en";
  } else if (parametro('es')) {
    opc.lingua = "es";
  } else if (parametro('pl')) {
    opc.lingua = "pl";
  }
  if (parametro('o') != undefined) {
    opc.outfit = parametro('o');
  }
  if (parametro('m') != undefined) {
    opc.montaria = parametro('m');
  }
  if (parametro('f')) {
    opc.sexo = "Female";
    $("#sexo").toggleClass("sexo_m");
    $("#sexo").toggleClass("sexo_f");
  }
  if (parametro('1')) {
    opc.addon1 = true;
  }
  if (parametro('2')) {
    opc.addon2 = true;
  }
  if (opc.addon1) {
    $("#addon_1").attr('checked', true);
  }
  if (opc.addon2) {
    $("#addon_2").attr('checked', true);
  }
  if (parametro('l') != undefined) {
    opc.lado = parametro('l');
  }
  if (parametro('h') != undefined) {
    opc.h = parametro('h');
  }
  if (parametro('p') != undefined) {
    opc.p = parametro('p');
  }
  if (parametro('s') != undefined) {
    opc.s = parametro('s');
  }
  if (parametro('d') != undefined) {
    opc.d = parametro('d');
  }
  if (parametro('aa')) {
    $("#suavizar").attr('checked', true);
    opc.aa = true;
  }
  if (parametro('an')) {
    $("#animar").attr('checked', true);
    opc.animar = true;
  }
  if (parametro('q')) {
    $("#quadros").attr('checked', true);
    opc.quadros = true;
  }
  if (parametro('hp')) {
    $('#vida').attr("checked", true);
    opc.hp = true;
  }
  if (parametro('n') != undefined) {
    opc.nome = parametro('n').replace("_", " ");
    $('.nome_char').val(parametro('n').replace("_", " "));
  }
}

function janelas() {
  $('#form_outfits').empty();
  var dif = true;
  for (x = 0; x < outfits.length; x++) {
    if ($.isArray(outfits[x])) {
      if (dif) {
        $('#form_outfits').append('<div class="janela_opcao_out_dif"><input id="'+ outfits[x][0] +'" type="radio" name="outfit" value="'+ outfits[x][0] +'"><label for="'+ outfits[x][0] +'">' + outfits[x][lingua].replace(/_/g, " ") + '</label></div>');
      } else {
        $('#form_outfits').append('<div class="janela_opcao_out"><input id="'+ outfits[x][0] +'" type="radio" name="outfit" value="'+ outfits[x][0] +'"><label for="'+ outfits[x][0] +'">' + outfits[x][lingua].replace(/_/g, " ") + '</label></div>');
      }
    } else {
      if (dif) {
        $('#form_outfits').append('<div class="janela_opcao_out_dif"><input id="'+ outfits[x] +'" type="radio" name="outfit" value="'+ outfits[x] +'"><label for="'+ outfits[x] +'">' + outfits[x].replace(/_/g, " ") + '</label></div>');
      } else {
        $('#form_outfits').append('<div class="janela_opcao_out"><input id="'+ outfits[x] +'" type="radio" name="outfit" value="'+ outfits[x] +'"><label for="'+ outfits[x] +'">' + outfits[x].replace(/_/g, " ") + '</label></div>');
      }
    }
    dif = !dif;
  }
  $('#form_montarias').empty();
  dif = true;
  for (x = 0; x < montarias.length; x++) {
    if ($.isArray(montarias[x])) {
      if (dif) {
        $('#form_montarias').append('<div class="janela_opcao_mount_dif"><input id="'+ montarias[x][0] +'" type="radio" name="montaria" value="'+ montarias[x][0] +'"><label for="' + montarias[x][0] +'">' + montarias[x][lingua].replace(/_/g, " ") +'</label></div>');
      } else {
        $('#form_montarias').append('<div class="janela_opcao_mount"><input id="'+ montarias[x][0] +'" type="radio" name="montaria" value="'+ montarias[x][0] +'"><label for="' + montarias[x][0] +'">' + montarias[x][lingua].replace(/_/g, " ") +'</label></div>');
      }
    } else {
      if (dif) {
        $('#form_montarias').append('<div class="janela_opcao_mount_dif"><input id="'+ montarias[x] +'" type="radio" name="montaria" value="'+ montarias[x] +'"><label for="' + montarias[x] +'">' + montarias[x].replace(/_/g, " ") +'</label></div>');
      } else {
        $('#form_montarias').append('<div class="janela_opcao_mount"><input id="'+ montarias[x] +'" type="radio" name="montaria" value="'+ montarias[x] +'"><label for="' + montarias[x] +'">' + montarias[x].replace(/_/g, " ") +'</label></div>');
      }
    }
    dif = !dif;
  }
  if ($.isArray(outfits[opc.outfit])) {
    $('input#'+outfits[opc.outfit][0]).prop("checked", true);
  } else {
    $('input#'+outfits[opc.outfit]).prop("checked", true);
  }
  if ($.isArray(montarias[opc.montaria])) {
    $('input#'+montarias[opc.montaria][0]).attr("checked", true);
  } else {
    $('input#'+montarias[opc.montaria]).attr("checked", true); 
  }
}

function ie() {
  if (/MSIE/i.test(navigator.userAgent) || /rv:11.0/i.test(navigator.userAgent) || /Edge\/12/i.test(navigator.userAgent)) {
    opc.aa = true;
    $("#suavizar").attr("checked", true); 
    $("#suavizar").prop("disabled", true);
  }
}

/* Eventos */

$(document).ready(function(){
	debugger;
	
  $('#carregando_outfiter').hide();
  tabela_cor();
  $("#head").addClass('selecionado');
  $('#'+opc.h).addClass('cor_selecionada');
  artworks();
  obterParametros();
  idioma(opc.lingua);
  janelas();
  atualizar();
  ie();
  preload();
});

$('#form_outfits').change(function() {
  opc.outfit = outfits.indexOf($('input[name=outfit]:checked').val());
  if (opc.outfit == -1) {
    var x = 0;
    while (x < outfits.length && opc.outfit == -1) {
      if ($('input[name=outfit]:checked').val() == outfits[x][0]) {
        opc.outfit = x;
      }
      x++;
    }
  }
  atualizar();
});

$('#form_montarias').change(function() {
  opc.montaria = montarias.indexOf($('input[name=montaria]:checked').val());
  if (opc.montaria == -1) {
    var x = 0;
    while (x < montarias.length && opc.montaria == -1) {
      if ($('input[name=montaria]:checked').val() == montarias[x][0]) {
        opc.montaria = x;
      }
      x++;
    }
  }
  atualizar();
});

$('#out_e').click(function(){
  if (opc.outfit !== 0) {
    opc.outfit--;
  } else {
    opc.outfit = outfits.length - 1;
  }
  if ($.isArray(outfits[opc.outfit])) {
    $('input[value="'+outfits[opc.outfit][0]+'"]').prop('checked', true);
  } else {
    $('input[value="'+outfits[opc.outfit]+'"]').prop('checked', true);
  }
  atualizar();
});

$('#out_d').click(function(){
  if (opc.outfit != outfits.length - 1) {
    opc.outfit++;
  } else {
    opc.outfit = 0;
  }
  if ($.isArray(outfits[opc.outfit])) {
    $('input[value="'+outfits[opc.outfit][0]+'"]').prop('checked', true);
  } else {
    $('input[value="'+outfits[opc.outfit]+'"]').prop('checked', true);
  }
  atualizar();
});

$('#mount_e').click(function(){
  if (opc.montaria !== 0) {
    opc.montaria--;
  } else {
    opc.montaria = montarias.length - 1;
  }
  if ($.isArray(montarias[opc.montaria])) {
    $('input[value="'+montarias[opc.montaria][0]+'"]').prop('checked', true);
  } else {
    $('input[value="'+montarias[opc.montaria]+'"]').prop('checked', true);
  }
  atualizar();
});

$('#mount_d').click(function(){
  if (opc.montaria != montarias.length - 1) {
    opc.montaria++;
  } else {
    opc.montaria = 0;
  }
  if ($.isArray(montarias[opc.montaria])) {
    $('input[value="'+montarias[opc.montaria][0]+'"]').prop('checked', true);
  } else {
    $('input[value="'+montarias[opc.montaria]+'"]').prop('checked', true);
  }
  atualizar();
});

$(".botao_sexo").click(function(){
  $("#sexo").toggleClass("sexo_m");
  $("#sexo").toggleClass("sexo_f");
  if (opc.sexo == "Male") {
    opc.sexo = "Female";
  } else {
    opc.sexo = "Male";
  }
  atualizar();
});

$('.seta_cima').click(function() {
  opc.lado = 0;
  atualizar();
})

$('.seta_direita').click(function() {
  opc.lado = 1;
  atualizar();
})

$('.seta_baixo').click(function() {
  opc.lado = 2;
  atualizar();
})

$('.seta_esquerda').click(function() {
  opc.lado = 3;
  atualizar();
})

$("#addon_1").click(function() {
  opc.addon1 = !opc.addon1;
  if (OutAddonExcludente.indexOf(outfits[opc.outfit]) != -1) {
    if (opc.addon1) {
      opc.addon2 = false;
      $("#addon_2").attr("checked", false);
    }
  }
  atualizar();
});

$("#addon_2").click(function() {
  opc.addon2 = !opc.addon2;
  if (OutAddonExcludente.indexOf(outfits[opc.outfit]) != -1) {
    if (opc.addon2) {
      opc.addon1 = false;
      $("#addon_1").attr("checked", false);
    }
  }
  atualizar();
});

$('#suavizar').click(function() {
  //opc.aa = $('#suavizar').attr("checked");
  opc.aa = document.getElementById("suavizar").checked;
  atualizar();
});

$('#animar').click(function() {
	debugger;
	
  //opc.animar = $('#animar').attr("checked");
  opc.animar = document.getElementById("animar").checked;
  atualizar();
});

$('#quadros').click(function() {
  //opc.quadros = $('#quadros').attr("checked");
  opc.quadros = document.getElementById("quadros").checked;
  atualizar();
});

$('#vida').click(function() {
  //opc.hp = $('#vida').attr("checked");
  opc.hp = document.getElementById("vida").checked;
  atualizar();
});

$('.nome_char').click(function(){
  if ($('.nome_char').val() == char_name) {
    $('.nome_char').val("");
  }
});

$('.nome_char').keyup(function(){
  if ($('.nome_char').val() != char_name) {
    $('.nome_char').css('color', '#B2A898');
  }
  opc.nome = $('.nome_char').val();
  atualizar();
});

$('.nome_char').blur(function(){
  if ($('.nome_char').val() == "" || $('.nome_char').val() == "Nome do Char") {
    $('.nome_char').val(char_name);
    $('.nome_char').css('color', '#6C6A64');
  }
});

/* Seleção de Cores */

function tabela_cor(){
  cont = 0;
  $(quadrado_cor).each(function(){
    $(this).attr('id', cont);
    $(this).css('background', 'rgb('+cor[cont][0]+', '+cor[cont][1]+', '+cor[cont][2]+')');
    cont++;
  });
}

$(quadrado_cor).click(function(){
  $(quadrado_cor).removeClass('cor_selecionada');
  $(this).addClass('cor_selecionada');
  var selecionado = $('.selecionado').attr('id');
  switch(selecionado) {
    case "head":
      opc.h = $(this).attr('id');
      break;
    case "primary":
      opc.p = $(this).attr('id');
      break;
    case "secondary":
      opc.s = $(this).attr('id');
      break;
    case "detail":
      opc.d = $(this).attr('id');
      break;
  }
  atualizar();
});

$("#head").click(function(){
  $(".seletores").removeClass('selecionado');
  $("#head").addClass('selecionado');
  $(quadrado_cor).removeClass('cor_selecionada');
  $('#'+opc.h).addClass('cor_selecionada');
});

$("#primary").click(function(){
  $(".seletores").removeClass('selecionado');
  $("#primary").addClass('selecionado');
  $(quadrado_cor).removeClass('cor_selecionada');
  $('#'+opc.p).addClass('cor_selecionada');
});

$("#secondary").click(function(){
  $(".seletores").removeClass('selecionado');
  $("#secondary").addClass('selecionado');
  $(quadrado_cor).removeClass('cor_selecionada');
  $('#'+opc.s).addClass('cor_selecionada');
});

$("#detail").click(function(){
  $(".seletores").removeClass('selecionado');
  $("#detail").addClass('selecionado');
  $(quadrado_cor).removeClass('cor_selecionada');
  $('#'+opc.d).addClass('cor_selecionada');
});

/* Artworks */

function artworks() {
  var artwork_A = new Array(["BlackStag", 75, 0, 230], ["ConqueringLion", 85, 7, 280], ["Scorpion", 80, 0, 250], ["RiftRunner", 95, 0, 290]);
  var artwork_B = new Array(["ArmoredWarhorse", 70, 0, 240], ["LadyBug", 70, -5, 240], ["Walker", 70, -5, 230]);
  var artwork_C = new Array(["Dragonling", 85, 0, 300], ["Dragonling2", 90, 0, 300], ["Waccoon", 105, -15, 300]);
  var artwork_D = new Array(["BatCat", 105, -20, 300], ["CreepingHand", 80, -5, 250], ["PanzerBird", 72, 0, 230], ["MantaRay", 105, -15, 300]);
  var random = RandomInt(0,3);                                                         
  $('#artwork_e').append('<img class="artwork" id="artwork_A" style="width: '+artwork_A[random][1]+'%; max-width: '+artwork_A[random][3]+'px; top: '+artwork_A[random][2]+'px;" src="/wiki/Especial:Redirecionar/file/Outfiter_Artwork_'+artwork_A[random][0]+'.png">');
  random = RandomInt(0,2);
  $('#artwork_d').append('<img class="artwork" id="artwork_B" style="width: '+artwork_B[random][1]+'%; max-width: '+artwork_B[random][3]+'px; top: '+artwork_B[random][2]+'px;" src="/wiki/Especial:Redirecionar/file/Outfiter_Artwork_'+artwork_B[random][0]+'.png">');
  random = RandomInt(0,2);
  $('#artwork_e').append('<img class="artwork" id="artwork_C" style="width: '+artwork_C[random][1]+'%; max-width: '+artwork_C[random][3]+'px; right: '+artwork_C[random][2]+'px;" src="/wiki/Especial:Redirecionar/file/Outfiter_Artwork_'+artwork_C[random][0]+'.png">');
  random = RandomInt(0,3);
  $('#artwork_d').append('<img class="artwork" id="artwork_D" style="width: '+artwork_D[random][1]+'%; max-width: '+artwork_D[random][3]+'px; left: '+artwork_D[random][2]+'px;" src="/wiki/Especial:Redirecionar/file/Outfiter_Artwork_'+artwork_D[random][0]+'.png">');
}

function RandomInt(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

/* Idiomas */

$('.bandeira').click(function(){
  idioma($(this).attr('id'));
  janelas();
  atualizar();
});

function idioma(id) {
  $('.lingua').children().hide();
  $('.'+id).show();
  opc.lingua = id;
  switch (opc.lingua) {
    case "br":
      lingua = 0;
      char_name = "Nome do Char";
      break;
    case "en":
      lingua = 1;
      char_name = "Char Name";
      break;
    case "es":
      lingua = 2;
      char_name = "Nombre del Char";
      break;
    case "pl":
      lingua = 3;
      char_name = "Nazwa Postaci";
      break;
  }
  if (opc.nome == "" || opc.nome == "Nome do Char" || opc.nome == "Char Name" || opc.nome == "Nombre del Char" || opc.nome == "Nazwa Postaci") {
    opc.nome = char_name;
    $('.nome_char').val(char_name);
  }
  if ($('.nome_char').val() == char_name) {
    $('.nome_char').css('color', '#6C6A64');
  }
}