Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[142] Display required personal arena rating for PvP items; display d…

…amage info for weapons. Icons update available in `Downloads` section on github.com/Shadez/wowarmory/
  • Loading branch information...
commit e2e4ad32dcd325abd1ce795747b0e605e0544362 1 parent 45f6c8f
Shadez authored
14 includes/classes/class.items.php
View
@@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
- * @revision 135
+ * @revision 142
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -838,5 +838,17 @@ public function GetItemSubTypeInfo($itemID, $tooltip=false) {
}
return $this->aDB->selectRow("SELECT `subclass_name_".$this->_locale."` AS `subclass_name`, `key` FROM `armory_itemsubclass` WHERE `class`=? AND `subclass`=?", $itemclassInfo['class'], $itemclassInfo['subclass']);
}
+
+ public function IsRequiredArenaRating($itemID) {
+ $extended_cost_id = $this->wDB->selectCell("SELECT `ExtendedCost` FROM `npc_vendor` WHERE `item`=?", $itemID);
+ if(!$extended_cost_id) {
+ return false;
+ }
+ $arenaTeamRating = $this->aDB->selectCell("SELECT `personalRating` FROM `armory_extended_cost` WHERE `id`=?", $extended_cost_id);
+ if($arenaTeamRating > 0) {
+ return $arenaTeamRating;
+ }
+ return false;
+ }
}
?>
8 includes/classes/class.search.php
View
@@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
- * @revision 141
+ * @revision 142
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -456,7 +456,7 @@ public function SearchArenaTeams($num=false) {
$arenateams[$i]['battleGroup'] = $this->armoryconfig['defaultBGName'];
$arenateams[$i]['factionId'] = Characters::GetCharacterFaction($arenateams[$i]['race']);
$arenateams[$i]['relevance'] = 100;
- $arenateams[$i]['url'] = sprintf('r=%s&ts=%d&t=%s', urlencode($this->armoryconfig['defaultRealmName']), $arenateams[$i]['size'], urlencode($arenateams[$i]['name']));
+ $arenateams[$i]['url'] = sprintf('r=%s&ts=%d&t=%s', urlencode($this->armoryconfig['defaultRealmName']), $arenateams[$i]['size'], urlencode($arenateams[$i]['name']));
unset($arenateams[$i]['race']);
}
return $arenateams;
@@ -484,7 +484,7 @@ public function SearchGuilds($num=false) {
$guilds[$i]['factionId'] = Characters::GetCharacterFaction($guilds[$i]['race']);
$guilds[$i]['relevance'] = 100;
$guilds[$i]['realm'] = $this->armoryconfig['defaultRealmName'];
- $guilds[$i]['url'] = sprintf('r=%s&gn=%s', urlencode($this->armoryconfig['defaultRealmName']), urlencode($guilds[$i]['name']));
+ $guilds[$i]['url'] = sprintf('r=%s&gn=%s', urlencode($this->armoryconfig['defaultRealmName']), urlencode($guilds[$i]['name']));
unset($guilds[$i]['race']);
}
return $guilds;
@@ -511,7 +511,7 @@ public function SearchCharacters($num=false) {
for($j=0;$j<$count_data;$j++) {
if($cur_realm_data[$j]['guildId'] = $this->cDB->selectCell("SELECT `guildid` FROM `guild_member` WHERE `guid`=?", $cur_realm_data[$j]['guid'])) {
$cur_realm_data[$j]['guild'] = $this->cDB->selectCell("SELECT `name` FROM `guild` WHERE `guildid`=?", $cur_realm_data[$j]['guildId']);
- $cur_realm_data[$j]['guildUrl'] = sprintf('r=%s&gn=%s', urlencode($this->armoryconfig['defaultRealmName']), urlencode($cur_realm_data[$j]['guild']));
+ $cur_realm_data[$j]['guildUrl'] = sprintf('r=%s&amp;gn=%s', urlencode($this->armoryconfig['defaultRealmName']), urlencode($cur_realm_data[$j]['guild']));
}
$cur_realm_data[$j]['url'] = 'r='.urlencode($this->armoryconfig['defaultRealmName']).'&cn='.urlencode($cur_realm_data[$j]['name']);
$cur_realm_data[$j]['relevance'] = 100; // TODO
51 item-tooltip.php
View
@@ -3,7 +3,7 @@
/**
* @package World of Warcraft Armory
* @version Release Candidate 1
- * @revision 137
+ * @revision 142
* @copyright (c) 2009-2010 Shadez
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
@@ -112,6 +112,50 @@
$xml->XMLWriter()->endElement(); //containerSlots
}
$xml->XMLWriter()->endElement(); //equipData
+if($data['class'] == ITEM_CLASS_WEAPON) {
+ $xml->XMLWriter()->startElement('damageData');
+ $xml->XMLWriter()->startElement('damage');
+ $xml->XMLWriter()->startElement('type');
+ $xml->XMLWriter()->text('0');
+ $xml->XMLWriter()->endElement(); //type
+ $xml->XMLWriter()->startElement('min');
+ $xml->XMLWriter()->text($data['dmg_min1']);
+ $xml->XMLWriter()->endElement(); //min
+ $xml->XMLWriter()->startElement('max');
+ $xml->XMLWriter()->text($data['dmg_max1']);
+ $xml->XMLWriter()->endElement(); //max
+ $xml->XMLWriter()->endElement(); //damage
+
+ $xml->XMLWriter()->startElement('speed');
+ $xml->XMLWriter()->text(round($data['delay']/1000, 2));
+ $xml->XMLWriter()->endElement(); //speed
+ $xml->XMLWriter()->startElement('dps');
+ $dps = null;
+ for($jj=1;$jj<=2;$jj++) {
+ $d_type = $data['dmg_type'.$jj];
+ $d_min = $data['dmg_min'.$jj];
+ $d_max = $data['dmg_max'.$jj];
+ if(($d_max>0) && ($data['class'] != ITEM_CLASS_PROJECTILE)) {
+ $delay = $data['delay'] / 1000;
+ if($delay>0) {
+ $dps = $dps + round(($d_max+$d_min) / (2*$delay), 1);
+ }
+ if($jj>1) {
+ $delay=0;
+ }
+ }
+ }
+ $xml->XMLWriter()->text($dps);
+ $xml->XMLWriter()->endElement(); //dps
+
+ $xml->XMLWriter()->endElement(); //damageData
+
+}
+if($data['block'] > 0) {
+ $xml->XMLWriter()->startElement('blockValue');
+ $xml->XMLWriter()->text($data['block']);
+ $xml->XMLWriter()->endElement(); //blockValue
+}
if($data['fire_res'] > 0) {
$xml->XMLWriter()->startElement('fireResist');
$xml->XMLWriter()->text($data['fire_res']);
@@ -509,6 +553,11 @@
}
$xml->XMLWriter()->endElement(); //itemSource
}
+if($itemSource['value'] == 'sourceType.vendor' && $reqArenaRating = $items->IsRequiredArenaRating($itemID)) {
+ $xml->XMLWriter()->startElement('requiredPersonalArenaRating');
+ $xml->XMLWriter()->writeAttribute('personalArenaRating', $reqArenaRating);
+ $xml->XMLWriter()->endElement(); //requiredPersonalArenaRating
+}
$xml->XMLWriter()->endElement(); //itemTooltip
$xml->XMLWriter()->endElement(); //itemTooltips
$xml->XMLWriter()->endElement(); //page
Please sign in to comment.
Something went wrong with that request. Please try again.