]>
jfr.im git - irc/gameservirc.git/blob - gameserv/do_master.cpp
7 void do_master(char *u
)
12 if (!(user
= find(u
)))
14 notice(s_GameServ
, u
, "Fatal error. Contact a(n) <S admin. buf: %s", strtok(NULL
, ""));
17 else if (isIgnore(user
))
20 log("Ignoring %s.", user
->getNick());
24 else if (!is_playing(user
))
26 notice(s_GameServ
, u
, "You must be playing to see your master!");
29 else if (is_fighting(user
))
31 notice(s_GameServ
, u
, "You're in the middle of a fight! Pay attention!");
34 else if (!isAlive(user
->stats
))
36 notice(s_GameServ
, u
, "You're dead. Wait until tomorrow to see your master!");
40 updateTS(user
->stats
);
42 char *cmd
= strtok(NULL
, " ");
43 Player
*p
= user
->stats
;
48 notice(s_GameServ
, u
, "You have already seen your master today. Wait until tomorrow to try again");
91 need
= p
->getExp() + 1;
92 notice(s_GameServ
, u
, "You are at level %d. You are the master. What's left? The DRAGON!", REALLEVELS
);
96 need
= p
->getExp() + 1; // Unknown level... don't let them fight a fake master!
102 notice(s_GameServ
, u
, "SYNTAX: MASTER {FIGHT | QUESTION}");
106 if (stricmp(cmd
, "FIGHT") == 0)
108 if (p
->getExp() >= need
)
114 notice(s_GameServ
, u
, "You are not worthy of fighting %s! You need %ld more experience.",
115 levels
[p
->getLevel() - 1].master
.name
.c_str(), (need
- p
->getExp()));
118 else if (stricmp(cmd
, "QUESTION") == 0)
120 if (p
->getExp() >= need
)
121 notice(s_GameServ
, u
, "%s looks you up and down and decides you are more ready than you will ever be.",
122 levels
[p
->getLevel() - 1].master
.name
.c_str());
124 notice(s_GameServ
, u
, "You pathetic fool! You are no match for %s, %s!",
125 levels
[p
->getLevel() - 1].master
.name
.c_str(), p
->getName().c_str());
131 notice(s_GameServ
, u
, "SYNTAX: MASTER {FIGHT | QUESTION}");