From 508496d7e9a688164e3c1f81efbe1129a707f41a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 26 Dec 2021 13:12:10 -0300 Subject: Allow scrying once you obtain the Grimorium. This allows you to see other players data. --- npc/items/books.txt | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'npc/items/books.txt') diff --git a/npc/items/books.txt b/npc/items/books.txt index 5d68ac7e2..18f27ad7e 100644 --- a/npc/items/books.txt +++ b/npc/items/books.txt @@ -163,6 +163,7 @@ OnInit: end; function myself { + .@all = getarg(0, true); mes ".:: " + strcharinfo(0) + " ::."; if (getcharid(1)) mesc l("Party Name: @@", strcharinfo(1)); @@ -214,7 +215,8 @@ function myself { .@pos=getguildrole(.@gid, getcharid(3)); mesc l("Current Guild: %s", getguildname(.@gid)); mesc l("Guild Master: @@", getguildmaster(.@gid)); - mesc l("You are the guild's \"%s\", and you contribute with %02d%% EXP.", + if (.@all) + mesc l("You are the guild's \"%s\", and you contribute with %02d%% EXP.", getguildpostitle(.@gid, .@pos), getguildpostax(.@gid, .@pos)); } @@ -246,6 +248,28 @@ function myself { return; } +OnScry: + if (!countitem(JesusalvaGrimorium) && !is_staff()) + end; + .@w$ = implode(.@atcmd_parameters$, " "); + if (.@w$ == "") + .@w$ = strcharinfo(0); + .@me = getcharid(3); + .@id = getcharid(3, .@w$); + if (!.@id) { + mesc l("The requested char is not online or does not exist."), 1; + close; + } + setnpcdialogtitle sprintf("@scry %s", .@w$); + attachrid(.@id); + if (!GSET_NOSCRY) + myself(false); + else + mesc l("%s has protected themselves from prying eyes. Your scry attempt failed.", strcharinfo(0)), 1; + detachrid(); + attachrid(.@me); + close; + function read_book { setnpcdialogtitle l(.book_name$); @@ -402,6 +426,7 @@ OnInit: .book_name$ = getitemname(JesusalvaGrimorium); .sex = G_OTHER; .distance = 1; + bindatcmd "scry", "#Book-JGrimorium::OnScry", 0, 99, 0; end; } -- cgit v1.2.3-60-g2f50