summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-07-16 23:01:47 -0300
committerJesusaves <cpntb1@ymail.com>2018-07-16 23:01:47 -0300
commitb27d189868e08f4459d324fcdc71d996b4ba84ae (patch)
tree9a126f44a30d5f9fc47ca0c493488609ef697d95 /npc
parentc3ac02f19bd21b196841934cea8205c77c2f51bf (diff)
downloadserverdata-b27d189868e08f4459d324fcdc71d996b4ba84ae.tar.gz
serverdata-b27d189868e08f4459d324fcdc71d996b4ba84ae.tar.bz2
serverdata-b27d189868e08f4459d324fcdc71d996b4ba84ae.tar.xz
serverdata-b27d189868e08f4459d324fcdc71d996b4ba84ae.zip
User Control Panel (@ucp)
Diffstat (limited to 'npc')
-rw-r--r--npc/commands/super-menu.txt17
-rw-r--r--npc/commands/ucp.txt67
-rw-r--r--npc/functions/main.txt7
-rw-r--r--npc/scripts.conf1
4 files changed, 76 insertions, 16 deletions
diff --git a/npc/commands/super-menu.txt b/npc/commands/super-menu.txt
index a14f26bc3..9bb3b9365 100644
--- a/npc/commands/super-menu.txt
+++ b/npc/commands/super-menu.txt
@@ -49,8 +49,7 @@ function script SuperMenu {
OnCall:
- if (!debug && !is_gm())
- {
+ if (!debug && !is_gm()) {
dispbottom l("You do not have the required access privileges to use the Super Menu.");
end;
}
@@ -59,20 +58,6 @@ OnCall:
closedialog;
end;
-OnPCLoginEvent:
- .@debug_skill = getskilllv(EVOL_SUPER_MENU);
-
- if (.@debug_skill > 0 && !debug)
- {
- skill EVOL_SUPER_MENU, 0, 0; // remove debug skill
- }
-
- else if (.@debug_skill < 1 && debug)
- {
- skill EVOL_SUPER_MENU, 1, 0; // give debug skill
- }
- end;
-
OnInit:
bindatcmd "super", "@super::OnCall", 80, 99, 0;
//bindatcmd "numa", "@super::OnCall", 80, 99, 0; // alias for those used to TMW's @numa - none at the moment, iirc
diff --git a/npc/commands/ucp.txt b/npc/commands/ucp.txt
new file mode 100644
index 000000000..dbdf06221
--- /dev/null
+++ b/npc/commands/ucp.txt
@@ -0,0 +1,67 @@
+function script UserCtrlPanel {
+ do
+ {
+ clear;
+ setnpcdialogtitle l("User Control Panel");
+ mes l("This menu gives you some options which affect your account.");
+ mes l("In some cases, your pincode will be required.");
+ mes "";
+ mes l("What do you want to access?");
+ next;
+ select
+ l("Rules"),
+ l("Game News"),
+ l("Account Information"),
+ l("Quit");
+
+ switch (@menu)
+ {
+ case 1: GameRules; break;
+ case 2: GameNews; break;
+ case 3:
+ if (!validatepin())
+ break;
+ query_sql("SELECT email,logincount,last_ip FROM `login` WHERE account_id="+getcharid(3)+"' LIMIT 2", .@email$, .@lgc, .@ip$);
+ mes l("Char Name: @@", strcharinfo(0));
+ mes l("Party Name: @@", strcharinfo(1));
+ mes l("Guild Name: @@", strcharinfo(2));
+ mes l("Clan Name: @@", strcharinfo(4));
+ mes "";
+ mes l("Email: @@", .@email$[0]);
+ if (Sex)
+ mes l("Male");
+ else
+ mes l("Female");
+ mes l("Last IP: @@", .@ip$[0]);
+ mes l("Total Logins: @@", .@lgc[0]);
+ next;
+ query_sql("SELECT name,last_login,last_map,partner_id FROM `char` WHERE account_id="+getcharid(3)+"' LIMIT 9", .@name$, .@lastlogin$, .@map$, .@married);
+ for (.@i = 1; .@i < getarraysize(.@name$); .@i++) {
+ mesn .@name$[i-1];
+ mes l("Last Seen: @@", .@lastlogin$[i-1]);
+ mes l("Last map: @@", .@map$[i-1]);
+ if (.@married[i-1])
+ mes l("Married with @@", gf_charname(.@married[i-1]));
+ mes "";
+ }
+ next;
+ break;
+ case 7: close; break;
+ }
+ } while (1);
+}
+
+
+
+- script @ucp 32767,{
+ end;
+
+OnCall:
+
+ UserCtrlPanel;
+ closedialog;
+ end;
+
+OnInit:
+ bindatcmd "ucp", "@ucp::OnCall", 0, 99, 0;
+}
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 0318ce69e..d290bac63 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -248,6 +248,13 @@ function script gf_accid {
return .@value[0];
}
+// Get some char name from char ID, even if offline
+// ( Name )
+function script gf_charname {
+ .@nb = query_sql("SELECT name FROM `char` WHERE char_id="+escape_sql(getarg(0))+" LIMIT 2", .@value$);
+ return .@value$[0];
+}
+
// Request pincode and validate it. Use any non-4-digits code to cancel. Failure will dc you.
// Returns 1 if pin check is OK.
function script validatepin {
diff --git a/npc/scripts.conf b/npc/scripts.conf
index b02cc7157..5dca6e73c 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -76,6 +76,7 @@
"npc/commands/super-menu.txt",
"npc/commands/warp.txt",
"npc/commands/wgm.txt",
+"npc/commands/ucp.txt",
// config script
"npc/config/hairstyle_config.txt",