summaryrefslogtreecommitdiff
path: root/npc/commands
diff options
context:
space:
mode:
Diffstat (limited to 'npc/commands')
-rw-r--r--npc/commands/ucp.txt42
1 files changed, 35 insertions, 7 deletions
diff --git a/npc/commands/ucp.txt b/npc/commands/ucp.txt
index 6fdc2bb83..aeaf805a0 100644
--- a/npc/commands/ucp.txt
+++ b/npc/commands/ucp.txt
@@ -20,6 +20,7 @@ function script UserCtrlPanel {
select
l("Rules"),
l("Game News"),
+ rif(is_admin(), l("Create PIN Number")),
l("Account Information"),
rif(getcharid(2) > 0, l("Guild Information")),
l("Change Language"),
@@ -29,9 +30,36 @@ function script UserCtrlPanel {
switch (@menu)
{
- case 1: GameRules; break;
- case 2: GameNews; break;
+ case 1: GameRules(); break;
+ case 2: GameNews(); break;
case 3:
+ // Account age check
+ if (#REG_DATE < gettimetick(2)+86400*15) {
+ mesc l("Your account is too young."), 1;
+ mesc l("The accounts need 15 days to set Pin Codes."), 1;
+ break;
+ }
+ mes l(".:: Create PIN Code ::.");
+ mes l("If you decide to continue, a random PINCODE will be");
+ mes l("sent to the email you used to register on Moubootaur Legends.");
+ mes "";
+ mes l("With a PinCode, you'll have access to restricted features,");
+ mes l("Like Discord integration and sensitive options.");
+ mes "";
+ mes l("You can change the PIN from ManaPlus char selection screen.");
+ mes l("You can also modify your email with %s.", b("@email"));
+ mes l("This will do nothing if the account already have a PIN.");
+ next;
+ mesc l("Are you sure you want to create a PIN now?"), 1;
+ if (askyesno() == ASK_NO)
+ break;
+ mes "";
+ .@msg$=json_encode("date", gettimetick(2),
+ "accid", getcharid(3),
+ "pin", rand2(1000));
+ api_send(302, .@msg$);
+ break;
+ case 4:
if (!validatepin())
break;
if (!@lgc || @query) {
@@ -72,7 +100,7 @@ function script UserCtrlPanel {
}
next;
break;
- case 4:
+ case 5:
.@gid=getcharid(2);
mesc (".:: "+getguildname(.@gid)+" ::."), 1;
mesc l("Guild Master: @@", getguildmaster(.@gid)), 3;
@@ -86,8 +114,8 @@ function script UserCtrlPanel {
mesc l("Your position on the guild: @@", getguildrole(.@gid, getcharid(3), true));
next;
break;
- case 5: asklanguage(LANG_IN_SHIP); break;
- case 6:
+ case 6: asklanguage(LANG_IN_SHIP); break;
+ case 7:
// Draw the GUI and any info on it
csysGUI_Report();
mesc l("NOTE: The effective bonus level applied is the average level of enabled options!");
@@ -137,7 +165,7 @@ function script UserCtrlPanel {
}
} while (@menu > 1);
break;
- case 7:
+ case 8:
do
{
mesc ".:: " + l("GAME SETTINGS") + " ::.", 3;
@@ -252,7 +280,7 @@ function script UserCtrlPanel {
clear;
} while (@menu != 1);
break;
- case 8: close; break;
+ default: close; break;
}
} while (1);
}