summaryrefslogtreecommitdiff
path: root/src/map/atcommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/atcommand.cpp')
-rw-r--r--src/map/atcommand.cpp387
1 files changed, 13 insertions, 374 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 336ef47..3d9e409 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -21,7 +21,6 @@
#include "battle.hpp"
#include "clif.hpp"
#include "chrif.hpp"
-#include "guild.hpp"
#include "intif.hpp"
#include "itemdb.hpp"
#include "map.hpp"
@@ -58,7 +57,6 @@ ATCOMMAND_FUNC (save);
ATCOMMAND_FUNC (load);
ATCOMMAND_FUNC (speed);
ATCOMMAND_FUNC (storage);
-ATCOMMAND_FUNC (guildstorage);
ATCOMMAND_FUNC (option);
ATCOMMAND_FUNC (hide);
ATCOMMAND_FUNC (die);
@@ -75,8 +73,6 @@ ATCOMMAND_FUNC (help);
ATCOMMAND_FUNC (gm);
ATCOMMAND_FUNC (pvpoff);
ATCOMMAND_FUNC (pvpon);
-ATCOMMAND_FUNC (gvgoff);
-ATCOMMAND_FUNC (gvgon);
ATCOMMAND_FUNC (model);
ATCOMMAND_FUNC (go);
//ATCOMMAND_FUNC (spawn);
@@ -91,7 +87,6 @@ ATCOMMAND_FUNC (statuspoint);
ATCOMMAND_FUNC (skillpoint);
ATCOMMAND_FUNC (zeny);
ATCOMMAND_FUNC (param);
-ATCOMMAND_FUNC (guildlevelup);
//ATCOMMAND_FUNC (recall);
ATCOMMAND_FUNC (recallall);
ATCOMMAND_FUNC (revive);
@@ -115,7 +110,6 @@ ATCOMMAND_FUNC (charquestskill);
ATCOMMAND_FUNC (lostskill);
ATCOMMAND_FUNC (charlostskill);
ATCOMMAND_FUNC (party);
-ATCOMMAND_FUNC (guild);
ATCOMMAND_FUNC (charskreset);
ATCOMMAND_FUNC (charstreset);
ATCOMMAND_FUNC (charreset);
@@ -123,8 +117,6 @@ ATCOMMAND_FUNC (charstpoint);
ATCOMMAND_FUNC (charmodel);
ATCOMMAND_FUNC (charskpoint);
ATCOMMAND_FUNC (charzeny);
-ATCOMMAND_FUNC (agitstart);
-ATCOMMAND_FUNC (agitend);
ATCOMMAND_FUNC (reloaditemdb);
ATCOMMAND_FUNC (reloadmobdb);
ATCOMMAND_FUNC (reloadskilldb);
@@ -144,9 +136,7 @@ ATCOMMAND_FUNC (char_unblock); // by Yor
ATCOMMAND_FUNC (char_unban); // by Yor
ATCOMMAND_FUNC (mount_peco); // by Valaris
ATCOMMAND_FUNC (char_mount_peco); // by Yor
-ATCOMMAND_FUNC (guildspy); // [Syrus22]
ATCOMMAND_FUNC (partyspy); // [Syrus22]
-ATCOMMAND_FUNC (guildrecall); // by Yor
ATCOMMAND_FUNC (partyrecall); // by Yor
ATCOMMAND_FUNC (enablenpc);
ATCOMMAND_FUNC (disablenpc);
@@ -237,7 +227,6 @@ static AtCommandInfo atcommand_info[] = {
{AtCommand_Load, "@load", 40, atcommand_load},
{AtCommand_Speed, "@speed", 40, atcommand_speed},
{AtCommand_Storage, "@storage", 1, atcommand_storage},
- {AtCommand_GuildStorage, "@gstorage", 50, atcommand_guildstorage},
{AtCommand_Option, "@option", 40, atcommand_option},
{AtCommand_Hide, "@hide", 40, atcommand_hide}, // + /hide
{AtCommand_Die, "@die", 1, atcommand_die},
@@ -254,10 +243,6 @@ static AtCommandInfo atcommand_info[] = {
{AtCommand_GM, "@gm", 100, atcommand_gm},
{AtCommand_PvPOff, "@pvpoff", 40, atcommand_pvpoff},
{AtCommand_PvPOn, "@pvpon", 40, atcommand_pvpon},
- {AtCommand_GvGOff, "@gvgoff", 40, atcommand_gvgoff},
- {AtCommand_GvGOff, "@gpvpoff", 40, atcommand_gvgoff},
- {AtCommand_GvGOn, "@gvgon", 40, atcommand_gvgon},
- {AtCommand_GvGOn, "@gpvpon", 40, atcommand_gvgon},
{AtCommand_Model, "@model", 20, atcommand_model},
{AtCommand_Go, "@go", 10, atcommand_go},
{AtCommand_Spawn, "@spawn", 50, atcommand_spawn},
@@ -276,7 +261,6 @@ static AtCommandInfo atcommand_info[] = {
{AtCommand_Intelligence, "@int", 60, atcommand_param},
{AtCommand_Dexterity, "@dex", 60, atcommand_param},
{AtCommand_Luck, "@luk", 60, atcommand_param},
- {AtCommand_GuildLevelUp, "@guildlvl", 60, atcommand_guildlevelup},
{AtCommand_Recall, "@recall", 60, atcommand_recall}, // + /recall
{AtCommand_Revive, "@revive", 60, atcommand_revive},
{AtCommand_CharacterStats, "@charstats", 40, atcommand_character_stats},
@@ -304,9 +288,6 @@ static AtCommandInfo atcommand_info[] = {
{AtCommand_LostSkill, "@lostskill", 40, atcommand_lostskill},
{AtCommand_CharLostSkill, "@charlostskill", 60, atcommand_charlostskill},
{AtCommand_Party, "@party", 1, atcommand_party},
- {AtCommand_Guild, "@guild", 50, atcommand_guild},
- {AtCommand_AgitStart, "@agitstart", 60, atcommand_agitstart},
- {AtCommand_AgitEnd, "@agitend", 60, atcommand_agitend},
{AtCommand_MapExit, "@mapexit", 99, atcommand_mapexit},
{AtCommand_IDSearch, "@idsearch", 60, atcommand_idsearch},
{AtCommand_MapMove, "@mapmove", 40, atcommand_warp}, // /mm command
@@ -338,9 +319,7 @@ static AtCommandInfo atcommand_info[] = {
{AtCommand_CharUnBan, "@unban", 60, atcommand_char_unban}, // by Yor
{AtCommand_MountPeco, "@mountpeco", 20, atcommand_mount_peco}, // by Valaris
{AtCommand_CharMountPeco, "@charmountpeco", 50, atcommand_char_mount_peco}, // by Yor
- {AtCommand_GuildSpy, "@guildspy", 60, atcommand_guildspy}, // [Syrus22]
{AtCommand_PartySpy, "@partyspy", 60, atcommand_partyspy}, // [Syrus22]
- {AtCommand_GuildRecall, "@guildrecall", 60, atcommand_guildrecall}, // by Yor
{AtCommand_PartyRecall, "@partyrecall", 60, atcommand_partyrecall}, // by Yor
{AtCommand_Enablenpc, "@enablenpc", 80, atcommand_enablenpc}, // []
{AtCommand_Disablenpc, "@disablenpc", 80, atcommand_disablenpc}, // []
@@ -1264,7 +1243,6 @@ int atcommand_whogroup (const int fd, struct map_session_data *sd,
int pl_GM_level, GM_level;
char match_text[100];
char player_name[24];
- struct guild *g;
struct party *p;
memset (temp0, '\0', sizeof (temp0));
@@ -1296,11 +1274,6 @@ int atcommand_whogroup (const int fd, struct map_session_data *sd,
player_name[j] = tolower (player_name[j]);
if (strstr (player_name, match_text) != NULL)
{ // search with no case sensitive
- g = guild_search (pl_sd->status.guild_id);
- if (g == NULL)
- sprintf (temp1, "None");
- else
- sprintf (temp1, "%s", g->name);
p = party_search (pl_sd->status.party_id);
if (p == NULL)
sprintf (temp0, "None");
@@ -1308,9 +1281,8 @@ int atcommand_whogroup (const int fd, struct map_session_data *sd,
sprintf (temp0, "%s", p->name);
if (pl_GM_level > 0)
sprintf (output,
- "Name: %s (GM:%d) | Party: '%s' | Guild: '%s'",
- pl_sd->status.name, pl_GM_level, temp0,
- temp1);
+ "Name: %s (GM:%d) | Party: '%s'",
+ pl_sd->status.name, pl_GM_level, temp0);
else
sprintf (output,
"Name: %s | Party: '%s' | Guild: '%s'",
@@ -1415,18 +1387,15 @@ int atcommand_whomapgroup (const int fd, struct map_session_data *sd,
const char *command, const char *message)
{
char temp0[100];
- char temp1[100];
char output[200];
struct map_session_data *pl_sd;
int i, count;
int pl_GM_level, GM_level;
int map_id = 0;
char map_name[100];
- struct guild *g;
struct party *p;
memset (temp0, '\0', sizeof (temp0));
- memset (temp1, '\0', sizeof (temp1));
memset (output, '\0', sizeof (output));
memset (map_name, '\0', sizeof (map_name));
@@ -1453,14 +1422,10 @@ int atcommand_whomapgroup (const int fd, struct map_session_data *sd,
((battle_config.hide_GM_session
|| (pl_sd->status.option & OPTION_HIDE))
&& (pl_GM_level > GM_level)))
- { // you can look only lower or same level
+ {
+ // you can look only lower or same level
if (pl_sd->bl.m == map_id)
{
- g = guild_search (pl_sd->status.guild_id);
- if (g == NULL)
- sprintf (temp1, "None");
- else
- sprintf (temp1, "%s", g->name);
p = party_search (pl_sd->status.party_id);
if (p == NULL)
sprintf (temp0, "None");
@@ -1468,13 +1433,12 @@ int atcommand_whomapgroup (const int fd, struct map_session_data *sd,
sprintf (temp0, "%s", p->name);
if (pl_GM_level > 0)
sprintf (output,
- "Name: %s (GM:%d) | Party: '%s' | Guild: '%s'",
- pl_sd->status.name, pl_GM_level, temp0,
- temp1);
+ "Name: %s (GM:%d) | Party: '%s'",
+ pl_sd->status.name, pl_GM_level, temp0);
else
sprintf (output,
- "Name: %s | Party: '%s' | Guild: '%s'",
- pl_sd->status.name, temp0, temp1);
+ "Name: %s | Party: '%s'",
+ pl_sd->status.name, temp0);
clif_displaymessage (fd, output);
count++;
}
@@ -1503,18 +1467,15 @@ int atcommand_whogm (const int fd, struct map_session_data *sd,
const char *command, const char *message)
{
char temp0[100];
- char temp1[100];
char output[200];
struct map_session_data *pl_sd;
int i, j, count;
int pl_GM_level, GM_level;
char match_text[100];
char player_name[24];
- struct guild *g;
struct party *p;
memset (temp0, '\0', sizeof (temp0));
- memset (temp1, '\0', sizeof (temp1));
memset (output, '\0', sizeof (output));
memset (match_text, '\0', sizeof (match_text));
memset (player_name, '\0', sizeof (player_name));
@@ -1555,18 +1516,13 @@ int atcommand_whogm (const int fd, struct map_session_data *sd,
job_name (pl_sd->status.pc_class),
pl_sd->status.job_level);
clif_displaymessage (fd, output);
- g = guild_search (pl_sd->status.guild_id);
- if (g == NULL)
- sprintf (temp1, "None");
- else
- sprintf (temp1, "%s", g->name);
p = party_search (pl_sd->status.party_id);
if (p == NULL)
sprintf (temp0, "None");
else
sprintf (temp0, "%s", p->name);
- sprintf (output, " Party: '%s' | Guild: '%s'",
- temp0, temp1);
+ sprintf (output, " Party: '%s'",
+ temp0);
clif_displaymessage (fd, output);
count++;
}
@@ -1689,7 +1645,7 @@ int atcommand_storage (const int fd, struct map_session_data *sd,
struct storage *stor; //changes from Freya/Yor
nullpo_retr (-1, sd);
- if (sd->state.storage_flag)
+ if (sd->state.storage_open)
{
clif_displaymessage (fd, "msg_table[250]");
return -1;
@@ -1711,40 +1667,6 @@ int atcommand_storage (const int fd, struct map_session_data *sd,
*
*------------------------------------------
*/
-int atcommand_guildstorage (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- struct storage *stor; //changes from Freya/Yor
- nullpo_retr (-1, sd);
-
- if (sd->status.guild_id > 0)
- {
- if (sd->state.storage_flag)
- {
- clif_displaymessage (fd, "msg_table[251]");
- return -1;
- }
- if ((stor = account2storage2 (sd->status.account_id)) != NULL
- && stor->storage_status == 1)
- {
- clif_displaymessage (fd, "msg_table[251]");
- return -1;
- }
- storage_guild_storageopen (sd);
- }
- else
- {
- clif_displaymessage (fd, "msg_table[252]");
- return -1;
- }
-
- return 0;
-}
-
-/*==========================================
- *
- *------------------------------------------
- */
int atcommand_option (const int fd, struct map_session_data *sd,
const char *command, const char *message)
{
@@ -2384,50 +2306,6 @@ int atcommand_pvpon (const int fd, struct map_session_data *sd,
*
*------------------------------------------
*/
-int atcommand_gvgoff (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- if (map[sd->bl.m].flag.gvg)
- {
- map[sd->bl.m].flag.gvg = 0;
- clif_send0199 (sd->bl.m, 0);
- clif_displaymessage (fd, "GvG: Off.");
- }
- else
- {
- clif_displaymessage (fd, "GvG is already Off.");
- return -1;
- }
-
- return 0;
-}
-
-/*==========================================
- *
- *------------------------------------------
- */
-int atcommand_gvgon (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- if (!map[sd->bl.m].flag.gvg)
- {
- map[sd->bl.m].flag.gvg = 1;
- clif_send0199 (sd->bl.m, 3);
- clif_displaymessage (fd, "GvG: On.");
- }
- else
- {
- clif_displaymessage (fd, "GvG is already On.");
- return -1;
- }
-
- return 0;
-}
-
-/*==========================================
- *
- *------------------------------------------
- */
int atcommand_model (const int fd, struct map_session_data *sd,
const char *command, const char *message)
{
@@ -3510,58 +3388,6 @@ int atcommand_all_stats (const int fd, struct map_session_data *sd,
*
*------------------------------------------
*/
-int atcommand_guildlevelup (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- int level = 0;
- short added_level;
- struct guild *guild_info;
-
- if (!message || !*message || sscanf (message, "%d", &level) < 1
- || level == 0)
- {
- clif_displaymessage (fd,
- "Please, enter a valid level (usage: @guildlvl <# of levels>).");
- return -1;
- }
-
- if (sd->status.guild_id <= 0
- || (guild_info = guild_search (sd->status.guild_id)) == NULL)
- {
- clif_displaymessage (fd, "You're not in a guild.");
- return -1;
- }
- if (strcmp (sd->status.name, guild_info->master) != 0)
- {
- clif_displaymessage (fd, "You're not the master of your guild.");
- return -1;
- }
-
- added_level = (short) level;
- if (level > 0 && (level > MAX_GUILDLEVEL || added_level > ((short) MAX_GUILDLEVEL - guild_info->guild_lv))) // fix positiv overflow
- added_level = (short) MAX_GUILDLEVEL - guild_info->guild_lv;
- else if (level < 0 && (level < -MAX_GUILDLEVEL || added_level < (1 - guild_info->guild_lv))) // fix negativ overflow
- added_level = 1 - guild_info->guild_lv;
-
- if (added_level != 0)
- {
- intif_guild_change_basicinfo (guild_info->guild_id, GBI_GUILDLV,
- &added_level, 2);
- clif_displaymessage (fd, "Guild level changed.");
- }
- else
- {
- clif_displaymessage (fd, "Guild level change failed.");
- return -1;
- }
-
- return 0;
-}
-
-/*==========================================
- *
- *------------------------------------------
- */
int atcommand_recall (const int fd, struct map_session_data *sd,
const char *command, const char *message)
{
@@ -4891,73 +4717,6 @@ int atcommand_party (const int fd, struct map_session_data *sd,
}
/*==========================================
- *
- *------------------------------------------
- */
-int atcommand_guild (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- char guild[100];
- int prev;
-
- memset (guild, '\0', sizeof (guild));
-
- if (!message || !*message || sscanf (message, "%99[^\n]", guild) < 1)
- {
- clif_displaymessage (fd,
- "Please, enter a guild name (usage: @guild <guild_name>).");
- return -1;
- }
-
- prev = battle_config.guild_emperium_check;
- battle_config.guild_emperium_check = 0;
- guild_create (sd, guild);
- battle_config.guild_emperium_check = prev;
-
- return 0;
-}
-
-/*==========================================
- *
- *------------------------------------------
- */
-int atcommand_agitstart (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- if (agit_flag == 1)
- {
- clif_displaymessage (fd, "Already it has started siege warfare.");
- return -1;
- }
-
- agit_flag = 1;
- guild_agit_start ();
- clif_displaymessage (fd, "Guild siege warfare start!");
-
- return 0;
-}
-
-/*==========================================
- *
- *------------------------------------------
- */
-int atcommand_agitend (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- if (agit_flag == 0)
- {
- clif_displaymessage (fd, "Siege warfare hasn't started yet.");
- return -1;
- }
-
- agit_flag = 0;
- guild_agit_end ();
- clif_displaymessage (fd, "Guild siege warfare end!");
-
- return 0;
-}
-
-/*==========================================
* @mapexitでマップサーバーを終了させる
*------------------------------------------
*/
@@ -5525,75 +5284,6 @@ int atcommand_recallall (const int fd, struct map_session_data *sd,
}
/*==========================================
- * Recall online characters of a guild to your location
- *------------------------------------------
- */
-int atcommand_guildrecall (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- struct map_session_data *pl_sd;
- int i;
- char guild_name[100];
- char output[200];
- struct guild *g;
- int count;
-
- memset (guild_name, '\0', sizeof (guild_name));
- memset (output, '\0', sizeof (output));
-
- if (!message || !*message || sscanf (message, "%99[^\n]", guild_name) < 1)
- {
- clif_displaymessage (fd,
- "Please, enter a guild name/id (usage: @guildrecall <guild_name/id>).");
- return -1;
- }
-
- if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto
- && battle_config.any_warp_GM_min_level > pc_isGM (sd))
- {
- clif_displaymessage (fd,
- "You are not authorised to warp somenone to your actual map.");
- return -1;
- }
-
- if ((g = guild_searchname (guild_name)) != NULL || // name first to avoid error when name begin with a number
- (g = guild_search (atoi (message))) != NULL)
- {
- count = 0;
- for (i = 0; i < fd_max; i++)
- {
- if (session[i] && (pl_sd = (struct map_session_data *)session[i]->session_data)
- && pl_sd->state.auth
- && sd->status.account_id != pl_sd->status.account_id
- && pl_sd->status.guild_id == g->guild_id)
- {
- if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp
- && battle_config.any_warp_GM_min_level > pc_isGM (sd))
- count++;
- else
- pc_setpos (pl_sd, sd->mapname, sd->bl.x, sd->bl.y, 2);
- }
- }
- sprintf (output, "All online characters of the %s guild are near you.", g->name);
- clif_displaymessage (fd, output);
- if (count)
- {
- sprintf (output,
- "Because you are not authorised to warp from some maps, %d player(s) have not been recalled.",
- count);
- clif_displaymessage (fd, output);
- }
- }
- else
- {
- clif_displaymessage (fd, "Incorrect name/ID, or no one from the guild is online.");
- return -1;
- }
-
- return 0;
-}
-
-/*==========================================
* Recall online characters of a party to your location
*------------------------------------------
*/
@@ -5796,15 +5486,10 @@ int atcommand_mapinfo (const int fd, struct map_session_data *sd,
sprintf (output, "Chats In Map: %d", chat_num);
clif_displaymessage (fd, output);
clif_displaymessage (fd, "------ Map Flags ------");
- sprintf (output, "Player vs Player: %s | No Guild: %s | No Party: %s",
+ sprintf (output, "Player vs Player: %s | No Party: %s",
(map[m_id].flag.pvp) ? "True" : "False",
- (map[m_id].flag.pvp_noguild) ? "True" : "False",
(map[m_id].flag.pvp_noparty) ? "True" : "False");
clif_displaymessage (fd, output);
- sprintf (output, "Guild vs Guild: %s | No Party: %s",
- (map[m_id].flag.gvg) ? "True" : "False",
- (map[m_id].flag.gvg_noparty) ? "True" : "False");
- clif_displaymessage (fd, output);
sprintf (output, "No Dead Branch: %s",
(map[m_id].flag.nobranch) ? "True" : "False");
clif_displaymessage (fd, output);
@@ -6056,52 +5741,6 @@ int atcommand_char_mount_peco (const int fd, struct map_session_data *sd,
*Spy Commands by Syrus22
*------------------------------------------
*/
-int atcommand_guildspy (const int fd, struct map_session_data *sd,
- const char *command, const char *message)
-{
- char guild_name[100];
- char output[200];
- struct guild *g;
-
- memset (guild_name, '\0', sizeof (guild_name));
- memset (output, '\0', sizeof (output));
-
- if (!message || !*message || sscanf (message, "%99[^\n]", guild_name) < 1)
- {
- clif_displaymessage (fd,
- "Please, enter a guild name/id (usage: @guildspy <guild_name/id>).");
- return -1;
- }
-
- if ((g = guild_searchname (guild_name)) != NULL || // name first to avoid error when name begin with a number
- (g = guild_search (atoi (message))) != NULL)
- {
- if (sd->guildspy == g->guild_id)
- {
- sd->guildspy = 0;
- sprintf (output, "No longer spying on the %s guild.", g->name);
- clif_displaymessage (fd, output);
- }
- else
- {
- sd->guildspy = g->guild_id;
- sprintf (output, "Spying on the %s guild.", g->name);
- clif_displaymessage (fd, output);
- }
- }
- else
- {
- clif_displaymessage (fd, "Incorrect name/ID, or no one from the guild is online.");
- return -1;
- }
-
- return 0;
-}
-
-/*==========================================
- *
- *------------------------------------------
- */
int atcommand_partyspy (const int fd, struct map_session_data *sd,
const char *command, const char *message)
{
@@ -7784,7 +7423,7 @@ atcommand_storeall (const int fd, struct map_session_data *sd,
int i;
nullpo_retr (-1, sd);
- if (sd->state.storage_flag != 1)
+ if (!sd->state.storage_open)
{ //Open storage.
switch (storage_storageopen (sd))
{