Greasy Fork is available in English.

Ghost Trappers Whiskey Changer

Change Magic Potions into Pre-FB changes Whiskeys

// ==UserScript==
// @name        Ghost Trappers Whiskey Changer
// @namespace   Hazado
// @description Change Magic Potions into Pre-FB changes Whiskeys
// @require		https://code.jquery.com/jquery-2.2.2.min.js
// @match       *www.ghost-trappers.com*
// @exclude     *www.ghost-trappers.com/fb/talent_calculator.php*
// @exclude     *www.ghost-trappers.com/fb/scotch_ninth_floor.php?page=talents*
// @exclude     *www.ghost-trappers.com/fb/donate.php*
// @exclude     *www.ghost-trappers.com/fb/scotch_intern.php*
// @version     1.6.1
// ==/UserScript==

var Changes = {};
var ElementChanges = document.querySelectorAll('div[class*=itemHeadline],div[class*=flavourLine],div[style*=font-weight],div[class*=merchantText],div[class*=logText],p,td,b,option');

function replaceAll(str,mapObj){
    var re = new RegExp(Object.keys(mapObj).join("|"),"g");

    return str.replace(re, function(matched){
        return mapObj[matched];
    });
}

//Change Disclaimer to let you know all drinks are actually alcoholic
if (document.getElementById('baitDisclaimer') !== null) document.getElementById('baitDisclaimer').innerHTML = 'Disclaimer<p>All beverages in Ghost Trappers are <b>alcoholic<\/b>.<br><a href="http://www.aa.org" target="_blank">Please drink responsibly</a><br><a onclick="closeBaitDisclaimerPopup()"><i>(close)<\/i><\/a>';

var BarChanges = {"button_mix_mocktails":"button_mix_cocktails","scotch_headline2_bar_v2":"scotch_headline2_bar"};
var SilverStarChanges = {"icon_whisky_silverstar_green.png":"icon_whisky_jimmystalker.png","icon_whisky_silverstar_blue.png":"icon_whisky_jimmystalker_12yo.png","icon_whisky_silverstar_purple.png":"icon_whisky_jimmystalker_30yo.png","whisky_silverstar_green.jpg":"whisky_01_jimmystalker_10yo.jpg","whisky_silverstar_blue.jpg":"whisky_01_jimmystalker_12yo.jpg","whisky_silverstar_purple.jpg":"whisky_01_jimmystalker_30yo.jpg","This popular magic potion is a solid base for attracting the most common ghosts. However, more rare ghosts prefer more magical stuff. Recommended if you want to avoid stronger ghosts.":"This popular blend is a solid base for attracting the most common ghosts. However, more rare ghosts prefer single malts. Recommended if you want to avoid stronger ghosts. ","Silver star - green":"Jimmy Stalker 10 y.o.","The \"blue\" version is a very special magic potion  for rookies and experienced players alike. Due to its top-secret production process, it adds power to your trap.":"The older vintage is a very special whisky for rookies and experienced players alike. Due to its top-secret blending process, it adds power to your trap. ","Silver star - blue":"Jimmy Stalker 12 y.o.","Silver star \"purple\" is an extremely rare and exquisite potion full of arcane secrets. It can only be found in places where no agent should go alone.":"Jimmy Stalker 30 y.o. is an extremely rare and exquisite vintage full of arcane secrets. It can only be found in places where no agent should go alone. ","Silver star - purple":"Jimmy Stalker 30 y.o.","Silver star - orange":"Jimmy Stalker 18 y.o.","Silver star - red":"Jimmy Stalker 16 y.o."};
var MoonshadowChanges = {"icon_whisky_moonshadow_green.png":"icon_whisky_mcmillan.png","icon_whisky_moonshadow_blue.png":"icon_whisky_mcmillan_15yo.png","icon_whisky_moonshadow_purple.png":"icon_whisky_mcmillan_20yo.png","whisky_moonshadow_green.jpg":"whisky_01_mcmillan_12yo.jpg","whisky_moonshadow_blue.jpg":"whisky_01_mcmillan_15yo.jpg","whisky_moonshadow_purple.jpg":"whisky_01_mcmillan_20yo.jpg","This magic potion is a good start for daring hunters who venture into the more scary locations since it might attract some stronger ghosts.":"A single malt that has matured in sherry casks. A good start for experienced hunters who venture into the more scary locations since it might attract some stronger ghosts. ",'Moonshadow - green':"McMillan 12 y.o.",'Using the "blue" version of Moonshadow is such a clever move that the reward for catching ghosts with it is slightly increased.':"Using the older version of the McMillan, which has matured in old sherry casks, is such a clever move that the reward for catching ghosts with it is slightly increased. ",'Moonshadow - blue':"McMillan 15 y.o.","This special magic potion is reserved only for New Year's and other special occasions. It's so explosive that ghosts think that fireworks have gone off in their heads.":"This special vintage is reserved only for New Year's. It's so strong that ghosts think that fireworks have gone off in their heads. ",'Moonshadow - purple':"McMillan 20 y.o."};
var MoormistChanges = {"icon_whisky_moormist_green.png":"icon_whisky_moormist.png","icon_whisky_moormist_blue.png":"icon_whisky_moormist_21yo.png","icon_whisky_moormist_purple.png":"icon_whisky_moormist_30yo.png","whisky_moormist_green.jpg":"whisky_01_moormist_15yo.jpg","whisky_moormist_blue.jpg":"whisky_01_moormist_21yo.jpg","whisky_moormist_purple.jpg":"whisky_01_moormist_30yo.jpg","This potent magic potion attracts the rarer ghosts of Scotland. An excellent choice for experienced hunters.":"This peaty single malt attracts the rarer ghosts of Scotland. An excellent choice for experienced hunters. ","Moormist - green":"Moormist 15 y.o.","Enigmatic flavour, yet very mild. This mildness is almost mystical in nature and Ghosts are rumoured to bring more money along when they suspect this fantastic magic potion.":"Peaty flavour, yet very mild. This mildness is almost mystical in nature and Ghosts are rumoured to bring more money along when they suspect this fantastic vintage. ","Moormist - blue":"Moormist 21 y.o.","The purple version is a very rare, special potion that can only be found in the most secret and strangest locations, i.e., game rooms, theatres and museums.":"Moormist 30 y.o. is a very rare, special vintage that can only be found in the most secret and strangest locations, i.e., game rooms, theatres and museums. ","Moormist - purple":"Moormist 30 y.o."};
var GlengreenChanges = {"icon_whisky_glengreens_green.png":"icon_whisky_glengreen.png","icon_whisky_glengreens_blue.png":"icon_whisky_glengreen_25yo.png","icon_whisky_glengreens_purple.png":"icon_whisky_glengreen_35yo.png","whisky_glengreens_green.jpg":"whisky_01_glengreen_18yo.jpg","whisky_glengreens_blue.jpg":"whisky_01_glengreen_25yo.jpg","whisky_glengreens_purple.jpg":"whisky_01_glengreen_35yo.jpg","Glengreen is a very strong magic potion that will attract almost all ghosts. Truely for veterans and those who are not easily scared!":"Glengreens is a very well-rounded single malt that will attract almost all ghosts. Truely for veterans and those who are not easily scared! ","Glengreen - green":"Glengreens 18 y.o.","The blue version is a very well-rounded magic potion that all ghosts crave. No surprise that agents will yield slightly better results when using it.":"This vintage is a very well-rounded whisky that all ghosts crave. No surprise that you will yield slightly better results when using it. ","Glengreen - blue":"Glengreens 25 y.o.","The rare version of the Glengreen magic potions was supposed to be lost forever on the lost island, but now that the Q-section has been able to open a portal, some bottles can be salvaged by brave agents.":"The rare version of the Glengreens whiskies was supposed to be lost forever on the lost island, but now that the Q-section has been able to open a portal, some bottles can be salvaged by brave agents.","Glengreen - purple":"Glengreens 35 y.o."};
var WhisperwindChanges = {"icon_whisky_whisperwind_green.png":"icon_whisky_portkarrie_21yo.png","icon_whisky_whisperwind_blue.png":"icon_whisky_portkarrie_28yo.png","whisky_whisperwind_green.jpg":"whisky_02_portkarrie_21yo.jpg","whisky_whisperwind_blue.jpg":"whisky_02_portkarrie_28yo.jpg","This magic potion was developed by a femme fatale. So it consists of many tears, broken hearts and many sorrows. Exactly the stuff  that some ghosts find attractive! The blue version even adds more melancholy.":"Port Karrie is named after a famous femme fatale that was legendary for stealing men's hearts and money. A strong malt with a mystical flavour. The 28 y.o. vintage even adds more melancholy.","This magic potion was developed by a femme fatale. So it consists of many tears, broken hearts and many sorrows. Exactly the stuff  that some ghosts find attractive!":"Port Karrie is named after a famous femme fatale that was legendary for stealing men's hearts and money. A strong malt with a mystical flavour. ","Whisperwind - green":"Port Karrie 21 y.o.","Whisperwind - blue":"Port Karrie 28 y.o.","Whisperwind - purple":"Port Karrie 31 y.o."};
var NessyChanges = {'Rumoured to use the magical waters of Loch Ness, this legendary magic potion will attract all ghosts of Scotland, even prize ghosts, ghost monsters and some ghosts that are only attracted to "Nessy\'s"! The power of that potion is so strong that neither ghosts will steal it nor does it fail to attract a ghost. Simply liquid magic! Only available through donations. Help to improve Ghost Trappers in adding more unique features and being even more fun!':'Rumoured to be distilled with the waters of Loch Ness, this legendary whisky will attract all rare ghosts of Scotland, even prize ghosts, ghost monsters and some ghosts that are only attracted to "Nessy\'s"! The power of this whisky is so strong that neither ghosts will steal it nor does it fail to attract a ghost. Simply liquid magic! Only available through donations. Help to improve Ghost Trappers in adding more unique features and being even more fun! ','Rumoured to be blessed with the waters of Loch Ness, this great magic potion has a very high attraction rate for all rare ghosts of Scotland, also for prize ghosts! The power of that magic potion is so strong that neither ghosts will steal it nor angels will touch it and that you can hunt more often with it. Simply liquid magic! Only available through donations. Help to improve Ghost trappers in adding more unique features and being even more fun!':'Rumoured to be blessed with the waters of Loch Ness, this great whiskey has a very high attraction rate for all rare ghosts of Scotland, also for prize ghosts! The power of that whiskey is so strong that neither ghosts will steal it nor angels will touch it and that you can hunt more often with it. Simply liquid magic! Only available through donations. Help to improve Ghost trappers in adding more unique features and being even more fun! '};
var SpecialEditionChanges = {"Although avalanches are a bad thing, this magic potions deserves that name because it can infuse agents with a force-of-nature-like buff.":"Although avalanches are a bad thing, these whiskies deserves that name because it can infuse agents with a force-of-nature-like buff. ","Belt of Venus is a multy-layered magic potions. Each layer symbolizes one power of the elements.":"Belt of Venus is a multy-layered whisky. Each layer symbolizes one power of the elements. ","A magic potion that has a relatively high attraction combined with the power to purify infernal traps.":"A whisky that has a relatively high attraction combined with the power to purify infernal traps. ","Liquid ember is a magic potion that is often attractive to vampire lords and ladies..":"Liquid ember is a whisky that is often attractive to vampire lords and ladies.. ",'A pumpkin punch potion can only be produced during Halloween. Its mystic properties have an extremely high influence on midnight ghosts.':'A pumpkin punch whisky can only be produced during Halloween. Its mystic properties have an extremely high influence on midnight ghosts. ',"Secret eye magic potions are made from centuries-old recipes, hoarded by the confectioner ghost and other secret ghost families. These magic potions are extremely hard to come by and are best saved for those times when you are trying to find a secret ghost.":"Secret eye whiskies are made from centuries-old recipes, hoarded by the confectioner ghost and other secret ghost families. These whiskies are extremely hard to come by and are best saved for those times when you are trying to find a secret ghost. ","These magic potions are extremely hard to come by and are reserved for special agents. Shadetouch even attracts ghosts that would normally only be attracted by Nessy's.":"These whiskies are extremely hard to come by and are reserved for special agents. Shadetouch even attracts ghosts that would normally only be attracted by Nessy's. ","Shadetouch green":"Shadetouch 15 y.o.","Shadetouch blue":"Shadetouch 35 y.o.","Shadetouch purple":"Shadetouch 50 y.o.","Shadetouch orange":"Shadetouch 60 y.o."};
var MixedMagicPotionChanges = {"misc_recipes_apple_zapper.jpg":"misc_recipes_applemanhattan.jpg","misc_apple_zapper.jpg":"misc_applemanhattan.jpg","icon_cocktail_apple_zapper.png":"icon_cocktail_applemanhattan.png","applezapper_1.png":"applemanhattan_1.png","applezapper_2.png":"applemanhattan_2.png",'An Apple zapper is a mocktail mixed with Midnight apple juice, which is very hard to come by. Ghosts know this and bring some extra money along.':'An Apple Manhattan is mixed with Midnight apple juice, which is very hard to come by. Ghosts know this and bring extra money along. ',"Apple zapper":"Apple Manhattan","Apple Zapper":"Apple Manhattan",'A "Black Widow" is a very delicious mocktail. Actually, it is so delicious that it even has a slight chance to attract Ghost monsters!':'A "Black Widow" is a very delicious cocktail. Actually, it is so delicious that it even has a slight chance to attract Ghost monsters! ',"misc_recipes_braveheart.jpg":"misc_recipes_robroy.jpg","misc_braveheart.jpg":"misc_robroy.jpg","icon_cocktail_braveheart.png":"icon_cocktail_robroy.png","braveheart_1.png":"robroy_1.png","braveheart_2.png":"robroy_2.png","A Braveheart is a mocktail named after one of Scotland's most famous sons. This high amount of tradition cannot be withstood by many ghosts.":"A Rob Roy is a cocktail named after one of Scotland's most famous sons. This high amount of tradition cannot be withstood by many ghosts. ","Braveheart":"Rob Roy","Cherry bombs have such an overwhelming taste, that ghosts are under the impression that really a bomb has exploded over their heads. This recipe is only available through Cherry Credits.":"Cherry Bombs have such an overwhelming taste, that ghosts are under the impression that really a bomb has exploded over their heads. This recipe is only available through Cherry Credits. ","A sip of this mocktail can literally revive corpses. It tastes so great that even some nocturnal ghosts try to get their hands on it.":"A sip of this cocktail can literally revive corpses. It tastes so great that even some nocturnal ghosts try to get their hands on it. ","A Devil Driver is such a delicious mocktail that its attraction is simply irresistible to all ghosts! No matter where you are hunting, you cannot go wrong with it.":"Devil Driver is such a delicious cocktail that its attraction is simply irresistible to all ghosts! No matter where you are hunting, you cannot go wrong with it. ","The Double feature is a mocktail that is very popular among all cineastic ghosts who are so snobby that are not interested in aynthing else.":"The Double feature is a cocktail that is very popular among all cineastic ghosts who are so snobby that are not interested in aynthing else. ","A frozen mist is made from the mist and morning dew of the low lands and the Glengreen potions, resulting in a frosty, aromatic potion that many ghosts love.":"A Frozen mist is made from the mist and morning dew of the low lands and the Glengreens whiskies, resulting in a frosty, aromatic cocktail that many ghosts love. ","misc_recipes_gentleman.jpg":"misc_recipes_oldfashioned.jpg","gentleman_1.png":"oldfashioned_1.png","gentleman_2.png":"oldfashioned_2.png","A classic mocktail that is older than some of the ghosts. You can't do anything wrong with this one, although it is difficult to mix. Only true masters of the art of mixing can produce a perfect Gentleman. Using this mocktail will increase your rewards.":"A classic cocktail that is older than some of the ghosts. You can't do anything wrong with this one, although it is difficult to mix. Only true masters of the art of mixing can produce a perfect Old Fashioned. Using this cocktail will increase your rewards. ","A classic mocktail whose recipe is older than some of the ghosts. You can't do anything wrong with this one, although it is difficult to mix. Only true masters of the art of mixing can produce a true Gentleman. Using this mocktail will increase your rewards.":"A classic cocktail that is older than some of the ghosts. You can't do anything wrong with this one, although it is difficult to mix. Only true masters of the art of mixing can produce a perfect Old Fashioned. Using this cocktail will increase your rewards. ","Gentleman":"Old Fashioned","When Charles the barkeeper feels that the agents of S.C.O.T.C.H. are in dire need of special bait, he will supply them with a mocktail made from a recipe only he knows.":"When Charles the barkeeper feels that the agents of S.C.O.T.C.H. are in dire need of special bait, he will supply them with a cocktail made from a recipe only he knows. ","misc_recipes_jack_jones.jpg":"misc_recipes_jackfrost.jpg","jackjones_1.png":"jackfrost_1.png","jackjones_2.png":"jackfrost_2.png","A Jack Jones is such a sweet and strong mocktail it makes even the toughest ghosts very soft, allowing for sharper pictures to be taken. Those pictures are worth more experience points.":"A Jack Frost is such a sweet and strong cocktail it makes even the toughest ghosts very tipsy, allowing for sharper pictures to be taken. Those pictures are worth more experience points. ","A Jack Jones is such a sweet and delicious mocktail it makes even the toughest ghosts soft, allowing for sharper pictures to be taken. Those pictures are worth more experience points.":"A Jack Frost is such a sweet and strong cocktail it makes even the toughest ghosts very tipsy, allowing for sharper pictures to be taken. Those pictures are worth more experience points.","Jack jones":"Jack Frost","Jack Jones":"Jack Frost",'The lucky punch is a mocktail that radiates pure luck to those who even touch the glass.':'The Lucky Punch is a cocktail that radiates pure luck to those who even touch the glass. ','Not all ghosts are curious to try new things, especially not the spoiled party ghosts, but those who try the famous German "Maß" during Oktoberfest will quickly note that non-alcoholic malt juice tastes great!':'Not all ghosts are curious to try new things, especially not the spoiled party ghosts, but those who try the famous German "Maß" during Oktoberfest will quickly note it has a good punch! ',"Maß malt juice":"Maß bier",'After acquiring a few secret ingredients, Charles the barkeeper has managed to come up with two new mocktails that even midnight ghosts cannot resist during daytime.':'After acquiring a few secret ingredients, Charles the barkeeper has managed to come up with two new cocktail that even midnight ghosts cannot resist during daytime. ','If you want to taste the "spirit" of Christmas, then this is the mocktail for you. Only available from Santa or his three little Diviad helpers.':'If you want to taste the "spirit" of Christmas, then this is the cocktail for you. Only available from Santa or his three little Diviad helpers. ','A nightcap is a very special mocktail that is really famous among the ghosts of Kirkyard Crypt.':'A Nightcap is a very special cocktail that is really famous among the ghosts of Kirkyard Crypt.',"The famous Old admiral from the Pusser's bar is said to cure terrible pain. In our case, ghosts are considered the terrible pain.":'The famous Painkiller from <a href="http://www.pussersbar.de/" target="_blank">Pusser\'s Bar</a> is said to cure terrible pain. In our case, ghosts are considered the terrible pain. ','The famous "Old admiral" mocktail from the Pusser\'s bar is said to make you feel well even despite terrible pain. In our case, ghosts are considered the terrible pain.':'The famous "Painkiller" cocktail from <a href="http://www.pussersbar.de/" target="_blank">Pusser\'s Bar</a> is said to cure terrible pain. In our case, ghosts are considered the terrible pain. ',"Old admiral":"Painkiller","Old Admiral":"Painkiller","The Ruby Tuesday is a mocktail whose recipe has been passed down from one generation of alchemists  to the next. To learn how to mix such a delicious mocktail, you have to prove yourself worthy to S.C.O.T.C.H. HQ and its staff!":"The Ruby Tuesday cocktail's recipe has been passed down from one generation of barkeepers to the next. To learn how to mix such a delicious cocktail, you have to prove yourself worthy to S.C.O.T.C.H. HQ and its barkeep staff!","A witch hunt is a very fancy mocktail that is best used to attract the legendary dragonrider ghost.":"A witch hunt is a very fancy cocktail that is best used to attract the legendary dragonrider ghost. ","misc_recipes_old_admiral.jpg":"misc_recipes_painkiller.jpg","oldadmiral_2.png":"oldadmiral_1.png"};
var MixersChanges = {"icon_juice_kreepy_koko.png":"icon_juice_kreepykahlua.png","misc_kreepy_koko.jpg":"misc_kreepykahlua.jpg",'Kreepy Koko is a rare import from the Caribbean. Its creamy flavour is the basis for sweet mocktails.':'Kreepy Kahlua is a rare import from the Caribbean. Its creamy flavour is the basis for sweet cocktails.',"Kreepy koko":"Kreepy kahlua","Kreepy Koko":"Kreepy kahlua","misc_widow_tears.jpg":"misc_widowvermouth.jpg","icon_juice_widow_tears.png":"icon_juice_widowvermouth.png",'The sweet bitterness of widow tears comes from its secret ingredients: the tears of sorrow, shed by young widows.':'The sweet bitterness of Widow vermouth comes from its secret ingredients: the tears of sorrow, shed by young widows.',"Widow tears":"Widow vermouth",'Silver screen juice actually consists of coconut milk, but that would not sound too fitting for an ingredient of a double feature mocktail.':'Silver screen juice actually consists of coconut milk, but that would not sound too fitting for an ingredient of a double feature cocktail.'};
var GhostChanges = {"potionmaster":"master distiller","Potionmaster":"Master distiller","Greedy ghost":"Distiller ghost","greedy ghost":"distiller ghost"};
var MiscChanges = {'The kind of potion that even makes gargoyles tipsy.':'The kind of whisky that even makes gargoyles tipsy.','Instead of malt juice Friar Benedict really has a weakness for magic potions. He helps S.C.O.T.C.H. agents to trap ghosts to eliminate the competition.':'Instead of Maß bier Friar Benedict really has a weakness for whiskies. He helps S.C.O.T.C.H. agents to trap ghosts to eliminate the competition.',"BURNER - This mechanism uses additional magic potions.":"BURNER - This mechanism uses additional whiskies.","Currencies are mainly used for buying things in Lady Bayoushi's. Some mocktail recipes require currencies, too.":"Currencies are mainly used for buying things in Lady Bayoushi's. Some cocktail recipes require currencies, too.","Castle McWallace has a huge cellar that can store many a barrel of magic potions. No surprise that ghosts are attracted to this place.":"Castle McWallace has a huge cellar that can store many a barrel of whisky. No surprise that ghosts are attracted to this place.","Visit the different departments of S.C.O.T.C.H. You will find mechanisms in the Q-section, magic circles in the laboratory and magic potions at the bar.":"Visit the different departments of S.C.O.T.C.H. You will find mechanisms in the Q-section, magic circles in the laboratory and whiskies at the bar.","Juices are needed for mixing mocktails.":"Juices are needed for mixing cocktails.","magic potions":"whiskies","Magic Potions":"Whiskies","Magic potions":"Whiskies","magic potion":"whisky","Magic Potion":"Whisky","Magic potion":"Whisky","mocktail":"cocktail","mocktails":"cocktails","Mocktail":"Cocktail","Cocktails":"Cocktails"};

$.extend(Changes,BarChanges,SilverStarChanges,MoonshadowChanges,MoormistChanges,GlengreenChanges,WhisperwindChanges,NessyChanges,SpecialEditionChanges,MixedMagicPotionChanges,MixersChanges,GhostChanges,MiscChanges);

for (i = 0; i < ElementChanges.length; i++) {
    //console.log(ElementChanges[i].innerHTML);
    if (i !== 0){
        ElementChanges[i].innerHTML = replaceAll(ElementChanges[i].innerHTML,Changes);
    }
}
for (i = 0; i < document.querySelectorAll('img[src]').length; i++) {
    document.querySelectorAll('img[src]')[i].src = replaceAll(document.querySelectorAll('img[src]')[i].src,Changes);
}