Some fixes from myself
//fix offline member check
//$(doc).find("h2:contains('Last Activity:')"); TO $(doc).find("p:contains('Last Activity:')");
var lastActivity = $(doc).find("p:contains('Last Activity:')");
//Problem, cannot fetch player his own stat due to null value of attackText.parentNode.nextSibling.firstChild.firstChild
if (anItem.innerHTML == "Attack: "){
var attackText = anItem;
var playerName = "";
playerName = $(doc).find('h1').text();
if (attackText.parentNode.nextSibling.firstChild.firstChild == null){
var attackLocation = attackText.parentNode.nextSibling.firstChild;
playerAttackValue = attackLocation.textContent;
}
else{
var attackLocation = attackText.parentNode.nextSibling.firstChild.firstChild.firstChild.firstChild;
playerAttackValue = attackLocation.textContent;
}
if (attackText.parentNode.nextSibling.firstChild.firstChild == null){
var defenseText = attackText.parentNode.nextSibling.nextSibling.nextSibling.firstChild;
var defenseLocation = defenseText.parentNode.nextSibling.firstChild;
playerDefenseValue = defenseLocation.textContent;
}
else{
var defenseText = attackText.parentNode.nextSibling.nextSibling.nextSibling.firstChild;
var defenseLocation = defenseText.parentNode.nextSibling.firstChild.firstChild.firstChild.firstChild;
playerDefenseValue = defenseLocation.textContent;
}
if (attackText.parentNode.nextSibling.firstChild.firstChild == null){
var armorText = defenseText.parentNode.parentNode.nextSibling.nextSibling.firstChild.nextSibling.firstChild;
var armorLocation = armorText.parentNode.nextSibling.firstChild;
playerArmorValue = armorLocation.textContent;
}
else{
var armorText = defenseText.parentNode.parentNode.nextSibling.nextSibling.firstChild.nextSibling.firstChild;
var armorLocation = armorText.parentNode.nextSibling.firstChild.firstChild.firstChild.firstChild;
playerArmorValue = armorLocation.textContent;
}
if (attackText.parentNode.nextSibling.firstChild.firstChild == null){
var damageText = armorText.parentNode.nextSibling.nextSibling.nextSibling.firstChild;
var damageLocation = damageText.parentNode.nextSibling.firstChild;
playerDamageValue = damageLocation.textContent;
}
else{
var damageText = armorText.parentNode.nextSibling.nextSibling.nextSibling.firstChild;
var damageLocation = damageText.parentNode.nextSibling.firstChild.firstChild.firstChild.firstChild;
playerDamageValue = damageLocation.textContent;
}
if (attackText.parentNode.nextSibling.firstChild.firstChild == null){
var hpText = damageText.parentNode.parentNode.nextSibling.nextSibling.firstChild.nextSibling.firstChild;
var hpLocation = hpText.parentNode.nextSibling.firstChild;
playerHPValue = hpLocation.textContent;
}
else{
var hpText = damageText.parentNode.parentNode.nextSibling.nextSibling.firstChild.nextSibling.firstChild;
var hpLocation = hpText.parentNode.nextSibling.firstChild.firstChild.firstChild.firstChild;
playerHPValue = hpLocation.textContent;
}
//
//fix buff 16 in group page
for (var k = 0; k < listOfDefenders.length; k++) {
shortList.push(listOfDefenders[k]);
if (((k + 1) % 16 === 0 && k !== 0) || (k == listOfDefenders.length - 1)) {
modifierWord = Helper.getGroupBuffModifierWord(k);
theItem.innerHTML += "<br><nobr><a href='#' id='buffAll" + aMember.id + modifierWord + "'><span style='color:blue; font-size:x-small;' title='Quick buff functionality from HCS only does 16'>"+
"Buff " + modifierWord + " 16</span></a></nobr>";
var buffAllLink = System.findNode("//a[@id='buffAll" + aMember.id + modifierWord + "']");
buffAllLink.setAttribute("href","javascript:openWindow('index.php?cmd=quickbuff&t=" + shortList + "', 'fsQuickBuff', 618, 1000, ',scrollbars')");
shortList = new Array();
//
helpLink: function(title, text) {
//popup description fix
return ' [ ' +
'<span style="text-decoration:underline;cursor:pointer;" class="tip-static" data-tipped="' +
'<span style=\\\'font-weight:bold; color:#FFF380;\\\'>' + title + '</span><br /><br />' +
text + '\');">?</span>' +
' ]';
},
//fix fetch the group stat from group page by the button "Fetch Group Stat"
getRelicGroupData: function(responseText) {
var processingStatus = $('td[title="ProcessingStatus"]');
processingStatus.html('Parsing attacking group stats ... ');
var doc=System.createDocument(responseText);
var allItems = doc.getElementsByTagName("TD");
for (var i=0;i<allItems.length;i++) {
var anItem=allItems[i];
if (anItem.innerHTML == '<font color="#333333">Attack: </font>'){
var attackLocation = anItem.nextSibling;
Helper.relicGroupAttackValue = attackLocation.textContent.replace(/,/g,"")*1;
}
if (anItem.innerHTML == '<font color="#333333">Defense: </font>'){
var defenseLocation = anItem.nextSibling;
Helper.relicGroupDefenseValue = defenseLocation.textContent.replace(/,/g,"")*1;
}
if (anItem.innerHTML == '<font color="#333333">Armor: </font>'){
var armorLocation = anItem.nextSibling;
Helper.relicGroupArmorValue = armorLocation.textContent.replace(/,/g,"")*1;
}
if (anItem.innerHTML == '<font color="#333333">Damage: </font>'){
var damageLocation = anItem.nextSibling;
Helper.relicGroupDamageValue = damageLocation.textContent.replace(/,/g,"")*1;
}
if (anItem.innerHTML == '<font color="#333333">HP: </font>'){
var hpLocation = anItem.nextSibling;
Helper.relicGroupHPValue = hpLocation.textContent.replace(/,/g,"")*1;
}
}
System.xmlhttp("index.php?cmd=guild&subcmd=mercs", Helper.parseRelicMercStats);
},
//
//Fix the null value of Def and Armor evulation in Creature info popup
//var playerHPValue = parseInt($(doc).find('td:contains("HP:"):first').next().clone().children().remove().end().text().trim(),10);
var playerHPValue = parseInt($(doc).find('td:contains("Health:"):first').next().clone().children().remove().end().text().trim(),10);
