diff --git a/design/maps.py b/design/maps.py index d6e0d1ec..40fcb0b7 100644 --- a/design/maps.py +++ b/design/maps.py @@ -1221,6 +1221,7 @@ "npcs":[ {"id":"transporter","position":[-14,-477]}, {"id":"locksmith","position":[316,-270]}, + {"id":"scrollsmith","position":[606,-1590]}, ], "monsters":[ {"type":"plantoid","boundary":[-1013,-472,-575,-130],"count":4,"grow":True}, #added grow 31/1/2024 diff --git a/design/npcs.py b/design/npcs.py index 818b54d9..e8fed04f 100644 --- a/design/npcs.py +++ b/design/npcs.py @@ -891,6 +891,13 @@ "type":"fullstatic", "name":"Smith", }, + "scrollsmith":{ + "role":"scrollsmith", + "skin":"bsoldier", + "says":"X", + "type":"fullstatic", + "name":"Sir Bob", + }, "transporter":{ "role":"transport", "skin":"spell", diff --git a/design/sprites.py b/design/sprites.py index 28995b2a..74e24840 100644 --- a/design/sprites.py +++ b/design/sprites.py @@ -372,7 +372,7 @@ "columns":4, "matrix":[ [None,"nexus",None,None], - [None,None,None,None], + [None,None,"bsoldier",None], ] }, "military3":{ @@ -1136,4 +1136,4 @@ "ruins":{"file":"/images/tiles/map/ruins.png?v=2"}, "tree":{"file":"/images/tiles/map/tree.png"}, "lights":{"file":"/images/tiles/map/lights.png?v=3","light":"yes"}, # "frames":3,"frame_width":48, -} \ No newline at end of file +} diff --git a/js/functions.js b/js/functions.js index 86b0c44a..ed9af67c 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2953,6 +2953,14 @@ function lock_item(num) return push_deferred("locksmith"); } +function destat_item(num) +{ + if(num===undefined) num=s_item; + socket.emit("destat",{num:num}); + return push_deferred("destat"); +} + + function seal_item(num) { if(num===undefined) num=l_item; @@ -3204,6 +3212,7 @@ function reopen() else if(rendered_target=="dismantler") render_dismantler(); else if(rendered_target=="none") render_none_shrine(); else if(rendered_target=="locksmith") render_locksmith(); + else if(rendered_target=="scrollsmith") render_scrollsmith(); // else if(rendered_target=="secondhands") render_secondhands(); // Manual resets if(inventory) reset_inventory(); @@ -3270,7 +3279,7 @@ function reset_inventory(condition) { if(inventory) { - if(condition && !in_arr(rendered_target,["upgrade","compound","exchange","npc","merchant","craftsman","dismantler","none","locksmith"])) return; + if(condition && !in_arr(rendered_target,["upgrade","compound","exchange","npc","merchant","craftsman","dismantler","none","locksmith","scrollsmith"])) return; render_inventory(true); } } diff --git a/js/game.js b/js/game.js index 5615ba90..27f1d42d 100644 --- a/js/game.js +++ b/js/game.js @@ -2194,6 +2194,15 @@ function init_socket(args) } else if(response=="magiport_failed") ui_log("Magiport failed","gray"),no_no_no(2); else if(response=="revive_failed") ui_log("Revival failed","gray"),no_no_no(1); + else if(response=="scrollsmith_cant") + { + ui_log("Can't destat this item","gray") + } + else if(response=="scrollsmith_success") + { + ui_log("Spent " + data.gold.toLocaleString() + " gold","gray"); + ui_log("De-statted the item","gray"); + } else if(response=="locksmith_cant") { ui_log("Can't lock/unlock this item","gray") @@ -3257,6 +3266,10 @@ function npc_right_click(event){ { render_interaction({auto:true,dialog:"locksmith",skin:"asoldier"}); } + if(this.role=="scrollsmith") + { + render_interaction({auto:true,dialog:"scrollsmith",skin:"bsoldier"}); + } if(this.role=="compound") { render_compound_shrine(1); diff --git a/js/html.js b/js/html.js index 0365b378..8f42c726 100644 --- a/js/html.js +++ b/js/html.js @@ -1,4 +1,4 @@ -var u_item=null,u_scroll=null,u_offering=null,c_items=e_array(3),c_scroll=null,c_offering=null,c_last=0,e_item=null,p_item=null,l_item=null,cr_items=e_array(9),cr_last=0,ds_item=null; +var u_item=null,u_scroll=null,u_offering=null,c_items=e_array(3),c_scroll=null,c_offering=null,c_last=0,e_item=null,p_item=null,l_item=null,s_item=null,cr_items=e_array(9),cr_last=0,ds_item=null; var settings_shown=0; function show_settings() @@ -1142,6 +1142,30 @@ function render_locksmith(mode) if(!inventory) render_inventory(),inventory_opened_for=topleft_npc; } +function render_scrollsmith() +{ + var button="DE-STAT",f="destat_item",shade="shade_chest"; + reset_inventory(1); + topleft_npc="scrollsmith"; rendered_target=topleft_npc; + s_item=null; + var html="