itemtooltips price, spell and damage

This commit is contained in:
Ulf Gebhardt 2016-04-05 19:15:51 +02:00
parent f4803ea60b
commit 153be4c8cd
4 changed files with 98 additions and 3 deletions

View File

@ -3,8 +3,20 @@ namespace SQL;
class TBC_ITEM extends \SYSTEM\DB\QP {
public static function get_class(){return \get_class();}
public static function mysql(){return
'SELECT item_template.*, lower(mangos_one_dbc.itemdisplayinfo.6) as icon FROM item_template'.
'SELECT item_template.*,'.
' lower(mangos_one_dbc.itemdisplayinfo.6) as icon,'.
' s1.161 as spelltext_1'.
//' s2.161 as spelltext_2,'.
//' s3.161 as spelltext_3,'.
//' s4.161 as spelltext_4,'.
//' s5.161 as spelltext_5'.
' FROM item_template'.
' LEFT JOIN mangos_one_dbc.itemdisplayinfo ON item_template.displayid = mangos_one_dbc.itemdisplayinfo.1'.
' LEFT JOIN mangos_one_dbc.spell AS s1 ON item_template.spellid_1 = s1.1'.
//' LEFT JOIN mangos_one_dbc.spell AS s2 ON item_template.spellid_2 = s2.1'.
//' LEFT JOIN mangos_one_dbc.spell AS s3 ON item_template.spellid_3 = s3.1'.
//' LEFT JOIN mangos_one_dbc.spell AS s4 ON item_template.spellid_4 = s4.1'.
//' LEFT JOIN mangos_one_dbc.spell AS s5 ON item_template.spellid_5 = s5.1'.
' WHERE entry = ?;';
}
}

View File

@ -25,7 +25,16 @@ $flavour: #FFD100;
}
@mixin money( $type: "copper" ) {
$srcUrl: "http://wowimg.zamimg.com/images/";
$type: $srcUrl + "icons/money-#{$type}.gif";
background-image: url( $type );
background-repeat: no-repeat;
background-position: right;
}
.wow-icon {
@ -272,6 +281,31 @@ $flavour: #FFD100;
}
.wow-item__price {
.price {
&__gold {
@include money( "gold" );
float: left;
padding-right: 15px;
margin-left: 2px;
}
&__silver {
@include money( "silver" );
float: left;
padding-right: 15px;
margin-left: 2px;
}
&__copper {
@include money( "copper" );
float: left;
padding-right: 15px;
margin-left: 2px;
}
}
}
.wow-item__enchantments {
margin: $gap*2 0;

View File

@ -386,6 +386,15 @@ var wow_statstype = {
48: "Blockvalue"
}
var wow_spelltrigger = {
0: "Use",
1: "On Equip",
2: "Chance on Hit",
4: "Soulstone",
5: "Use",
6: "Learn"
}
function wow_tooltips(){
//item hover
var items = {}
@ -437,7 +446,14 @@ function wow_tooltips(){
json.result.type = wow_class_subclass[json.result.class][json.result.subclass];
//flags
json.result.unique = json.result.flags % 524288 === 0 ? true : false;
json.result.unique = json.result.flags % 524288 === 0 ? 'true' : 'false';
//dmg
if(json.result.dmg_min1 > 0 || json.result.dmg_max1 > 0){
json.result.damage = { min: json.result.dmg_min1,
max: json.result.dmg_max1,
speed: json.result.delay / 1000}
}
//stats
json.result.stats = {};
@ -503,7 +519,29 @@ function wow_tooltips(){
//Set
//spells
json.result.bonuses = [];
if(json.result.spellid_1 !== 0){
json.result.bonuses[0] = {description: wow_spelltrigger[json.result.spelltrigger_1]+': '+json.result.spelltext_1};}
if(json.result.spellid_2 !== 0){
json.result.bonuses[1] = {description: wow_spelltrigger[json.result.spelltrigger_2]+': '+json.result.spelltext_2};}
if(json.result.spellid_3 !== 0){
json.result.bonuses[2] = {description: wow_spelltrigger[json.result.spelltrigger_3]+': '+json.result.spelltext_3};}
if(json.result.spellid_4 !== 0){
json.result.bonuses[3] = {description: wow_spelltrigger[json.result.spelltrigger_4]+': '+json.result.spelltext_4};}
if(json.result.spellid_5 !== 0){
json.result.bonuses[4] = {description: wow_spelltrigger[json.result.spelltrigger_5]+': '+json.result.spelltext_5};}
//Price
var sp = json.result.SellPrice;
if(sp / 10000 >= 1){
json.result.price_gold = Math.floor(sp / 10000);
sp = sp % 10000;}
if(sp / 100 >= 1){
json.result.price_silver = Math.floor(sp / 100);
sp = sp % 100;}
if(sp => 1){
json.result.price_copper = sp;}
items[json.result.entry] = json.result;
if( json.result.icon ) {

View File

@ -145,5 +145,16 @@
<p class="info__flavour-text">"{{ description }}"</p>
{{/if}}
</section>
<section class="wow-item__price">
{{#if price_gold }}
<p class="price__gold">Sell Price: {{ price_gold }}</p>
{{/if}}
{{#if price_silver }}
<p class="price__silver">{{ price_silver }}</p>
{{/if}}
{{#if price_copper }}
<p class="price__copper">{{ price_copper }}</p>
{{/if}}
</section>
</aside>
</script>