]>
jfr.im git - irc/gameservirc.git/blob - gameserv/do_equip.cpp
15 char *item
= strtok(NULL
, " ");
17 if (!item
|| int(item
[0]) < 48 || int(item
[0] > 57))
19 notice(s_GameServ
, u
, "SYNTAX: EQUIP ####");
20 notice(s_GameServ
, u
, "Type /msg <S HELP EQUIP for more information.");
23 else if (!(user
= find(u
)))
25 notice(s_GameServ
, u
, "Fatal error in do_equip. Contact a(n) <S Admin");
28 else if (isIgnore(user
))
31 log("Ignoring %s.", user
->getNick());
35 else if (!is_playing(user
))
37 notice(s_GameServ
, u
, "You must be playing to equip weapons and armor!");
40 id
= stringtoint(item
);
41 if (!is_fighting(user
))
42 updateTS(user
->stats
);
43 p
= user
->stats
->inventory
;
46 if (!(equip
= p
->Find(id
)))
50 notice(s_GameServ
, u
, "You aren't carrying that item!");
52 showinventory(user
->stats
, user
);
54 else if (equip
->getItem()->getType() != ARMOR
&& equip
->getItem()->getType() != WEAPON
)
56 notice(s_GameServ
, u
, "You can't use %s like that. Try /msg <S use", equip
->getItem()->getName().c_str());
61 notice(s_GameServ
, u
, "You equip %s.", equip
->getItem()->getName().c_str());
62 equip
->use(user
->stats
);