}
else if (!name)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|WEAPON|ARMOR|HP POTIONS|STRENGTH POTIONS|DEFENSE POTIONS|HEALING POTIONS|ALIVE|SEEN MASTER} {STRING|NUMBER|ON|OFF}");
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|WEAPON|ARMOR|HP POTIONS|STRENGTH POTIONS|DEFENSE POTIONS|HEALING POTIONS|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
return;
}
else if (!(target = findplayer(name)))
}
else if (stricmp(cmd, "BANK") == 0 || stricmp(cmd, "BALANCE") == 0)
{
- if (!isAdmin(user))
+ if (!isAdmin(user))
{
notice(s_GameServ, u, "Admins Only!");
return;
}
- else if (stricmp(cmd, "BANK") == 0)
+ else if (stricmp(cmd, "BANK") == 0)
{
cmd2 = strtok(NULL, " "); // Need an extra parameter for set bank balance
}
- else
+ if (!cmd2)
{
- target->stats->bank = stringtoint(cmd2);
- notice(s_GameServ, u, "Balance changed!");
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] [BANK] BALANCE <NUMBER>");
+ return;
}
+
+ target->stats->bank = stringtoint(cmd2);
+ notice(s_GameServ, u, "Bank balance changed to %s!", cmd2);
}
else if (stricmp(cmd, "PLAYER") == 0)
{
}
else if (stricmp(cmd2, "FIGHTS") != 0)
{
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] PLAYER FIGHTS <number>");
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] PLAYER FIGHTS <NUMBER>");
return;
}
else
{
cmd2 = strtok(NULL, " ");
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] PLAYER FIGHTS <NUMBER>");
+ return;
+ }
target->stats->player_fights = stringtoint(cmd2);
- notice(s_GameServ, u, "Player fights changed!");
+ notice(s_GameServ, u, "Player fights changed to %s!", cmd2);
}
}
else if (stricmp(cmd, "FOREST") == 0)
else
{
cmd2 = strtok(NULL, " ");
- target->stats->player_fights = stringtoint(cmd2);
- notice(s_GameServ, u, "Player fights changed!");
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] FOREST FIGHTS <NUMBER>");
+ return;
+ }
+ target->stats->forest_fights = stringtoint(cmd2);
+ notice(s_GameServ, u, "Forest fights changed to %s!", cmd2);
}
}
else if (stricmp(cmd, "GOLD") == 0)
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] GOLD <NUMBER>");
+ return;
+ }
target->stats->gold = stringtoint(cmd2);
notice(s_GameServ, u, "Gold set to %s", cmd2);
return;
}
}
- else if (stricmp(cmd, "STRENGTH") == 0 && stricmp(cmd, "POTIONS") != 0)
+ else if (stricmp(cmd, "STRENGTH") == 0 && stricmp(cmd2, "POTIONS") != 0)
{
if (!isAdmin(user))
{
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] STRENGTH <NUMBER>");
+ return;
+ }
+
target->stats->strength = stringtoint(cmd2);
notice(s_GameServ, u, "Strength set to %s", cmd2);
return;
}
}
- else if (stricmp(cmd, "DEFENSE") == 0 && stricmp(cmd, "POTIONS") != 0)
+ else if (stricmp(cmd, "DEFENSE") == 0 && stricmp(cmd2, "POTIONS") != 0)
{
if (!isAdmin(user))
{
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] DEFENSE <NUMBER>");
+ return;
+ }
+
target->stats->defense = stringtoint(cmd2);
notice(s_GameServ, u, "Defense set to %s", cmd2);
return;
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] HP <NUMBER>");
+ return;
+ }
target->stats->hp = stringtoint(cmd2);
notice(s_GameServ, u, "HP set to %s", cmd2);
return;
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] MAXHP <NUMBER>");
+ return;
+ }
target->stats->maxhp = stringtoint(cmd2);
notice(s_GameServ, u, "MaxHP set to %s", cmd2);
return;
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {EXPERIENCE|EXP} <NUMBER>");
+ return;
+ }
+
target->stats->exp = stringtoint(cmd2);
notice(s_GameServ, u, "Exp set to %s", cmd2);
return;
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] LEVEL <NUMBER>");
+ return;
+ }
target->stats->level = stringtoint(cmd2);
notice(s_GameServ, u, "Level set to %s", cmd2);
return;
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] WEAPON <NUMBER>");
+ return;
+ }
+
target->stats->weapon = stringtoint(cmd2);
notice(s_GameServ, u, "Weapon set to %s", weapons[target->stats->weapon]);
return;
}
else
{
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] ARMOR <NUMBER>");
+ return;
+ }
target->stats->armor = stringtoint(cmd2);
notice(s_GameServ, u, "Armor set to %s", armors[target->stats->armor]);
return;
else
{
cmd2 = strtok(NULL, " ");
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] HP POTIONS <NUMBER>");
+ return;
+ }
target->stats->inventory.setHP(stringtoint(cmd2));
notice(s_GameServ, u, "HP Potions set to %s", cmd2);
return;
else
{
cmd2 = strtok(NULL, " ");
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] HEALING POTIONS <NUMBER>");
+ return;
+ }
target->stats->inventory.setHealing(stringtoint(cmd2));
notice(s_GameServ, u, "Healing Potions set to %s", cmd2);
return;
else
{
cmd2 = strtok(NULL, " ");
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] STRENGTH POTIONS <NUMBER>");
+ return;
+ }
target->stats->inventory.setStrength(stringtoint(cmd2));
notice(s_GameServ, u, "Strength Potions set to %s", cmd2);
return;
else
{
cmd2 = strtok(NULL, " ");
+ if (!cmd2)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] DEFENSE POTIONS <NUMBER>");
+ return;
+ }
target->stats->inventory.setDefense(stringtoint(cmd2));
notice(s_GameServ, u, "Defense Potions set to %s", cmd2);
return;
notice(s_GameServ, u, "SYNTAX: /msg %S SET ALIVE TRUE|FALSE");
return;
}
+ else if (stricmp(cmd2, "TRUE") == 0)
+ {
+ notice(s_GameServ, u, "Target has been Resurrected!");
+ target->addFlag(FLAG_ALIVE);
+ }
+ else
+ {
+ notice(s_GameServ, u, "Target is now dead!");
+ target->remFlag(FLAG_ALIVE);
+ }
}
}
+ else if (stricmp(cmd, "SEEN") == 0)
+ {
+ if (!isAdmin(user))
+ {
+ notice(s_GameServ, u, "Admins Only!");
+ return;
+ }
+ else if (stricmp(cmd2, "MASTER") != 0)
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] SEEN MASTER {TRUE|FALSE}");
+ return;
+ }
+ else
+ {
+ cmd2 = strtok(NULL, " ");
+ if (!cmd2 || (stricmp(cmd2, "TRUE") != 0 && stricmp(cmd2, "FALSE") != 0))
+ {
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NICK] SEEN MASTER {TRUE|FALSE}");
+ return;
+ }
+ else if (stricmp(cmd2, "TRUE") == 0)
+ {
+ notice(s_GameServ, u, "Target has seen their master now.");
+ target->addFlag(FLAG_MASTER);
+ }
+ else
+ {
+ notice(s_GameServ, u, "Target has not seen their master now.");
+ target->remFlag(FLAG_MASTER);
+ }
+ }
+ }
else
{
notice(s_GameServ, u, "Unknown command: SET %s", cmd);
- notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|WEAPON|ARMOR|HP POTIONS|STRENGTH POTIONS|DEFENSE POTIONS|HEALING POTIONS|ALIVE|SEEN MASTER} {STRING|NUMBER|ON|OFF}");
+ notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] {PASSWORD|BANK BALANCE|PLAYER FIGHTS|FOREST FIGHTS|GOLD|STRENGTH|DEFENSE|HP|MAXHP|EXP|LEVEL|WEAPON|ARMOR|HP POTIONS|STRENGTH POTIONS|DEFENSE POTIONS|HEALING POTIONS|ALIVE|SEEN MASTER} {STRING|NUMBER|TRUE|FALSE}");
return;
}
}
Player *p = user->stats;
setMaster(p);
- see_master(u);
notice(s_GameServ, u, "You approach the dragon's lair cautiously.");
notice(s_GameServ, u, "The stench of sulfer fills the air as a "\
"deep, red fog rolls in. The air is filled with the "\
notice(s_GameServ, u, "Just then you notice the eye begin to "\
"glare orange! The tooth is moving... but it is still too "\
"dark for you to make out.... THE DRAGON! You see it!");
- display_monster(u);
+ see_master(u);
}
void do_master(char *u)