This is a wiki for a reason. Anyone can contribute. If you see something that is inaccurate or can be improved, don't ask that it be fixed--just improve it.
[ Disclaimer, Create new user --- Wiki markup help, Install P99 ]

Difference between revisions of "Magelo Blue:Loramin"

From Project 1999 Wiki
Jump to: navigation, search
Line 1: Line 1:
startMageloProfile
+
var allSlots = [
 +
  'Neck', 'Head', 'Ears1', 'Ears2', 'Face', 'Chest', 'Arms', 'Back', 'Waist', 'Shoulders',
 +
  'Wrists1', 'Wrists2', 'Legs', 'Hands', 'Fingers1', 'Fingers2', 'Feet', 'Primary',
 +
  'Secondary', 'Range', 'Ammo', 'Inv1', 'Inv2', 'Inv3', 'Inv4', 'Inv5', 'Inv6', 'Inv7', 'Inv8',
 +
];
  
* Name: Loramin
+
var parseEqText = function (eqText) {
* Class: Shaman
+
  var convertSlot = function (rows, slot) {
* Race: Barbarian
+
    if (slot === 'Ear') return 'Ears' + (rows.Ears1 ? 2 : 1);
* Level: 60
+
    if (slot === 'Fingers') return rows.Fingers1 ? 'Fingers2' : 'Fingers1';
* Guild: Anonymous
+
    if (slot === 'Wrist') return rows.Wrists1 ? 'Wrists2' : 'Wrists1';
* Religion: The Tribunal
+
    if (slot.substr(0, 7) === 'General') {
* AltOrTestChar: No
+
      var index = slot.substr(7, 8);
 +
      var isBagSlot = '-' === slot.substr(8, 9);
 +
      if (!isBagSlot) return 'Inv' + index;
 +
    }
 +
    return slot;
 +
  };
  
* BaseSTR: 103
+
  var parseRows = function (eqText) {
* BaseSTA: 105
+
    var rows = eqText.split('\n');
* BaseAGI: 82
+
    return rows.reduce(function (memo, row) {
* BaseDEX: 70
+
      var slot = convertSlot(memo, row.split(' ')[0]);
* BaseWIS: 105
+
      var value = row.split(' ')[1];
* BaseINT: 60
+
      memo[slot] = value === 'Empty' ? '' : value;
* BaseCHA: 60
+
      return memo;
 +
    }, {});
 +
  };
  
* Neck: Ayillish's Talisman
+
  var buildItemsBySlot = function (itemRows) {
* Head: Lumberjack's Cap
+
    return allSlots.reduce(function (itemsBySlot, slot) {
* Ears1: Shrunken Goblin Skull Earring
+
      itemsBySlot[slot] = itemRows[slot];
* Ears2: Forest Loop
+
      return itemsBySlot;
* Face: Arctic Wyvern Mask
+
    }, {});
* Chest: Chestplate of Vindication
+
  };
* Arms: Wolf Caller's Vambraces
+
* Back: Lodizal Shell Shield
+
* Waist: Flayed Turmoilskin Belt
+
* Shoulders: Runed Coldain Prayer Shawl
+
* Wrists1: Wolf Caller's Bracer
+
* Wrists2: Jaundiced Bone Bracer
+
* Legs: Wolf Caller's Greaves
+
* Hands: Wolf Caller's Gauntlets
+
* Fingers1: Di'zok Signet of Service
+
* Fingers2: Velium Fire Wedding Ring
+
* Feet: Shamanistic Shenannigan Boots
+
  
* Primary: Spear of Fate
+
  var itemRows = parseRows(eqText);
* Secondary: Glowing Red Stone
+
  return buildItemsBySlot(itemRows);
* Range: Othmir Prexus Totem
+
};
* Ammo:
+
  
* Inv1: Shovel of Ponz
+
var copyMageloCode = function () {
* Inv2: Black Fur Boots
+
  try {
* Inv3: Driftwood Treasure Chest
+
    var range = document.createRange();
* Inv4: Driftwood Treasure Chest
+
    range.selectNode($('#magelo-text-output')[0]);
* Inv5: Driftwood Treasure Chest
+
    window.getSelection().addRange(range);
* Inv6: Driftwood Treasure Chest
+
    if (!document.execCommand('copy')) throw new Error();
* Inv7: Driftwood Treasure Chest
+
* Inv8: Driftwood Treasure Chest
+
  
endMageloProfile
+
    alert(
==Achievements ==
+
      'Your Magelo code has been copied.  You can now paste in your Magelo profile, in ' +
 +
        'place of your current equipment section.'
 +
    );
 +
  } catch (err) {
 +
    alert('Failed to copy code :( Please select and copy the code yourself.');
 +
  } finally {
 +
    window.getSelection().removeAllRanges();
 +
  }
 +
};
  
NOTE: This is just an example; Loramin is not (yet) at max Halas faction!
+
var onTextareaChange = function (e) {
{{Max Faction Group Achievement|Halas Factions}}
+
  var parsed = parseEqText($(e.target).val());
  
== Extra ==
+
  var mageloCode = allSlots
=== Clickies (in Bag) ===
+
    .map(function (slot) {
<ul>
+
      var newLine = slot === 'Primary' || slot === 'Inv1' ? '\n' : '';
<li>{{:Wolf Caller's Breastplate}}
+
      return newLine + '* ' + slot + ': ' + (parsed[slot] || '');
<li>{{:Jaundiced Bone Vambraces}} (for buffing lowbies)
+
    })
<li>{{:Jaundiced Bone Gauntlets}} (for buffing lowbies)
+
    .join('\n');
<li>{{:Jaundiced Bone Boots}} (for buffing lowbies)
+
<li>{{:Pegasus Feather Cloak}}
+
</ul>
+
=== Clickies, Limited Use (in Bag) ===
+
<ul>
+
<li>{{:Leatherfoot Raider Skullcap}}
+
<li>{{:Reaper of the Dead}}
+
<li>{{:Wooly Spider Silk Net}}
+
<li>{{:10 Dose Potion of Unlife Awareness}}
+
</ul>
+
=== Proc Weapons (in Bag) ===
+
<ul>
+
<li>{{:Journeyman's Walking Stick}}
+
<li>{{:Worker Sledgemallet}}
+
</ul>
+
  
=== Keys ===
+
  $('#magelo-text-output').text(mageloCode);
 +
  window.setTimeout(function() { copyMageloCode(); });
 +
};
  
* [[Cobalt Scar]] Dragon Circle: [[Tooth of the Cobalt Scar]]
+
$('#magelo-import-placeholder').replaceWith(
* [[Skyshrine]] Exit: [[Shrine Key]]
+
  '<textarea id="eq-text-input" style="min-height: 6em; max-width:50em""></textarea>' +
* [[Sebilis]]: [[Trakanon Idol]]
+
    '<pre id="magelo-text-output" style="min-height: 10em; min-width: 20em; max-width:50em""></pre>'
* [[Howling Stones]]: [[Key to Charasis]]
+
);
* [[Veeshan's Peak]]: [[Key of Veeshan]]
+
$('#eq-text-input').change(onTextareaChange);
 
+
=== Tradeskills ===
+
* [[Alchemy]]: 63
+
* [[Baking]]: 142
+
* [[Blacksmithing]]: 154
+
* [[Brewing]]: 168
+
* [[Fletching]]: 168
+
* [[Jewelry Making]]: 162
+
* [[Pottery]]: 148
+
* [[Tailoring]]: 161
+
 
+
== Shopping List ==
+
{{CheckboxList}}
+
==== Ear ====
+
<ul>
+
<li>{{:Sanctum Guardian's Earring}} ([[The Spirit of Garzicor]])
+
</ul>
+
 
+
==== Head ====
+
Looking for BiS "bear head" look (ie. [[:Category:Fashion: Leather|Leather]]).  Lucy lists the Custom helms, eg.
+
 
+
<ul>
+
<li> {{:Custom Crown of the Kromzek Kings}} (Kael Drakkel - [[King Tormax]])
+
<li> {{:Custom Frostreaver's Velium Crown}} (Icewell Keep - [[Dain Frostreaver IV]])
+
<li> {{:Custom Cowl of Mortality}} (Dragon Necropolis - [[Zlandicar]])
+
</ul>
+
 
+
as [[:Category:Fashion: Leather|Leather]] ... but I think that's a mistake, and those helms ''don't'' have the bear head look.  If I confirm that, that makes the following the best options:
+
 
+
<ul>
+
<li> Best overall? {{:Spirit Talker's Headdress}} (Dragon Necropolis - [[a Paebala Spirit Talker]])
+
<li> Easiest? 500p: {{:Iksar Hide Cap}} (Chardok - [[Kennel Master Al`ele]])
+
<li> Best AC? {{:Idiot Savant's Cap}} [[Plane of Mischief]] ({{:Red Throne}}, {{:White Throne}}, {{:Red Crown}}, {{:White Crown}})
+
</ul>
+
 
+
(out of ... [http://wiki.project1999.com/index.php?title=Special:MultiCategorySearch&limit=500&offset=0&wpInCategory1=Shaman+Equipment&wpInCategory2=Fashion%3A+Leather&wpInCategory3=Head] ... note to self: run hidden code below to generate a comparison table from that search link ... code hidden because if too many people used it, without a proper API from Ravhin being built first, it could over-tax the wiki).
+
 
+
<div style="display: none">
+
Run this code in the developer's console to convert that search link above into a comparison table:
+
 
+
<pre>(() => {
+
    var $body = $('body');
+
    const $categoryAnchors = $('.mw-content-ltr ul li a');
+
    //let $anchors = $('.eoTable3+ul li .hbdiv>a'); // List below table
+
    const $listAnchors = $('ul li .hbdiv>a');
+
    const $tableAnchors = $('td > .hbdiv a')
+
  .filter(function(i, el) {
+
      return !$(el).parents().is('.itemdata')
+
  });
+
 
+
    let $anchors = $listAnchors.length
+
                    ? $listAnchors
+
                    : $tableAnchors.length
+
                      ? $tableAnchors : $categoryAnchors;
+
 
+
    var urls = $anchors.map((i, a) => $(a).attr('href')).toArray();
+
 
+
    // FIXME: This isn't changing the cursor ... why?
+
    $body.css('cursor', 'progress');
+
 
+
    // FIXME: This approach will kill the wiki; we need to fetch
+
    // sequentially, one at a time (with a 2s? pause between fetches?),
+
    // using a reduce instead of a map!
+
 
+
    var fetches = urls.map(url => {
+
      return fetch(url)
+
        .then(function(response) {
+
          return response.text();
+
        }).then(function(html) {
+
            var name = html
+
              .split('class="itemtitle">')[1]
+
              .split('</div>')[0];
+
            var block = html
+
              .split(/class="itemicon"\>.*?\<\/div\><\/div>\n\<p\>/)[1]
+
              .split('</p>')[0];
+
            var parsedBlock = block
+
              .replace(/<br ? \/?>|\n/g, ' ')
+
              .split(/(\w+ ?\w+?\: \+?\d+)/)
+
              .filter(function(x) {
+
                return x.trim() && x.indexOf(':') != -1
+
              });
+
 
+
            return parsedBlock
+
              .slice(1, parsedBlock.length -1)
+
              .reduce(function(memo, text) {
+
                var bits = text.split(':');
+
                var statName = bits[0].trim().toLowerCase();
+
                const statValue = parseFloat(bits[1].replace('+', '').trim());
+
                if (isNaN(statValue)) return memo;
+
 
+
                memo[statName] = statValue;
+
                return memo;
+
              }, { name: name });
+
          });
+
    });
+
 
+
    var itemColumns = ['name', 'ac', 'str', 'sta', 'agi', 'dex', 'cha',
+
      'int', 'wis', 'hp', 'mana', 'mr', 'fr', 'cr', 'pr', 'dr', 'wt'];
+
    var buildHeaderRow = function() {
+
      return '<tr><th>' + itemColumns.map(function(column) {
+
        return column.toUpperCase();
+
      }).join('</th><th>') + '</th></tr>';
+
    };
+
    var buildItemRow = function(item) {
+
      var row = '<tr>';
+
      itemColumns.forEach(function(column) {
+
        var  value = item[column] || item[column] === 0 ? item[column] : '-';
+
        if (column === 'name')
+
          value = '<a href="/' + value + '">' + value + '</a>';
+
        row += '<td>' + value + '</td>';
+
      });
+
      return row + '</tr>'
+
    };
+
 
+
    Promise.all(fetches).then(function(items) {
+
      var $table = $('<table class="eoTable3">');
+
      $table.append(buildHeaderRow());
+
      $table.append(items.map(function(item) {
+
        return buildItemRow(item);
+
      }));
+
      $('hr:first').before($table);
+
 
+
      // Go get sort library, as search results don't load it
+
      $.getScript('http://wiki.project1999.com/load.php?debug=false&lang=en&modules=jquery.tablesorter&skin=monobook')
+
      .then(function() {
+
        // Not sure why timeout is needed *after* then, but *shrug*
+
        window.setTimeout(function() {
+
          // Add sorting to the new table
+
          $table.tablesorter();
+
        });
+
      });
+
    });
+
    $body.css('cursor', 'default');
+
})();</pre>
+
</div>
+
 
+
==== Finger ====
+
 
+
<ul>
+
<li>{{:Ring of Dain Frostreaver IV}} ([[Coldain Ring Quests]])
+
<li>{{:Regal Band of Bathezid}} ([[Regal Band of Bathezid Quest]])
+
</ul>
+
 
+
==== Wrist ====
+
<ul>
+
<li>{{:Spirit Wracked Cord}} ([[Spirit Wracked Cord Quest]])
+
</ul>
+
{{End}}
+
 
+
<div class="checkbox-data" style="display:none">{"druidEpic": [1,2,3]}</div>
+

Revision as of 19:08, 25 June 2020

var allSlots = [

 'Neck', 'Head', 'Ears1', 'Ears2', 'Face', 'Chest', 'Arms', 'Back', 'Waist', 'Shoulders',
 'Wrists1', 'Wrists2', 'Legs', 'Hands', 'Fingers1', 'Fingers2', 'Feet', 'Primary',
 'Secondary', 'Range', 'Ammo', 'Inv1', 'Inv2', 'Inv3', 'Inv4', 'Inv5', 'Inv6', 'Inv7', 'Inv8',

];

var parseEqText = function (eqText) {

 var convertSlot = function (rows, slot) {
   if (slot === 'Ear') return 'Ears' + (rows.Ears1 ? 2 : 1);
   if (slot === 'Fingers') return rows.Fingers1 ? 'Fingers2' : 'Fingers1';
   if (slot === 'Wrist') return rows.Wrists1 ? 'Wrists2' : 'Wrists1';
   if (slot.substr(0, 7) === 'General') {
     var index = slot.substr(7, 8);
     var isBagSlot = '-' === slot.substr(8, 9);
     if (!isBagSlot) return 'Inv' + index;
   }
   return slot;
 };
 var parseRows = function (eqText) {
   var rows = eqText.split('\n');
   return rows.reduce(function (memo, row) {
     var slot = convertSlot(memo, row.split('	')[0]);
     var value = row.split('	')[1];
     memo[slot] = value === 'Empty' ?  : value;
     return memo;
   }, {});
 };
 var buildItemsBySlot = function (itemRows) {
   return allSlots.reduce(function (itemsBySlot, slot) {
     itemsBySlot[slot] = itemRows[slot];
     return itemsBySlot;
   }, {});
 };
 var itemRows = parseRows(eqText);
 return buildItemsBySlot(itemRows);

};

var copyMageloCode = function () {

 try {
   var range = document.createRange();
   range.selectNode($('#magelo-text-output')[0]);
   window.getSelection().addRange(range);
   if (!document.execCommand('copy')) throw new Error();
   alert(
     'Your Magelo code has been copied.  You can now paste in your Magelo profile, in ' +
       'place of your current equipment section.'
   );
 } catch (err) {
   alert('Failed to copy code :( Please select and copy the code yourself.');
 } finally {
   window.getSelection().removeAllRanges();
 }

};

var onTextareaChange = function (e) {

 var parsed = parseEqText($(e.target).val());
 var mageloCode = allSlots
   .map(function (slot) {
     var newLine = slot === 'Primary' || slot === 'Inv1' ? '\n' : ;
     return newLine + '* ' + slot + ': ' + (parsed[slot] || );
   })
   .join('\n');
 $('#magelo-text-output').text(mageloCode);
 window.setTimeout(function() { copyMageloCode(); });

};

$('#magelo-import-placeholder').replaceWith(

 '<textarea id="eq-text-input" style="min-height: 6em; max-width:50em""></textarea>' +
'
'

); $('#eq-text-input').change(onTextareaChange);