Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% layout('layout') -%>
- <div id="table_container">
- <!-- Equipment Table -->
- <table border="1" id = 'equipment'>
- <caption>
- <span>Equipment</span>
- </caption>
- <% function sortByDamage() {
- for (var i=0; i<damageRows.length; i++ ) {
- for (var j=0; j<damageRows.length; j++ ) {
- if (damageRows[i].exp > damageRows[j].exp) {
- swapEXP(i,j);
- }
- }
- }
- }%>
- <% function swapDamage(a,b) {
- var temp = damageRows[a];
- var temp2 = damageRows[b];
- damageRows[a] = temp2;
- damageRows[b] = temp;
- }%>
- <%
- var helmetLocation = -1;
- var armorLocation = -1;
- var bootsLocation = -1;
- var weaponLocation = -1;
- var beltLocation = -1;
- var leggingsLocation = -1;
- var glovesLocation = -1;
- var necklaceLocation = -1;
- var ringLocation = -1;
- var temp = -2;
- for(var i=0; i < rows.length; i++) {
- if (rows[i].armor_type == 1 && rows[i].Inventory == 'Equipped') {
- helmetLocation = i;
- }
- if (rows[i].armor_type == 2 && rows[i].Inventory == 'Equipped') {
- armorLocation = i;
- }
- if (rows[i].armor_type == 3 && rows[i].Inventory == 'Equipped') {
- bootsLocation = i;
- }
- if (rows[i].armor_type == 6 && rows[i].Inventory == 'Equipped') {
- weaponLocation = i;
- }
- if (rows[i].armor_type == 7 && rows[i].Inventory == 'Equipped') {
- beltLocation = i;
- }
- if (rows[i].armor_type == 8 && rows[i].Inventory == 'Equipped') {
- leggingsLocation = i;
- }
- if (rows[i].armor_type == 9 && rows[i].Inventory == 'Equipped') {
- glovesLocation = i;
- }
- if (rows[i].armor_type == 11 && rows[i].Inventory == 'Equipped') {
- necklaceLocation = i;
- }
- if (rows[i].armor_type == 10 && rows[i].Inventory == 'Equipped') {
- ringLocation = i;
- }
- }
- %>
- <% for (var i=0; i<3; i++) { %>
- <tr>
- <% for (var j=0; j<3; j++) { %>
- <%
- if ((i*3+j) == 0) {
- temp = necklaceLocation;
- }
- if ((i*3+j) == 1) {
- temp = helmetLocation;
- }
- if ((i*3+j) == 2) {
- temp = ringLocation;
- }
- if ((i*3+j) == 3) {
- temp = weaponLocation;
- }
- if ((i*3+j) == 4) {
- temp = armorLocation;
- }
- if ((i*3+j) == 5) {
- temp = beltLocation;
- }
- if ((i*3+j) == 8) {
- temp = bootsLocation;
- }
- if ((i*3+j) == 7) {
- temp = leggingsLocation;
- }
- if ((i*3+j) == 6) {
- temp = glovesLocation;
- }
- %>
- <td>
- <% if (temp >= 0) {
- var itemId = rows[temp].item_id;
- var quality = rows[temp].quality;
- var itemName = rows[temp].item_name;
- var itemDmg = rows[temp].damage;
- var itemHealth = rows[temp].health;
- var itemArmor = rows[temp].armor;
- var itemLevel = rows[temp].item_level;
- var itemCrit = rows[temp].crit;
- var armorType = rows[temp].armor_type;
- var itemLifeSteal = rows[temp].lifesteal;
- var itemMinDamage = rows[temp].mindamage;
- var itemMaxDamage = rows[temp].maxdamage;
- var itemStrength = rows[temp].strength;
- var itemIntelligence = rows[temp].intelligence;
- var itemDexterity = rows[temp].dexterity;
- %>
- <% if (quality == 1) { %>
- <quality1>
- <%= itemName %>
- <br>
- </quality1>
- <% } else if (quality == 2) { %>
- <quality2>
- <%= itemName %>
- <br>
- </quality2>
- <% } else if (quality == 3) { %>
- <quality3>
- <%= itemName %>
- <br>
- </quality3>
- <% } else if (quality == 4) { %>
- <quality4>
- <%= itemName %>
- <br>
- </quality4>
- <% } %>
- <itemtext>
- <% if (itemMinDamage > 0) { %>
- <%= itemMinDamage %> - <%= itemMaxDamage %>
- Damage
- <br>
- <% } %>
- <% if (itemDmg > 0) { %>
- <%= itemDmg %>
- Damage
- <br>
- <% } %>
- <% if (itemStrength > 0) { %>
- <%= itemStrength %>
- Strength
- <br>
- <% } %>
- <% if (itemIntelligence > 0) { %>
- <%= itemIntelligence %>
- Intelligence
- <br>
- <% } %>
- <% if (itemDexterity > 0) { %>
- <%= itemDexterity %>
- Dexterity
- <br>
- <% } %>
- <% if (itemHealth > 0) { %>
- <%= itemHealth %>
- Health
- <br>
- <% } %>
- <% if (itemCrit > 0) { %>
- <%= itemCrit %>
- % Crit
- <br>
- <% } %>
- <% if (itemLifeSteal > 0) { %>
- <%= itemLifeSteal %>
- % Lifesteal
- <br>
- <% } %>
- <% if (armorType == 1 || armorType == 2 || armorType == 3 || armorType == 8) { %>
- <%= itemArmor + itemLevel %>
- Armor
- <br>
- <% } %>
- <% if (armorType != 1 && armorType != 2 && armorType != 3 && armorType != 8 && itemArmor > 0) { %>
- <%= itemArmor %>
- Armor
- <br>
- <% } %>
- </itemtext>
- <br>
- <form action='/equipped/unequip' method='post'>
- <button type='submit' name = 'unequip' value=<%= itemId %>> Unequip </button>
- </form>
- <% } %>
- </td>
- <% temp = -2; %>
- <% } %>
- </tr>
- <% } %>
- </table>
- <!-- Inventory Table -->
- <table border="1" id = 'right'>
- <caption>
- <span>Inventory</span>
- <%
- var totalUsedSlots = rows.length;
- var totalSlots = rows.slots;
- var numItems = 0;
- if ( rows.length > 0 ) {
- var sellallvalue = 0;
- for( var z = 0; z < rows.length; z++ ) {
- if ( rows[z].Inventory == 'Inventory' ) {
- sellallvalue = sellallvalue + (rows[z].quality*10*rows[z].item_level);
- numItems++;
- }
- }
- var info = new Array();
- info.push(numItems);
- info.push(sellallvalue);
- %>
- <span> (<%= numItems %>/<%= totalSlots %>) </span><br><br>
- <form action='/equipped/sellall' method='post'>
- <button type='submit' value = <%= info %> name = 'sellall'> Sell All <%= sellallvalue %></button>
- </form>
- <% } %>
- </caption>
- <% for(var i=0; i < (Math.floor(totalSlots/3)); i++) { %>
- <tr>
- <% for(var j=0; j<3; j++) {
- var position = i*3+j;
- %>
- <td>
- <% if (rows[position] && invItemSold != 'true' && rows[position].Inventory == 'Inventory') {
- var invItemQuality = rows[position].quality;
- var invItemSold = rows[position].sold;
- var invItemName = rows[position].item_name;
- var invItemDmg = rows[position].damage;
- var invItemHealth = rows[position].health;
- var invItemArmor = rows[position].armor;
- var invItemLevel = rows[position].item_level;
- var invItemID = rows[position].item_id;
- var invItemCrit = rows[position].crit;
- var invItemLifeSteal = rows[position].lifesteal;
- var invArmorType = rows[position].armor_type;
- var invMinDamage = rows[position].mindamage;
- var invMaxDamage = rows[position].maxdamage;
- var invStrength = rows[position].strength;
- var invIntelligence = rows[position].intelligence;
- var invDexterity = rows[position].dexterity;
- if (invItemQuality == 1) { %>
- <quality1>
- <%= invItemName %>
- <br>
- </quality1>
- <% } else if (invItemQuality == 2) { %>
- <quality2>
- <%= invItemName %>
- <br>
- </quality2>
- <% } else if (invItemQuality == 3) { %>
- <quality3>
- <%= invItemName %>
- <br>
- </quality3>
- <% } else if (invItemQuality == 4) { %>
- <quality4>
- <%= invItemName %>
- <br>
- </quality4>
- <% } %>
- <itemtext>
- <% if (invMinDamage > 0) { %>
- <%= invMinDamage %> - <%= invMaxDamage %>
- Damage
- <br>
- <% } %>
- <% if (invItemDmg > 0) { %>
- <%= invItemDmg %> Damage
- <br>
- <% } %>
- <% if (invStrength > 0) { %>
- <%= invStrength %> Strength
- <br>
- <% } %>
- <% if (invIntelligence > 0) { %>
- <%= invIntelligence %> Intelligence
- <br>
- <% } %>
- <% if (invDexterity > 0) { %>
- <%= invDexterity %> Dexterity
- <br>
- <% } %>
- <% if (invItemHealth > 0) { %>
- <%= invItemHealth %> Health
- <br>
- <% } %>
- <% if (invItemCrit > 0) { %>
- <%= invItemCrit%>
- % Crit
- <br>
- <% } %>
- <% if (invItemLifeSteal > 0) { %>
- <%= invItemLifeSteal%>
- % Lifesteal
- <br>
- <% } %>
- <% if (invArmorType == 1 || invArmorType == 2 || invArmorType == 3 || invArmorType == 8) { %>
- <%= invItemArmor + invItemLevel %>
- Armor
- <br>
- <% } %>
- <% if (invArmorType != 1 && invArmorType != 2 && invArmorType != 3 && invArmorType != 8 && invItemArmor > 0) { %>
- <%= invItemArmor %>
- Armor
- <br>
- <% } %>
- <br>
- </itemtext>
- <form action='/equipped/equip' method='post'>
- <button type='submit' name = 'equip' value=<%= invItemID %>> Equip </button>
- </form>
- <form action='/equipped/store' method='post'>
- <button type='submit' name = 'store' value=<%= invItemID %>> Store </button>
- </form>
- <% } %>
- </td>
- <% } %>
- </tr>
- <% } %>
- </table>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement