Skip to content

Commit 97362ee

Browse files
committed
Add deiron confirm
1 parent 565bcb5 commit 97362ee

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

server/plugins/com/openrsc/server/plugins/authentic/npcs/tutorial/IronMan.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,27 @@ public void onTalkNpc(final Player player, final Npc npc) {
6060
}
6161
}
6262

63-
final int mode = player.getAttribute("ironman_mode");
63+
final int mode = player.getAttribute("ironman_mode_new");
6464
if (mode == -1) return;
65-
player.setIronMan(mode);
66-
player.message("You have downgraded your Ironman status.");
67-
ActionSender.sendIronManMode(player);
68-
ActionSender.sendIronManInterface(player);
65+
mes( "Are you sure you wish to downgrade your Ironman status?");
66+
// Confirmation for downgrading Ironman status
67+
final int confirmation = multi(player,
68+
"Yes, I am sure, please downgrade my Ironman status.", // 0
69+
"No, I changed my mind, keep my Ironman status." // 1
70+
);
71+
72+
switch (confirmation) {
73+
case 0: // Confirm downgrade
74+
player.setIronMan(mode);
75+
player.setAttribute("ironman_mode", mode);
76+
player.message("You have downgraded your Ironman status.");
77+
break;
78+
case 1: // Cancel downgrade
79+
default:
80+
player.message("You have chosen to keep your current Ironman status.");
81+
break;
82+
}
83+
6984
return;
7085
}
7186

server/src/com/openrsc/server/net/rsc/handlers/InterfaceOptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ private void handleIronmanMode(final Player player, final OptionsStruct payload)
183183
}
184184

185185
player.setAttribute("ironman_delete", true);
186-
player.setAttribute("ironman_mode", mode);
186+
player.setAttribute("ironman_mode_new", mode);
187187

188188
ironManNpc.initializeTalkScript(player);
189189
break;

0 commit comments

Comments
 (0)