Donnabot's GOTA_Extender_Original

GOTA_Extender_Original to go with my fork of GOTA_Extender

สคริปต์นี้ไม่ควรถูกติดตั้งโดยตรง มันเป็นคลังสำหรับสคริปต์อื่น ๆ เพื่อบรรจุด้วยคำสั่งเมทา // @require https://update.greasyfork.org/scripts/7493/33084/Donnabot%27s%20GOTA_Extender_Original.js

var original = {};
original.doLog =
    "function doLog(b,a,c){$.browser.msie||(!0==a?console.error(b):console.log(b))}";
original.doInstantSpeedUp =
    "function doInstantSpeedUp(b,a){var c=buildingById(b),d=getCurrentSpeedUpType(c.producing_archetype_id,c.recipe_symbol);if(!1==hasGold(instantSpeedCost(c.build_remaining,d),function(){doInstantSpeedUp(b,!0)},a)&&!0!=a)return!1;playSound(\"coins\");return speedBuild(-1,b)}";
original.doFinishProduction =
    "function doFinishProduction(b){var a=buildingByItemId(b),c=itemFromId(a.producing_archetype_id);userContext.lastFinish=a.symbol;doLog(\"doFinishProduction: building_id=\"+b+\" symbol=\"+a.symbol+\" producing=\"+c.symbol);\"Upgrade\"!==c.slot&&(analytics.track(\"Production Finish\",{building_symbol:a.symbol,item_symbol:c.symbol,item_category:c.slot}),analytics.wizardtrack(\"Production Finish\",{building_symbol:a.symbol,item_symbol:c.symbol,item_category:c.slot}));var d=\"finish-\"+b;userLock(d)&&(playSound(\"build\"),\nisWeb()&&$(\"#collect_\"+a.symbol).html(\"\"),$.ajax({url:\"/play/finish_production/\"+b,dataType:\"JSON\",success:function(a){doLog(\"doFinishProduction: succeess \");freeLock(d);var c=buildingByItemId(b,a.building);userContext.playerData.character=a.character;userContext.playerData.user.money=a.user.money;userContext.playerData.stat.onboarding=a.stat.onboarding;userContext.playerData.stat.num_items_produced=a.stat.num_items_produced;userContext.playerData.stat.produced_stone=a.stat.produced_stone;userContext.playerData.stat.building_upgrades_finished=\na.stat.building_upgrades_finished;c.producing_archetype_id=void 0;c.modifier=void 0;c.recipe_symbol=void 0;var f=extractItemBySymbol(playerInventory,c.symbol);f.effective_upgrade_level=a.building.effective_upgrade_level;f.producing_archetype_id=void 0;f.modifier=void 0;f.recipe_symbol=void 0;if(a.produced_item)if(userContext.intCurrentRecipeIndex=void 0,doLog(\"doFinishProduction: data.produced_item.id=\"+a.produced_item.id+\" quantity=\"+a.produced_item.quantity),insertInventoryFromItem(playerInventory,\na.produced_item),theNewItem=extractItemById(playerInventory,a.produced_item.id),1==a.is_loot)0<a.enhanced_loot_roll?dialogAlert({style:\"alert\",text:\"The result of your production (enhanced) is: \"+a.produced_full_name,items:[theNewItem],heading:\"You have produced...\",button1:\"Okay\"}):dialogAlert({style:\"alert\",text:\"The result of your production is: \"+a.produced_full_name,items:[theNewItem],heading:\"You have produced...\",button1:\"Okay\"});else if(0<a.affix_chance){var p;p=\"\"+(\"You have a \"+a.affix_chance_from_stats+\n\"% chance to produce a superior-quality item from your talents, equipment and buildings.\");a.bonus_item_name&&(p+=\" Your \"+a.bonus_item_name+\" adds another +\"+a.affix_chance_from_bonus+\"% chance to produce a superior-quality item from your talents, equipment and buildings.\");p=a.affix_roll1<=a.affix_chance&&a.affix_roll2<=a.affix_chance?p+\"<p/>Critical Success! You obtained a superb result!\":a.affix_roll1>a.affix_chance&&a.affix_roll2>a.affix_chance?p+\"<p/>You obtained a normal result.\":p+\"<p/>Success! You obtained a good result.\";\nvar q=JSON.parse(JSON.stringify(theNewItem));void 0!=a.produced_quantity&&(q.quantity=a.produced_quantity,q.available_quantity=a.produced_quantity);dialogAlert({style:\"alert\",text:p,items:[q],heading:a.produced_full_name,button1:\"Okay\"})}userContext.newBldgOrUpgrade=!0;var m;\"Upgrade\"!=theNewItem.slot?(userContext.newProducedItem=theNewItem,isWeb()&&$(\"#collect_\"+f.symbol).html(renderUpgradeCollect(f)),isWeb()&&$(\"#build_panel_action_\"+f.id).html(renderBuildPanelAction(f)),isWeb()&&$(\"#speed_button_\"+\nf.id).hide()):m=theNewItem.symbol;isWeb()?(renderBuildingInventory(userContext.playerData),renderBuildingsOnScreen(userContext.playerData)):(f=void 0,f=void 0==m?{symbol:c.symbol,status:\"idle\"}:{symbol:c.symbol,status:\"idle\",upgrade:m},iosSignal(\"finish_production\",\"update\",f),isAndroid()&&mobileCooldownDataSignal([{mode:\"building\",symbol:c.symbol}]),refreshActiveBuildingPanel(),$(\"#building_tab_prod, .buildingupgradetree\").fadeTo(\"slow\",\"1\"));uiEvent(\"do_finish_production\");uiEvent(\"building_panel_\"+\nuserContext.activeBuildingPanel);a.produced_item&&(\"stacks_of_coins\"==a.produced_item.symbol?retrievePlayerData(!0,function(a){userContext.playerData.quests=a.quests;reRenderQuestActionItems()}):\"stacks_of_coins\"==a.produced_item.symbol&&(userContext.playerData.stat.ftpe_decorative_blade=1));\"Upgrade\"==theNewItem.slot&&buildingUpgradePanel(c.symbol);updatePlayerInfo(userContext.playerData);updateAllStatus()}}))}";
original.doProduction =
    "function doProduction(b,a,c,d,g){userContext.lastFinish=void 0;void 0==c&&(c=1);doLog(\"doProduction: symbol=\"+b+\" producer=\"+a+\" quantity=\"+c);var k=void 0,f=\"\",p=void 0,q=\"\",m=void 0,D=void 0,w=[],s=[],z=[],u=!1;uiEvent(\"start_production\");void 0==userContext.playerData.stat.num_shop_items_started&&(userContext.playerData.stat.num_shop_items_started=0);userContext.playerData.stat.num_shop_items_started+=1;for(var y=0;y<userContext.recipeData.length;y++)if(g==userContext.recipeData[y].symbol||void 0==\ng&&(userContext.recipeData[y].output==b||userContext.recipeData[y].output_loot==b)&&userContext.recipeData[y].category==a){k=userContext.recipeData[y];k.output==b?(m=itemFromSymbol(b),q=m.full_name):(k.output_loot==b&&(p=b),q=k.name);D=y;components=userContext.recipeData[y].input.split(\",\");quantity_components=userContext.recipeData[y].input_quantity.split(\",\");var E=itemFromSymbol(userContext.recipeData[y].category);if(!0==userContext.recipeData[y].unlocked){if(1<userContext.recipeData[y].input.length)for(E=\n0;E<components.length;E++){var M=itemFromSymbol(components[E]),L=!1;0==E&&!0==userContext.recipeData[y].evolution&&(L=!0);L=sumInventoryQuantity(M.symbol,L);if(parseInt(quantity_components[E])*c>L){\"\"==f&&(f=\"You need more of the following:<p/>\");f+=\"<div>\";if(4<=userContext.playerData.character.level)switch(components[E]){case \"stone\":case \"iron\":case \"fur\":case \"ore\":case \"horse\":case \"riverways_fish_consumable\":case \"smallfolk\":case \"wood\":case \"cloth\":case \"grains\":L=parseInt(quantity_components[E])*\nc-L;if(cost_item=itemFromSymbol(\"pennyroyal\"))var W=cost_item.price_perk_points*L;f+='<div id=\"basic_resource_'+components[E]+'\">';f+=itemMiniView(M,{extra_styles:\"left:-70px\",quantity_override:L});f+='<span style=\"position: relative; left: 250px; top: -88px\" class=\"btnwrap btnmed btnprice\" onclick=\"getBasicResource(\\''+components[E]+\"',\"+L+',true);\"><span class=\"btnedge\"><a class=\"btngold\">Get Now</a><em>for</em><strong>'+W+\"</strong></span></span>\";f+=\"</div>\";break;default:f+=itemMiniView(M)}f+=\n\"</div>\";f+=\"<p>\"+M.howto+\"</p>\"}else 1<c&&(u=!0,s.push(M),z.push(parseInt(quantity_components[E])*c),w.push(M.full_name))}}else f=\"You need <em>\"+E.full_name+\"</em> to produce that.\";break}if(\"\"!=f)doAlert(\"Requirements: \"+q,f),analytics.track(\"Production Blocked-Resources\",{item_symbol:b}),analytics.wizardtrack(\"Production Blocked-Resources\",{item_symbol:b});else if(k&&hasMoney(k.craft_cost*c,function(){doProduction(b,a,c,d,g)})){f=JSON.parse(JSON.stringify(userContext.playerData.inventory));y=\n[];k.output==b?(m=itemFromSymbol(b),q=m.full_name):(k.output_loot==b&&(p=b),q=k.name);components=k.input.split(\",\");quantity_components=k.input_quantity.split(\",\");E=itemFromSymbol(k.category);if(!0==k.unlocked&&(userContext.intCurrentRecipeIndex=D,1<k.input.length))for(E=0;E<components.length;E++)M=itemFromSymbol(components[E]),L=!1,0==E&&!0==k.evolution&&(L=!0),depleteItems(M.symbol,parseInt(quantity_components[E])*c,void 0,y,L);for(E=0;E<y.length;E++)if(q=itemFromSymbol(y[E].symbol),y[E].full_name!=\nq.full_name)s.push(JSON.parse(JSON.stringify(y[E]))),w.push(y[E].full_name);else if(itemHasSeals(y[E])&&(!y[E].preserve_attributes||!1==y[E].preserve_attributes))s.push(JSON.parse(JSON.stringify(y[E]))),q=generateSealNameList(y[E]),w.push(\"[\"+y[E].full_name+\" : \"+q+\"]\");if(!0!=d&&0<s.length)return playerInventory=JSON.parse(JSON.stringify(f)),userContext.playerData.inventory=playerInventory,p=u?\"Producing %{value} of %{symbol} will consume multiples of your materials: \".replace(\"%{value}\",c).replace(\"%{symbol}\",\nm.full_name):\"Producing this item now will consume superior versions of your materials: \",m=u?\"Are you sure you want to consume these material quantities to produce %{value} of this item?\".replace(\"%{value}\",c):\"Are you sure you want to contribute superior versions of materials to produce this item?\",w[w.length-1]=\"and \"+$(w).last()[0],dialogAlert({style:\"confirm\",margin_top:100,items:s,item_quantity:z,craft_confirm_items:!0,button2:\"Not Now\",button2_action:function(){closeAlert()},button1:\"Confirm\",\nbutton1_action:function(){closeAlert();return doProduction(b,a,c,!0,g)},heading:u?\"Confirm Resource Use\":\"Confirm Superior Materials\",text:p+w.join(\", \")+\".<p/>\"+m}),!1;var h=buildingBySymbol(userContext.activeBuildingPanel);h.build_remaining=k.craft_duration*c;h.original_build_seconds=k.craft_duration*c;h.build_progress=0;\"\"!=k.output&&(h.producing_archetype_id=itemFromSymbol(k.output).id);h.recipe_symbol=k.symbol;h.action_sub_id=c;f=renderBuildingConstruction(h);isWeb()&&$(\"#bc_\"+h.id).html(f);\ndisplayBuildingCooldown(h);\"Upgrade\"==itemFromId(h.producing_archetype_id).slot?buildingUpgradePanel(userContext.activeBuildingPanel,!0,!1):(buildingUpgradePanel(userContext.activeBuildingPanel,!0,!1,!0),buildingTabProd(),isWeb()&&$(\"#collect_\"+h.symbol).html(renderUpgradeCollect(h)));w=\"/play/set_production\";w=(p?w+(\"?loot_symbol=\"+p+\"&producer_symbol=\"+a):m?w+(\"/\"+b+\"?producer_symbol=\"+a):w+(\"?producer_symbol=\"+a))+(\"&quantity=\"+c);g&&(w+=\"&recipe_symbol=\"+g);$.ajax({url:w,dataType:\"JSON\",success:function(a){userContext.prodProgressShow=\nvoid 0;userContext.playerData.stat.num_shop_items_started=a.num_shop_items_started;updateAllStatus();uiEvent(\"do_production\");isWeb()||iosSignal(\"building\",\"cooldown\",mobileCooldownData({mode:\"building\",symbol:h.symbol,flag:\"production_started\"}))}})}}";
original.buildTimerUpdate =
    "function buildTimerUpdate(b,a,c){doLog(\"buildTimerUpdate: id=\"+b+\" remaining=\"+a);$(\"#timer-\"+b).html(renderBuildTime(a));$(\"#timer-panel-\"+b).html(renderBuildTime(a));percent=100-100*(a/c);$(\"#progress-\"+b).html('<span style=\"width:'+percent+'%;\"></span>');var d=buildingById(b);d.build_remaining=a;markup=renderBuildPanelAction(d);$(\"#speed_button_\"+b).show();$(\"#build_panel_action_\"+b).html(markup);$(\"#production_timer_\"+b).html(renderBuildTime(d.build_remaining,!0));$(\"#production_timer_upper_\"+\nb).html(renderBuildTime(d.build_remaining));$(\"#production_progress_\"+b).css({width:percent+\"%\"});$(\"#duration_long_\"+b).html(durationLong(buildTimerDescription(d),a,c));a--;userContext.doBuildId==b&&(300>=a?($(\"#speed_up_skip_block\").hide(),$(\"#speed_up_skip_use\").show()):($(\"#speed_up_skip_use\").hide(),$(\"#speed_up_skip_block\").show()),$(\".speed_building_\"+b).html()!=renderSpeedUpButton(b)&&$(\".speed_building_\"+b).html(renderSpeedUpButton(b)));d.cooldown=a;d.original_cooldown_seconds=c;displayBuildingCooldown(d);\n0<a||(closeSpeedUp(),finalizeBuildingConstruction(d),clearBuildingTimer(d.symbol))}";
original.doCollect =
    "function doCollect(b){lock_name=\"collect-\"+b;if(userLock(lock_name)){var a=buildingByItemId(b);0<predictCollect(a)&&(playSound(\"coins\"),isWeb()&&animatedCoins.init($(\"#collectbtn\"),$(\"#silver\"),[-10,-40],[-72,-44]));uiEvent(\"collect_\"+buildingSymbolFromItemId(b),userContext.PlayerData);the_url=\"/play/collect_building/\"+b+\"?client_seqnum=\"+userContext.player_data_seqnum;isWeb()||showSpinner();$.ajax({url:the_url,dataType:\"JSON\",success:function(c){freeLock(lock_name);doLog(\"doCollect: building_id=\"+\nb+\" data.money=\"+c.money);updateSilver(c.money);updateBaseTime(c.base_time);a.last_collected_at=c.last_collected_at;userContext.playerData.stat.buildings_collected=c.buildings_collected;userContext.playerData.stat.onboarding=c.onboarding;isWeb()||(iosSignal(\"building_collected\"),hideSpinner());isWeb()&&$(\"#collect_\"+a.symbol).html(renderUpgradeCollect(a));buildingUpgradePanel(a.symbol);c=renderBuildingOwned(a);isWeb()&&$(\"#bc_\"+a.id).html(c);updateAllStatus();questListings()}})}}";
original.claimDaily =
    "function claimDaily(){showSpinner();$.ajax({url:\"/play/advice_claim_daily\",dataType:\"JSON\",success:function(b){hideSpinner();$(\"#claimed_holder\").html(\"<h5>Claimed</h5>\");updateSilver(b.total_silver);updateGold(b.total_gold);$(\".claimrewardchest\").hide();$(\"#daily_reward_statview\").html(itemStatViewFromSymbol(b.item,{produce:\"Continue\",produce_callback:\"welcomeClaimed\"}));$(\"#dailynewsbtn\").removeClass(\"btnglow\");var a=buildingBySymbol(\"keep\");userContext.playerData.stat.daily_streak_claimed=userContext.playerData.stat.daily_streak;\na&&$(\"#bc_\"+a.id).html(renderBuildingOwned(a));isWeb()||iosSignal(\"daily_reward_claimed\",void 0,b.item)}});return!1}";
original.applySelectedUpgrade =
    "function applySelectedUpgrade(b,a){lock_name=\"upgrade-\"+b.id;var c=void 0;userContext.lastFinish=void 0;if(0<b.gold&&void 0==a)doGoldUnlock(b.id,function(){applySelectedUpgrade(b,!0)});else if(hasMoney(b.silver,function(){applySelectedUpgrade(b,a,b.silver)})&&userLock(lock_name)){var d=buildingUpgradeResourceCheck(b.building_id,b.id);if(isWeb()){if(void 0!=d.markup&&\"\"!=d.markup){doAlert(\"Resources Required\",\"You need additional resources to construct that upgrade:<p/>\"+d.markup);return}}else if(void 0!=\nd.strMissingComponentText){if(isAndroid()){iosSignal(\"building\",\"upgrade_fail\",d);return}return d}c=d.item;playSound(\"build\");var g=buildingById(b.building_id);itemFromSymbol(g.symbol);d=extractItemBySymbol(userContext.playerData.inventory,g.symbol).upgrade_level-1;0>d&&(d=0);userContext.buildIndex++;g.build_progress=0;g.producing_archetype_id=c.id;$.ajax({url:\"/play/apply_upgrade/\"+b.id,dataType:\"JSON\",success:function(a){freeLock(lock_name);if(a.resource_list)for(var d=0;d<a.resource_list.length;d++){var p=\nextractItemBySymbol(playerInventory,a.resource_list[d]);p&&(p.quantity-=parseInt(a.resource_quantities[d]))}updateSilver(a.money);updateBaseTime(a.base_time);userContext.playerData.stat.onboarding=a.onboarding;userContext.playerData.stat.building_upgrades_added=a.building_upgrades_added;g.build_remaining=a.build_remaining;g.original_build_seconds=a.original_build_seconds;displayBuildingCooldown(g);isWeb()&&buildingUpgradePanel(g.symbol);a=renderBuildingConstruction(g);$(\"#bc_\"+g.id).html(a);uiEvent(\"add_\"+\nuserContext.activeBuildingPanel,userContext.PlayerData);selectedUpgrade=extractItemBySymbol(playerInventory,c.symbol);q_upgrade=1;selectedUpgrade&&(q_upgrade=selectedUpgrade.quantity+1);$(\"#addbtn_container\").html(addButtonUpgrade(c,!1,q_upgrade));isWeb()?selectUpgrade(userContext.activeUpgrade):iosSignal(\"building\",\"cooldown\",mobileCooldownData({mode:\"building\",symbol:g.symbol,flag:\"production_started\"}));questListings();analytics.track(\"Building Apply-Upgrade\",{building:userContext.activeBuildingPanel,\nupgrade:itemData[itemById[b.id]].symbol,cost:itemData[itemById[b.id]].cost});analytics.wizardtrack(\"Building Apply-Upgrade\",{building:userContext.activeBuildingPanel,upgrade:itemData[itemById[b.id]].symbol,cost:itemData[itemById[b.id]].cost})}})}}";
original.speedBuild =
    "function speedBuild(b,a){$(\"#modal_dialogs_top2\").hide();doLog(\"speedBuild: speed_item=\"+b+\" item_id=\"+a);$.ajax({url:\"/play/build_now/\"+a+\"?complete=\"+b,dataType:\"JSON\",success:function(c){doLog(\"speedBuild: returned, data.building.id=\"+c.building.id);userContext.playerData.user.money=c.user.money;userContext.playerData.stat.onboarding=c.stat.onboarding;userContext.playerData.chapter=c.chapter;var d=buildingById(a,c.building);doLog(\"speedBuild: speed_item:\");doLog(c.speed_item);c.speed_item&&insertInventoryFromItem(userContext.playerData.inventory,\nc.speed_item);insertInventoryFromItem(userContext.playerData.inventory,c.produced_item);logLastItem(\"speedBuild:A\");userContext.buildingsData&&(userContext.playerData.buildings=userContext.buildingsData);playerInventory&&(userContext.playerData.inventory=playerInventory);userContext.chapterData=c.chapter;d&&(analytics.track(\"SpeedUp-Building\",{building:d.symbol,speed_item:b}),analytics.wizardtrack(\"SpeedUp-Building\",{building:d.symbol,speed_item:b}));userContext.buildIndex++;logLastItem(\"speedBuild:B\");\nfinalizeBuildingConstruction(d);isItemBuildingUpgrade(d)||void 0==d.producing_archetype_id&&void 0==d.recipe_symbol?(renderBuildingInventory(userContext.playerData,buildingUpgradePanel,userContext.activeBuildingPanel,!0),isWeb()||iosSignal(\"building\",\"cooldown\",mobileCooldownData({mode:\"building\",symbol:d.symbol,flag:\"speed_up\"}))):(userContext.craftingItemFinished=!0,renderBuildingInventory(userContext.playerData,buildingUpgradePanelProd,userContext.activeBuildingPanel,!0),$(\"#collect_\"+d.symbol).html(renderUpgradeCollect(d)),\n$(\"#build_panel_action_\"+d.id).html(renderBuildPanelAction(d)),$(\"#speed_button_\"+d.id).hide());renderBuildingsOnScreen(userContext.playerData);d&&uiEvent(\"building_panel_\"+d.symbol)}})}";
original.doAdventure =
    "function doAdventure(b,a,c){if(void 0!=userContext.setSwornSword&&void 0!=userContext.setSwornSword.batch_type&&0!=userContext.setSwornSword.batch_type)return 1==userContext.setSwornSword.batch_type&&(!1==c&&prepareAdvPartyTimeout(),$.ajax({url:\"/play/batch_set_sworn_sword_target?batch_type=1&ss_id=\"+userContext.setSwornSword.id+\"&batch_action=\"+a+\"&target_symbol=\"+b,dataType:\"JSON\",success:function(a){questClose();showAdvPartyResponse(a);uiEvent(\"ss_adventure_party\");return!0},error:function(c){400==\nc.status?advPartyFail():409==c.status?setTimeout(function(){doAdventure(b,a,!0)},5E3):spinTimeout()}})),!1;$.ajaxQueue({url:\"/play/adventure/\"+userContext.setSwornSword.id+\"?action_name=\"+a+\"&symbol=\"+b,dataType:\"JSON\",success:function(b){analytics.track(\"Adventure Start\",{adventure_region:b.location,adventure_action:a,adventure_swornsword_id:userContext.setSwornSword.id,adventure_swornsword_level:userContext.setSwornSword.ugprade_level});analytics.wizardtrack(\"Adventure Start\",{adventure_region:b.location,\nadventure_action:a,adventure_swornsword_id:userContext.setSwornSword.id,adventure_swornsword_level:userContext.setSwornSword.ugprade_level});adventureProgress(userContext.setSwornSword.id,b);uiEvent(\"do_adventure\");\"1\"==userContext.playerData.stat.onboarding_ftue&&uiTelemetry(\"ss_adventure\")}})}";
original.playSound =
    "function playSound(a,d){if(!1!=doSound())if($.browser.msie||console.log(\"playSound [1]: \"+a),!1==soundEnabled)$.browser.msie||console.log(\"playSound [1]: sound disabled\");else{void 0==d&&(d=0);musicMuted=userContext.mute_music;soundMuted=userContext.mute_sound;try{if(-1!=a.indexOf(\"voice-\")&&($.browser.msie||console.log(\"play voiceover\"),soundMapChannel[a]=\"voice\"),theUrl=soundMap[a],void 0==soundMapChannel[a]&&(soundMapChannel[a]=\"channel1\"),isWeb()){if($.browser.msie||console.log(\"playSound[2]: \"+\na+\" soundReady=\"+soundReady),!0==soundReady){$.browser.msie||console.log(\"soundReady: \"+soundMapChannel[a]);play_it=!0;if(\"music\"==soundMapChannel[a]){if(0==musicVolume||!0==musicMuted)play_it=!1;vol=musicVolume;$.browser.msie||console.log(\"MUSIC vol=\"+vol)}else{if(0==soundVolume||!0==soundMuted)play_it=!1;vol=soundVolume;$.browser.msie||console.log(\"SOUND vol=\"+vol)}if(\"channel1\"==soundMapChannel[a]||\"channel2\"==soundMapChannel[a]||\"channel3\"==soundMapChannel[a]||\"channel4\"==soundMapChannel[a]||\n\"channel5\"==soundMapChannel[a]||\"music\"==soundMapChannel[a]||\"voice\"==soundMapChannel[a]||\"voice2\"==soundMapChannel[a])if(!0==soundChannel[soundMapChannel[a]])$.browser.msie||console.log(\"Sound channel busy: \"+soundMapChannel[a]+\" playing=\"+soundActive[a]),\"music\"==soundMapChannel[a]&&currentMusic!=a&&(doLog(\"switch to new music\"),soundCrossFade(\"music\",vol,function(){playSound(a,d)}));else if(sound_url=assetUrl()+theUrl,$.browser.msie||console.log(\"SOUND: play_it=\"+play_it),!0!=play_it)$.browser.msie||\nconsole.log(\"SOUND: returning\");else{\"music\"==soundMapChannel[a]&&(doLog(\"currentMusic = \"+currentMusic),currentMusic=a);$.browser.msie||console.log(\"SOUND: createSound\");soundObject=soundManager.createSound({id:soundMapChannel[a],url:theUrl,volume:vol,onfinish:function(){$.browser.msie||console.log(\"soundObject.onfinish: id=\"+a+\" soundMapChannel=\"+soundMapChannel[a]);soundChannel[soundMapChannel[a]]=!1;soundManager.destroySound(soundMapChannel[a]);\"music\"==soundMapChannel[a]&&(0<musicVolume&&!0!=\nuserContext.mute_music)&&playSound(a)}});if(null==soundObject||void 0==soundObject)$.browser.msie||console.log(\"soundObject: invalid\");!0==play_it&&(soundChannel[soundMapChannel[a]]=!0,soundActive[soundMapChannel[a]]=sound_url,soundManager.getSoundById(soundMapChannel[a]).setVolume(vol),0<d?setTimeout(soundObject.play,d):($.browser.msie||console.log(\"soundObject.play: [\"+soundMapChannel[a]+\"] \"+soundActive[soundMapChannel[a]]),soundObject.play()))}else 0<vol&&($.browser.msie||console.log(\"playing [3]: [\"+\nsoundMapChannel[a]+\"] vol=\"+vol),soundManager.getSoundById(soundMapChannel[a]).setVolume(vol),soundManager.getSoundById(soundMapChannel[a]).volume=vol,soundManager.play(a))}}else iosSignal(\"playsound\",soundMapChannel[a]+\":\"+soundMap[a].substring(soundMap[a].lastIndexOf(\"/\")+1)+\":\"+d)}catch(e){$.browser.msie||console.log(\"playSound exception: \"+e)}}}";
original.submitWorldEventAction =
    "function submitWorldEventAction(b,a,c){showSpinner();data={sworn_sword_id:b,order:a};!0==c&&(data.weakness_attack=c);$.ajax({url:\"/play/world_event_attack\",data:data,complete:function(){hideSpinner()},success:function(a){hideSpinner();a.error&&doAlert(\"Error Sending Swornsword\",formatWorldEventError(a.error,a.error_code));a.swornsword&&(insertInventoryFromItem(userContext.playerData.inventory,a.swornsword),doItemCooldown(a.swornsword));a.challenge&&updateWorldEventChallenge(a.challenge);!0==a.show_outmaneuver_alert&&\ndialogAlert({style:\"alert\",text:\"The order you just sent is guaranteed to critically hit and will have a bonus chance to find a weakness.\",heading:\"\",button1:\"Okay\"})}})}";
original.getWorldEventAttackResults =
    "function getWorldEventAttackResults(b,a){showSpinner();$.ajax({url:\"/play/world_event_attack_results\",data:{sworn_sword_id:b},complete:function(){hideSpinner()},success:function(b){hideSpinner();b.error?doAlert(\"Error Getting Results\",formatWorldEventError(b.error,b.error_code)):(b.swornsword&&(insertInventoryFromItem(userContext.playerData.inventory,b.swornsword),doItemCooldown(b.swornsword)),b.character&&(userContext.playerData.stat.level_progress=b.xp_after,userContext.playerData.character=b.character,\ninfoBar(userContext.playerData,userContext.playerData.inventory)),void 0!=b.prestige_awarded&&updatePrestige(void 0,b.prestige_awarded),isWeb()?(b=_.template('<div class=\"modalbg\"></div><div class=\"contentframe1\" style=\"top:44px; z-index:22;\"><div class=\"contentframe2\"><div class=\"contentframe3\"><div class=\"contentframe4\"><span class=\"corner tl\"></span><span class=\"corner tr\"></span><a class=\"closebtn\" onclick=\"closeWorldEventAttackResults();\">close</a>    <h2 class=\"alertheader\"><%= translateString(\\'we_order_completed\\') %></h2>    <div class=\"alertcontents\">    <div class=\"alertbox\">      <div class=\"alertboxinner\">        <div class=\"weinforow\">          <%= itemMiniView(data.swornsword) %>          <% if(data.wounds > 0) { %>            <div class=\"orderwound\">Wounded</div>          <% } %>          <div class=\"bossopttop\">            <div class=\"bossoptbtn\">              <span class=\"btnwrap btnlg\"><span class=\"btnedge\"><a class=\"btnbrown\"> \\x3c!-- Selected button is brown --\\x3e              <span><img src=\"<%= assetUrl() %>/images/content/talent/<%=data.action%>.png\" /></span>              <strong><%= translateString(data.action) %></strong>              <em><%= data.label %></em>            </a></span></span>            <div class=\"challengebar\">              <div class=\"challengeicon\"></div>                <div class=\"challenge-outer challengelose\">                  <div style=\"width:<%= data.cr %>%;\" class=\"challenge-yours\"></div>                  <div style=\"width:<%=100 - data.cr%>%;\" class=\"challenge-target\"></div>                </div>              </div>            </div>          </div>        </div>                <% if(data.outcome > 0) { %>          <h3 class=\"challengerewardhead-success\">Success!</h3>        <% } else { %>          <h3 class=\"challengerewardhead-lose\">Failure!</h3>        <% } %>        <div class=\"weinforow orderresult\">          <p><%= data.damage %> Damage Dealt</p>          <% if (data.prestige_awarded != undefined && data.prestige_awarded > 0) {%>            <span class=\"rewarditem\">              <span class=\"rewardicon\"><img src=\"<%= assetUrl() %>/images/icons/icon-prestige.png?<%= assetVersion %>\" /></span>              +<%= data.prestige_awarded %>             </span>          <% } %>          <% if(data.xp_after > data.xp_before) { %>            <%= xpReward(data.xp_before, data.xp_after) %>          <% } %>        <div class=\"weinforow\">          <div class=\"weinfo\"><%= data.text %></div>        </div>      </div>      </div>    </div>  </div>    <div class=\"alertbtm\">    <% if(data.can_repeat) { %>      <span class=\"btnwrap btnlg\" onclick=\"submitWorldEventAction(<%=data.swornsword.id%>,\\'<%=data.action%>\\');closeWorldEventAttackResults();\"><span class=\"btnedge\"><a class=\"btngold\">Repeat</a></span></span>    <% } %>    <span class=\"btnwrap btnlg\" onclick=\"closeWorldEventAttackResults();\"><span class=\"btnedge\"><a class=\"btngold\">Close</a></span></span>  </div></div></div></div></div>',\n{data:b}),$(\".weordercomplete\").html(b).show()):iosSignal(\"we\",\"viewSSResult\",b),a&&refreshWorldEventChallenge())}})}";
original.charCharacterTab =
    "function charCharacterTab(){$(\".lineage\").hide();playerData=userContext.focusData;markup=\"\";markup+='\\t\\t\\t\\t<div class=\"stoneridge\" id=\"charactertop\">';markup+='\\t\\t\\t\\t\\t<div class=\"left35\">';markup+='\\t\\t\\t\\t\\t\\t<div class=\"charframe\">';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"portraitimage\"><img src=\"'+playerData.portrait_pic+'\" /></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div id=\"character_sheet_portrait\" class=\"charframe-lg\"></div>';0<playerData.id&&playerData.id==userContext.playerData.character.id&&(markup+=\n'\\t\\t\\t\\t\\t\\t\\t<a class=\"lineagebtn\" onclick=\"lineageIncarnationsPage();\"></a>');markup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t\\t<div class=\"charnameoverlay\">';if(userContext.focusData.user_id==userContext.playerData.character.user_id){var b=playerData.title+\" \";if(\"male\"==userContext.playerData.strings.gender){if(1<userContext.playerData.strings.eligible_titles_male.length){b=\"\";markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"selectwrap\">';markup+=\"\\t\\t\\t\\t\\t\\t\\t\\t<select id=\\\"selecttitle\\\" onchange=\\\"$('#portrait_name > em').html($('#selecttitle').val());return setTitle('selecttitle',characterModal);\\\">\";\nfor(var a=0;a<userContext.playerData.strings.eligible_titles_male.length;a++)selected=\"\",playerData.title==userContext.playerData.strings.eligible_titles_male[a].title&&(selected=\"selected\"),markup+=\"<option \"+selected+\">\"+userContext.playerData.strings.eligible_titles_male[a].title+\"</option>\";markup+=\"\\t\\t\\t\\t\\t\\t\\t\\t</select>\";markup+=\"\\t\\t\\t\\t\\t\\t\\t</div>\"}}else if(\"female\"==userContext.playerData.strings.gender&&1<userContext.playerData.strings.eligible_titles_female.length){markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"selectwrap\">';\nmarkup+=\"\\t\\t\\t\\t\\t\\t\\t\\t<select id=\\\"selecttitle\\\" onchange=\\\"$('#portrait_name > em').html($('#selecttitle').val());return setTitle('selecttitle',characterModal);\\\">\";b=\"\";for(a=0;a<userContext.playerData.strings.eligible_titles_female.length;a++)selected=\"\",playerData.title==userContext.playerData.strings.eligible_titles_female[a].title&&(selected=\"selected\"),markup+=\"<option \"+selected+\">\"+userContext.playerData.strings.eligible_titles_female[a].title+\"</option>\";markup+=\"\\t\\t\\t\\t\\t\\t\\t\\t</select>\";\nmarkup+=\"\\t\\t\\t\\t\\t\\t\\t</div>\"}markup+=\"\\t\\t\\t\\t\\t\\t\\t<h3><em>\"+b+\"</em>\"+playerData.name+\"</h3>\";markup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+=\"\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t<div class=\"center30\">';markup+='\\t\\t\\t\\t\\t\\t<div class=\"holdingsname\">';playerData.holdings&&(markup+=\"\\t\\t\\t\\t\\t\\t\\t<h3>Holdings:</h3>\",markup+='\\t\\t\\t\\t\\t\\t\\t<input id=\"holdings_name\" type=\"text\" value=\"'+playerData.holdings+'\" onchange=\"renameHoldings();\"/>')}else markup+='                         <span class=\"btnwrap btnmed\" id=\"ptpbtn\" style=\"position: absolute; top: -200px; width: 200px; left: -10px\"><span class=\"btnedge\"><a class=\"btnbrown\" onclick=\"return pvpStartWithTarget('+\nplayerData.id+');\"><span></span>Player to Player</a></span></span>',markup+='                         <span class=\"btnwrap btnmed frnd-none\" id=\"friendbtn\" style=\"display:none;\"><span class=\"btnedge\"><a class=\"btnbrown\" onclick=\"$(\\'.frnd-none\\').fadeOut(\\'slow\\',function(){ $(\\'.frnd-pending\\').show(); });friendSendRequest('+playerData.user_id+');\"><span></span>Add</a></span></span>',markup+='                         <span class=\"btnwrap btnmed frnd-friends\" id=\"friendbtn\" style=\"display:none;\"><span class=\"btnedge\"><a class=\"btnbrown\" onclick=\"$(\\'.frnd-friends\\').fadeOut(\\'slow\\',function(){ $(\\'.frnd-none\\').show(); });friendRemove('+\nplayerData.user_id+');\"><span></span>Remove</a></span></span>',markup+='                         <span class=\"btnwrap btnmed frnd-pending\" id=\"friendbtn\" style=\"display:none;\"><span class=\"btnedge\"><a class=\"btnbrown\"><span></span>Pending</a></span></span>',b=playerData.title_and_name,b=b.replace(playerData.title,\"<em>\"+playerData.title+\"</em>\"),b=b.replace(playerData.name,\"<h3>\"+playerData.name+\"</h3>\"),markup+=b,markup+=\"\\t\\t\\t\\t\\t\\t</div>\",markup+=\"\\t\\t\\t\\t\\t</div>\",markup+='\\t\\t\\t\\t\\t<div class=\"center30\">',\nmarkup+='\\t\\t\\t\\t\\t\\t<div class=\"holdingsname\">',markup+=\"\\t\\t\\t\\t\\t\\t\\t<h3>Holdings:</h3>\",markup+=\"\\t\\t\\t\\t\\t\\t\\t<h2>\"+playerData.holdings+\"</h2>\";markup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t\\t<div class=\"reviewfealty\">\\t';void 0!=playerData.fealty&&(markup+='                         <div class=\"reviewcircle\">',markup+='                             <a class=\"icon-book\" onclick=\"lorePage(\\'house_'+playerData.fealty.toLowerCase()+\"')\\\"></a>\",markup+='                             <img style=\"margin: 7px\" img src=\"'+\nassetUrl()+\"/images/banner-\"+playerData.fealty.toLowerCase()+'-lg.png?t=2106882ad94f\"></img>',markup+=\"                         </div>\");markup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t    <div class=\"reviewbackground\">\\t';void 0!=playerData.background_option&&(markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"reviewcircle '+playerData.background_option+'\">',markup+='\\t\\t\\t\\t\\t\\t\\t\\t<a class=\"icon-book\" onclick=\"lorePage(\\'background-'+playerData.background_option+\"');\\\"></a>\",markup+=\"\\t\\t\\t\\t\\t\\t\\t</div>\");markup+=\n\"\\t\\t\\t\\t\\t\\t</div>\";userContext.focusData.user_id!=userContext.playerData.character.user_id&&(markup+='\\t\\t\\t\\t\\t\\t<div class=\"charequipment\">',markup+=\"\\t\\t\\t\\t\\t\\t\\t<h3>Equipment</h3>\",markup=null==playerData.weapon?markup+'\\t\\t\\t\\t\\t\\t<div class=\"iconview iconview-weapon\" ></div>':markup+itemIconView(playerData.weapon,\"inventoryDisplayStatsWithTab\",\"iconview-weapon\"),markup=null==playerData.armor?markup+'                     <div class=\"iconview iconview-armor\" ></div>':markup+itemIconView(playerData.armor,\n\"inventoryDisplayStatsWithTab\",\"iconview-armor\"),markup=null==playerData.companion?markup+'                     <div class=\"iconview iconview-companion\" ></div>':markup+itemIconView(playerData.companion,\"inventoryDisplayStatsWithTab\",\"iconview-companion\"),markup+=\"\\t\\t\\t\\t\\t\\t</div>\",markup+='<span class=\"btnwrap btnlg\" style=\"position: relative; left: -285px; margin-top: 230px; z-index: 1\" onclick=\"return contactPlayer('+playerData.id+\",'\"+escape(playerData.name)+'\\')\"><span class=\"btnedge\"><a class=\"btngold\"><span></span>Send a Raven</a></span></span>');\nplayerData.alliance_name&&(markup+='\\t\\t\\t\\t\\t\\t\\t<div style=\"position:relative; top:-30px; z-index: 1\"><h3>Alliance:</h3>',markup+='\\t\\t\\t\\t\\t\\t\\t<a href=\"#\" onclick=\"return allianceInfo('+playerData.alliance_id+')\">'+playerData.alliance_name+\"</a></div>\");markup+=\"\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t<div class=\"right35\">';markup+='\\t\\t\\t\\t\\t\\t<div class=\"charframe\">';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"portraitimage\"></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"charframe-lg\"></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"charbanner-lg\" style=\"margin-left: -7px;\"><img src=\"'+\nplayerData.banner+'\" /></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"bannerpole-lg\"></div>';userContext.focusData.user_id==userContext.playerData.character.user_id&&(markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"editbanneroverlay\">',markup+='\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"btnwrap btnmed\" id=\"editbtn\"><span class=\"btnedge\"><a class=\"btnbrown\" onclick=\"return bannerDesigner();\"><span></span>Edit</a></span></span>',markup+=\"\\t\\t\\t\\t\\t\\t\\t</div>\");markup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+=\"\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t<div class=\"stoneridgebtm\"></div>';\nmarkup+=\"\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t<div class=\"chargenbox\" id=\"alignment\">';markup+='\\t\\t\\t\\t\\t<div class=\"marbletop oldways realm crafty\">';markup+=\"\\t\\t\\t\\t\\t\\t<h3>Alignment</h3>\";markup+='\\t\\t\\t\\t\\t\\t<div class=\"alignmenttabs\">';markup+=\"\\t\\t\\t\\t\\t\\t\\t<a id=\\\"alignmenttab-tradition\\\" class=\\\"active\\\" onclick=\\\"$(this).siblings().removeClass('active');$(this).addClass('active');$('.alignmentbar').hide();$('#alignmentbar-tradition').show();\\\" onmouseover=\\\"return doTip('tip_alignment_tradition',function(){return renderAlignmentTip('tradition')});\\\" onmouseout=\\\"return noTip('tip_alignment_tradition');\\\"><span></span><em></em></a>\";\nmarkup+=\"\\t\\t\\t\\t\\t\\t\\t<a id=\\\"alignmenttab-duty\\\" onclick=\\\"$(this).siblings().removeClass('active');$(this).addClass('active');$('.alignmentbar').hide();$('#alignmentbar-duty').show();\\\" onmouseover=\\\"return doTip('tip_alignment_duty',function(){return renderAlignmentTip('duty')});\\\" onmouseout=\\\"return noTip('tip_alignment_duty');\\\"><span></span><em></em></a>\";markup+=\"\\t\\t\\t\\t\\t\\t\\t<a id=\\\"alignmenttab-integrity\\\" onclick=\\\"$(this).siblings().removeClass('active');$(this).addClass('active');$('.alignmentbar').hide();$('#alignmentbar-integrity').show();\\\" onmouseover=\\\"return doTip('tip_alignment_integrity',function(){return renderAlignmentTip('integrity')});\\\" onmouseout=\\\"return noTip('tip_alignment_integrity');\\\"><span></span><em></em></a>\";\nmarkup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t\\t<div id=\"alignmentbar-tradition\" class=\"alignmentbar\">';markup+=\"\\t\\t\\t\\t\\t\\t\\t<div class=\\\"alignmenticon-left\\\" onmouseover=\\\"return doTip('tip_alignment_old_ways',function(){return renderAlignmentTip('old_ways')});\\\" onmouseout=\\\"return noTip('tip_alignment_old_ways');\\\"></div>\";markup+=\"\\t\\t\\t\\t\\t\\t\\t<div class=\\\"alignmenticon-right\\\" onmouseover=\\\"return doTip('tip_alignment_new_ways',function(){return renderAlignmentTip('new_ways')});\\\" onmouseout=\\\"return noTip('tip_alignment_new_ways');\\\"></div>\";\nmarkup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"aligncenter\"></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"alignbar-left\" style=\"width:30%;\"><span></span></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"alignbar-right\" style=\"width:5%;\"><span></span></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<p class=\"aligntext-left\">Old Ways</p>';markup+='\\t\\t\\t\\t\\t\\t\\t<p class=\"aligntext-right\">New Ways</p>';markup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t\\t<div id=\"alignmentbar-duty\" class=\"alignmentbar\" style=\"display:none;\">';markup+=\"\\t\\t\\t\\t\\t\\t\\t<div class=\\\"alignmenticon-left\\\" onmouseover=\\\"return doTip('tip_alignment_family',function(){return renderAlignmentTip('family')});\\\" onmouseout=\\\"return noTip('tip_alignment_family');\\\"></div>\";\nmarkup+=\"\\t\\t\\t\\t\\t\\t\\t<div class=\\\"alignmenticon-right\\\" onmouseover=\\\"return doTip('tip_alignment_realm',function(){return renderAlignmentTip('realm')});\\\" onmouseout=\\\"return noTip('tip_alignment_realm');\\\"></div>\";markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"aligncenter\"></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"alignbar-left\" style=\"width:45%\"><span></span></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"alignbar-right\" style=\"width:15%\"><span></span></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<p class=\"aligntext-left\">Family</p>';\nmarkup+='\\t\\t\\t\\t\\t\\t\\t<p class=\"aligntext-right\">Realm</p>';markup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t\\t\\t<div id=\"alignmentbar-integrity\" class=\"alignmentbar\" style=\"display:none;\">';markup+=\"\\t\\t\\t\\t\\t\\t\\t<div class=\\\"alignmenticon-left\\\" onmouseover=\\\"return doTip('tip_alignment_cunning',function(){return renderAlignmentTip('cunning')});\\\" onmouseout=\\\"return noTip('tip_alignment_cunning');\\\"></div>\";markup+=\"\\t\\t\\t\\t\\t\\t\\t<div class=\\\"alignmenticon-right\\\" onmouseover=\\\"return doTip('tip_alignment_truthful',function(){return renderAlignmentTip('truthful')});\\\" onmouseout=\\\"return noTip('tip_alignment_truthful');\\\"></div>\";\nmarkup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"aligncenter\"></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"alignbar-left\" style=\"width:25%\"><span></span></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<div class=\"alignbar-right\" style=\"width:40%\"><span></span></div>';markup+='\\t\\t\\t\\t\\t\\t\\t<p class=\"aligntext-left\">Cunning</p>';markup+='\\t\\t\\t\\t\\t\\t\\t<p class=\"aligntext-right\">Truthful</p>';markup+=\"\\t\\t\\t\\t\\t\\t</div>\";markup+=\"\\t\\t\\t\\t\\t</div>\";markup+=\"\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t<div id=\"alignment_tips\">';for(x=0;x<alignmentData.length;x++)markup+=\n'<div id=\"tip_alignment_'+alignmentData[x].symbol+'\" style=\"top: -240px; left: -130px; position: relative\"></div>';markup+=\"             </div>\";markup+='\\t\\t\\t\\t<div class=\"chargenbox\" id=\"activity\">';markup+='\\t\\t\\t\\t\\t<div class=\"marbletop\">';markup+=\"\\t\\t\\t\\t\\t\\t<h3>Recent Activity</h3>\";if(void 0==playerData.recent_activity)markup+=\"         <p>No recent activity to display.</p>\";else if(0==playerData.recent_activity.length)markup+=\"         <p>No recent activity to display.</p>\";else{for(a=\n0;a<playerData.recent_activity.length&&3>a;a++)markup+='\\t\\t\\t\\t\\t\\t<p class=\"icon-'+playerData.recent_activity[a].type+'\"><span style=\"width:27px;height:25px;\"></span>'+playerData.recent_activity[a].text+\"</p>\";3<playerData.recent_activity.length&&(markup+='\\t\\t\\t\\t\\t\\t<span class=\"btnwrap btnmed\" id=\"morebtn\"><span class=\"btnedge\"><a class=\"btnbrown\" onclick=\"lineageMainModal(\\'activities\\');\"><span></span>More</a></span></span>')}markup+=\"\\t\\t\\t\\t\\t</div>\";markup+=\"\\t\\t\\t\\t</div>\";markup+='\\t\\t\\t\\t<div id=\"charbtmbar\">';\nmarkup+='\\t\\t\\t\\t\\t<div class=\"househr\"></div>';markup+=\"\\t\\t\\t\\t</div>\";$(\"#chargenmain\").removeClass(\"stats\");$(\"#chargenmain\").html(markup);userContext.focusData.user_id!=userContext.playerData.character.user_id&&$(\".frnd-\"+userContext.focusData.friend_status).show();alignments=[\"tradition\",\"integrity\",\"duty\"];tips_markup=\"\";for(a=0;a<alignments.length;a++)alignment=-1*playerData[\"got_\"+alignments[a]],0<alignment?($(\"#alignmentbar-\"+alignments[a]+\" > .alignbar-left\").css(\"width\",alignment/100/\n2+\"%\").show(),$(\"#alignmentbar-\"+alignments[a]+\" > .aligntext-left\").css(\"color\",\"white\"),$(\"#alignmentbar-\"+alignments[a]+\" > .aligntext-right\").css(\"color\",\"#666\"),$(\"#alignmentbar-\"+alignments[a]+\" > .alignbar-right\").hide()):0>alignment?($(\"#alignmentbar-\"+alignments[a]+\" > .alignbar-right\").css(\"width\",alignment/-100/2+\"%\").show(),$(\"#alignmentbar-\"+alignments[a]+\" > .aligntext-right\").css(\"color\",\"white\"),$(\"#alignmentbar-\"+alignments[a]+\" > .aligntext-left\").css(\"color\",\"#666\"),$(\"#alignmentbar-\"+\nalignments[a]+\" > .alignbar-left\").hide()):($(\"#alignmentbar-\"+alignments[a]+\" > .aligntext-left\").css(\"color\",\"white\"),$(\"#alignmentbar-\"+alignments[a]+\" > .aligntext-right\").css(\"color\",\"white\"),$(\"#alignmentbar-\"+alignments[a]+\" > .alignbar-left\").hide(),$(\"#alignmentbar-\"+alignments[a]+\" > .alignbar-right\").hide());uiEvent(\"character\");userContext.focusData.user_id==userContext.playerData.character.user_id&&uiEvent(\"character_self\")}";
original.inventoryDisplayStatsWithTab =
    "function inventoryDisplayStatsWithTab(b){b=extractItemById(playerInventory,b);\"unit\"==b.slot?inventorySubTab(\"companion\"):inventorySubTab(b.slot);inventoryDisplayStats(void 0,void 0,b,void 0,!0)}";
original.inventoryTab =
    "function inventoryTab(b){$(\"#statview_container_right\").html(\"\");$(\"#statview_container\").html(\"\");$(\".characterview\").hide();$(\".\"+b+\"view\").show();$(\"#swornswordstab_inner\").removeClass(\"active\");$(\"#foodtab_inner\").removeClass(\"active\");$(\"#charactertab_inner\").removeClass(\"active\");$(\"#boonstab_inner\").removeClass(\"active\");$(\"#resourcestab_inner\").removeClass(\"active\");$(\"#sealtab_inner\").removeClass(\"active\");$(\"#gearinvtab_inner\").removeClass(\"active\");$(\"#companionsinvtab_inner\").removeClass(\"active\");\n$(\"#inventorybtm\").removeClass(\"character\");$(\"#weapontab\").hide();$(\"#armortab\").hide();$(\"#companiontab\").hide();$(\"#swordcompaniontab\").hide();$(\"#inventory-listing\").hide();var a=[],c=void 0;\"character\"==b?($(\"#inventorybtm\").addClass(\"character\"),$(\"#weapontab\").show(),$(\"#armortab\").show(),$(\"#companiontab\").show(),equipContextPrefix=equipContextTarget=\"character\",equipContextPosition=\"right\",$(\"#inventory_toolbar_Weapon\").show()):\"swornswords\"==b?($(\"#inventorybtm\").addClass(\"character\"),first_sworn=\nextractFirstSwornSword(playerInventory),inventoryDisplayStatsRight(void 0,void 0,first_sworn),$(\"#weapontab\").show(),$(\"#armortab\").show(),$(\"#swordcompaniontab\").show(),equipContextPrefix=\"item\",$(\"#inventory_toolbar\").show(),c=\"Sworn Sword\",a.push(c)):\"boons\"==b?(first_boon=extractFirstBoon(playerInventory),inventoryDisplayStatsRight(void 0,void 0,first_boon),$(\"#inventory_toolbar\").hide(),c=\"Boon\",a.push(c)):\"food\"==b?(first_consumable=extractFirstConsumable(playerInventory),inventoryDisplayStatsRight(void 0,\nvoid 0,first_consumable),$(\"#inventory_toolbar\").hide(),c=\"Consumable\",a.push(c)):\"seal\"==b?(first_seal=extractFirstSeal(playerInventory),inventoryDisplayStatsRight(void 0,void 0,first_seal),$(\"#inventory_toolbar\").hide(),c=\"Seal\",a.push(c)):\"resources\"==b?(first_resource=extractFirstTreasure(playerInventory),inventoryDisplayStatsRight(void 0,void 0,first_resource),$(\"#inventory_toolbar\").hide(),c=\"Treasure\",a.push(c)):\"gearinv\"==b?(first_gearinv=extractFirstGear(playerInventory),inventoryDisplayStatsRight(void 0,\nvoid 0,first_gearinv),$(\"#inventory_toolbar\").hide(),c=\"Weapon, Armor\",a.push(\"Weapon\"),a.push(\"Armor\")):\"companionsinv\"==b&&(first_companionsinv=extractFirstCompanion(playerInventory),inventoryDisplayStatsRight(void 0,void 0,first_companionsinv),$(\"#inventory_toolbar\").hide(),c=\"Companion, Unit\",a.push(\"Companion\"),a.push(\"Unit\"));doLog(\"inventoryTab: category=\"+b+\" listing_slot=\"+c);if(void 0!=c){initPagination(b,6);for(var d=!1,g=[],k=\"\",f=0;f<playerInventory.length;f++)for(var p=0;p<a.length;p++)playerInventory[f].slot==\na[p]&&g.push(playerInventory[f]);0==g.length&&(d=!0);k+=\"<div id='mv_container'></div>\";\"character\"==b?$(\"#inventory-listing\").html(k).hide():!0==d?\"swornswords\"==b?$(\"#inventory-listing\").html('You have no sworn swords. Visit the <a class=\"shop_link\" href=\"#\" onclick=\"return shopModal();\">shop</a> to hire one.').show():\"food\"==b?$(\"#inventory-listing\").html('You have no Food. Visit the <a class=\"shop_link\" href=\"#\" onclick=\"return shopModal();\">shop</a> to purchase some.').show():\"boons\"==b?$(\"#inventory-listing\").html('You have no Boons. Visit the <a class=\"shop_link\" href=\"#\" onclick=\"return shopModal();\">shop</a> to purchase one.').show():\n\"seal\"==b?$(\"#inventory-listing\").html(\"You have no Seals. Earn seals from PtP.\").show():\"gearinv\"==b?$(\"#inventory-listing\").html('You have no Gear. Visit the <a class=\"shop_link\" href=\"#\" onclick=\"return shopModal();\">shop</a> to purchase some.').show():\"companionsinv\"==b&&$(\"#inventory-listing\").html('You have no Companions. Visit the <a class=\"shop_link\" href=\"#\" onclick=\"return shopModal();\">shop</a> to purchase some.').show():$(\"#inventory-listing\").html(k).show();d||($.each(g,function(a,c){addPageItem(b);\nitemMiniView(c,{callback:inventoryDisplayStatsRight,extra_styles:pageStyle(b),extra_class:pageClass(b)},\"#mv_container\")}),$(\"#mv_container\").append(bookPageNumbers(b)))}$(\"#\"+b+\"tab_inner\").addClass(\"active\");void 0!=c&&pageBegin(b)}";
original.inventoryModal =
    "function inventoryModal(b,a){closeUpgradePanel();uiTelemetry(\"inventory\");void 0==b?(b={},b.storage=a,b.content_loading=!0,showSpinner(),$.ajaxq(\"gotAjaxQueue\",{url:\"/play/player_data?client_seqnum=\"+userContext.player_data_seqnum,dataType:\"JSON\",success:function(c){inventoryModal(c,a)}})):(b.content_loading=!1,hideSpinner(),setupPlayerData(b,void 0),inventoryTab(\"character\"));b.storage=a;b.allowseals=!0;var c=_.template('<div id=\"modalwrap\" class=\"modal690\" style=\"display:block\"><div class=\"contentframe1\" id=\"content_character_view-inventory\">\\t<div class=\"contentframe2\">\\t\\t<div class=\"contentframe3\">\\t\\t\\t<div class=\"contentframe4\">\\t\\t\\t<div class=\"stonecurve\" id=\"stonecurve-l\">\\t\\t\\t\\t<span></span>\\t\\t\\t</div>\\t\\t\\t<div class=\"stonecurve\" id=\"stonecurve-r\">\\t\\t\\t\\t<span></span>\\t\\t\\t</div>\\t\\t\\t<div class=\"infobar\">\\t\\t\\t\\t<div class=\"infobarpattern\"></div>\\t\\t\\t<%\\t\\t\\tif(data.storage)\\t\\t\\t%>\\t\\t\\t\\t<h2><%= translateString(\\'ui_storage\\')  %></h2>\\t\\t\\t<%\\t\\t\\telse\\t\\t\\t{\\t\\t\\t%>\\t\\t\\t\\t<h2><%= translateString(\\'your_character\\') %></h2>\\t\\t\\t<%\\t\\t\\t}\\t\\t\\t%>\\t\\t\\t\\t<span class=\"barbtmedge\"></span>\\t\\t\\t\\t<span class=\"corner tl\"></span>\\t\\t\\t\\t<span class=\"corner tr\"></span>\\t\\t\\t\\t<a class=\"closebtn\" onclick=\"return clickCloseInventory();\">\\t\\t\\t\\t\\t<%= translateString(\\'close\\')  %>\\t\\t\\t\\t</a>\\t\\t\\t</div>\\t\\t\\t<%\\t\\t\\tif(!data.content_loading)\\t\\t\\t{\\t\\t\\t%>\\t\\t\\t\\t<div class=\"tabbedheading\">\\t\\t\\t\\t\\t<div class=\"inventorytabs\">\\t\\t\\t\\t\\t\\t<%\\t\\t\\t\\t\\t\\tif(data.storage)\\t\\t\\t\\t\\t\\t{\\t\\t\\t\\t\\t\\t%>\\t\\t\\t\\t\\t\\t\\t<span class=\"inventorytabwrap\" id=\"resourcetab\"><span class=\"inventorytabedge\"\"><a id=\"resourcestab_inner\" class=\"inventorytab\" onclick=\"clickInventoryTab(\\'resources\\');\"><span></span><%= translateString(\\'resource_tab_label\\') %><em></em></a></span></span>\\t\\t\\t\\t\\t\\t\\t<span class=\"inventorytabwrap\" id=\"boonstab\" onclick=\"return clickInventoryTab(\\'boons\\');\"><span class=\"inventorytabedge\"><a class=\"inventorytab\" id=\"boonstab_inner\"><span></span><%= translateString(\\'ui_ss_boons\\')  %><em></em></a></span></span>\\t\\t\\t\\t\\t\\t\\t<span class=\"inventorytabwrap\" id=\"foodtab\" onclick=\"return clickInventoryTab(\\'food\\');\"><span class=\"inventorytabedge\"><a class=\"inventorytab\" id=\"foodtab_inner\"><span></span><%= translateString(\\'ui_char_food\\')  %><em></em></a></span></span>              <%              if(data.allowseals)              {              %>                <span class=\"inventorytabwrap\" id=\"sealtab\" onclick=\"return clickInventoryTab(\\'seal\\');\"><span class=\"inventorytabedge\"><a class=\"inventorytab\" id=\"sealtab_inner\"><span></span><%= translateString(\\'ui_char_seal\\')  %><em></em></a></span></span>                <span class=\"inventorytabwrap\" id=\"gearinvtab\" onclick=\"return clickInventoryTab(\\'gearinv\\');\"><span class=\"inventorytabedge\"><a class=\"inventorytab\" id=\"gearinvtab_inner\"><span></span><%= translateString(\\'ui_char_gear\\')  %><em></em></a></span></span>                <span class=\"inventorytabwrap\" id=\"companionsinvtab\" onclick=\"return clickInventoryTab(\\'companionsinv\\');\"><span class=\"inventorytabedge\"><a class=\"inventorytab\" id=\"companionsinvtab_inner\"><span></span><%= translateString(\\'ui_char_companions\\')  %><em></em></a></span></span>              <%              }              %>\\t\\t\\t\\t\\t\\t<%\\t\\t\\t\\t\\t\\t}\\t\\t\\t\\t\\t\\telse\\t\\t\\t\\t\\t\\t{\\t\\t\\t\\t\\t\\t%>\\t\\t\\t\\t\\t\\t\\t<span class=\"inventorytabwrap\" id=\"armortab\" style=\"right: 0px\" onclick=\"return clickInventoryTab(\\'character\\');\"><span class=\"inventorytabedge\"><a class=\"inventorytab active\" id=\"charactertab_inner\"><span></span><%= translateString(\\'equipment\\')  %><em></em></a></span></span>\\t\\t\\t\\t\\t\\t\\t<span class=\"inventorytabwrap\" id=\"charactertab\" onclick=\"return characterModal(undefined, characterMainModal, true);\"><span class=\"inventorytabedge\"><a id=\"charactertab_inner\" class=\"inventorytab\"><span></span><%= translateString(\\'mainmenu_character\\')  %><em></em></a></span></span>\\t\\t\\t\\t\\t\\t\\t<span class=\"inventorytabwrap\" id=\"pactstab\"><span class=\"inventorytabedge\"><a class=\"inventorytab\"  id=\"pactstab_inner\" onclick=\"return characterModal(undefined, pactsModal, true);\"><span></span><%= translateString(\\'pacts_and_influence\\') %><em></em></a></span></span>\\t\\t\\t\\t\\t\\t\\t<span class=\"inventorytabwrap\" id=\"statstab\"><span class=\"inventorytabedge\"><a class=\"inventorytab\"  id=\"statstab_inner\" onclick=\"return characterModal(undefined, statsModal, true);\"><span></span><%= translateString(\\'stats\\') %><em></em></a></span></span>\\t\\t\\t\\t\\t\\t\\t<span class=\"inventorytabwrap\" id=\"achievementstab\"><span class=\"inventorytabedge\"><a class=\"inventorytab\" id=\"achievementstab_inner\" onmouseover=\"return setTooltip(\\'achievementstab_inner\\',\\'achievements\\');\" onclick=\"return characterModal(undefined, achievementsModal, true);\"><span></span><%= translateString(\\'achievements\\') %><em></em></a></span></span>\\t\\t\\t\\t\\t\\t<%\\t\\t\\t\\t\\t\\t}\\t\\t\\t\\t\\t\\t%>\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t</div>\\t\\t\\t\\t<div class=\"inventorycontent\">\\t\\t\\t\\t\\t<div id=\"statview_container_right\"></div>\\t\\t\\t\\t\\t\\t<div class=\"darkroundedbox miniviewmenu-inventory\" id=\"inventory-listing\" style=\"display:none\">\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t\\t\\t<div class=\"characterview\">\\t\\t\\t\\t\\t\\t\\t<div class=\"characterviewname\"><h3><%= data.strings.title_and_name%></div>\\t\\t\\t\\t\\t\\t\\t<div class=\"characterviewimg\">\\t\\t\\t\\t\\t\\t\\t\\t<img src=\"<%= userContext.playerData.strings.portrait_pic %>\" width=\"170\">\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"characterviewframe\"></span>\\t\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t\\t\\t\\t<div class=\"characterviewstats\">\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"battlebonus\"><span></span><var id=\"char_battlebonus\" class=\"battle_val\"><%= userContext.playerData.character.got_battle %></var></span>\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"tradebonus\"><span></span><var id=\"char_tradebonus\" class=\"trade_val\"><%= userContext.playerData.character.got_trade %></var></span>\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"intriguebonus\"><span></span><var id=\"char_intriguebonus\" class=\"intrigue_val\"><%= userContext.playerData.character.got_intrigue %></var></span>\\t\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t\\t\\t\\t<div class=\"characterviewinfo\">\\t\\t\\t\\t\\t\\t\\t\\t<span id=\"chartalentbtn\" class=\"btnwrap btnxxl\" onclick=\"talentsModal();\">\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"btnedge\">\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<a class=\"btngold\">\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span></span><%= translateString(\\'talents\\')  %>\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<%\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tif(data.character.talents_earned>0)\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t{\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t%>\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<strong><%= data.character.talents_earned%><%= translateString(\\'ui_char_point\\')  %><%if(data.character.talents_earned > 1){%>s<%}%>\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</strong>\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<%\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t}\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t%>\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</a>\\t\\t\\t\\t\\t\\t\\t\\t\\t</span>\\t\\t\\t\\t\\t\\t\\t\\t</span>\\t\\t\\t\\t\\t\\t\\t\\t<span id=\"charstoragebtn\" class=\"btnwrap btnxxl\" onclick=\"inventoryModal(undefined,true);\">\\t\\t\\t\\t\\t\\t\\t\\t\\t<span class=\"btnedge\">\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<a class=\"btngold\">\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t<span></span><%= translateString(\\'ui_storage\\')  %>\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t</a>\\t\\t\\t\\t\\t\\t\\t\\t\\t</span>\\t\\t\\t\\t\\t\\t\\t\\t</span>\\t\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t\\t\\t\\t<div class=\"charseals\">\\t\\t\\t\\t\\t\\t\\t\\t<%= characterSealMarkup() %>\\t\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t\\t\\t\\t<div class=\"characterequipmentinfo\">\\t\\t\\t\\t\\t\\t\\t\\t<%= characterEquipmentMarkup() %>\\t\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t\\t\\t\\t\\t<div class=\"characterviewbtm\">\\t\\t\\t\\t\\t\\t\\t\\t<% if(hand_slot == null) %>\\t\\t\\t\\t\\t\\t\\t\\t\\t<div id=\"character_weapon_container\" onclick=\"return modalContextEquip(\\'character\\',\\'Weapon\\')\"><div class=\"iconview iconview-weapon\"></div></div>\\t\\t\\t\\t\\t\\t\\t\\t<% else %>\\t\\t\\t\\t\\t\\t\\t\\t\\t<div id=\"character_weapon_container\" onclick=\"return modalContextEquip(\\'character\\',\\'Weapon\\')\"><%= itemIconView(hand_slot, \"inventoryDisplayStatsWithTab\", \\'iconview-weapon\\') %></div>\\t\\t\\t\\t\\t\\t\\t\\t<% if(armor_slot == null) %>\\t\\t\\t\\t\\t\\t\\t\\t\\t<div id=\"character_armor_container\" onclick=\"return modalContextEquip(\\'character\\',\\'Armor\\')\"><div class=\"iconview iconview-armor\"></div></div>\\t\\t\\t\\t\\t\\t\\t\\t<% else %>\\t\\t\\t\\t\\t\\t\\t\\t\\t<div id=\"character_armor_container\" onclick=\"return modalContextEquip(\\'character\\',\\'Armor\\')\"><%= itemIconView(armor_slot, \"inventoryDisplayStatsWithTab\", \\'iconview-armor\\') %></div>\\t\\t\\t\\t\\t\\t\\t\\t<% if(companion_slot == null) %>\\t\\t\\t\\t\\t\\t\\t\\t\\t<div id=\"character_companion_container\" onclick=\"return modalContextEquip(\\'character\\',\\'Companion\\')\"><div class=\"iconview iconview-companion\"></div></div>\\t\\t\\t\\t\\t\\t\\t\\t<% else %>\\t\\t\\t\\t\\t\\t\\t\\t\\t<div id=\"character_companion_container\" onclick=\"return modalContextEquip(\\'character\\',\\'Companion\\')\"><%= itemIconView(companion_slot, \"inventoryDisplayStatsWithTab\", \\'iconview-companion\\') %></div>\\t\\t\\t\\t\\t\\t\\t</div>\\t\\t\\t<% \\t\\t\\t/* end of if(!data.content_loading) */\\t\\t\\t}\\t\\t\\t%>\\t\\t\\t\\t</div>\\t\\t\\t</div>\\t\\t</div>\\t<div class=\"contentbtm\"></div></div></div>',\n{data:b});displayModalDialog(c,\"character_dialog\");uiEvent(\"character_dialog_open\");!b.content_loading&&a&&($(\"#inventorybtm\").hide(),clickInventoryTab(\"resources\"))}";
original.shopModal =
    "function shopModal(b,a){userContext.playerData.user.new_items=0;updateAllStatus();doToolbar(\"shop\");closeAlert();closeUpgradePanel();clearModalDialogs(\"modal_dialogs_top\");doLog(\"shopModal\");uiTelemetry(\"shop\");void 0==a&&(a=\"dealstab\");if(void 0==b){var c;c=\"\"+(shopModalHead()+shopModalFoot());isWeb()&&displayModalDialog(c,void 0,void 0,\"min-height: 692px; top: 0px; margin-top: 40px\");showSpinner();$.ajaxQueue({url:\"/play/shop/\",dataType:\"JSON\",complete:hideSpinner,success:function(c){shopModal(c,\na)}})}else hideSpinner(),updateSilver(b.money),updateGold(b.perk_points),c=sortShopItems(b.shop),userContext.filteredShopData=distrubuteShopItemsToFilteredLists(c),userContext.shopFilterIndex=userContext.shopFilterIndex||0,userContext.shopData=userContext.filteredShopData[userContext.shopFilterIndex],baseShopTime=parseInt((new Date).getTime()/1E3),b.cost_refresh_shop=2,b.userContext=userContext,b.open_tab=a,b.featuredTabLabel&&(phraseText.featured_tab_label=b.featuredTabLabel),b.dealsData?(b.overrideDealsData=\n[],b.dealsData.map(function(a){b.overrideDealsData.push(a)}),b.dealsData=[],b.overrideDealsData.map(function(a){b.dealsData.push(a.symbol);a.price_perk_points&&(itemFromSymbol(a.symbol).price_perk_points=a.price_perk_points)}),userContext.defaultDeals_id=itemFromSymbol(b.dealsData[0]).id,userContext.defaultDeals_symbol=b.dealsData[0]):b.dealsData=shopSetDealData(\"deals\"),b.featuredItemPack?(b.overridefeaturedItemPack={},b.overridefeaturedItemPack.symbol=b.featuredItemPack.symbol,b.overridefeaturedItemPack.price_perk_points=\nb.featuredItemPack.price_perk_points,b.featuredItemPack=b.overridefeaturedItemPack.symbol,b.overridefeaturedItemPack.price_perk_points&&(itemFromSymbol(b.overridefeaturedItemPack.symbol).price_perk_points=b.overridefeaturedItemPack.price_perk_points),userContext.defaultFeaturedPack_id=itemFromSymbol(b.featuredItemPack).id,userContext.defaultFeaturedPack_symbol=b.featuredItemPack):b.featuredItemPack=shopSetDealData(\"featured_item_pack\"),b.featuredItem?(b.overridefeaturedItem=[],b.featuredItem.map(function(a){b.overridefeaturedItem.push(a)}),\nb.featuredItem=[],b.overridefeaturedItem.map(function(a){b.featuredItem.push(a.symbol);a.price_perk_points&&(itemFromSymbol(a.symbol).price_perk_points=a.price_perk_points)})):b.featuredItem=shopSetDealData(\"featured_items\"),userContext.shopMetadata=b,drawShopModal(userContext.shopMetadata)}";
original.hasGold =
    "function hasGold(b,a,c){if(0<b){void 0==c&&(c=!1);doLog(\"hasGold: cost=\"+b+\" [player perk_points=\"+userContext.playerData.user.perk_points+\"]\");if(b>userContext.playerData.user.perk_points)return currencyModal(\"gold\"),iosSignal(\"purchase\",\"need_gold\"),!1;if(2==(userContext.playerData.user.options_mask&2)&&!1==c)return dialogAlert({style:\"confirm\",button1:\"Okay\",button1_action:function(){closeAlert();a()},button2:\"Cancel\",heading:jsTranslate(\"Spend %{val} Gold\",\"val\",numberWithDelimiter(b)),text:jsTranslate(\"Please confirm that you wish to spend %{val} gold.\",\n\"val\",numberWithDelimiter(b)),keep_previous:!0}),!1}return!0}";
original.pvpLaunch =
    "function pvpLaunch(){json={pvp:{}};json.pvp.target_id=pvpForm.target_id;json.pvp.sworn_sword_id=userContext.setSwornSword.id;json.pvp.pvp_action_symbol=userContext.currentActionLabel;json.pvp.region_symbol=fealtySymbol[pvpForm.target_faction_id];pvpForm.sub_region_index=Math.floor(3*Math.random());var b=pvpForm.target_faction_id;void 0==b&&(b=userContext.playerData.character.faction_id);json.pvp.sub_region_symbol=fealtySubRegions[b][pvpForm.sub_region_index].symbol;json.pvp.attack_value=userContext.currentQuest.action_type[userContext.currentActionLabel].attacker_strength;\njson.pvp.defense_value=userContext.currentQuest.action_type[userContext.currentActionLabel].defender_strength;checkPvpBan()||(showSpinner(),$.ajax({type:\"get\",url:\"/pvps/create\",data:json,dataType:\"JSON\",complete:hideSpinner,success:function(a){void 0==a.error?(pvpForm={},userContext.pvp=a,pvpRenderProgress(a),insertInventoryFromItem(playerInventory,a.attacker.sworn_sword),analytics.track(\"PvP Start\",{pvp_context:\"attack\",pvp_action:json.pvp.pvp_action_symbol}),analytics.wizardtrack(\"PvP Start\",{pvp_context:\"attack\",\npvp_action:json.pvp.pvp_action_symbol})):handleSwornSwordError(a.error)}}))}";
original.questSubmit =
    "function questSubmit(b,a,c,d,g,k,f){doLog(\"questSubmit: stage=\"+a+\" choice=\"+c);uiEvent(\"quest_submit_\"+b+\"_\"+a+\"_choice_\"+c,userContext.playerData);userContext.postQuestEvent=\"quest_post_\"+b+\"_\"+a+\"_choice_\"+c;userContext.playerData;userContext.questActionChoice=c;b=void 0!=f?\"/play/quest?quest_id=\"+f+\"&stage=\"+a+\"&choice=\"+c+\"&chosen=\"+escape(d):\"/play/quest?quest_symbol=\"+b+\"&stage=\"+a+\"&choice=\"+c+\"&chosen=\"+escape(d);void 0!=g?(b=isWeb()?b+(\"&chat=\"+escape($(\"#\"+g).val())):b+(\"&chat=\"+escape(g)),\nuserContext.hideWarParty=!0):playSound(\"page-turn\");void 0!=k&&(userContext.dialogIndex++,userContext.dialogHistory[userContext.dialogIndex]=unescape(k));isIpad()&&showSpinner();$.ajax({url:b,dataType:\"JSON\",success:function(a){isIpad()&&hideSpinner();questSubmitCallback(a);questById(f).action_taken=!0}});return!1}";