124 lines (119 with data), 2.6 kB
#include "security.h"
inherit "RO/Servers";
reset() {}
string query_desc((int | object) who)
/* return a short, token-like descriptor as used in the wiz_soul's 'people'
* command */
/* who is object pointer to a player */
/* returns padded out string */
/* formats returned: */
/* "w" is a wizard
* "g" is a guest
* "t" is a test character
* "p" is a player
* "l" is a lord
* "k" is king
* "a" is an Apprentice Wizard (training wheels)
* "God" or similar is a god
*/
{
int tmpl;
string l, r;
int lord;
if (!objectp(who))
{
return "?????";
}
tmpl = who->query_wiz();
l = "huh?";
r = "";
if (tmpl >= 10000)
{
if (tmpl == 10000)
l = "god";
else if (tmpl < 100000)
l = "God";
else
{
l = "GOD";
while (tmpl >= 1000000)
{
r = r + "!";
tmpl = tmpl / 10;
}
}
}
else if (tmpl >= 100)
{
l = "" + tmpl; r = "W";
}
else if (tmpl)
{
l = "" + tmpl; r = "w";
}
else if ( stringp(who->query_real_name()) )
{
lord = PEERAGE_SERV->query_station_value(who->query_real_name());
if (lord >= 0)
{
l = "" + lord;
if (lord==4) r= "K";
else r = "L";
}
else
{
l = QUEST_SERV->query_quest_points(who) + "";
r = "p";
}
}
if (who->query_guest())
r = r + "g";
if ( stringp(who->query_real_name()) )
{
if (TEST_REGISTER->query_test_char(who->query_real_name()))
r = r + "t";
if (TEST_REGISTER->query_apprentice(who->query_real_name()))
r = r + "a";
}
r = " "[sizeof(l)..] + l + " " + r + " "[sizeof(r)..];
/* if (strlen(tmpl) > 6)
tmpl = tmpl[0..5]; */
return r;
}
query_long_desc(who)
/* as above, but returns a detailed descriptor.
*/
{
/* also check for:
* Judge
* Lords
*/
array res;
int tmpl;
if (!who)
return "";
res = [ ];
tmpl = who->query_wiz();
if (tmpl >= 10000)
res += [ "God" ] ;
else if (tmpl >= 700)
res += [ "Elder Wizard" ];
else if (tmpl >= 100)
res += [ "Senior Wizard" ];
else if (tmpl <= 21 && tmpl > 0)
res += [ "Apprentice Wizard" ];
else if (tmpl)
res += [ "Wizard " + tmpl ];
else
res += ["Player "+ QUEST_SERV->query_quest_points(who) ];
if (WHOIS->is_lord(who))
res += [ PEERAGE_SERV->query_station_title(
who->query_real_name()) ];
if (who->query_guest())
res += [ "Guest" ];
if (WHOIS->is_test_char(who))
res += [ "Test Character" ];
if (WHOIS->is_judge(who))
res += [ "Judge" ];
return implode(res, ", ");
}