commit fc8d79fcab20a2dbe18897798ac30113c1a30490 Author: Ulf Gebhardt Date: Mon Apr 11 20:20:28 2016 +0200 init commit diff --git a/autoload.inc b/autoload.inc new file mode 100644 index 0000000..9860f78 --- /dev/null +++ b/autoload.inc @@ -0,0 +1,3 @@ + 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 = {}; + if(json.result.stat_type1 !== 0){ + json.result.stats[0] = {stat: wow_statstype[json.result.stat_type1], value: json.result.stat_value1, type: json.result.stat_type1 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type2 !== 0){ + json.result.stats[1] = {stat: wow_statstype[json.result.stat_type2], value: json.result.stat_value2, type: json.result.stat_type2 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type3 !== 0){ + json.result.stats[2] = {stat: wow_statstype[json.result.stat_type3], value: json.result.stat_value3, type: json.result.stat_type3 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type4 !== 0){ + json.result.stats[3] = {stat: wow_statstype[json.result.stat_type4], value: json.result.stat_value4, type: json.result.stat_type4 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type5 !== 0){ + json.result.stats[4] = {stat: wow_statstype[json.result.stat_type5], value: json.result.stat_value5, type: json.result.stat_type5 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type6 !== 0){ + json.result.stats[5] = {stat: wow_statstype[json.result.stat_type6], value: json.result.stat_value6, type: json.result.stat_type6 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type7 !== 0){ + json.result.stats[6] = {stat: wow_statstype[json.result.stat_type7], value: json.result.stat_value7, type: json.result.stat_type7 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type8 !== 0){ + json.result.stats[7] = {stat: wow_statstype[json.result.stat_type8], value: json.result.stat_value8, type: json.result.stat_type8 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type9 !== 0){ + json.result.stats[8] = {stat: wow_statstype[json.result.stat_type9], value: json.result.stat_value9, type: json.result.stat_type9 <= 7 ? "primary" : "secondary" };} + if(json.result.stat_type10 !== 0){ + json.result.stats[9] = {stat: wow_statstype[json.result.stat_type10], value: json.result.stat_value10, type: json.result.stat_type10 <= 7 ? "primary" : "secondary" };} + + json.result.enchantments = {}; + //socket + json.result.enchantments.sockets = {}; + if(json.result.socketColor_1 !== 0){ + json.result.enchantments.sockets[0] = {color: wow_socketcolor[json.result.socketColor_1]};} + if(json.result.socketColor_2 !== 0){ + json.result.enchantments.sockets[1] = {color: wow_socketcolor[json.result.socketColor_2]};} + if(json.result.socketColor_3 !== 0){ + json.result.enchantments.sockets[2] = {color: wow_socketcolor[json.result.socketColor_3]};} + + json.result.enchantments.socketBonus = wow_socketbonus[json.result.socketBonus]; + + //Classes + json.result.classes = []; + if(json.result.AllowableClass !== -1){ + if(json.result.AllowableClass % 1 === 0){ + json.result.classes.push("Warrior");} + if(json.result.AllowableClass % 2 === 0){ + json.result.classes.push("Paladin");} + if(json.result.AllowableClass % 4 === 0){ + json.result.classes.push("Hunter");} + if(json.result.AllowableClass % 8 === 0){ + json.result.classes.push("Rogue");} + if(json.result.AllowableClass % 16 === 0){ + json.result.classes.push("Priest");} + if(json.result.AllowableClass % 32 === 0){ + json.result.classes.push("Death Knight");} + if(json.result.AllowableClass % 64 === 0){ + json.result.classes.push("Shaman");} + if(json.result.AllowableClass % 128 === 0){ + json.result.classes.push("Mage");} + if(json.result.AllowableClass % 256 === 0){ + json.result.classes.push("Warlock");} + if(json.result.AllowableClass % 512 === 0){ + json.result.classes.push("Monk");} + if(json.result.AllowableClass % 1024 === 0){ + json.result.classes.push("Druid");} + } + + //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 ) { + $this.css({"background-image": "url(http://wow.zamimg.com/images/wow/icons/medium/"+ json.result.icon +".jpg)"}); + } + if( json.result.stack ) { + $this.append(""+json.result.stack+"");} + }); + + }); + + $wowIcons.on("mouseover.wow", function(e) { + var $this = $(this); + var $html; + + if( !lastHovered || !lastHovered.is( $this ) ) { + + var id = $this.data("item-id"); + $html = $( template(items[id]) ); + + $body.find(".wow-item").remove(); + $body.append( $html ); + + $html.css({ + left: e.clientX + 20, + top: e.clientY - 10 + }); + + lastHovered = $this; + + } else { + $html = $(".wow-item"); + } + + setTimeout(function() { + $html.removeClass("hidden"); + },10); + + $this.on("mousemove.wow", function(e) { + $html.css({ + left: e.clientX + 20, + top: e.clientY - 30 + }); + }); + + }); + + $wowIcons.on("mouseout.wow",function(e) { + $body.find(".wow-item").addClass("hidden"); + $(this).off("mousemove.wow"); + }); + + $body.on("mouseover.wow", ".wow-item" , function(e) { + //$(this).removeClass("hidden"); + }); + + $body.on("mouseout.wow", ".wow-item" , function(e) { + $(this).addClass("hidden"); + }); + +/*var example = { + + // most values can be left blank + // or omitted if they aren't needed. + + "example": { + + icon: "icon_name" + quality: "trash", + name: "Example Tooltip", + binds: "when picked up", + unique: true, + slot: "Two-Hand", + type: "Axe", + + damage: { + min: 25, + max: 39, + // extras is for stuff like additional fire dmg + extras: { + min: [], + max: [] + }, + speed: 2.50 + }, + + stats: [ + { stat: "Agility", value: 4, type: "primary" }, + { stat: "Stamina", value: 4, type: "primary" }, + { stat: "Hit", value: 4, type: "secondary" }, + { stat: "Haste", value: 4, type: "secondary" } + ], + + enchantments: { + + enchants: [ + { description: "Flametongue" } + ], + + sockets: [ + { color: "red" }, + { color: "blue" }, + { color: "yellow" }, + { color: "meta" }, + { color: "prismatic" } + ], + + socketBonus: "+12 Haste" + + }, + + durability: 65, + + chanceOnHit: [ + { description: "Strike an enemy for an additional 2 fire damage." }, + { description: "Explode." } + ], + + classes: [ "Warrior", "Paladin", "Death Knight" ], + + level: 14, + ilevel: 19, + + bonuses: [ + { description: "Equip: Increases your PVP Power by 10." }, + { description: "Use: Summon a basilisk as a buddy for 10 seconds." } + ] + + } + +};*/ +} \ No newline at end of file diff --git a/lib_wow_tooltips.php b/lib_wow_tooltips.php new file mode 100644 index 0000000..0deea06 --- /dev/null +++ b/lib_wow_tooltips.php @@ -0,0 +1,10 @@ +