-
Posts
194 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Diana
-
roBrowser (Ragnarök Online in Browser) Stopped working? I cant download or access the files of it : https://github.com/vthibault/roBrowser/archive/master.zip https://github.com/vthibault/roBrowser
-
I tried to enable rodex in english language but in the grf there're 2 folders for rodex ( 1 have english translation and 1 in Korean language ) that's a screenshot of it : how can i make rodex use the renewal rodex ( the english one ) ??
-
I edited it and the same error there
-
I just install the latest rAthena server on my CentOS 6 I followed the guide here and that's my src/map/atcommand.c // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #include "../common/cbasetypes.h" #include "../common/mmo.h" #include "../common/timer.h" #include "../common/nullpo.h" #include "../common/showmsg.h" #include "../common/malloc.h" #include "../common/random.h" #include "../common/socket.h" #include "../common/strlib.h" #include "../common/utils.h" #include "../common/conf.h" #include "map.h" #include "atcommand.h" #include "battle.h" #include "chat.h" #include "channel.h" #include "chrif.h" #include "duel.h" #include "instance.h" #include "intif.h" #include "pet.h" #include "homunculus.h" #include "mail.h" #include "mercenary.h" #include "elemental.h" #include "party.h" #include "script.h" #include "storage.h" #include "trade.h" #include "mapreg.h" #include "quest.h" #include "pc.h" #include "achievement.h" #include <stdlib.h> #include <math.h> #define ATCOMMAND_LENGTH 50 #define ACMD_FUNC(x) static int atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message) typedef struct AtCommandInfo AtCommandInfo; typedef struct AliasInfo AliasInfo; int atcmd_binding_count = 0; /// Atcommand restriction usage enum e_atcmd_restict { ATCMD_NOCONSOLE = 0x1, /// Cannot be used via console (is_atcommand type 2) ATCMD_NOSCRIPT = 0x2, /// Cannot be used via script command 'atcommand' or 'useatcmd' (is_atcommand type 0 and 3) ATCMD_NOAUTOTRADE = 0x4, /// Like ATCMD_NOSCRIPT, but if the player is autotrader. Example: atcommand "@kick "+strcharinfo(0); }; struct AtCommandInfo { char command[ATCOMMAND_LENGTH]; AtCommandFunc func; char* at_groups; /// Quick @commands "can-use" lookup char* char_groups; /// Quick @charcommands "can-use" lookup uint8 restriction; /// Restrictions see enum e_restict }; struct AliasInfo { AtCommandInfo *command; char alias[ATCOMMAND_LENGTH]; }; char atcommand_symbol = '@'; // first char of the commands char charcommand_symbol = '#'; static DBMap* atcommand_db = NULL; //name -> AtCommandInfo static DBMap* atcommand_alias_db = NULL; //alias -> AtCommandInfo static config_t atcommand_config; static char atcmd_output[CHAT_SIZE_MAX]; static char atcmd_player_name[NAME_LENGTH]; const char *parent_cmd; struct atcmd_binding_data** atcmd_binding; static AtCommandInfo* get_atcommandinfo_byname(const char *name); // @help static const char* atcommand_checkalias(const char *aliasname); // @help static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand); // @help static void warp_get_suggestions(struct map_session_data* sd, const char *name); // @rura, @warp, @mapmove // @commands (script-based) struct atcmd_binding_data* get_atcommandbind_byname(const char* name) { int i = 0; if( *name == atcommand_symbol || *name == charcommand_symbol ) name++; // for backwards compatibility ARR_FIND( 0, atcmd_binding_count, i, strcmpi(atcmd_binding[i]->command, name) == 0 ); return ( i < atcmd_binding_count ) ? atcmd_binding[i] : NULL; } /** * retrieves the help string associated with a given command. * * @param name the name of the command to retrieve help information for * @return the string associated with the command, or NULL */ static const char* atcommand_help_string(const char* command) { const char* str = NULL; config_setting_t* info; if( *command == atcommand_symbol || *command == charcommand_symbol ) {// remove the prefix symbol for the raw name of the command command ++; } // convert alias to the real command name command = atcommand_checkalias(command); // attempt to find the first default help command info = config_lookup(&atcommand_config, "help"); if( info == NULL ) {// failed to find the help property in the configuration file return NULL; } if( !config_setting_lookup_string( info, command, &str ) ) {// failed to find the matching help string return NULL; } // push the result from the method return str; } /*========================================== * @send (used for testing packet sends from the client) *------------------------------------------*/ ACMD_FUNC(send) { int len=0,type; // read message type as hex number (without the 0x) if(!message || !*message || !((sscanf(message, "len %8x", &type)==1 && (len=1)) || sscanf(message, "%8x", &type)==1) ) { int i; for (i = 900; i <= 903; ++i) clif_displaymessage(fd, msg_txt(sd,i)); return -1; } #define PARSE_ERROR(error,p) \ {\ clif_displaymessage(fd, (error));\ sprintf(atcmd_output, ">%s", (p));\ clif_displaymessage(fd, atcmd_output);\ } //define PARSE_ERROR #define CHECK_EOS(p) \ if(*(p) == 0){\ clif_displaymessage(fd, "Unexpected end of string");\ return -1;\ } //define CHECK_EOS #define SKIP_VALUE(p) \ {\ while(*(p) && !ISSPACE(*(p))) ++(p); /* non-space */\ while(*(p) && ISSPACE(*(p))) ++(p); /* space */\ } //define SKIP_VALUE #define GET_VALUE(p,num) \ {\ if(sscanf((p), "x%16lx", &(num)) < 1 && sscanf((p), "%20ld ", &(num)) < 1){\ PARSE_ERROR("Invalid number in:",(p));\ return -1;\ }\ } //define GET_VALUE if (type > 0 && type < MAX_PACKET_DB) { int off,end; long num; if(len) {// show packet length sprintf(atcmd_output, msg_txt(sd,904), type, packet_db[type].len); // Packet 0x%x length: %d clif_displaymessage(fd, atcmd_output); return 0; } len=packet_db[type].len; off=2; if(len == 0) {// unknown packet - ERROR sprintf(atcmd_output, msg_txt(sd,905), type); // Unknown packet: 0x%x clif_displaymessage(fd, atcmd_output); return -1; } else if(len == -1) {// dynamic packet len=SHRT_MAX-4; // maximum length off=4; } WFIFOHEAD(fd, len); WFIFOW(fd,0)=TOW(type); // parse packet contents SKIP_VALUE(message); while(*message != 0 && off < len){ if(ISDIGIT(*message) || *message == '-' || *message == '+') {// default (byte) GET_VALUE(message,num); WFIFOB(fd,off)=TOB(num); ++off; } else if(TOUPPER(*message) == 'B') {// byte ++message; GET_VALUE(message,num); WFIFOB(fd,off)=TOB(num); ++off; } else if(TOUPPER(*message) == 'W') {// word (2 bytes) ++message; GET_VALUE(message,num); WFIFOW(fd,off)=TOW(num); off+=2; } else if(TOUPPER(*message) == 'L') {// long word (4 bytes) ++message; GET_VALUE(message,num); WFIFOL(fd,off)=TOL(num); off+=4; } else if(TOUPPER(*message) == 'S') {// string - escapes are valid // get string length - num <= 0 means not fixed length (default) ++message; if(*message == '"'){ num=0; } else { GET_VALUE(message,num); while(*message != '"') {// find start of string if(*message == 0 || ISSPACE(*message)){ PARSE_ERROR(msg_txt(sd,906),message); // Not a string: return -1; } ++message; } } // parse string ++message; CHECK_EOS(message); end=(num<=0? 0: min(off+((int)num),len)); for(; *message != '"' && (off < end || end == 0); ++off){ if(*message == '\\'){ ++message; CHECK_EOS(message); switch(*message){ case 'a': num=0x07; break; // Bell case 'b': num=0x08; break; // Backspace case 't': num=0x09; break; // Horizontal tab case 'n': num=0x0A; break; // Line feed case 'v': num=0x0B; break; // Vertical tab case 'f': num=0x0C; break; // Form feed case 'r': num=0x0D; break; // Carriage return case 'e': num=0x1B; break; // Escape default: num=*message; break; case 'x': // Hexadecimal { ++message; CHECK_EOS(message); if(!ISXDIGIT(*message)){ PARSE_ERROR(msg_txt(sd,907),message); // Not a hexadecimal digit: return -1; } num=(ISDIGIT(*message)?*message-'0':TOLOWER(*message)-'a'+10); if(ISXDIGIT(*message)){ ++message; CHECK_EOS(message); num<<=8; num+=(ISDIGIT(*message)?*message-'0':TOLOWER(*message)-'a'+10); } WFIFOB(fd,off)=TOB(num); ++message; CHECK_EOS(message); continue; } case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': // Octal { num=*message-'0'; // 1st octal digit ++message; CHECK_EOS(message); if(ISDIGIT(*message) && *message < '8'){ num<<=3; num+=*message-'0'; // 2nd octal digit ++message; CHECK_EOS(message); if(ISDIGIT(*message) && *message < '8'){ num<<=3; num+=*message-'0'; // 3rd octal digit ++message; CHECK_EOS(message); } } WFIFOB(fd,off)=TOB(num); continue; } } } else num=*message; WFIFOB(fd,off)=TOB(num); ++message; CHECK_EOS(message); }//for while(*message != '"') {// ignore extra characters ++message; CHECK_EOS(message); } // terminate the string if(off < end) {// fill the rest with 0's memset(WFIFOP(fd,off),0,end-off); off=end; } } else {// unknown PARSE_ERROR(msg_txt(sd,908),message); // Unknown type of value in: return -1; } SKIP_VALUE(message); } if(packet_db[type].len == -1) {// send dynamic packet WFIFOW(fd,2)=TOW(off); WFIFOSET(fd,off); } else {// send static packet if(off < len) memset(WFIFOP(fd,off),0,len-off); WFIFOSET(fd,len); } } else { clif_displaymessage(fd, msg_txt(sd,259)); // Invalid packet return -1; } sprintf (atcmd_output, msg_txt(sd,258), type, type); // Sent packet 0x%x (%d) clif_displaymessage(fd, atcmd_output); return 0; #undef PARSE_ERROR #undef CHECK_EOS #undef SKIP_VALUE #undef GET_VALUE } /** * Retrieves map name suggestions for a given string. * This will first check if any map names contain the given string, and will * print out MAX_SUGGESTIONS results if any maps are found. * Otherwise, suggestions will be calculated through Levenshtein distance, * and up to 5 of the closest matches will be printed. * * @author Euphy */ static void warp_get_suggestions(struct map_session_data* sd, const char *name) { char buffer[512]; int i, count = 0; if (strlen(name) < 2) return; // build the suggestion string strcpy(buffer, msg_txt(sd, 205)); // Maybe you meant: strcat(buffer, "\n"); // check for maps that contain string for (i = 0; i < MAX_MAP_PER_SERVER; i++) { if (count < MAX_SUGGESTIONS && strstr(map[i].name, name) != NULL) { strcat(buffer, map[i].name); strcat(buffer, " "); if (++count >= MAX_SUGGESTIONS) break; } } // if no maps found, search by edit distance if (!count) { unsigned int distance[MAX_MAP_PER_SERVER][2]; int j; // calculate Levenshtein distance for all maps for (i = 0; i < MAX_MAP_PER_SERVER; i++) { if (strlen(map[i].name) < 4) // invalid map name? distance[i][0] = INT_MAX; else { distance[i][0] = levenshtein(map[i].name, name); distance[i][1] = i; } } // selection sort elements as needed count = min(MAX_SUGGESTIONS, 5); // results past 5 aren't worth showing for (i = 0; i < count; i++) { int min = i; for (j = i+1; j < MAX_MAP_PER_SERVER; j++) { if (distance[j][0] < distance[min][0]) min = j; } // print map name if (distance[min][0] > 4) { // awful results, don't bother if (!i) return; break; } strcat(buffer, map[distance[min][1]].name); strcat(buffer, " "); // swap elements SWAP(distance[i][0], distance[min][0]); SWAP(distance[i][1], distance[min][1]); } } clif_displaymessage(sd->fd, buffer); } Members 19 244 posts Report post Posted June 14, 2012 hi this is whosell source.. this source credit to people who make it, i just edit it :D add this at src/map/atcommand.c /*========================================== * @whosell - List who is vending the item (amount, price, and location). * revamped by VoidLess, original by zephyrus_cr *------------------------------------------*/ ACMD_FUNC(whosell) { char item_name[100]; int item_id = 0, j, count = 0, sat_num = 0; int s_type = 1; // search bitmask: 0-name,1-id, 2-card, 4-refine int refine = 0,card_id = 0; bool flag = 0; // place dot on the minimap? struct map_session_data* pl_sd; struct s_mapiterator* iter; unsigned int MinPrice = battle_config.vending_max_value, MaxPrice = 0; struct item_data *item_data; nullpo_retr(-1, sd); if (!message || !*message) { clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>"); return -1; } if (sscanf(message, "+%d %d[%d]", &refine, &item_id, &card_id) == 3){ s_type = 1+2+4; } else if (sscanf(message, "+%d %d", &refine, &item_id) == 2){ s_type = 1+4; } else if (sscanf(message, "+%d [%d]", &refine, &card_id) == 2){ s_type = 2+4; } else if (sscanf(message, "%d[%d]", &item_id, &card_id) == 2){ s_type = 1+2; } else if (sscanf(message, "[%d]", &card_id) == 1){ s_type = 2; } else if (sscanf(message, "+%d", &refine) == 1){ s_type = 4; } else if (sscanf(message, "%d", &item_id) == 1 && item_id == atoi(message)){ //names, that start on num are not working //so implemented minumum item_id>500 //or better make item_id == atoi(message) ? s_type = 1; } else if (sscanf(message, "%99[^\n]", item_name) == 1){ s_type = 1; if ((item_data = itemdb_searchname(item_name)) == NULL){ clif_displaymessage(fd, "Not found item with this name"); return -1; } item_id = item_data->nameid; } else { clif_displaymessage(fd, "Use: @whosell (<+refine> )(<item_id>)(<[card_id]>) or @whosell <name>"); return -1; } //check card if(s_type & 2 && ((item_data = itemdb_exists(card_id)) == NULL || item_data->type != IT_CARD)){ clif_displaymessage(fd, "Not found a card with than ID"); return -1; } //check item if(s_type & 1 && (item_data = itemdb_exists(item_id)) == NULL){ clif_displaymessage(fd, "Not found an item with than ID"); return -1; } //check refine if(s_type & 4){ if (refine<0 || refine>10){ clif_displaymessage(fd, "Refine out of bounds: 0 - 10"); return -1; } /*if(item_data->type != IT_WEAPON && item_data->type != IT_ARMOR){ clif_displaymessage(fd, "Use refine only with weapon or armor"); return -1; }*/ } iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if( pl_sd->vender_id ) //check if player is vending { for (j = 0; j < pl_sd->vend_num; j++) { if((item_data = itemdb_exists(pl_sd->status.cart[pl_sd->vending[j].index].nameid)) == NULL) continue; if(s_type & 1 && pl_sd->status.cart[pl_sd->vending[j].index].nameid != item_id) continue; if(s_type & 2 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || (pl_sd->status.cart[pl_sd->vending[j].index].card[0] != card_id && pl_sd->status.cart[pl_sd->vending[j].index].card[1] != card_id && pl_sd->status.cart[pl_sd->vending[j].index].card[2] != card_id && pl_sd->status.cart[pl_sd->vending[j].index].card[3] != card_id))) continue; if(s_type & 4 && ((item_data->type != IT_ARMOR && item_data->type != IT_WEAPON) || pl_sd->status.cart[pl_sd->vending[j].index].refine != refine)) continue; if(item_data->type == IT_ARMOR) snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",pl_sd->status.cart[pl_sd->vending[j].index].refine ,pl_sd->status.cart[pl_sd->vending[j].index].nameid ,pl_sd->status.cart[pl_sd->vending[j].index].card[0] ,pl_sd->vending[j].value ,pl_sd->vending[j].amount ,mapindex_id2name(pl_sd->mapindex) ,pl_sd->bl.x,pl_sd->bl.y ,pl_sd->status.name); else if(item_data->type == IT_WEAPON) snprintf(atcmd_output, CHAT_SIZE_MAX, "+%d %d[%d,%d,%d,%d] | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",pl_sd->status.cart[pl_sd->vending[j].index].refine ,pl_sd->status.cart[pl_sd->vending[j].index].nameid ,pl_sd->status.cart[pl_sd->vending[j].index].card[0] ,pl_sd->status.cart[pl_sd->vending[j].index].card[1] ,pl_sd->status.cart[pl_sd->vending[j].index].card[2] ,pl_sd->status.cart[pl_sd->vending[j].index].card[3] ,pl_sd->vending[j].value ,pl_sd->vending[j].amount ,mapindex_id2name(pl_sd->mapindex) ,pl_sd->bl.x,pl_sd->bl.y ,pl_sd->status.name); else snprintf(atcmd_output, CHAT_SIZE_MAX, "ID %d | Price %d | Amount %d | Map %s[%d,%d] | Seller %s",pl_sd->status.cart[pl_sd->vending[j].index].nameid ,pl_sd->vending[j].value ,pl_sd->vending[j].amount ,mapindex_id2name(pl_sd->mapindex) ,pl_sd->bl.x, pl_sd->bl.y ,pl_sd->status.name); if(pl_sd->vending[j].value < MinPrice) MinPrice = pl_sd->vending[j].value; if(pl_sd->vending[j].value > MaxPrice) MaxPrice = pl_sd->vending[j].value; clif_displaymessage(fd, atcmd_output); count++; flag = 1; } if(flag && pl_sd->mapindex == sd->mapindex){ clif_viewpoint(sd, 1, 1, pl_sd->bl.x, pl_sd->bl.y, ++sat_num, 0xFFFFFF); flag = 0; } } } mapit_free(iter); if(count > 0) { snprintf(atcmd_output,CHAT_SIZE_MAX, "Found %d ea. Prices from %dz to %dz", count, MinPrice, MaxPrice); clif_displaymessage(fd, atcmd_output); } else clif_displaymessage(fd, "Nobody is selling it now."); return 0; } /*========================================== * @rura, @warp, @mapmove *------------------------------------------*/ ACMD_FUNC(mapmove) { char map_name[MAP_NAME_LENGTH_EXT]; unsigned short mapindex; short x = 0, y = 0; int16 m = -1; nullpo_retr(-1, sd); memset(map_name, '\0', sizeof(map_name)); if (!message || !*message || (sscanf(message, "%15s %6hd %6hd", map_name, &x, &y) < 3 && sscanf(message, "%15[^,],%6hd,%6hd", map_name, &x, &y) < 1)) { clif_displaymessage(fd, msg_txt(sd,909)); // Please enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>). return -1; } mapindex = mapindex_name2id(map_name); if (mapindex) m = map_mapindex2mapid(mapindex); if (!mapindex) { // m < 0 means on different server! [Kevin] clif_displaymessage(fd, msg_txt(sd,1)); // Map not found. if (battle_config.warp_suggestions_enabled) warp_get_suggestions(sd, map_name); return -1; } if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS)) { //This is to prevent the pc_setpos call from printing an error. clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell. if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } if ((map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) || !pc_job_can_entermap((enum e_job)sd->status.class_, m, sd->group_level)) { clif_displaymessage(fd, msg_txt(sd,247)); // You are not authorized to warp to this map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map. return -1; } if (pc_setpos(sd, mapindex, x, y, CLR_TELEPORT) != SETPOS_OK) { clif_displaymessage(fd, msg_txt(sd,1)); // Map not found. return -1; } clif_displaymessage(fd, msg_txt(sd,0)); // Warped. return 0; } /*========================================== * Displays where a character is. Corrected version by Silent. [Skotlex] *------------------------------------------*/ ACMD_FUNC(where) { struct map_session_data* pl_sd; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof atcmd_player_name); if (!message || !*message || sscanf(message, "%23s[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,910)); // Please enter a player name (usage: @where <char name>). return -1; } pl_sd = map_nick2sd(atcmd_player_name,true); if (pl_sd == NULL || strncmp(pl_sd->status.name, atcmd_player_name, NAME_LENGTH) != 0 || (pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) && pc_get_group_level(pl_sd) > pc_get_group_level(sd) && !pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) ) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } snprintf(atcmd_output, sizeof atcmd_output, "%s %s %d %d", pl_sd->status.name, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(jumpto) { struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,911)); // Please enter a player name (usage: @jumpto/@warpto/@goto <char name/ID>). return -1; } if((pl_sd=map_nick2sd(atcmd_player_name,true)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,247)); // You are not authorized to warp to this map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map. return -1; } if( pc_isdead(sd) ) { clif_displaymessage(fd, msg_txt(sd,664)); // You cannot use this command when dead. return -1; } pc_setpos(sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(sd,4), pl_sd->status.name); // Jumped to %s clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(jump) { short x = 0, y = 0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); sscanf(message, "%6hd %6hd", &x, &y); if (map[sd->bl.m].flag.noteleport && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map. return -1; } if( pc_isdead(sd) ) { clif_displaymessage(fd, msg_txt(sd,664)); // You cannot use this command when dead. return -1; } if ((x || y) && map_getcell(sd->bl.m, x, y, CELL_CHKNOPASS)) { //This is to prevent the pc_setpos call from printing an error. clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell. if (!map_search_freecell(NULL, sd->bl.m, &x, &y, 10, 10, 1)) x = y = 0; //Invalid cell, use random spot. } pc_setpos(sd, sd->mapindex, x, y, CLR_TELEPORT); sprintf(atcmd_output, msg_txt(sd,5), sd->bl.x, sd->bl.y); // Jumped to %d %d clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * Display list of online characters with * various info. *------------------------------------------*/ ACMD_FUNC(who) { struct map_session_data *pl_sd = NULL; struct s_mapiterator *iter = NULL; char player_name[NAME_LENGTH] = ""; int count = 0; int level = 0; StringBuf buf; /** * 1 = @who : Player name, [Title], [Party name], [Guild name] * 2 = @who2 : Player name, [Title], BLvl, JLvl, Job * 3 = @who3 : [CID/AID] Player name [Title], Map, X, Y */ int display_type = 1; int map_id = -1; nullpo_retr(-1, sd); if (strstr(command, "map") != NULL) { char map_name[MAP_NAME_LENGTH_EXT] = ""; if (sscanf(message, "%15s %23s", map_name, player_name) < 1 || (map_id = map_mapname2mapid(map_name)) < 0) map_id = sd->bl.m; } else { sscanf(message, "%23s", player_name); } if (strstr(command, "2") != NULL) display_type = 2; else if (strstr(command, "3") != NULL) display_type = 3; level = pc_get_group_level(sd); StringBuf_Init(&buf); iter = mapit_getallusers(); for (pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter)) { if (!((pc_has_permission(pl_sd, PC_PERM_HIDE_SESSION) || pc_isinvisible(pl_sd)) && pc_get_group_level(pl_sd) > level)) { // you can look only lower or same level if (stristr(pl_sd->status.name, player_name) == NULL // search with no case sensitive || (map_id >= 0 && pl_sd->bl.m != map_id)) continue; switch (display_type) { case 2: { StringBuf_Printf(&buf, msg_txt(sd,343), pl_sd->status.name); // "Name: %s " if (pc_get_group_id(pl_sd) > 0) // Player title, if exists StringBuf_Printf(&buf, msg_txt(sd,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " StringBuf_Printf(&buf, msg_txt(sd,347), pl_sd->status.base_level, pl_sd->status.job_level, job_name(pl_sd->status.class_)); // "| Lv:%d/%d | Job: %s" break; } case 3: { if (pc_has_permission(sd, PC_PERM_WHO_DISPLAY_AID)) StringBuf_Printf(&buf, msg_txt(sd,912), pl_sd->status.char_id, pl_sd->status.account_id); // "(CID:%d/AID:%d) " StringBuf_Printf(&buf, msg_txt(sd,343), pl_sd->status.name); // "Name: %s " if (pc_get_group_id(pl_sd) > 0) // Player title, if exists StringBuf_Printf(&buf, msg_txt(sd,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " StringBuf_Printf(&buf, msg_txt(sd,348), mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); // "| Location: %s %d %d" break; } default: { struct party_data *p = party_search(pl_sd->status.party_id); struct guild *g = pl_sd->guild; StringBuf_Printf(&buf, msg_txt(sd,343), pl_sd->status.name); // "Name: %s " if (pc_get_group_id(pl_sd) > 0) // Player title, if exists StringBuf_Printf(&buf, msg_txt(sd,344), pc_group_id2name(pc_get_group_id(pl_sd))); // "(%s) " if (p != NULL) StringBuf_Printf(&buf, msg_txt(sd,345), p->party.name); // " | Party: '%s'" if (g != NULL) StringBuf_Printf(&buf, msg_txt(sd,346), g->name); // " | Guild: '%s'" break; } } clif_displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); count++; } } mapit_free(iter); if (map_id < 0) { if (count == 0) StringBuf_Printf(&buf, msg_txt(sd,28)); // No player found. else if (count == 1) StringBuf_Printf(&buf, msg_txt(sd,29)); // 1 player found. else StringBuf_Printf(&buf, msg_txt(sd,30), count); // %d players found. } else { if (count == 0) StringBuf_Printf(&buf, msg_txt(sd,54), map[map_id].name); // No player found in map '%s'. else if (count == 1) StringBuf_Printf(&buf, msg_txt(sd,55), map[map_id].name); // 1 player found in map '%s'. else StringBuf_Printf(&buf, msg_txt(sd,56), count, map[map_id].name); // %d players found in map '%s'. } clif_displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(whogm) { struct map_session_data* pl_sd; struct s_mapiterator* iter; int j, count; int level; char match_text[CHAT_SIZE_MAX]; char player_name[NAME_LENGTH]; struct guild *g; struct party_data *p; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(match_text, '\0', sizeof(match_text)); memset(player_name, '\0', sizeof(player_name)); if (sscanf(message, "%255[^\n]", match_text) < 1) strcpy(match_text, ""); for (j = 0; match_text[j]; j++) match_text[j] = TOLOWER(match_text[j]); count = 0; level = pc_get_group_level(sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { int pl_level = pc_get_group_level(pl_sd); if (!pl_level) continue; if (match_text[0]) { memcpy(player_name, pl_sd->status.name, NAME_LENGTH); for (j = 0; player_name[j]; j++) player_name[j] = TOLOWER(player_name[j]); // search with no case sensitive if (strstr(player_name, match_text) == NULL) continue; } if (pl_level > level) { if (pc_isinvisible(pl_sd)) continue; sprintf(atcmd_output, msg_txt(sd,913), pl_sd->status.name); // Name: %s (GM) clif_displaymessage(fd, atcmd_output); count++; continue; } sprintf(atcmd_output, msg_txt(sd,914), // Name: %s (GM:%d) | Location: %s %d %d pl_sd->status.name, pl_level, mapindex_id2name(pl_sd->mapindex), pl_sd->bl.x, pl_sd->bl.y); clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,915), // BLvl: %d | Job: %s (Lvl: %d) pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level); clif_displaymessage(fd, atcmd_output); p = party_search(pl_sd->status.party_id); g = pl_sd->guild; sprintf(atcmd_output,msg_txt(sd,916), // Party: '%s' | Guild: '%s' p?p->party.name:msg_txt(sd,917), g?g->name:msg_txt(sd,917)); // None. clif_displaymessage(fd, atcmd_output); count++; } mapit_free(iter); if (count == 0) clif_displaymessage(fd, msg_txt(sd,150)); // No GM found. else if (count == 1) clif_displaymessage(fd, msg_txt(sd,151)); // 1 GM found. else { sprintf(atcmd_output, msg_txt(sd,152), count); // %d GMs found. clif_displaymessage(fd, atcmd_output); } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(save) { nullpo_retr(-1, sd); if( map[sd->bl.m].instance_id ) { clif_displaymessage(fd, msg_txt(sd,383)); // You cannot create a savepoint in an instance. return 1; } pc_setsavepoint(sd, sd->mapindex, sd->bl.x, sd->bl.y); if (sd->status.pet_id > 0 && sd->pd) intif_save_petdata(sd->status.account_id, &sd->pd->pet); chrif_save(sd, CSAVE_NORMAL); clif_displaymessage(fd, msg_txt(sd,6)); // Your save point has been changed. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(load) { int16 m; nullpo_retr(-1, sd); m = map_mapindex2mapid(sd->status.save_point.map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,249)); // You are not authorized to warp to your save map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map. return -1; } pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, CLR_OUTSIGHT); clif_displaymessage(fd, msg_txt(sd,7)); // Warping to save point.. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(speed) { short speed; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%6hd", &speed) < 1) { sprintf(atcmd_output, msg_txt(sd,918), MIN_WALK_SPEED, MAX_WALK_SPEED); // Please enter a speed value (usage: @speed <%d-%d>). clif_displaymessage(fd, atcmd_output); return -1; } sd->state.permanent_speed = 0; // Remove lock when set back to default speed. if (speed < 0) sd->base_status.speed = DEFAULT_WALK_SPEED; else sd->base_status.speed = cap_value(speed, MIN_WALK_SPEED, MAX_WALK_SPEED); if (sd->base_status.speed != DEFAULT_WALK_SPEED) { sd->state.permanent_speed = 1; // Set lock when set to non-default speed. clif_displaymessage(fd, msg_txt(sd,8)); // Speed changed. } else clif_displaymessage(fd, msg_txt(sd,389)); // Speed returned to normal. status_calc_bl(&sd->bl, SCB_SPEED); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(storage) { nullpo_retr(-1, sd); if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading || sd->state.storage_flag) return -1; if (storage_storageopen(sd) == 1) { //Already open. clif_displaymessage(fd, msg_txt(sd,250)); // You have already opened your storage. Close it first. return -1; } clif_displaymessage(fd, msg_txt(sd,919)); // Storage opened. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(guildstorage) { nullpo_retr(-1, sd); if (!sd->status.guild_id) { clif_displaymessage(fd, msg_txt(sd,252)); // You are not in a guild. return -1; } if (sd->npc_id || sd->state.vending || sd->state.buyingstore || sd->state.trading) return -1; if (sd->state.storage_flag == 1) { clif_displaymessage(fd, msg_txt(sd,250)); // You have already opened your storage. Close it first. return -1; } if (sd->state.storage_flag == 2) { clif_displaymessage(fd, msg_txt(sd,251)); // You have already opened your guild storage. Close it first. return -1; } if (sd->state.storage_flag == 3) { clif_displaymessage(fd, msg_txt(sd,250)); // You have already opened your storage. Close it first. return -1; } storage_guild_storageopen(sd); clif_displaymessage(fd, msg_txt(sd,920)); // Guild storage opened. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(option) { int param1 = 0, param2 = 0, param3 = 0; nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%11d %11d %11d", ¶m1, ¶m2, ¶m3) < 1 || param1 < 0 || param2 < 0 || param3 < 0) {// failed to match the parameters so inform the user of the options const char* text; // attempt to find the setting information for this command text = atcommand_help_string( command ); // notify the user of the requirement to enter an option clif_displaymessage(fd, msg_txt(sd,921)); // Please enter at least one option. if( text ) {// send the help text associated with this command clif_displaymessage( fd, text ); } return -1; } sd->sc.opt1 = param1; sd->sc.opt2 = param2; pc_setoption(sd, param3); clif_displaymessage(fd, msg_txt(sd,9)); // Options changed. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(hide) { nullpo_retr(-1, sd); if (pc_isinvisible(sd)) { sd->sc.option &= ~OPTION_INVISIBLE; if (sd->disguise) status_set_viewdata(&sd->bl, sd->disguise); else status_set_viewdata(&sd->bl, sd->status.class_); clif_displaymessage(fd, msg_txt(sd,10)); // Invisible: Off // increment the number of pvp players on the map map[sd->bl.m].users_pvp++; if( !battle_config.pk_mode && map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank ) {// register the player for ranking calculations sd->pvp_timer = add_timer( gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0 ); } //bugreport:2266 map_foreachinmovearea(clif_insight, &sd->bl, AREA_SIZE, sd->bl.x, sd->bl.y, BL_ALL, &sd->bl); } else { sd->sc.option |= OPTION_INVISIBLE; sd->vd.class_ = INVISIBLE_CLASS; clif_displaymessage(fd, msg_txt(sd,11)); // Invisible: On // decrement the number of pvp players on the map map[sd->bl.m].users_pvp--; if( map[sd->bl.m].flag.pvp && !map[sd->bl.m].flag.pvp_nocalcrank && sd->pvp_timer != INVALID_TIMER ) {// unregister the player for ranking delete_timer( sd->pvp_timer, pc_calc_pvprank_timer ); sd->pvp_timer = INVALID_TIMER; } } clif_changeoption(&sd->bl); return 0; } /*========================================== * Changes a character's class *------------------------------------------*/ ACMD_FUNC(jobchange) { int job = 0, upper = 0; const char* text; nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%11d %11d", &job, &upper) < 1) { int i; bool found = false; upper = 0; // Normal Jobs for( i = JOB_NOVICE; i < JOB_MAX_BASIC && !found; i++ ) { if (strncmpi(message, job_name(i), 16) == 0) { job = i; found = true; } } // High Jobs, Babys and Third for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ) { if (strncmpi(message, job_name(i), 16) == 0) { job = i; found = true; } } if (!found) { text = atcommand_help_string(command); if (text) clif_displaymessage(fd, text); return -1; } } if (job == JOB_KNIGHT2 || job == JOB_CRUSADER2 || job == JOB_WEDDING || job == JOB_XMAS || job == JOB_SUMMER || job == JOB_HANBOK || job == JOB_OKTOBERFEST || job == JOB_LORD_KNIGHT2 || job == JOB_PALADIN2 || job == JOB_BABY_KNIGHT2 || job == JOB_BABY_CRUSADER2 || job == JOB_STAR_GLADIATOR2 || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2) || job == JOB_BABY_STAR_GLADIATOR2) { // Deny direct transformation into dummy jobs clif_displaymessage(fd, msg_txt(sd,923)); //"You can not change to this job by command." return 0; } if (pcdb_checkid(job)) { if (pc_jobchange(sd, job, upper)) clif_displaymessage(fd, msg_txt(sd,12)); // Your job has been changed. else { clif_displaymessage(fd, msg_txt(sd,155)); // You are unable to change your job. return -1; } } else { text = atcommand_help_string(command); if (text) clif_displaymessage(fd, text); return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(kill) { nullpo_retr(-1, sd); status_kill(&sd->bl); clif_displaymessage(sd->fd, msg_txt(sd,13)); // A pity! You've died. if (fd != sd->fd) clif_displaymessage(fd, msg_txt(sd,14)); // Character killed. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(alive) { nullpo_retr(-1, sd); if (!status_revive(&sd->bl, 100, 100)) { clif_displaymessage(fd, msg_txt(sd,667)); // You're not dead. return -1; } clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); clif_displaymessage(fd, msg_txt(sd,16)); // You've been revived! It's a miracle! return 0; } /*========================================== * +kamic [LuzZza] *------------------------------------------*/ ACMD_FUNC(kami) { unsigned long color=0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if(*(command + 5) != 'c' && *(command + 5) != 'C') { if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,980)); // Please enter a message (usage: @kami <message>). return -1; } sscanf(message, "%255[^\n]", atcmd_output); if (strstr(command, "l") != NULL) clif_broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP); else intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, (*(command + 5) == 'b' || *(command + 5) == 'B') ? BC_BLUE : BC_DEFAULT); } else { if(!message || !*message || (sscanf(message, "%20lx %199[^\n]", &color, atcmd_output) < 2)) { clif_displaymessage(fd, msg_txt(sd,981)); // Please enter color and message (usage: @kamic <color> <message>). return -1; } if(color > 0xFFFFFF) { clif_displaymessage(fd, msg_txt(sd,982)); // Invalid color. return -1; } intif_broadcast2(atcmd_output, strlen(atcmd_output) + 1, color, 0x190, 12, 0, 0); } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(heal) { int hp = 0, sp = 0; // [Valaris] thanks to fov nullpo_retr(-1, sd); sscanf(message, "%11d %11d", &hp, &sp); // some overflow checks if( hp == INT_MIN ) hp++; if( sp == INT_MIN ) sp++; if ( hp == 0 && sp == 0 ) { if (!status_percent_heal(&sd->bl, 100, 100)) clif_displaymessage(fd, msg_txt(sd,157)); // HP and SP have already been recovered. else clif_displaymessage(fd, msg_txt(sd,17)); // HP, SP recovered. return 0; } if ( hp > 0 && sp >= 0 ) { if(!status_heal(&sd->bl, hp, sp, 0)) clif_displaymessage(fd, msg_txt(sd,157)); // HP and SP are already with the good value. else clif_displaymessage(fd, msg_txt(sd,17)); // HP, SP recovered. return 0; } if ( hp < 0 && sp <= 0 ) { status_damage(NULL, &sd->bl, -hp, -sp, 0, 0); clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, DMG_ENDURE, 0, false); clif_displaymessage(fd, msg_txt(sd,156)); // HP or/and SP modified. return 0; } //Opposing signs. if ( hp ) { if (hp > 0) status_heal(&sd->bl, hp, 0, 0); else { status_damage(NULL, &sd->bl, -hp, 0, 0, 0); clif_damage(&sd->bl,&sd->bl, gettick(), 0, 0, -hp, 0, DMG_ENDURE, 0, false); } } if ( sp ) { if (sp > 0) status_heal(&sd->bl, 0, sp, 0); else status_damage(NULL, &sd->bl, 0, -sp, 0, 0); } clif_displaymessage(fd, msg_txt(sd,156)); // HP or/and SP modified. return 0; } /*========================================== * @item command (usage: @item <itemdid1:itemid2:itemname:..> <quantity>) (modified by [Yor] for pet_egg) * @itembound command (usage: @itembound <name/id_of_item> <quantity> <bound_type>) *------------------------------------------*/ ACMD_FUNC(item) { char item_name[100]; int number = 0, bound = BOUND_NONE; char flag = 0; struct item item_tmp; struct item_data *item_data[10]; int get_count, i, j=0; char *itemlist; nullpo_retr(-1, sd); memset(item_name, '\0', sizeof(item_name)); parent_cmd = atcommand_checkalias(command+1); if (!strcmpi(parent_cmd,"itembound")) { if (!message || !*message || ( sscanf(message, "\"%99[^\"]\" %11d %11d", item_name, &number, &bound) < 3 && sscanf(message, "%99s %11d %11d", item_name, &number, &bound) < 3)) { clif_displaymessage(fd, msg_txt(sd,295)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity> <bound_type>). clif_displaymessage(fd, msg_txt(sd,298)); // Invalid bound type return -1; } if( bound <= BOUND_NONE || bound >= BOUND_MAX ) { clif_displaymessage(fd, msg_txt(sd,298)); // Invalid bound type return -1; } } else if (!message || !*message || ( sscanf(message, "\"%99[^\"]\" %11d", item_name, &number) < 1 && sscanf(message, "%99s %11d", item_name, &number) < 1 )) { clif_displaymessage(fd, msg_txt(sd,983)); // Please enter an item name or ID (usage: @item <item name/ID> <quantity>). return -1; } itemlist = strtok(item_name, ":"); while (itemlist != NULL && j<10) { if ((item_data[j] = itemdb_searchname(itemlist)) == NULL && (item_data[j] = itemdb_exists(atoi(itemlist))) == NULL){ clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name. return -1; } itemlist = strtok(NULL, ":"); //next itemline j++; } if (number <= 0) number = 1; get_count = number; for(j--; j>=0; j--){ //produce items in list unsigned short item_id = item_data[j]->nameid; //Check if it's stackable. if (!itemdb_isstackable2(item_data[j])) get_count = 1; for (i = 0; i < number; i += get_count) { // if not pet egg if (!pet_create_egg(sd, item_id)) { memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; item_tmp.identify = 1; item_tmp.bound = bound; if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) clif_additem(sd, 0, 0, flag); } } } if (flag == 0) clif_displaymessage(fd, msg_txt(sd,18)); // Item created. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(item2) { struct item item_tmp; struct item_data *item_data; char item_name[100]; unsigned short item_id; int number = 0, bound = BOUND_NONE; int identify = 0, refine = 0, attr = 0; int c1 = 0, c2 = 0, c3 = 0, c4 = 0; nullpo_retr(-1, sd); memset(item_name, '\0', sizeof(item_name)); parent_cmd = atcommand_checkalias(command+1); if (!strcmpi(parent_cmd+1,"itembound2")) { if (!message || !*message || ( sscanf(message, "\"%99[^\"]\" %11d %11d %11d %11d %11d %11d %11d %11d %11d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4, &bound) < 10 && sscanf(message, "%99s %11d %11d %11d %11d %11d %11d %11d %11d %11d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4, &bound) < 10 )) { clif_displaymessage(fd, msg_txt(sd,296)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity> clif_displaymessage(fd, msg_txt(sd,297)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4> <bound_type>). clif_displaymessage(fd, msg_txt(sd,298)); // Invalid bound type return -1; } if( bound <= BOUND_NONE || bound >= BOUND_MAX ) { clif_displaymessage(fd, msg_txt(sd,298)); // Invalid bound type return -1; } } else if ( !message || !*message || ( sscanf(message, "\"%99[^\"]\" %11d %11d %11d %11d %11d %11d %11d %11d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 && sscanf(message, "%99s %11d %11d %11d %11d %11d %11d %11d %11d", item_name, &number, &identify, &refine, &attr, &c1, &c2, &c3, &c4) < 9 )) { clif_displaymessage(fd, msg_txt(sd,984)); // Please enter all parameters (usage: @item2 <item name/ID> <quantity> clif_displaymessage(fd, msg_txt(sd,985)); // <identify_flag> <refine> <attribute> <card1> <card2> <card3> <card4>). return -1; } if (number <= 0) number = 1; item_id = 0; if ((item_data = itemdb_searchname(item_name)) != NULL || (item_data = itemdb_exists(atoi(item_name))) != NULL) item_id = item_data->nameid; if (item_id > 500) { int loop, get_count, i; char flag = 0; //Check if it's stackable. if(!itemdb_isstackable2(item_data)){ loop = number; get_count = 1; }else{ loop = 1; get_count = number; } if( itemdb_isequip2(item_data ) ){ refine = cap_value( refine, 0, MAX_REFINE ); }else{ // All other items cannot be refined and are always identified identify = 1; refine = attr = 0; } for (i = 0; i < loop; i++) { // if not pet egg if (!pet_create_egg(sd, item_id)) { memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; item_tmp.identify = identify; item_tmp.refine = refine; item_tmp.attribute = attr; item_tmp.card[0] = c1; item_tmp.card[1] = c2; item_tmp.card[2] = c3; item_tmp.card[3] = c4; item_tmp.bound = bound; if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) clif_additem(sd, 0, 0, flag); } } if (flag == 0) clif_displaymessage(fd, msg_txt(sd,18)); // Item created. } else { clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(itemreset) { int i; nullpo_retr(-1, sd); for (i = 0; i < MAX_INVENTORY; i++) { if (sd->inventory.u.items_inventory[i].amount && sd->inventory.u.items_inventory[i].equip == 0) { pc_delitem(sd, i, sd->inventory.u.items_inventory[i].amount, 0, 0, LOG_TYPE_COMMAND); } } clif_displaymessage(fd, msg_txt(sd,20)); // All of your items have been removed. return 0; } /*========================================== * Atcommand @lvlup *------------------------------------------*/ ACMD_FUNC(baselevelup) { int level=0, i=0, status_point=0; nullpo_retr(-1, sd); level = atoi(message); if (!message || !*message || !level) { clif_displaymessage(fd, msg_txt(sd,986)); // Please enter a level adjustment (usage: @lvup/@blevel/@baselvlup <number of levels>). return -1; } if (level > 0) { if (sd->status.base_level >= pc_maxbaselv(sd)) { // check for max level by Valaris clif_displaymessage(fd, msg_txt(sd,47)); // Base level can't go any higher. return -1; } // End Addition if ((unsigned int)level > pc_maxbaselv(sd) || (unsigned int)level > pc_maxbaselv(sd) - sd->status.base_level) // fix positive overflow level = pc_maxbaselv(sd) - sd->status.base_level; for (i = 0; i < level; i++) status_point += pc_gets_status_point(sd->status.base_level + i); sd->status.status_point += status_point; sd->status.base_level += (unsigned int)level; status_calc_pc(sd, SCO_FORCE); status_percent_heal(&sd->bl, 100, 100); clif_misceffect(&sd->bl, 0); achievement_update_objective(sd, AG_GOAL_LEVEL, 1, sd->status.base_level); achievement_update_objective(sd, AG_GOAL_STATUS, 2, sd->status.base_level, sd->status.class_); clif_displaymessage(fd, msg_txt(sd,21)); // Base level raised. } else { if (sd->status.base_level == 1) { clif_displaymessage(fd, msg_txt(sd,158)); // Base level can't go any lower. return -1; } level*=-1; if ((unsigned int)level >= sd->status.base_level) level = sd->status.base_level-1; for (i = 0; i > -level; i--) status_point += pc_gets_status_point(sd->status.base_level + i - 1); if (sd->status.status_point < status_point) pc_resetstate(sd); if (sd->status.status_point < status_point) sd->status.status_point = 0; else sd->status.status_point -= status_point; sd->status.base_level -= (unsigned int)level; clif_displaymessage(fd, msg_txt(sd,22)); // Base level lowered. status_calc_pc(sd, SCO_FORCE); level*=-1; } sd->status.base_exp = 0; clif_updatestatus(sd, SP_STATUSPOINT); clif_updatestatus(sd, SP_BASELEVEL); clif_updatestatus(sd, SP_BASEEXP); clif_updatestatus(sd, SP_NEXTBASEEXP); pc_baselevelchanged(sd); if(sd->status.party_id) party_send_levelup(sd); if( level > 0 && battle_config.atcommand_levelup_events ) npc_script_event(sd,NPCE_BASELVUP); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(joblevelup) { int level=0; nullpo_retr(-1, sd); level = atoi(message); if (!message || !*message || !level) { clif_displaymessage(fd, msg_txt(sd,987)); // Please enter a level adjustment (usage: @joblvup/@jlevel/@joblvlup <number of levels>). return -1; } if (level > 0) { if (sd->status.job_level >= pc_maxjoblv(sd)) { clif_displaymessage(fd, msg_txt(sd,23)); // Job level can't go any higher. return -1; } if ((unsigned int)level > pc_maxjoblv(sd) || (unsigned int)level > pc_maxjoblv(sd) - sd->status.job_level) // fix positive overflow level = pc_maxjoblv(sd) - sd->status.job_level; sd->status.job_level += (unsigned int)level; sd->status.skill_point += level; clif_misceffect(&sd->bl, 1); achievement_update_objective(sd, AG_GOAL_LEVEL, 1, sd->status.job_level); clif_displaymessage(fd, msg_txt(sd,24)); // Job level raised. } else { if (sd->status.job_level == 1) { clif_displaymessage(fd, msg_txt(sd,159)); // Job level can't go any lower. return -1; } level *=-1; if ((unsigned int)level >= sd->status.job_level) // fix negative overflow level = sd->status.job_level-1; sd->status.job_level -= (unsigned int)level; if (sd->status.skill_point < level) pc_resetskill(sd,0); //Reset skills since we need to subtract more points. if (sd->status.skill_point < level) sd->status.skill_point = 0; else sd->status.skill_point -= level; clif_displaymessage(fd, msg_txt(sd,25)); // Job level lowered. level *=-1; } sd->status.job_exp = 0; clif_updatestatus(sd, SP_JOBLEVEL); clif_updatestatus(sd, SP_JOBEXP); clif_updatestatus(sd, SP_NEXTJOBEXP); clif_updatestatus(sd, SP_SKILLPOINT); status_calc_pc(sd, SCO_FORCE); if( level > 0 && battle_config.atcommand_levelup_events ) npc_script_event(sd,NPCE_JOBLVUP); return 0; } /*========================================== * @help *------------------------------------------*/ ACMD_FUNC(help) { config_setting_t *help; const char *text = NULL; const char *command_name = NULL; char *default_command = "help"; nullpo_retr(-1, sd); help = config_lookup(&atcommand_config, "help"); if (help == NULL) { clif_displaymessage(fd, msg_txt(sd,27)); // "Commands help is not available." return -1; } if (!message || !*message) { command_name = default_command; // If no command_name specified, display help for @help. } else { if (*message == atcommand_symbol || *message == charcommand_symbol) ++message; command_name = atcommand_checkalias(message); } if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) { sprintf(atcmd_output, msg_txt(sd,153), message); // "%s is Unknown Command" clif_displaymessage(fd, atcmd_output); atcommand_get_suggestions(sd, command_name, true); return -1; } if (!config_setting_lookup_string(help, command_name, &text)) { sprintf(atcmd_output, msg_txt(sd,988), atcommand_symbol, command_name); // There is no help for %c%s. clif_displaymessage(fd, atcmd_output); atcommand_get_suggestions(sd, command_name, true); return -1; } sprintf(atcmd_output, msg_txt(sd,989), atcommand_symbol, command_name); // Help for command %c%s: clif_displaymessage(fd, atcmd_output); { // Display aliases DBIterator* iter; AtCommandInfo *command_info; AliasInfo *alias_info = NULL; StringBuf buf; bool has_aliases = false; StringBuf_Init(&buf); StringBuf_AppendStr(&buf, msg_txt(sd,990)); // Available aliases: command_info = get_atcommandinfo_byname(command_name); iter = db_iterator(atcommand_alias_db); for (alias_info = (AliasInfo *)dbi_first(iter); dbi_exists(iter); alias_info = (AliasInfo *)dbi_next(iter)) { if (alias_info->command == command_info) { StringBuf_Printf(&buf, " %s", alias_info->alias); has_aliases = true; } } dbi_destroy(iter); if (has_aliases) clif_displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); } // Display help contents clif_displaymessage(fd, text); return 0; } // helper function, used in foreach calls to stop auto-attack timers // parameter: '0' - everyone, 'id' - only those attacking someone with that id static int atcommand_stopattack(struct block_list *bl,va_list ap) { struct unit_data *ud = unit_bl2ud(bl); int id = va_arg(ap, int); if (ud && ud->attacktimer != INVALID_TIMER && (!id || id == ud->target)) { unit_stop_attack(bl); return 1; } return 0; } /*========================================== * *------------------------------------------*/ static int atcommand_pvpoff_sub(struct block_list *bl,va_list ap) { TBL_PC* sd = (TBL_PC*)bl; clif_pvpset(sd, 0, 0, 2); if (sd->pvp_timer != INVALID_TIMER) { delete_timer(sd->pvp_timer, pc_calc_pvprank_timer); sd->pvp_timer = INVALID_TIMER; } return 0; } ACMD_FUNC(pvpoff) { nullpo_retr(-1, sd); if (!map[sd->bl.m].flag.pvp) { clif_displaymessage(fd, msg_txt(sd,160)); // PvP is already Off. return -1; } map[sd->bl.m].flag.pvp = 0; if (!battle_config.pk_mode){ clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); } map_foreachinmap(atcommand_pvpoff_sub,sd->bl.m, BL_PC); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); clif_displaymessage(fd, msg_txt(sd,31)); // PvP: Off. return 0; } /*========================================== * *------------------------------------------*/ static int atcommand_pvpon_sub(struct block_list *bl,va_list ap) { TBL_PC* sd = (TBL_PC*)bl; if (sd->pvp_timer == INVALID_TIMER) { sd->pvp_timer = add_timer(gettick() + 200, pc_calc_pvprank_timer, sd->bl.id, 0); sd->pvp_rank = 0; sd->pvp_lastusers = 0; sd->pvp_point = 5; sd->pvp_won = 0; sd->pvp_lost = 0; } return 0; } ACMD_FUNC(pvpon) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.pvp) { clif_displaymessage(fd, msg_txt(sd,161)); // PvP is already On. return -1; } map[sd->bl.m].flag.pvp = 1; if (!battle_config.pk_mode) {// display pvp circle and rank clif_map_property_mapall(sd->bl.m, MAPPROPERTY_FREEPVPZONE); map_foreachinmap(atcommand_pvpon_sub,sd->bl.m, BL_PC); } clif_displaymessage(fd, msg_txt(sd,32)); // PvP: On. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(gvgoff) { nullpo_retr(-1, sd); if (!map[sd->bl.m].flag.gvg) { clif_displaymessage(fd, msg_txt(sd,162)); // GvG is already Off. return -1; } map[sd->bl.m].flag.gvg = 0; clif_map_property_mapall(sd->bl.m, MAPPROPERTY_NOTHING); map_foreachinmap(atcommand_stopattack,sd->bl.m, BL_CHAR, 0); clif_displaymessage(fd, msg_txt(sd,33)); // GvG: Off. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(gvgon) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.gvg) { clif_displaymessage(fd, msg_txt(sd,163)); // GvG is already On. return -1; } map[sd->bl.m].flag.gvg = 1; clif_map_property_mapall(sd->bl.m, MAPPROPERTY_AGITZONE); clif_displaymessage(fd, msg_txt(sd,34)); // GvG: On. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(model) { int hair_style = 0, hair_color = 0, cloth_color = 0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%11d %11d %11d", &hair_style, &hair_color, &cloth_color) < 1) { sprintf(atcmd_output, msg_txt(sd,991), // Please enter at least one value (usage: @model <hair ID: %d-%d> <hair color: %d-%d> <clothes color: %d-%d>). MIN_HAIR_STYLE, MAX_HAIR_STYLE, MIN_HAIR_COLOR, MAX_HAIR_COLOR, MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); clif_displaymessage(fd, atcmd_output); return -1; } if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE && hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR && cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) { pc_changelook(sd, LOOK_HAIR, hair_style); pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); clif_displaymessage(fd, msg_txt(sd,36)); // Appearance changed. } else { clif_displaymessage(fd, msg_txt(sd,37)); // An invalid number was specified. return -1; } return 0; } /*========================================== * @bodystyle [Rytech] *------------------------------------------*/ ACMD_FUNC(bodystyle) { int body_style = 0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); // Limit body styles to certain jobs since not all of them are released yet. if (!((sd->class_&MAPID_THIRDMASK) == MAPID_GUILLOTINE_CROSS || (sd->class_&MAPID_THIRDMASK) == MAPID_GENETIC || (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC || (sd->class_&MAPID_THIRDMASK) == MAPID_ROYAL_GUARD || (sd->class_&MAPID_THIRDMASK) == MAPID_ARCH_BISHOP || (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER || (sd->class_&MAPID_THIRDMASK) == MAPID_WARLOCK || (sd->class_&MAPID_THIRDMASK) == MAPID_SHADOW_CHASER || (sd->class_&MAPID_THIRDMASK) == MAPID_MINSTRELWANDERER || (sd->class_&MAPID_THIRDMASK) == MAPID_SORCERER)) { clif_displaymessage(fd, msg_txt(sd,740)); // This job has no alternate body styles. return -1; } if (!message || !*message || sscanf(message, "%d", &body_style) < 1) { sprintf(atcmd_output, msg_txt(sd,739), MIN_BODY_STYLE, MAX_BODY_STYLE); // Please enter a body style (usage: @bodystyle <body ID: %d-%d>). clif_displaymessage(fd, atcmd_output); return -1; } if (body_style >= MIN_BODY_STYLE && body_style <= MAX_BODY_STYLE) { pc_changelook(sd, LOOK_BODY2, body_style); clif_displaymessage(fd, msg_txt(sd,36)); // Appearence changed. } else { clif_displaymessage(fd, msg_txt(sd,37)); // An invalid number was specified. return -1; } return 0; } /*========================================== * @dye && @ccolor *------------------------------------------*/ ACMD_FUNC(dye) { int cloth_color = 0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%11d", &cloth_color) < 1) { sprintf(atcmd_output, msg_txt(sd,992), MIN_CLOTH_COLOR, MAX_CLOTH_COLOR); // Please enter a clothes color (usage: @dye/@ccolor <clothes color: %d-%d>). clif_displaymessage(fd, atcmd_output); return -1; } if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) { pc_changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); clif_displaymessage(fd, msg_txt(sd,36)); // Appearance changed. } else { clif_displaymessage(fd, msg_txt(sd,37)); // An invalid number was specified. return -1; } return 0; } /*========================================== * @hairstyle && @hstyle *------------------------------------------*/ ACMD_FUNC(hair_style) { int hair_style = 0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%11d", &hair_style) < 1) { sprintf(atcmd_output, msg_txt(sd,993), MIN_HAIR_STYLE, MAX_HAIR_STYLE); // Please enter a hair style (usage: @hairstyle/@hstyle <hair ID: %d-%d>). clif_displaymessage(fd, atcmd_output); return -1; } if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) { pc_changelook(sd, LOOK_HAIR, hair_style); clif_displaymessage(fd, msg_txt(sd,36)); // Appearance changed. } else { clif_displaymessage(fd, msg_txt(sd,37)); // An invalid number was specified. return -1; } return 0; } /*========================================== * @haircolor && @hcolor *------------------------------------------*/ ACMD_FUNC(hair_color) { int hair_color = 0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%11d", &hair_color) < 1) { sprintf(atcmd_output, msg_txt(sd,994), MIN_HAIR_COLOR, MAX_HAIR_COLOR); // Please enter a hair color (usage: @haircolor/@hcolor <hair color: %d-%d>). clif_displaymessage(fd, atcmd_output); return -1; } if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) { pc_changelook(sd, LOOK_HAIR_COLOR, hair_color); clif_displaymessage(fd, msg_txt(sd,36)); // Appearance changed. } else { clif_displaymessage(fd, msg_txt(sd,37)); // An invalid number was specified. return -1; } return 0; } /*========================================== * @go [city_number or city_name] - Updated by Harbin *------------------------------------------*/ ACMD_FUNC(go) { int i; int town; char map_name[MAP_NAME_LENGTH]; const struct { char map[MAP_NAME_LENGTH]; int x, y; } data[] = { { MAP_PRONTERA, 156, 191 }, // 0=Prontera { MAP_MORROC, 156, 93 }, // 1=Morroc { MAP_GEFFEN, 119, 59 }, // 2=Geffen { MAP_PAYON, 162, 233 }, // 3=Payon { MAP_ALBERTA, 192, 147 }, // 4=Alberta #ifdef RENEWAL { MAP_IZLUDE, 128, 146 }, // 5=Izlude (Renewal) #else { MAP_IZLUDE, 128, 114 }, // 5=Izlude #endif { MAP_ALDEBARAN, 140, 131 }, // 6=Al de Baran { MAP_LUTIE, 147, 134 }, // 7=Lutie { MAP_COMODO, 209, 143 }, // 8=Comodo { MAP_YUNO, 157, 51 }, // 9=Yuno { MAP_AMATSU, 198, 84 }, // 10=Amatsu { MAP_GONRYUN, 160, 120 }, // 11=Gonryun { MAP_UMBALA, 89, 157 }, // 12=Umbala { MAP_NIFLHEIM, 21, 153 }, // 13=Niflheim { MAP_LOUYANG, 217, 40 }, // 14=Louyang #ifdef RENEWAL { MAP_NOVICE, 97, 90 }, // 15=Training Grounds (Renewal) #else { MAP_NOVICE, 53, 111 }, // 15=Training Grounds #endif { MAP_JAIL, 23, 61 }, // 16=Prison { MAP_JAWAII, 249, 127 }, // 17=Jawaii { MAP_AYOTHAYA, 151, 117 }, // 18=Ayothaya { MAP_EINBROCH, 64, 200 }, // 19=Einbroch { MAP_LIGHTHALZEN, 158, 92 }, // 20=Lighthalzen { MAP_EINBECH, 70, 95 }, // 21=Einbech { MAP_HUGEL, 96, 145 }, // 22=Hugel { MAP_RACHEL, 130, 110 }, // 23=Rachel { MAP_VEINS, 216, 123 }, // 24=Veins { MAP_MOSCOVIA, 223, 184 }, // 25=Moscovia { MAP_MIDCAMP, 180, 240 }, // 26=Midgard Camp { MAP_MANUK, 282, 138 }, // 27=Manuk { MAP_SPLENDIDE, 201, 147 }, // 28=Splendide { MAP_BRASILIS, 182, 239 }, // 29=Brasilis { MAP_DICASTES, 198, 187 }, // 30=El Dicastes { MAP_MORA, 44, 151 }, // 31=Mora { MAP_DEWATA, 200, 180 }, // 32=Dewata { MAP_MALANGDO, 140, 114 }, // 33=Malangdo Island { MAP_MALAYA, 242, 211 }, // 34=Malaya Port { MAP_ECLAGE, 110, 39 }, // 35=Eclage { MAP_LASAGNA, 193, 182 }, // 36=Lasagna }; nullpo_retr(-1, sd); if( map[sd->bl.m].flag.nogo && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE) ) { clif_displaymessage(sd->fd,msg_txt(sd,995)); // You cannot use @go on this map. return 0; } memset(map_name, '\0', sizeof(map_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); // get the number town = atoi(message); if (!message || !*message || sscanf(message, "%11s", map_name) < 1 || town < 0 || town >= ARRAYLENGTH(data)) {// no value matched so send the list of locations const char* text; // attempt to find the text help string text = atcommand_help_string( command ); clif_displaymessage(fd, msg_txt(sd,38)); // Invalid location number, or name. if( text ) {// send the text to the client clif_displaymessage( fd, text ); } return -1; } // get possible name of the city map_name[MAP_NAME_LENGTH-1] = '\0'; for (i = 0; map_name[i]; i++) map_name[i] = TOLOWER(map_name[i]); // try to identify the map name if (strncmp(map_name, "prontera", 3) == 0) { town = 0; } else if (strncmp(map_name, "morocc", 4) == 0 || strncmp(map_name, "morroc", 4) == 0) { town = 1; } else if (strncmp(map_name, "geffen", 3) == 0) { town = 2; } else if (strncmp(map_name, "payon", 3) == 0) { town = 3; } else if (strncmp(map_name, "alberta", 3) == 0) { town = 4; } else if (strncmp(map_name, "izlude", 3) == 0) { town = 5; } else if (strncmp(map_name, "aldebaran", 3) == 0) { town = 6; } else if (strncmp(map_name, "lutie", 3) == 0 || strcmp(map_name, "christmas") == 0 || strncmp(map_name, "xmas", 3) == 0 || strncmp(map_name, "x-mas", 3) == 0) { town = 7; } else if (strncmp(map_name, "comodo", 3) == 0) { town = 8; } else if (strncmp(map_name, "juno", 3) == 0 || strncmp(map_name, "yuno", 3) == 0) { town = 9; } else if (strncmp(map_name, "amatsu", 3) == 0) { town = 10; } else if (strncmp(map_name, "kunlun", 3) == 0 || strncmp(map_name, "gonryun", 3) == 0) { town = 11; } else if (strncmp(map_name, "umbala", 3) == 0) { town = 12; } else if (strncmp(map_name, "niflheim", 3) == 0) { town = 13; } else if (strncmp(map_name, "louyang", 3) == 0) { town = 14; } else if (strncmp(map_name, "new_1-1", 3) == 0 || strncmp(map_name, "startpoint", 3) == 0 || strncmp(map_name, "beginning", 3) == 0) { town = 15; } else if (strncmp(map_name, "sec_pri", 3) == 0 || strncmp(map_name, "prison", 3) == 0 || strncmp(map_name, "jail", 3) == 0) { town = 16; } else if (strncmp(map_name, "jawaii", 3) == 0) { town = 17; } else if (strncmp(map_name, "ayothaya", 3) == 0) { town = 18; } else if (strncmp(map_name, "einbroch", 5) == 0) { town = 19; } else if (strncmp(map_name, "lighthalzen", 3) == 0) { town = 20; } else if (strncmp(map_name, "einbech", 5) == 0) { town = 21; } else if (strncmp(map_name, "hugel", 3) == 0) { town = 22; } else if (strncmp(map_name, "rachel", 3) == 0) { town = 23; } else if (strncmp(map_name, "veins", 3) == 0) { town = 24; } else if (strncmp(map_name, "moscovia", 3) == 0) { town = 25; } else if (strncmp(map_name, "mid_camp", 3) == 0) { town = 26; } else if (strncmp(map_name, "manuk", 3) == 0) { town = 27; } else if (strncmp(map_name, "splendide", 3) == 0) { town = 28; } else if (strncmp(map_name, "brasilis", 3) == 0) { town = 29; } else if (strncmp(map_name, "dicastes01", 3) == 0) { town = 30; } else if (strcmp(map_name, "mora") == 0) { town = 31; } else if (strncmp(map_name, "dewata", 3) == 0) { town = 32; } else if (strncmp(map_name, "malangdo", 5) == 0) { town = 33; } else if (strncmp(map_name, "malaya", 5) == 0) { town = 34; } else if (strncmp(map_name, "eclage", 3) == 0) { town = 35; } else if (strncmp(map_name, "lasagna", 2) == 0) { town = 36; } if (town >= 0 && town < ARRAYLENGTH(data)) { int16 m = map_mapname2mapid(data[town].map); if (m >= 0 && map[m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,247)); // You are not authorized to warp to this map. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,248)); // You are not authorized to warp from your current map. return -1; } if (pc_setpos(sd, mapindex_name2id(data[town].map), data[town].x, data[town].y, CLR_TELEPORT) == SETPOS_OK) { clif_displaymessage(fd, msg_txt(sd,0)); // Warped. } else { clif_displaymessage(fd, msg_txt(sd,1)); // Map not found. return -1; } } else { // if you arrive here, you have an error in town variable when reading of names clif_displaymessage(fd, msg_txt(sd,38)); // Invalid location number or name. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(monster) { char name[NAME_LENGTH]; char monster[NAME_LENGTH]; char eventname[EVENT_NAME_LENGTH] = ""; int mob_id; int number = 0; int count; int i, range; short mx, my; unsigned int size; nullpo_retr(-1, sd); memset(name, '\0', sizeof(name)); memset(monster, '\0', sizeof(monster)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,80)); // Give the display name or monster name/id please. return -1; } if (sscanf(message, "\"%23[^\"]\" %23s %11d", name, monster, &number) > 1 || sscanf(message, "%23s \"%23[^\"]\" %11d", monster, name, &number) > 1) { //All data can be left as it is. } else if ((count=sscanf(message, "%23s %11d %23s", monster, &number, name)) > 1) { //Here, it is possible name was not given and we are using monster for it. if (count < 3) //Blank mob's name. name[0] = '\0'; } else if (sscanf(message, "%23s %23s %11d", name, monster, &number) > 1) { //All data can be left as it is. } else if (sscanf(message, "%23s", monster) > 0) { //As before, name may be already filled. name[0] = '\0'; } else { clif_displaymessage(fd, msg_txt(sd,80)); // Give a display name and monster name/id please. return -1; } if ((mob_id = mobdb_searchname(monster)) == 0) // check name first (to avoid possible name begining by a number) mob_id = mobdb_checkid(atoi(monster)); if (mob_id == 0) { clif_displaymessage(fd, msg_txt(sd,40)); // Invalid monster ID or name. return -1; } if (mob_id == MOBID_EMPERIUM) { clif_displaymessage(fd, msg_txt(sd,83)); // Monster 'Emperium' cannot be spawned. return -1; } if (number <= 0) number = 1; if( !name[0] ) strcpy(name, "--ja--"); // If value of atcommand_spawn_quantity_limit directive is greater than or equal to 1 and quantity of monsters is greater than value of the directive if (battle_config.atc_spawn_quantity_limit && number > battle_config.atc_spawn_quantity_limit) number = battle_config.atc_spawn_quantity_limit; parent_cmd = atcommand_checkalias(command+1); if (strcmp(parent_cmd, "monstersmall") == 0) size = SZ_MEDIUM; // This is just gorgeous [mkbu95] else if (strcmp(parent_cmd, "monsterbig") == 0) size = SZ_BIG; else size = SZ_SMALL; if (battle_config.etc_log) ShowInfo("%s monster='%s' name='%s' id=%d count=%d (%d,%d)\n", command, monster, name, mob_id, number, sd->bl.x, sd->bl.y); count = 0; range = (int)sqrt((float)number) +2; // calculation of an odd number (+ 4 area around) for (i = 0; i < number; i++) { int k; map_search_freecell(&sd->bl, 0, &mx, &my, range, range, 0); k = mob_once_spawn(sd, sd->bl.m, mx, my, name, mob_id, 1, eventname, size, AI_NONE); if(k) { //mapreg_setreg(reference_uid(add_str("$@mobid"), i),k); //retain created mobid in array uncomment if needed count ++; } } if (count != 0) if (number == count) clif_displaymessage(fd, msg_txt(sd,39)); // All monster summoned! else { sprintf(atcmd_output, msg_txt(sd,240), count); // %d monster(s) summoned! clif_displaymessage(fd, atcmd_output); } else { clif_displaymessage(fd, msg_txt(sd,40)); // Invalid monster ID or name. return -1; } return 0; } /*========================================== * *------------------------------------------*/ static int atkillmonster_sub(struct block_list *bl, va_list ap) { struct mob_data *md; int flag; nullpo_ret(md=(struct mob_data *)bl); flag = va_arg(ap, int); if (md->guardian_data) return 0; //Do not touch WoE mobs! if (flag) status_zap(bl,md->status.hp, 0); else status_kill(bl); return 1; } ACMD_FUNC(killmonster) { int map_id, drop_flag; char map_name[MAP_NAME_LENGTH_EXT]; nullpo_retr(-1, sd); memset(map_name, '\0', sizeof(map_name)); if (!message || !*message || sscanf(message, "%15s", map_name) < 1) map_id = sd->bl.m; else { if ((map_id = map_mapname2mapid(map_name)) < 0) map_id = sd->bl.m; } parent_cmd = atcommand_checkalias(command+1); drop_flag = strcmp(parent_cmd, "killmonster2"); map_foreachinmap(atkillmonster_sub, map_id, BL_MOB, -drop_flag); clif_displaymessage(fd, msg_txt(sd,165)); // All monsters killed! return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(refine) { int j, position = 0, refine = 0, current_position, final_refine; int count; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%11d %11d", &position, &refine) < 2) { clif_displaymessage(fd, msg_txt(sd,996)); // Please enter a position and an amount (usage: @refine <equip position> <+/- amount>). sprintf(atcmd_output, msg_txt(sd,997), EQP_HEAD_LOW); // %d: Lower Headgear clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,998), EQP_HAND_R); // %d: Right Hand clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,999), EQP_GARMENT); // %d: Garment clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1000), EQP_ACC_L); // %d: Left Accessory clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1001), EQP_ARMOR); // %d: Body Armor clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1002), EQP_HAND_L); // %d: Left Hand clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1003), EQP_SHOES); // %d: Shoes clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1004), EQP_ACC_R); // %d: Right Accessory clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1005), EQP_HEAD_TOP); // %d: Top Headgear clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1006), EQP_HEAD_MID); // %d: Mid Headgear clif_displaymessage(fd, atcmd_output); return -1; } refine = cap_value(refine, -MAX_REFINE, MAX_REFINE); count = 0; for (j = 0; j < EQI_MAX; j++) { int i; if ((i = sd->equip_index[j]) < 0) continue; if(j == EQI_AMMO) continue; if (pc_is_same_equip_index((enum equip_index)j, sd->equip_index, i)) continue; if(position && !(sd->inventory.u.items_inventory[i].equip & position)) continue; final_refine = cap_value(sd->inventory.u.items_inventory[i].refine + refine, 0, MAX_REFINE); if (sd->inventory.u.items_inventory[i].refine != final_refine) { sd->inventory.u.items_inventory[i].refine = final_refine; current_position = sd->inventory.u.items_inventory[i].equip; pc_unequipitem(sd, i, 3); clif_refine(fd, 0, i, sd->inventory.u.items_inventory[i].refine); clif_delitem(sd, i, 1, 3); clif_additem(sd, i, 1, 0); pc_equipitem(sd, i, current_position); clif_misceffect(&sd->bl, 3); achievement_update_objective(sd, AG_REFINE_SUCCESS, 2, sd->inventory_data[i]->wlv, sd->inventory.u.items_inventory[i].refine); count++; } } if (count == 0) clif_displaymessage(fd, msg_txt(sd,166)); // No item has been refined. else if (count == 1) clif_displaymessage(fd, msg_txt(sd,167)); // 1 item has been refined. else { sprintf(atcmd_output, msg_txt(sd,168), count); // %d items have been refined. clif_displaymessage(fd, atcmd_output); } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(produce) { char item_name[100]; unsigned short item_id; int attribute = 0, star = 0; struct item_data *item_data; struct item tmp_item; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(item_name, '\0', sizeof(item_name)); if (!message || !*message || ( sscanf(message, "\"%99[^\"]\" %11d %11d", item_name, &attribute, &star) < 1 && sscanf(message, "%99s %11d %11d", item_name, &attribute, &star) < 1 )) { clif_displaymessage(fd, msg_txt(sd,1007)); // Please enter at least one item name/ID (usage: @produce <equip name/ID> <element> <# of very's>). return -1; } if ( (item_data = itemdb_searchname(item_name)) == NULL && (item_data = itemdb_exists(atoi(item_name))) == NULL ) { clif_displaymessage(fd, msg_txt(sd,170)); //This item is not an equipment. return -1; } item_id = item_data->nameid; if (itemdb_isequip2(item_data)) { char flag = 0; if (attribute < MIN_ATTRIBUTE || attribute > MAX_ATTRIBUTE) attribute = ATTRIBUTE_NORMAL; if (star < MIN_STAR || star > MAX_STAR) star = 0; memset(&tmp_item, 0, sizeof tmp_item); tmp_item.nameid = item_id; tmp_item.amount = 1; tmp_item.identify = 1; tmp_item.card[0] = CARD0_FORGE; tmp_item.card[1] = item_data->type==IT_WEAPON? ((star*5) << 8) + attribute:0; tmp_item.card[2] = GetWord(sd->status.char_id, 0); tmp_item.card[3] = GetWord(sd->status.char_id, 1); clif_produceeffect(sd, 0, item_id); clif_misceffect(&sd->bl, 3); if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND))) clif_additem(sd, 0, 0, flag); } else { sprintf(atcmd_output, msg_txt(sd,169), item_id, item_data->name); // The item (%hu: '%s') is not equipable. clif_displaymessage(fd, atcmd_output); return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(memo) { int position = 0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if( !message || !*message || sscanf(message, "%11d", &position) < 1 ) { int i; clif_displaymessage(sd->fd, msg_txt(sd,668)); // Your actual memo positions are: for( i = 0; i < MAX_MEMOPOINTS; i++ ) { if( sd->status.memo_point[i].map ) sprintf(atcmd_output, "%d - %s (%d,%d)", i, mapindex_id2name(sd->status.memo_point[i].map), sd->status.memo_point[i].x, sd->status.memo_point[i].y); else sprintf(atcmd_output, msg_txt(sd,171), i); // %d - void clif_displaymessage(sd->fd, atcmd_output); } return 0; } if( position < 0 || position >= MAX_MEMOPOINTS ) { sprintf(atcmd_output, msg_txt(sd,1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo <memo_position:%d-%d>). clif_displaymessage(fd, atcmd_output); return -1; } return !pc_memo( sd, position ); } /*========================================== * *------------------------------------------*/ ACMD_FUNC(gat) { int y; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); for (y = 2; y >= -2; y--) { sprintf(atcmd_output, "%s (x= %d, y= %d) %02X %02X %02X %02X %02X", map[sd->bl.m].name, sd->bl.x - 2, sd->bl.y + y, map_getcell(sd->bl.m, sd->bl.x - 2, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x - 1, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x + 1, sd->bl.y + y, CELL_GETTYPE), map_getcell(sd->bl.m, sd->bl.x + 2, sd->bl.y + y, CELL_GETTYPE)); clif_displaymessage(fd, atcmd_output); } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(displaystatus) { int i, type, flag, tick, val1 = 0, val2 = 0, val3 = 0; nullpo_retr(-1, sd); if (!message || !*message || (i = sscanf(message, "%11d %11d %11d %11d %11d %11d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) { clif_displaymessage(fd, msg_txt(sd,1009)); // Please enter a status type/flag (usage: @displaystatus <status type> <flag> <tick> {<val1> {<val2> {<val3>}}}). return -1; } if (i < 2) flag = 1; if (i < 3) tick = 0; clif_status_change(&sd->bl, type, flag, tick, val1, val2, val3); return 0; } /*========================================== * @stpoint (Rewritten by [Yor]) *------------------------------------------*/ ACMD_FUNC(statuspoint) { int point; unsigned int new_status_point; if (!message || !*message || (point = atoi(message)) == 0) { clif_displaymessage(fd, msg_txt(sd,1010)); // Please enter a number (usage: @stpoint <number of points>). return -1; } if(point < 0) { if(sd->status.status_point < (unsigned int)(-point)) { new_status_point = 0; } else { new_status_point = sd->status.status_point + point; } } else if(UINT_MAX - sd->status.status_point < (unsigned int)point) { new_status_point = UINT_MAX; } else { new_status_point = sd->status.status_point + point; } if (new_status_point != sd->status.status_point) { sd->status.status_point = new_status_point; clif_updatestatus(sd, SP_STATUSPOINT); clif_displaymessage(fd, msg_txt(sd,174)); // Number of status points changed. } else { if (point < 0) clif_displaymessage(fd, msg_txt(sd,41)); // Unable to decrease the number/value. else clif_displaymessage(fd, msg_txt(sd,149)); // Unable to increase the number/value. return -1; } return 0; } /*========================================== * @skpoint (Rewritten by [Yor]) *------------------------------------------*/ ACMD_FUNC(skillpoint) { int point; unsigned int new_skill_point; nullpo_retr(-1, sd); if (!message || !*message || (point = atoi(message)) == 0) { clif_displaymessage(fd, msg_txt(sd,1011)); // Please enter a number (usage: @skpoint <number of points>). return -1; } if(point < 0) { if(sd->status.skill_point < (unsigned int)(-point)) { new_skill_point = 0; } else { new_skill_point = sd->status.skill_point + point; } } else if(UINT_MAX - sd->status.skill_point < (unsigned int)point) { new_skill_point = UINT_MAX; } else { new_skill_point = sd->status.skill_point + point; } if (new_skill_point != sd->status.skill_point) { sd->status.skill_point = new_skill_point; clif_updatestatus(sd, SP_SKILLPOINT); clif_displaymessage(fd, msg_txt(sd,175)); // Number of skill points changed. } else { if (point < 0) clif_displaymessage(fd, msg_txt(sd,41)); // Unable to decrease the number/value. else clif_displaymessage(fd, msg_txt(sd,149)); // Unable to increase the number/value. return -1; } return 0; } /*========================================== * @zeny *------------------------------------------*/ ACMD_FUNC(zeny) { int zeny=0, ret=-1; nullpo_retr(-1, sd); if (!message || !*message || (zeny = atoi(message)) == 0) { clif_displaymessage(fd, msg_txt(sd,1012)); // Please enter an amount (usage: @zeny <amount>). return -1; } if(zeny > 0){ if((ret=pc_getzeny(sd,zeny,LOG_TYPE_COMMAND,NULL)) == 1) clif_displaymessage(fd, msg_txt(sd,149)); // Unable to increase the number/value. } else { if( sd->status.zeny < -zeny ) zeny = -sd->status.zeny; if((ret=pc_payzeny(sd,-zeny,LOG_TYPE_COMMAND,NULL)) == 1) clif_displaymessage(fd, msg_txt(sd,41)); // Unable to decrease the number/value. } if(!ret) clif_displaymessage(fd, msg_txt(sd,176)); //ret=0 mean cmd success return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(param) { uint8 i; int value = 0; const char* param[] = { "str", "agi", "vit", "int", "dex", "luk" }; unsigned short new_value, *status[6], max_status[6]; //we don't use direct initialization because it isn't part of the c standard. nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%11d", &value) < 1 || value == 0) { clif_displaymessage(fd, msg_txt(sd,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } ARR_FIND( 0, ARRAYLENGTH(param), i, strcmpi(command+1, param[i]) == 0 ); if( i == ARRAYLENGTH(param) || i > MAX_STATUS_TYPE) { // normally impossible... clif_displaymessage(fd, msg_txt(sd,1013)); // Please enter a valid value (usage: @str/@agi/@vit/@int/@dex/@luk <+/-adjustment>). return -1; } status[0] = &sd->status.str; status[1] = &sd->status.agi; status[2] = &sd->status.vit; status[3] = &sd->status.int_; status[4] = &sd->status.dex; status[5] = &sd->status.luk; if( pc_has_permission(sd, PC_PERM_BYPASS_MAX_STAT) ) max_status[0] = max_status[1] = max_status[2] = max_status[3] = max_status[4] = max_status[5] = SHRT_MAX; else { max_status[0] = pc_maxparameter(sd,PARAM_STR); max_status[1] = pc_maxparameter(sd,PARAM_AGI); max_status[2] = pc_maxparameter(sd,PARAM_VIT); max_status[3] = pc_maxparameter(sd,PARAM_INT); max_status[4] = pc_maxparameter(sd,PARAM_DEX); max_status[5] = pc_maxparameter(sd,PARAM_LUK); } if(value > 0 && *status[i] + value >= max_status[i]) new_value = max_status[i]; else if(value < 0 && *status[i] <= -value) new_value = 1; else new_value = *status[i] + value; if (new_value != *status[i]) { *status[i] = new_value; clif_updatestatus(sd, SP_STR + i); clif_updatestatus(sd, SP_USTR + i); status_calc_pc(sd, SCO_FORCE); clif_displaymessage(fd, msg_txt(sd,42)); // Stat changed. } else { if (value < 0) clif_displaymessage(fd, msg_txt(sd,41)); // Unable to decrease the number/value. else clif_displaymessage(fd, msg_txt(sd,149)); // Unable to increase the number/value. return -1; } return 0; } /*========================================== * Stat all by fritz (rewritten by [Yor]) *------------------------------------------*/ ACMD_FUNC(stat_all) { int value = 0; uint8 count, i; unsigned short *status[PARAM_MAX], max_status[PARAM_MAX]; //we don't use direct initialization because it isn't part of the c standard. nullpo_retr(-1, sd); status[0] = &sd->status.str; status[1] = &sd->status.agi; status[2] = &sd->status.vit; status[3] = &sd->status.int_; status[4] = &sd->status.dex; status[5] = &sd->status.luk; if (!message || !*message || sscanf(message, "%11d", &value) < 1 || value == 0) { max_status[0] = pc_maxparameter(sd,PARAM_STR); max_status[1] = pc_maxparameter(sd,PARAM_AGI); max_status[2] = pc_maxparameter(sd,PARAM_VIT); max_status[3] = pc_maxparameter(sd,PARAM_INT); max_status[4] = pc_maxparameter(sd,PARAM_DEX); max_status[5] = pc_maxparameter(sd,PARAM_LUK); value = SHRT_MAX; } else { if( pc_has_permission(sd, PC_PERM_BYPASS_MAX_STAT) ) max_status[0] = max_status[1] = max_status[2] = max_status[3] = max_status[4] = max_status[5] = SHRT_MAX; else { max_status[0] = pc_maxparameter(sd,PARAM_STR); max_status[1] = pc_maxparameter(sd,PARAM_AGI); max_status[2] = pc_maxparameter(sd,PARAM_VIT); max_status[3] = pc_maxparameter(sd,PARAM_INT); max_status[4] = pc_maxparameter(sd,PARAM_DEX); max_status[5] = pc_maxparameter(sd,PARAM_LUK); } } count = 0; for (i = 0; i < ARRAYLENGTH(status); i++) { short new_value; if (value > 0 && *status[i] + value >= max_status[i]) new_value = max_status[i]; else if (value < 0 && *status[i] <= -value) new_value = 1; else new_value = *status[i] + value; if (new_value != *status[i]) { *status[i] = new_value; clif_updatestatus(sd, SP_STR + i); clif_updatestatus(sd, SP_USTR + i); count++; } } if (count > 0) { // if at least 1 stat modified status_calc_pc(sd, SCO_FORCE); clif_displaymessage(fd, msg_txt(sd,84)); // All stats changed! } else { if (value < 0) clif_displaymessage(fd, msg_txt(sd,177)); // You cannot decrease that stat anymore. else clif_displaymessage(fd, msg_txt(sd,178)); // You cannot increase that stat anymore. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(guildlevelup) { int level = 0; short added_level; struct guild *guild_info; nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%11d", &level) < 1 || level == 0) { clif_displaymessage(fd, msg_txt(sd,1014)); // Please enter a valid level (usage: @guildlvup/@guildlvlup <# of levels>). return -1; } if (sd->status.guild_id <= 0 || (guild_info = sd->guild) == NULL) { clif_displaymessage(fd, msg_txt(sd,43)); // You're not in a guild. return -1; } //if (strcmp(sd->status.name, guild_info->master) != 0) { // clif_displaymessage(fd, msg_txt(sd,44)); // 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 positive 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 negative overflow added_level = 1 - guild_info->guild_lv; if (added_level != 0) { intif_guild_change_basicinfo(guild_info->guild_id, GBI_GUILDLV, &added_level, sizeof(added_level)); clif_displaymessage(fd, msg_txt(sd,179)); // Guild level changed. } else { clif_displaymessage(fd, msg_txt(sd,45)); // Guild level change failed. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(makeegg) { struct item_data *item_data; int id, pet_id; nullpo_retr(-1, sd); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1015)); // Please enter a monster/egg name/ID (usage: @makeegg <pet>). return -1; } if ((item_data = itemdb_searchname(message)) != NULL) // for egg name id = item_data->nameid; else if ((id = mobdb_searchname(message)) != 0) // for monster name ; else id = atoi(message); pet_id = search_petDB_index(id, PET_CLASS); if (pet_id < 0) pet_id = search_petDB_index(id, PET_EGG); if (pet_id >= 0) { sd->catch_target_class = pet_db[pet_id].class_; intif_create_pet(sd->status.account_id, sd->status.char_id, pet_db[pet_id].class_, mob_db(pet_db[pet_id].class_)->lv, pet_db[pet_id].EggID, 0, pet_db[pet_id].intimate, 100, 0, 1, pet_db[pet_id].jname); } else { clif_displaymessage(fd, msg_txt(sd,180)); // The monster/egg name/id doesn't exist. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(hatch) { nullpo_retr(-1, sd); if (sd->status.pet_id <= 0) clif_sendegg(sd); else { clif_displaymessage(fd, msg_txt(sd,181)); // You already have a pet. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(petfriendly) { int friendly; struct pet_data *pd; nullpo_retr(-1, sd); if (!message || !*message || (friendly = atoi(message)) < 0) { clif_displaymessage(fd, msg_txt(sd,1016)); // Please enter a valid value (usage: @petfriendly <0-1000>). return -1; } pd = sd->pd; if (!pd) { clif_displaymessage(fd, msg_txt(sd,184)); // Sorry, but you have no pet. return -1; } if (friendly < 0 || friendly > 1000) { clif_displaymessage(fd, msg_txt(sd,37)); // An invalid number was specified. return -1; } if (friendly == pd->pet.intimate) { clif_displaymessage(fd, msg_txt(sd,183)); // Pet intimacy is already at maximum. return -1; } pet_set_intimate(pd, friendly); clif_send_petstatus(sd); clif_displaymessage(fd, msg_txt(sd,182)); // Pet intimacy changed. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(pethungry) { int hungry; struct pet_data *pd; nullpo_retr(-1, sd); if (!message || !*message || (hungry = atoi(message)) < 0) { clif_displaymessage(fd, msg_txt(sd,1017)); // Please enter a valid number (usage: @pethungry <0-100>). return -1; } pd = sd->pd; if (!sd->status.pet_id || !pd) { clif_displaymessage(fd, msg_txt(sd,184)); // Sorry, but you have no pet. return -1; } if (hungry < 0 || hungry > 100) { clif_displaymessage(fd, msg_txt(sd,37)); // An invalid number was specified. return -1; } if (hungry == pd->pet.hungry) { clif_displaymessage(fd, msg_txt(sd,186)); // Pet hunger is already at maximum. return -1; } pd->pet.hungry = hungry; clif_send_petstatus(sd); clif_displaymessage(fd, msg_txt(sd,185)); // Pet hunger changed. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(petrename) { struct pet_data *pd; nullpo_retr(-1, sd); if (!sd->status.pet_id || !sd->pd) { clif_displaymessage(fd, msg_txt(sd,184)); // Sorry, but you have no pet. return -1; } pd = sd->pd; if (!pd->pet.rename_flag) { clif_displaymessage(fd, msg_txt(sd,188)); // You can already rename your pet. return -1; } pd->pet.rename_flag = 0; intif_save_petdata(sd->status.account_id, &pd->pet); clif_send_petstatus(sd); clif_displaymessage(fd, msg_txt(sd,187)); // You can now rename your pet. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(recall) { struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1018)); // Please enter a player name (usage: @recall <char name/ID>). return -1; } if((pl_sd=map_nick2sd(atcmd_player_name,true)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level doesn't authorize you to preform this action on the specified player. return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,1019)); // You are not authorized to warp someone to this map. return -1; } if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,1020)); // You are not authorized to warp this player from their map. return -1; } if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) { return -1; } if( pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN) == SETPOS_AUTOTRADE ){ clif_displaymessage(fd, msg_txt(sd,1025)); // The player is currently autotrading and cannot be recalled. return -1; } sprintf(atcmd_output, msg_txt(sd,46), pl_sd->status.name); // %s recalled! clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * charblock command (usage: charblock <player_name>) * This command do a definitiv ban on a player *------------------------------------------*/ ACMD_FUNC(char_block) { nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { sprintf(atcmd_output, msg_txt(sd, 1021), command); // Please enter a player name (usage: %s <char name>). clif_displaymessage(fd, atcmd_output); return -1; } chrif_req_login_operation(sd->status.account_id, atcmd_player_name, CHRIF_OP_LOGIN_BLOCK, 0, 0, 0); sprintf(atcmd_output, msg_txt(sd,88), "login"); // Sending request to %s server... clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * accountban command (usage: ban <%time> <player_name>) * charban command (usage: charban <%time> <player_name>) * %time see common/timer.c::solve_time() *------------------------------------------*/ ACMD_FUNC(char_ban) { char *modif_p, output[CHAT_SIZE_MAX]; int32 timediff = 0; //don't set this as uint as we may want to decrease banned time enum chrif_req_op bantype; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); parent_cmd = atcommand_checkalias(command+1); if (strcmpi(parent_cmd,"charban") == 0) bantype = CHRIF_OP_BAN; else if (strcmpi(parent_cmd,"ban") == 0) bantype = CHRIF_OP_LOGIN_BAN; else return -1; if (!message || !*message || sscanf(message, "%255s %23[^\n]", atcmd_output, atcmd_player_name) < 2) { sprintf(output, msg_txt(sd,1022), command); // Please enter ban time and a player name (usage: %s <time> <char name>). clif_displaymessage(fd, output); return -1; } atcmd_output[sizeof(atcmd_output)-1] = '\0'; modif_p = atcmd_output; timediff = (int32)solve_time(modif_p); //discard seconds if (timediff == 0) { //allow negative ? safesnprintf(output, sizeof(output), msg_txt(sd,85), command, timediff); // Invalid time for %s command (time=%d) clif_displaymessage(fd, output); clif_displaymessage(fd, msg_txt(sd,702)); // Time parameter format is +/-<value> to alter. y/a = Year, m = Month, d/j = Day, h = Hour, n/mn = Minute, s = Second. return -1; } if( timediff < 0 && ( (bantype == CHRIF_OP_LOGIN_BAN && !pc_can_use_command(sd, "unban", COMMAND_ATCOMMAND)) || (bantype == CHRIF_OP_BAN && !pc_can_use_command(sd, "charunban", COMMAND_ATCOMMAND)) )) { clif_displaymessage(fd,msg_txt(sd,1023)); // You are not allowed to alter the time of a ban. return -1; } if (bantype == CHRIF_OP_BAN) chrif_req_charban(sd->status.account_id, atcmd_player_name,timediff); else chrif_req_login_operation(sd->status.account_id, atcmd_player_name, bantype, timediff, 0, 0); safesnprintf(output, sizeof(output), msg_txt(sd,88), bantype == CHRIF_OP_BAN ? "char" : "login"); // Sending request to %s server... clif_displaymessage(fd, output); return 0; } /*========================================== * charunblock command (usage: charunblock <player_name>) *------------------------------------------*/ ACMD_FUNC(char_unblock) { nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { sprintf(atcmd_output, msg_txt(sd, 1021), command); // Please enter a player name (usage: %s <char name>). clif_displaymessage(fd, atcmd_output); return -1; } // send answer to login server via char-server chrif_req_login_operation(sd->status.account_id, atcmd_player_name, CHRIF_OP_LOGIN_UNBLOCK, 0, 0, 0); sprintf(atcmd_output, msg_txt(sd,88), "login"); // Sending request to %s server... clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * acc unban command (usage: unban <player_name>) * char unban command (usage: charunban <player_name>) *------------------------------------------*/ ACMD_FUNC(char_unban){ enum chrif_req_op unbantype; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); parent_cmd = atcommand_checkalias(command+1); if (strcmpi(parent_cmd,"charunban") == 0) unbantype = CHRIF_OP_UNBAN; else if (strcmpi(parent_cmd,"unban") == 0) unbantype = CHRIF_OP_LOGIN_UNBAN; else return -1; if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { sprintf(atcmd_output, msg_txt(sd,435), command); // Please enter a player name (usage: %s <char name>). clif_displaymessage(fd, atcmd_output); return -1; } if (unbantype == CHRIF_OP_UNBAN) chrif_req_charunban(sd->status.account_id,atcmd_player_name); else chrif_req_login_operation(sd->status.account_id, atcmd_player_name, unbantype, 0, 0, 0); sprintf(atcmd_output, msg_txt(sd,88), unbantype == CHRIF_OP_UNBAN ? "char":"login"); // Sending request to %s server... clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(night) { nullpo_retr(-1, sd); if (night_flag != 1) { map_night_timer(night_timer_tid, 0, 0, 1); } else { clif_displaymessage(fd, msg_txt(sd,89)); // Night mode is already enabled. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(day) { nullpo_retr(-1, sd); if (night_flag != 0) { map_day_timer(day_timer_tid, 0, 0, 1); } else { clif_displaymessage(fd, msg_txt(sd,90)); // Day mode is already enabled. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(doom) { struct map_session_data* pl_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (pl_sd->fd != fd && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { status_kill(&pl_sd->bl); clif_specialeffect(&pl_sd->bl,450,AREA); clif_displaymessage(pl_sd->fd, msg_txt(sd,61)); // The holy messenger has given judgement. } } mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,62)); // Judgement was made. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(doommap) { struct map_session_data* pl_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (pl_sd->fd != fd && sd->bl.m == pl_sd->bl.m && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { status_kill(&pl_sd->bl); clif_specialeffect(&pl_sd->bl,450,AREA); clif_displaymessage(pl_sd->fd, msg_txt(sd,61)); // The holy messenger has given judgement. } } mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,62)); // Judgement was made. return 0; } /*========================================== * *------------------------------------------*/ static void atcommand_raise_sub(struct map_session_data* sd) { status_revive(&sd->bl, 100, 100); clif_skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1); clif_displaymessage(sd->fd, msg_txt(sd,63)); // Mercy has been shown. } /*========================================== * *------------------------------------------*/ ACMD_FUNC(raise) { struct map_session_data* pl_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) if( pc_isdead(pl_sd) ) atcommand_raise_sub(pl_sd); mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,64)); // Mercy has been granted. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(raisemap) { struct map_session_data* pl_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) if (sd->bl.m == pl_sd->bl.m && pc_isdead(pl_sd) ) atcommand_raise_sub(pl_sd); mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,64)); // Mercy has been granted. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(kick) { struct map_session_data *pl_sd; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1026)); // Please enter a player name (usage: @kick <char name/ID>). return -1; } if((pl_sd=map_nick2sd(atcmd_player_name,false)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player. return -1; } clif_GM_kick(sd, pl_sd); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(kickall) { struct map_session_data* pl_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kick only lower or same gm level if (sd->status.account_id != pl_sd->status.account_id) clif_GM_kick(NULL, pl_sd); } } mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,195)); // All players have been kicked! return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(allskill) { nullpo_retr(-1, sd); pc_allskillup(sd); // all skills sd->status.skill_point = 0; // 0 skill points clif_updatestatus(sd, SP_SKILLPOINT); // update clif_displaymessage(fd, msg_txt(sd,76)); // All skills have been added to your skill tree. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(questskill) { uint16 skill_id; nullpo_retr(-1, sd); if (!message || !*message || (skill_id = atoi(message)) <= 0) {// also send a list of skills applicable to this command const char* text; // attempt to find the text corresponding to this command text = atcommand_help_string( command ); // send the error message as always clif_displaymessage(fd, msg_txt(sd,1027)); // Please enter a quest skill number. if( text ) {// send the skill ID list associated with this command clif_displaymessage( fd, text ); } return -1; } if (skill_id >= MAX_SKILL_ID) { clif_displaymessage(fd, msg_txt(sd,198)); // This skill number doesn't exist. return -1; } if (!(skill_get_inf2(skill_id) & INF2_QUEST_SKILL)) { clif_displaymessage(fd, msg_txt(sd,197)); // This skill number doesn't exist or isn't a quest skill. return -1; } if (pc_checkskill(sd, skill_id) > 0) { clif_displaymessage(fd, msg_txt(sd,196)); // You already have this quest skill. return -1; } pc_skill(sd, skill_id, 1, ADDSKILL_PERMANENT); clif_displaymessage(fd, msg_txt(sd,70)); // You have learned the skill. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(lostskill) { uint16 skill_id = 0, sk_idx = 0; nullpo_retr(-1, sd); if (!message || !*message || (skill_id = atoi(message)) <= 0) {// also send a list of skills applicable to this command const char* text; // attempt to find the text corresponding to this command text = atcommand_help_string( command ); // send the error message as always clif_displaymessage(fd, msg_txt(sd,1027)); // Please enter a quest skill number. if( text ) {// send the skill ID list associated with this command clif_displaymessage( fd, text ); } return -1; } if (!(sk_idx = skill_get_index(skill_id))) { clif_displaymessage(fd, msg_txt(sd,198)); // This skill number doesn't exist. return -1; } if (!(skill_get_inf2(skill_id) & INF2_QUEST_SKILL)) { clif_displaymessage(fd, msg_txt(sd,197)); // This skill number doesn't exist or isn't a quest skill. return -1; } if (pc_checkskill(sd, skill_id) == 0) { clif_displaymessage(fd, msg_txt(sd,201)); // You don't have this quest skill. return -1; } sd->status.skill[sk_idx].lv = 0; sd->status.skill[sk_idx].flag = SKILL_FLAG_PERMANENT; clif_deleteskill(sd,skill_id); clif_displaymessage(fd, msg_txt(sd,71)); // You have forgotten the skill. return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(spiritball) { uint32 max_spiritballs; int number; nullpo_retr(-1, sd); max_spiritballs = zmin(ARRAYLENGTH(sd->spirit_timer), 0x7FFF); if( !message || !*message || (number = atoi(message)) < 0 || number > max_spiritballs ) { char msg[CHAT_SIZE_MAX]; safesnprintf(msg, sizeof(msg), msg_txt(sd,1028), max_spiritballs); // Please enter a party name (usage: @party <party_name>). clif_displaymessage(fd, msg); return -1; } if( sd->spiritball > 0 ) pc_delspiritball(sd, sd->spiritball, 1); sd->spiritball = number; clif_spiritball(&sd->bl); // no message, player can look the difference return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(party) { char party[NAME_LENGTH]; nullpo_retr(-1, sd); memset(party, '\0', sizeof(party)); if (!message || !*message || sscanf(message, "%23[^\n]", party) < 1) { clif_displaymessage(fd, msg_txt(sd,1029)); // Please enter a party name (usage: @party <party_name>). return -1; } party_create(sd, party, 0, 0); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(guild) { char guild[NAME_LENGTH]; int prev; nullpo_retr(-1, sd); memset(guild, '\0', sizeof(guild)); if (sd->clan) { clif_displaymessage(fd, msg_txt(sd, 1498)); // You cannot create a guild because you are in a clan. return -1; } if (!message || !*message || sscanf(message, "%23[^\n]", guild) < 1) { clif_displaymessage(fd, msg_txt(sd,1030)); // 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; } ACMD_FUNC(breakguild) { nullpo_retr(-1, sd); if (sd->status.guild_id) { // Check if the player has a guild struct guild *g; g = sd->guild; // Search the guild if (g) { // Check if guild was found if (sd->state.gmaster_flag) { // Check if player is guild master int ret = 0; ret = guild_break(sd, g->name); // Break guild if (ret) { // Check if anything went wrong return 0; // Guild was broken } else { return -1; // Something went wrong } } else { // Not guild master clif_displaymessage(fd, msg_txt(sd,1181)); // You need to be a Guild Master to use this command. return -1; } } else { // Guild was not found. HOW? clif_displaymessage(fd, msg_txt(sd,252)); // You are not in a guild. return -1; } } else { // Player does not have a guild clif_displaymessage(fd, msg_txt(sd,252)); // You are not in a guild. return -1; } } /** * Start WoE:FE */ ACMD_FUNC(agitstart) { nullpo_retr(-1, sd); if( guild_agit_start() ){ clif_displaymessage(fd, msg_txt(sd,72)); // War of Emperium has been initiated. return 0; }else{ clif_displaymessage(fd, msg_txt(sd,73)); // War of Emperium is currently in progress. return -1; } } /** * Start WoE:SE */ ACMD_FUNC(agitstart2) { nullpo_retr(-1, sd); if( guild_agit2_start() ){ clif_displaymessage(fd, msg_txt(sd,403)); // "War of Emperium SE has been initiated." return 0; }else{ clif_displaymessage(fd, msg_txt(sd,404)); // "War of Emperium SE is currently in progress." return -1; } } /** * Start WoE:TE */ ACMD_FUNC(agitstart3) { nullpo_retr(-1, sd); if( guild_agit3_start() ){ clif_displaymessage(fd, msg_txt(sd,749)); // "War of Emperium TE has been initiated." return 0; }else{ clif_displaymessage(fd, msg_txt(sd,750)); // "War of Emperium TE is currently in progress." return -1; } } /** * End WoE:FE */ ACMD_FUNC(agitend) { nullpo_retr(-1, sd); if( guild_agit_end() ){ clif_displaymessage(fd, msg_txt(sd,74)); // War of Emperium has been ended. return 0; }else{ clif_displaymessage(fd, msg_txt(sd,75)); // War of Emperium is currently not in progress. return -1; } } /** * End WoE:SE */ ACMD_FUNC(agitend2) { nullpo_retr(-1, sd); if( guild_agit2_end() ){ clif_displaymessage(fd, msg_txt(sd,405)); // "War of Emperium SE has been ended." return 0; }else{ clif_displaymessage(fd, msg_txt(sd,406)); // "War of Emperium SE is currently not in progress." return -1; } } /** * End WoE:TE */ ACMD_FUNC(agitend3) { nullpo_retr(-1, sd); if( guild_agit3_end() ){ clif_displaymessage(fd, msg_txt(sd,751));// War of Emperium TE has been ended. return 0; }else{ clif_displaymessage(fd, msg_txt(sd,752));// War of Emperium TE is currently not in progress. return -1; } } /*========================================== * @mapexit - shuts down the map server *------------------------------------------*/ ACMD_FUNC(mapexit) { nullpo_retr(-1, sd); do_shutdown(); return 0; } /*========================================== * idsearch <part_of_name>: revrited by [Yor] *------------------------------------------*/ ACMD_FUNC(idsearch) { char item_name[100]; unsigned int i, match; struct item_data *item_array[MAX_SEARCH]; nullpo_retr(-1, sd); memset(item_name, '\0', sizeof(item_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%99s", item_name) < 0) { clif_displaymessage(fd, msg_txt(sd,1031)); // Please enter part of an item name (usage: @idsearch <part_of_item_name>). return -1; } sprintf(atcmd_output, msg_txt(sd,77), item_name); // The reference result of '%s' (name: id): clif_displaymessage(fd, atcmd_output); match = itemdb_searchname_array(item_array, MAX_SEARCH, item_name); if (match == MAX_SEARCH) { sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches clif_displaymessage(fd, atcmd_output); } for(i = 0; i < match; i++) { sprintf(atcmd_output, msg_txt(sd,78), item_array[i]->jname, item_array[i]->nameid); // %s: %d clif_displaymessage(fd, atcmd_output); } sprintf(atcmd_output, msg_txt(sd,79), match); // It is %d affair above. clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * Recall All Characters Online To Your Location *------------------------------------------*/ ACMD_FUNC(recallall) { struct map_session_data* pl_sd; struct s_mapiterator* iter; int count; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,1032)); // You are not authorized to warp someone to your current map. return -1; } count = 0; iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (sd->status.account_id != pl_sd->status.account_id && pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { if (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y) continue; // Don't waste time warping the character to the same place. if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) count++; else { if( pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN) == SETPOS_AUTOTRADE ){ count++; } } } } mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,92)); // All characters recalled! if (count) { sprintf(atcmd_output, msg_txt(sd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled. clif_displaymessage(fd, atcmd_output); } return 0; } /*========================================== * Recall online characters of a guild to your location *------------------------------------------*/ ACMD_FUNC(guildrecall) { struct map_session_data* pl_sd; struct s_mapiterator* iter; int count; char guild_name[NAME_LENGTH]; struct guild *g; nullpo_retr(-1, sd); memset(guild_name, '\0', sizeof(guild_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1034)); // Please enter a guild name/ID (usage: @guildrecall <guild_name/ID>). return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,1032)); // You are not authorized to warp someone to your current 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) { clif_displaymessage(fd, msg_txt(sd,94)); // Incorrect name/ID, or no one from the guild is online. return -1; } count = 0; iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (sd->status.account_id != pl_sd->status.account_id && pl_sd->status.guild_id == g->guild_id) { if (pc_get_group_level(pl_sd) > pc_get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)) continue; // Skip GMs greater than you... or chars already on the cell if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) count++; else{ if( pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN) == SETPOS_AUTOTRADE ){ count++; } } } } mapit_free(iter); sprintf(atcmd_output, msg_txt(sd,93), g->name); // All online characters of the %s guild have been recalled to your position. clif_displaymessage(fd, atcmd_output); if (count) { sprintf(atcmd_output, msg_txt(sd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled. clif_displaymessage(fd, atcmd_output); } return 0; } /*========================================== * Recall online characters of a party to your location *------------------------------------------*/ ACMD_FUNC(partyrecall) { struct map_session_data* pl_sd; struct s_mapiterator* iter; char party_name[NAME_LENGTH]; struct party_data *p; int count; nullpo_retr(-1, sd); memset(party_name, '\0', sizeof(party_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1035)); // Please enter a party name/ID (usage: @partyrecall <party_name/ID>). return -1; } if (sd->bl.m >= 0 && map[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { clif_displaymessage(fd, msg_txt(sd,1032)); // You are not authorized to warp someone to your current map. return -1; } if ((p = party_searchname(party_name)) == NULL && // name first to avoid error when name begin with a number (p = party_search(atoi(message))) == NULL) { clif_displaymessage(fd, msg_txt(sd,96)); // Incorrect name or ID, or no one from the party is online. return -1; } count = 0; iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (sd->status.account_id != pl_sd->status.account_id && pl_sd->status.party_id == p->party.party_id) { if (pc_get_group_level(pl_sd) > pc_get_group_level(sd) || (pl_sd->bl.m == sd->bl.m && pl_sd->bl.x == sd->bl.x && pl_sd->bl.y == sd->bl.y)) continue; // Skip GMs greater than you... or chars already on the cell if (pl_sd->bl.m >= 0 && map[pl_sd->bl.m].flag.nowarp && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) count++; else{ if( pc_setpos(pl_sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_RESPAWN) == SETPOS_AUTOTRADE ){ count++; } } } } mapit_free(iter); sprintf(atcmd_output, msg_txt(sd,95), p->party.name); // All online characters of the %s party have been recalled to your position. clif_displaymessage(fd, atcmd_output); if (count) { sprintf(atcmd_output, msg_txt(sd,1033), count); // Because you are not authorized to warp from some maps, %d player(s) have not been recalled. clif_displaymessage(fd, atcmd_output); } return 0; } /*========================================== * *------------------------------------------*/ void atcommand_doload(); ACMD_FUNC(reload) { nullpo_retr(-1, sd); if ((strlen(command) < 8 ) && (!message || !*message)) { const char* text; text = atcommand_help_string( command ); if(text) clif_displaymessage( fd, text ); return -1; } if (strstr(command, "itemdb") || strncmp(message, "itemdb", 4) == 0) { itemdb_reload(); clif_displaymessage(fd, msg_txt(sd,97)); // Item database has been reloaded. } else if (strstr(command, "mobdb") || strncmp(message, "mobdb", 3) == 0) { mob_reload(); read_petdb(); hom_reload(); mercenary_readdb(); mercenary_read_skilldb(); reload_elementaldb(); clif_displaymessage(fd, msg_txt(sd,98)); // Monster database has been reloaded. } else if (strstr(command, "skilldb") || strncmp(message, "skilldb", 4) == 0) { skill_reload(); hom_reload_skill(); reload_elemental_skilldb(); mercenary_read_skilldb(); clif_displaymessage(fd, msg_txt(sd,99)); // Skill database has been reloaded. } else if (strstr(command, "atcommand") || strncmp(message, "atcommand", 4) == 0) { config_t run_test; if (conf_read_file(&run_test, "conf/groups.conf")) { clif_displaymessage(fd, msg_txt(sd,1036)); // Error reading groups.conf, reload failed. return -1; } config_destroy(&run_test); if (conf_read_file(&run_test, ATCOMMAND_CONF_FILENAME)) { clif_displaymessage(fd, msg_txt(sd,1037)); // Error reading atcommand_athena.conf, reload failed. return -1; } config_destroy(&run_test); atcommand_doload(); pc_groups_reload(); clif_displaymessage(fd, msg_txt(sd,254)); // GM command configuration has been reloaded. } else if (strstr(command, "battleconf") || strncmp(message, "battleconf", 3) == 0) { struct Battle_Config prev_config; memcpy(&prev_config, &battle_config, sizeof(prev_config)); battle_config_read(BATTLE_CONF_FILENAME); if( prev_config.item_rate_mvp != battle_config.item_rate_mvp || prev_config.item_rate_common != battle_config.item_rate_common || prev_config.item_rate_common_boss != battle_config.item_rate_common_boss || prev_config.item_rate_common_mvp != battle_config.item_rate_common_mvp || prev_config.item_rate_card != battle_config.item_rate_card || prev_config.item_rate_card_boss != battle_config.item_rate_card_boss || prev_config.item_rate_card_mvp != battle_config.item_rate_card_mvp || prev_config.item_rate_equip != battle_config.item_rate_equip || prev_config.item_rate_equip_boss != battle_config.item_rate_equip_boss || prev_config.item_rate_equip_mvp != battle_config.item_rate_equip_mvp || prev_config.item_rate_heal != battle_config.item_rate_heal || prev_config.item_rate_heal_boss != battle_config.item_rate_heal_boss || prev_config.item_rate_heal_mvp != battle_config.item_rate_heal_mvp || prev_config.item_rate_use != battle_config.item_rate_use || prev_config.item_rate_use_boss != battle_config.item_rate_use_boss || prev_config.item_rate_use_mvp != battle_config.item_rate_use_mvp || prev_config.item_rate_treasure != battle_config.item_rate_treasure || prev_config.item_rate_adddrop != battle_config.item_rate_adddrop || prev_config.logarithmic_drops != battle_config.logarithmic_drops || prev_config.item_drop_common_min != battle_config.item_drop_common_min || prev_config.item_drop_common_max != battle_config.item_drop_common_max || prev_config.item_drop_card_min != battle_config.item_drop_card_min || prev_config.item_drop_card_max != battle_config.item_drop_card_max || prev_config.item_drop_equip_min != battle_config.item_drop_equip_min || prev_config.item_drop_equip_max != battle_config.item_drop_equip_max || prev_config.item_drop_mvp_min != battle_config.item_drop_mvp_min || prev_config.item_drop_mvp_max != battle_config.item_drop_mvp_max || prev_config.item_drop_heal_min != battle_config.item_drop_heal_min || prev_config.item_drop_heal_max != battle_config.item_drop_heal_max || prev_config.item_drop_use_min != battle_config.item_drop_use_min || prev_config.item_drop_use_max != battle_config.item_drop_use_max || prev_config.item_drop_treasure_min != battle_config.item_drop_treasure_min || prev_config.item_drop_treasure_max != battle_config.item_drop_treasure_max || prev_config.base_exp_rate != battle_config.base_exp_rate || prev_config.job_exp_rate != battle_config.job_exp_rate ) { // Exp or Drop rates changed. mob_reload(); //Needed as well so rate changes take effect. chrif_ragsrvinfo(battle_config.base_exp_rate, battle_config.job_exp_rate, battle_config.item_rate_common); } clif_displaymessage(fd, msg_txt(sd,255)); // Battle configuration has been reloaded. } else if (strstr(command, "statusdb") || strncmp(message, "statusdb", 3) == 0) { status_readdb(); clif_displaymessage(fd, msg_txt(sd,256)); // Status database has been reloaded. } else if (strstr(command, "pcdb") || strncmp(message, "pcdb", 2) == 0) { pc_readdb(); clif_displaymessage(fd, msg_txt(sd,257)); // Player database has been reloaded. } else if (strstr(command, "motd") || strncmp(message, "motd", 4) == 0) { pc_read_motd(); clif_displaymessage(fd, msg_txt(sd,268)); // Reloaded the Message of the Day. } else if (strstr(command, "script") || strncmp(message, "script", 3) == 0) { struct s_mapiterator* iter; struct map_session_data* pl_sd; //atcommand_broadcast( fd, sd, "@broadcast", "Server is reloading scripts..." ); //atcommand_broadcast( fd, sd, "@broadcast", "You will feel a bit of lag at this point !" ); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) pc_close_npc(pl_sd,2); mapit_free(iter); flush_fifos(); map_reloadnpc(true); // reload config files seeking for npcs script_reload(); npc_reload(); clif_displaymessage(fd, msg_txt(sd,100)); // Scripts have been reloaded. } else if (strstr(command, "msgconf") || strncmp(message, "msgconf", 3) == 0) { map_msg_reload(); clif_displaymessage(fd, msg_txt(sd,463)); // Message configuration has been reloaded. } else if (strstr(command, "questdb") || strncmp(message, "questdb", 3) == 0) { do_reload_quest(); clif_displaymessage(fd, msg_txt(sd,1377)); // Quest database has been reloaded. } else if (strstr(command, "instancedb") || strncmp(message, "instancedb", 4) == 0) { instance_reload(); clif_displaymessage(fd, msg_txt(sd,516)); // Instance database has been reloaded. } else if (strstr(command, "achievementdb") || strncmp(message, "achievementdb", 4) == 0) { achievement_db_reload(); clif_displaymessage(fd, msg_txt(sd,771)); // Achievement database has been reloaded. } return 0; } /*========================================== * @partysharelvl <share_range> [Akinari] * Updates char server party share level range in runtime * Temporary - Permanent update in inter_athena.conf *------------------------------------------*/ ACMD_FUNC(partysharelvl) { unsigned int share_lvl; nullpo_retr(-1, sd); if(!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1322)); // Please enter an amount. return -1; } else { share_lvl = min(abs(atoi(message)),MAX_LEVEL); } if(intif_party_sharelvlupdate(share_lvl)) //Successfully updated clif_displaymessage(fd, msg_txt(sd,1478)); // Party share level range has been changed successfully. else //Char server offline clif_displaymessage(fd, msg_txt(sd,1479)); // Failed to update configuration. Character server is offline. return 0; } /*========================================== * @mapinfo [0-3] <map name> by MC_Cameri * => Shows information about the map [map name] * 0 = no additional information * 1 = Show users in that map and their location * 2 = Shows NPCs in that map * 3 = Shows the chats in that map *------------------------------------------*/ ACMD_FUNC(mapinfo) { struct map_session_data* pl_sd; struct s_mapiterator* iter; struct chat_data *cd = NULL; char direction[12]; int i, m_id, chat_num = 0, list = 0, vend_num = 0; unsigned short m_index; char mapname[24]; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(mapname, '\0', sizeof(mapname)); memset(direction, '\0', sizeof(direction)); sscanf(message, "%11d %23[^\n]", &list, mapname); if (list < 0 || list > 3) { clif_displaymessage(fd, msg_txt(sd,1038)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>). return -1; } if (mapname[0] == '\0') { safestrncpy(mapname, mapindex_id2name(sd->mapindex), MAP_NAME_LENGTH); m_id = map_mapindex2mapid(sd->mapindex); } else { m_id = map_mapname2mapid(mapname); } if (m_id < 0) { clif_displaymessage(fd, msg_txt(sd,1)); // Map not found. return -1; } m_index = mapindex_name2id(mapname); //This one shouldn't fail since the previous seek did not. clif_displaymessage(fd, msg_txt(sd,1039)); // ------ Map Info ------ // count chats (for initial message) chat_num = 0; iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if( pl_sd->mapindex == m_index ) { if( pl_sd->state.vending ) vend_num++; else if( (cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && cd->usersd[0] == pl_sd ) chat_num++; } } mapit_free(iter); sprintf(atcmd_output, msg_txt(sd,1040), mapname, map[m_id].users, map[m_id].npc_num, chat_num, vend_num); // Map: %s | Players: %d | NPCs: %d | Chats: %d | Vendings: %d clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1041)); // ------ Map Flags ------ if (map[m_id].flag.town) clif_displaymessage(fd, msg_txt(sd,1042)); // Town Map if (map[m_id].flag.restricted){ sprintf(atcmd_output, " Restricted (zone %d)",map[m_id].zone); clif_displaymessage(fd, atcmd_output); } if (battle_config.autotrade_mapflag == map[m_id].flag.autotrade) clif_displaymessage(fd, msg_txt(sd,1043)); // Autotrade Enabled else clif_displaymessage(fd, msg_txt(sd,1044)); // Autotrade Disabled if (map[m_id].flag.battleground){ sprintf(atcmd_output, msg_txt(sd,1045),map[m_id].flag.battleground); // Battlegrounds ON (type %d) clif_displaymessage(fd, atcmd_output); } /* Skill damage adjustment info [Cydh] */ #ifdef ADJUST_SKILL_DAMAGE if (map[m_id].flag.skill_damage) { clif_displaymessage(fd,msg_txt(sd,1052)); // Skill Damage Adjustments: sprintf(atcmd_output," > [Map] %d%%, %d%%, %d%%, %d%% | Caster:%d" ,map[m_id].adjust.damage.pc ,map[m_id].adjust.damage.mob ,map[m_id].adjust.damage.boss ,map[m_id].adjust.damage.other ,map[m_id].adjust.damage.caster); clif_displaymessage(fd, atcmd_output); if (map[m_id].skill_damage.count) { uint8 j; clif_displaymessage(fd," > [Map Skill] Name : Player, Monster, Boss Monster, Other | Caster"); for (j = 0; j < map[m_id].skill_damage.count; j++) { sprintf(atcmd_output," %d. %s : %d%%, %d%%, %d%%, %d%% | %d" ,j+1 ,skill_get_name(map[m_id].skill_damage.entries[j]->skill_id) ,map[m_id].skill_damage.entries[j]->pc ,map[m_id].skill_damage.entries[j]->mob ,map[m_id].skill_damage.entries[j]->boss ,map[m_id].skill_damage.entries[j]->other ,map[m_id].skill_damage.entries[j]->caster); clif_displaymessage(fd,atcmd_output); } } } #endif strcpy(atcmd_output,msg_txt(sd,1046)); // PvP Flags: if (map[m_id].flag.pvp) strcat(atcmd_output, " Pvp ON |"); if (map[m_id].flag.pvp_noguild) strcat(atcmd_output, " NoGuild |"); if (map[m_id].flag.pvp_noparty) strcat(atcmd_output, " NoParty |"); if (map[m_id].flag.pvp_nightmaredrop) strcat(atcmd_output, " NightmareDrop |"); if (map[m_id].flag.pvp_nocalcrank) strcat(atcmd_output, " NoCalcRank |"); clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output,msg_txt(sd,1047)); // GvG Flags: if (map[m_id].flag.gvg) strcat(atcmd_output, " GvG ON |"); if (map[m_id].flag.gvg_dungeon) strcat(atcmd_output, " GvG Dungeon |"); if (map[m_id].flag.gvg_castle) strcat(atcmd_output, " GvG Castle |"); if (map[m_id].flag.gvg_te) strcat(atcmd_output, " GvG TE |"); if (map[m_id].flag.gvg_te_castle) strcat(atcmd_output, " GvG TE Castle |"); if (map[m_id].flag.gvg_noparty) strcat(atcmd_output, " NoParty |"); clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output,msg_txt(sd,1048)); // Teleport Flags: if (map[m_id].flag.noteleport) strcat(atcmd_output, " NoTeleport |"); if (map[m_id].flag.monster_noteleport) strcat(atcmd_output, " Monster NoTeleport |"); if (map[m_id].flag.nowarp) strcat(atcmd_output, " NoWarp |"); if (map[m_id].flag.nowarpto) strcat(atcmd_output, " NoWarpTo |"); if (map[m_id].flag.noreturn) strcat(atcmd_output, " NoReturn |"); if (map[m_id].flag.nogo) strcat(atcmd_output, " NoGo |"); // if (map[m_id].flag.nomemo) strcat(atcmd_output, " NoMemo |"); clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1065), // No Exp Penalty: %s | No Zeny Penalty: %s (map[m_id].flag.noexppenalty) ? msg_txt(sd,1066) : msg_txt(sd,1067), (map[m_id].flag.nozenypenalty) ? msg_txt(sd,1066) : msg_txt(sd,1067)); // On / Off clif_displaymessage(fd, atcmd_output); if (map[m_id].flag.nosave) { if (!map[m_id].save.map) clif_displaymessage(fd, msg_txt(sd,1068)); // No Save (Return to last Save Point) else if (map[m_id].save.x == -1 || map[m_id].save.y == -1 ) { sprintf(atcmd_output, msg_txt(sd,1069), mapindex_id2name(map[m_id].save.map)); // No Save, Save Point: %s,Random clif_displaymessage(fd, atcmd_output); } else { sprintf(atcmd_output, msg_txt(sd,1070), // No Save, Save Point: %s,%d,%d mapindex_id2name(map[m_id].save.map),map[m_id].save.x,map[m_id].save.y); clif_displaymessage(fd, atcmd_output); } } strcpy(atcmd_output,msg_txt(sd,1049)); // Weather Flags: if (map[m_id].flag.snow) strcat(atcmd_output, " Snow |"); if (map[m_id].flag.fog) strcat(atcmd_output, " Fog |"); if (map[m_id].flag.sakura) strcat(atcmd_output, " Sakura |"); if (map[m_id].flag.clouds) strcat(atcmd_output, " Clouds |"); if (map[m_id].flag.clouds2) strcat(atcmd_output, " Clouds2 |"); if (map[m_id].flag.fireworks) strcat(atcmd_output, " Fireworks |"); if (map[m_id].flag.leaves) strcat(atcmd_output, " Leaves |"); if (map[m_id].flag.nightenabled) strcat(atcmd_output, " Displays Night |"); clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output,msg_txt(sd,1050)); // Other Flags: if (map[m_id].flag.nobranch) strcat(atcmd_output, " NoBranch |"); if (map[m_id].flag.notrade) strcat(atcmd_output, " NoTrade |"); if (map[m_id].flag.novending) strcat(atcmd_output, " NoVending |"); if (map[m_id].flag.nodrop) strcat(atcmd_output, " NoDrop |"); if (map[m_id].flag.noskill) strcat(atcmd_output, " NoSkill |"); if (map[m_id].flag.noicewall) strcat(atcmd_output, " NoIcewall |"); if (map[m_id].flag.allowks) strcat(atcmd_output, " AllowKS |"); if (map[m_id].flag.reset) strcat(atcmd_output, " Reset |"); if (map[m_id].flag.hidemobhpbar) strcat(atcmd_output, " HideMobHPBar |"); clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output,msg_txt(sd,1051)); // Other Flags2: if (map[m_id].nocommand) strcat(atcmd_output, " NoCommand |"); if (map[m_id].flag.nobaseexp) strcat(atcmd_output, " NoBaseEXP |"); if (map[m_id].flag.nojobexp) strcat(atcmd_output, " NoJobEXP |"); if (map[m_id].flag.nomobloot) strcat(atcmd_output, " NoMobLoot |"); if (map[m_id].flag.nomvploot) strcat(atcmd_output, " NoMVPLoot |"); if (map[m_id].flag.partylock) strcat(atcmd_output, " PartyLock |"); if (map[m_id].flag.guildlock) strcat(atcmd_output, " GuildLock |"); if (map[m_id].flag.loadevent) strcat(atcmd_output, " Loadevent |"); if (map[m_id].flag.chmautojoin) strcat(atcmd_output, " Chmautojoin |"); if (map[m_id].flag.nousecart) strcat(atcmd_output, " NoUsecart |"); if (map[m_id].flag.noitemconsumption) strcat(atcmd_output, " NoItemConsumption |"); if (map[m_id].flag.nosumstarmiracle) strcat(atcmd_output, " NoSumStarMiracle |"); if (map[m_id].flag.nomineeffect) strcat(atcmd_output, " NoMineEffect |"); if (map[m_id].flag.nolockon) strcat(atcmd_output, " NoLockOn |"); if (map[m_id].flag.notomb) strcat(atcmd_output, " NoTomb |"); if (map[m_id].flag.nocostume) strcat(atcmd_output, " NoCostume |"); clif_displaymessage(fd, atcmd_output); switch (list) { case 0: // Do nothing. It's list 0, no additional display. break; case 1: clif_displaymessage(fd, msg_txt(sd,480)); // ----- Players in Map ----- iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if (pl_sd->mapindex == m_index) { sprintf(atcmd_output, msg_txt(sd,481), // Player '%s' (session #%d) | Location: %d,%d pl_sd->status.name, pl_sd->fd, pl_sd->bl.x, pl_sd->bl.y); clif_displaymessage(fd, atcmd_output); } } mapit_free(iter); break; case 2: clif_displaymessage(fd, msg_txt(sd,482)); // ----- NPCs in Map ----- for (i = 0; i < map[m_id].npc_num;) { struct npc_data *nd = map[m_id].npc[i]; switch(nd->ud.dir) { case DIR_NORTH: strcpy(direction, msg_txt(sd,491)); break; // North case DIR_NORTHWEST: strcpy(direction, msg_txt(sd,492)); break; // North West case DIR_WEST: strcpy(direction, msg_txt(sd,493)); break; // West case DIR_SOUTHWEST: strcpy(direction, msg_txt(sd,494)); break; // South West case DIR_SOUTH: strcpy(direction, msg_txt(sd,495)); break; // South case DIR_SOUTHEAST: strcpy(direction, msg_txt(sd,496)); break; // South East case DIR_EAST: strcpy(direction, msg_txt(sd,497)); break; // East case DIR_NORTHEAST: strcpy(direction, msg_txt(sd,498)); break; // North East default: strcpy(direction, msg_txt(sd,499)); break; // Unknown } if(strcmp(nd->name,nd->exname) == 0) sprintf(atcmd_output, msg_txt(sd,490), // NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d ++i, nd->name, direction, nd->class_, nd->bl.x, nd->bl.y); else sprintf(atcmd_output, msg_txt(sd,489), // NPC %d: %s::%s | Direction: %s | Sprite: %d | Location: %d %d ++i, nd->name, nd->exname, direction, nd->class_, nd->bl.x, nd->bl.y); clif_displaymessage(fd, atcmd_output); } break; case 3: clif_displaymessage(fd, msg_txt(sd,483)); // ----- Chats in Map ----- iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if ((cd = (struct chat_data*)map_id2bl(pl_sd->chatID)) != NULL && pl_sd->mapindex == m_index && cd->usersd[0] == pl_sd) { sprintf(atcmd_output, msg_txt(sd,484), // Chat: %s | Player: %s | Location: %d %d cd->title, pl_sd->status.name, cd->bl.x, cd->bl.y); clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,485), // Users: %d/%d | Password: %s | Public: %s cd->users, cd->limit, cd->pass, (cd->pub) ? msg_txt(sd,486) : msg_txt(sd,487)); // Yes / No clif_displaymessage(fd, atcmd_output); } } mapit_free(iter); break; default: // normally impossible to arrive here clif_displaymessage(fd, msg_txt(sd,488)); // Please enter at least one valid list number (usage: @mapinfo <0-3> <map>). return -1; break; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(mount_peco) { nullpo_retr(-1, sd); if (sd->disguise) { clif_displaymessage(fd, msg_txt(sd,212)); // Cannot mount while in disguise. return -1; } if( (sd->class_&MAPID_THIRDMASK) == MAPID_RUNE_KNIGHT && pc_checkskill(sd,RK_DRAGONTRAINING) > 0 ) { if( !(sd->sc.option&OPTION_DRAGON) ) { unsigned int option = OPTION_DRAGON1; if( message[0] ) { int color = atoi(message); option = ( color == 2 ? OPTION_DRAGON2 : color == 3 ? OPTION_DRAGON3 : color == 4 ? OPTION_DRAGON4 : color == 5 ? OPTION_DRAGON5 : OPTION_DRAGON1 ); } clif_displaymessage(sd->fd,msg_txt(sd,1119)); // You have mounted your Dragon. pc_setoption(sd, sd->sc.option|option); } else { clif_displaymessage(sd->fd,msg_txt(sd,1120)); // You have released your Dragon. pc_setoption(sd, sd->sc.option&~OPTION_DRAGON); } return 0; } if( (sd->class_&MAPID_THIRDMASK) == MAPID_RANGER && pc_checkskill(sd,RA_WUGRIDER) > 0 && (!pc_isfalcon(sd) || battle_config.warg_can_falcon) ) { if( !pc_isridingwug(sd) ) { clif_displaymessage(sd->fd,msg_txt(sd,1121)); // You have mounted your Warg. pc_setoption(sd, sd->sc.option|OPTION_WUGRIDER); } else { clif_displaymessage(sd->fd,msg_txt(sd,1122)); // You have released your Warg. pc_setoption(sd, sd->sc.option&~OPTION_WUGRIDER); } return 0; } if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) { if( !pc_ismadogear(sd) ) { clif_displaymessage(sd->fd,msg_txt(sd,1123)); // You have mounted your Mado Gear. pc_setoption(sd, sd->sc.option|OPTION_MADOGEAR); } else { clif_displaymessage(sd->fd,msg_txt(sd,1124)); // You have released your Mado Gear. pc_setoption(sd, sd->sc.option&~OPTION_MADOGEAR); } return 0; } if (!pc_isriding(sd)) { // if actually no peco if (!pc_checkskill(sd, KN_RIDING)) { clif_displaymessage(fd, msg_txt(sd,213)); // You can not mount a Peco Peco with your current job. return -1; } pc_setoption(sd, sd->sc.option | OPTION_RIDING); clif_displaymessage(fd, msg_txt(sd,102)); // You have mounted a Peco Peco. } else {//Dismount pc_setoption(sd, sd->sc.option & ~OPTION_RIDING); clif_displaymessage(fd, msg_txt(sd,214)); // You have released your Peco Peco. } return 0; } /*========================================== *Spy Commands by Syrus22 *------------------------------------------*/ ACMD_FUNC(guildspy) { char guild_name[NAME_LENGTH]; struct guild *g; nullpo_retr(-1, sd); memset(guild_name, '\0', sizeof(guild_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!enable_spy) { clif_displaymessage(fd, msg_txt(sd,1125)); // The mapserver has spy command support disabled. return -1; } if (!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1126)); // 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(atcmd_output, msg_txt(sd,103), g->name); // No longer spying on the %s guild. clif_displaymessage(fd, atcmd_output); } else { sd->guildspy = g->guild_id; sprintf(atcmd_output, msg_txt(sd,104), g->name); // Spying on the %s guild. clif_displaymessage(fd, atcmd_output); } } else { clif_displaymessage(fd, msg_txt(sd,94)); // Incorrect name/ID, or no one from the specified guild is online. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(partyspy) { char party_name[NAME_LENGTH]; struct party_data *p; nullpo_retr(-1, sd); memset(party_name, '\0', sizeof(party_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!enable_spy) { clif_displaymessage(fd, msg_txt(sd,1125)); // The mapserver has spy command support disabled. return -1; } if (!message || !*message || sscanf(message, "%23[^\n]", party_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1127)); // Please enter a party name/ID (usage: @partyspy <party_name/ID>). return -1; } if ((p = party_searchname(party_name)) != NULL || // name first to avoid error when name begin with a number (p = party_search(atoi(message))) != NULL) { if (sd->partyspy == p->party.party_id) { sd->partyspy = 0; sprintf(atcmd_output, msg_txt(sd,105), p->party.name); // No longer spying on the %s party. clif_displaymessage(fd, atcmd_output); } else { sd->partyspy = p->party.party_id; sprintf(atcmd_output, msg_txt(sd,106), p->party.name); // Spying on the %s party. clif_displaymessage(fd, atcmd_output); } } else { clif_displaymessage(fd, msg_txt(sd,96)); // Incorrect name/ID, or no one from the specified party is online. return -1; } return 0; } ACMD_FUNC(clanspy){ char clan_name[NAME_LENGTH]; struct clan* c; nullpo_retr(-1, sd); memset(clan_name, '\0', sizeof(clan_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if( !enable_spy ){ clif_displaymessage(fd, msg_txt(sd, 1125)); // The mapserver has spy command support disabled. return -1; } if( !message || !*message || sscanf( message, "%23[^\n]", clan_name ) < 1 ){ clif_displaymessage(fd, msg_txt(sd, 1499)); // Please enter a clan name/ID (usage: @clanspy <clan_name/ID>). return -1; } if ((c = clan_searchname(clan_name)) != NULL || // name first to avoid error when name begin with a number (c = clan_search(atoi(message))) != NULL) { if (sd->clanspy == c->id) { sd->clanspy = 0; sprintf(atcmd_output, msg_txt(sd, 1500), c->name); // No longer spying on the %s clan. clif_displaymessage(fd, atcmd_output); } else { sd->clanspy = c->id; sprintf(atcmd_output, msg_txt(sd, 1501), c->name); // Spying on the %s clan. clif_displaymessage(fd, atcmd_output); } } else { clif_displaymessage(fd, msg_txt(sd, 1502)); // Incorrect clan name/ID. return -1; } return 0; } /*========================================== * @repairall [Valaris] *------------------------------------------*/ ACMD_FUNC(repairall) { int count, i; nullpo_retr(-1, sd); count = 0; for (i = 0; i < MAX_INVENTORY; i++) { if (sd->inventory.u.items_inventory[i].nameid && sd->inventory.u.items_inventory[i].attribute == 1) { sd->inventory.u.items_inventory[i].attribute = 0; clif_produceeffect(sd, 0, sd->inventory.u.items_inventory[i].nameid); count++; } } if (count > 0) { clif_misceffect(&sd->bl, 3); clif_equiplist(sd); clif_displaymessage(fd, msg_txt(sd,107)); // All items have been repaired. } else { clif_displaymessage(fd, msg_txt(sd,108)); // No item need to be repaired. return -1; } return 0; } /*========================================== * @nuke [Valaris] *------------------------------------------*/ ACMD_FUNC(nuke) { struct map_session_data *pl_sd; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1128)); // Please enter a player name (usage: @nuke <char name>). return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name,false)) != NULL) { if (pc_get_group_level(sd) >= pc_get_group_level(pl_sd)) { // you can kill only lower or same GM level skill_castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, gettick(), 0); clif_displaymessage(fd, msg_txt(sd,109)); // Player has been nuked! } else { clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player. return -1; } } else { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } return 0; } /*========================================== * @tonpc *------------------------------------------*/ ACMD_FUNC(tonpc) { char npcname[NPC_NAME_LENGTH]; struct npc_data *nd; nullpo_retr(-1, sd); memset(npcname, 0, sizeof(npcname)); if (!message || !*message || sscanf(message, "%49[^\n]", npcname) < 1) { clif_displaymessage(fd, msg_txt(sd,1129)); // Please enter a NPC name (usage: @tonpc <NPC_name>). return -1; } if ((nd = npc_name2id(npcname)) != NULL) { if (pc_setpos(sd, map_id2index(nd->bl.m), nd->bl.x, nd->bl.y, CLR_TELEPORT) == SETPOS_OK) clif_displaymessage(fd, msg_txt(sd,0)); // Warped. else return -1; } else { clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(shownpc) { char NPCname[NPC_NAME_LENGTH]; nullpo_retr(-1, sd); memset(NPCname, '\0', sizeof(NPCname)); if (!message || !*message || sscanf(message, "%49[^\n]", NPCname) < 1) { clif_displaymessage(fd, msg_txt(sd,1130)); // Please enter a NPC name (usage: @enablenpc <NPC_name>). return -1; } if (npc_name2id(NPCname) != NULL) { npc_enable(NPCname, 1); clif_displaymessage(fd, msg_txt(sd,110)); // Npc Enabled. } else { clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist. return -1; } return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(hidenpc) { char NPCname[NPC_NAME_LENGTH]; nullpo_retr(-1, sd); memset(NPCname, '\0', sizeof(NPCname)); if (!message || !*message || sscanf(message, "%49[^\n]", NPCname) < 1) { clif_displaymessage(fd, msg_txt(sd,1131)); // Please enter a NPC name (usage: @hidenpc <NPC_name>). return -1; } if (npc_name2id(NPCname) == NULL) { clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist. return -1; } npc_enable(NPCname, 0); clif_displaymessage(fd, msg_txt(sd,112)); // Npc Disabled. return 0; } ACMD_FUNC(loadnpc) { if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1132)); // Please enter a script file name (usage: @loadnpc <file name>). return -1; } if (!npc_addsrcfile(message, true)) { clif_displaymessage(fd, msg_txt(sd,261)); // Script could not be loaded. return -1; } npc_read_event_script(); clif_displaymessage(fd, msg_txt(sd,262)); // Script loaded. return 0; } ACMD_FUNC(unloadnpc) { struct npc_data *nd; char NPCname[NPC_NAME_LENGTH]; nullpo_retr(-1, sd); memset(NPCname, '\0', sizeof(NPCname)); if (!message || !*message || sscanf(message, "%49[^\n]", NPCname) < 1) { clif_displaymessage(fd, msg_txt(sd,1133)); // Please enter a NPC name (usage: @unloadnpc <NPC_name>). return -1; } if ((nd = npc_name2id(NPCname)) == NULL) { clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist. return -1; } npc_unload_duplicates(nd); npc_unload(nd,true); npc_read_event_script(); clif_displaymessage(fd, msg_txt(sd,112)); // Npc Disabled. return 0; } ACMD_FUNC(reloadnpcfile) { if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,733)); // Please enter a NPC file name (usage: @reloadnpcfile <file name>). return -1; } if (npc_unloadfile(message)) clif_displaymessage(fd, msg_txt(sd,1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed. if (!npc_addsrcfile(message, true)) { clif_displaymessage(fd, msg_txt(sd,261)); // Script could not be loaded. return -1; } npc_read_event_script(); clif_displaymessage(fd, msg_txt(sd,262)); // Script loaded. return 0; } /*========================================== * time in txt for time command (by [Yor]) *------------------------------------------*/ char* txt_time(unsigned int duration) { int days, hours, minutes, seconds; char temp[CHAT_SIZE_MAX]; static char temp1[CHAT_SIZE_MAX]; memset(temp, '\0', sizeof(temp)); memset(temp1, '\0', sizeof(temp1)); days = duration / (60 * 60 * 24); duration = duration - (60 * 60 * 24 * days); hours = duration / (60 * 60); duration = duration - (60 * 60 * hours); minutes = duration / 60; seconds = duration - (60 * minutes); if (days == 1) sprintf(temp, msg_txt(NULL,219), days); // %d day else if (days > 1) sprintf(temp, msg_txt(NULL,220), days); // %d days if (hours == 1) sprintf(temp1, msg_txt(NULL,221), temp, hours); // %s %d hour else if (hours > 1) sprintf(temp1, msg_txt(NULL,222), temp, hours); // %s %d hours if (minutes < 2) sprintf(temp, msg_txt(NULL,223), temp1, minutes); // %s %d minute else sprintf(temp, msg_txt(NULL,224), temp1, minutes); // %s %d minutes if (seconds == 1) sprintf(temp1, msg_txt(NULL,225), temp, seconds); // %s and %d second else if (seconds > 1) sprintf(temp1, msg_txt(NULL,226), temp, seconds); // %s and %d seconds return temp1; } /*========================================== * @time/@date/@serverdate/@servertime: Display the date/time of the server (by [Yor] * Calculation management of GM modification (@day/@night GM commands) is done *------------------------------------------*/ ACMD_FUNC(servertime) { const struct TimerData * timer_data; time_t time_server; // variable for number of seconds (used with time() function) struct tm *datetime; // variable for time in structure ->tm_mday, ->tm_sec, ... char temp[CHAT_SIZE_MAX]; nullpo_retr(-1, sd); memset(temp, '\0', sizeof(temp)); time(&time_server); // get time in seconds since 1/1/1970 datetime = localtime(&time_server); // convert seconds in structure // like sprintf, but only for date/time (Sunday, November 02 2003 15:12:52) strftime(temp, sizeof(temp)-1, msg_txt(sd,230), datetime); // Server time (normal time): %A, %B %d %Y %X. clif_displaymessage(fd, temp); if (battle_config.night_duration == 0 && battle_config.day_duration == 0) { if (night_flag == 0) clif_displaymessage(fd, msg_txt(sd,231)); // Game time: The game is in permanent daylight. else clif_displaymessage(fd, msg_txt(sd,232)); // Game time: The game is in permanent night. } else if (battle_config.night_duration == 0) if (night_flag == 1) { // we start with night timer_data = get_timer(day_timer_tid); sprintf(temp, msg_txt(sd,233), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is in night for %s. clif_displaymessage(fd, temp); clif_displaymessage(fd, msg_txt(sd,234)); // Game time: After, the game will be in permanent daylight. } else clif_displaymessage(fd, msg_txt(sd,231)); // Game time: The game is in permanent daylight. else if (battle_config.day_duration == 0) if (night_flag == 0) { // we start with day timer_data = get_timer(night_timer_tid); sprintf(temp, msg_txt(sd,235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is in daylight for %s. clif_displaymessage(fd, temp); clif_displaymessage(fd, msg_txt(sd,236)); // Game time: After, the game will be in permanent night. } else clif_displaymessage(fd, msg_txt(sd,232)); // Game time: The game is in permanent night. else { const struct TimerData * timer_data2; if (night_flag == 0) { timer_data = get_timer(night_timer_tid); timer_data2 = get_timer(day_timer_tid); sprintf(temp, msg_txt(sd,235), txt_time(DIFF_TICK(timer_data->tick,gettick())/1000)); // Game time: The game is in daylight for %s. clif_displaymessage(fd, temp); if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0) sprintf(temp, msg_txt(sd,237), txt_time(DIFF_TICK(timer_data->interval,DIFF_TICK(timer_data->tick,timer_data2->tick)) / 1000)); // Game time: After, the game will be in night for %s. else sprintf(temp, msg_txt(sd,237), txt_time(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000)); // Game time: After, the game will be in night for %s. clif_displaymessage(fd, temp); sprintf(temp, msg_txt(sd,238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. clif_displaymessage(fd, temp); } else { timer_data = get_timer(day_timer_tid); timer_data2 = get_timer(night_timer_tid); sprintf(temp, msg_txt(sd,233), txt_time(DIFF_TICK(timer_data->tick,gettick()) / 1000)); // Game time: The game is in night for %s. clif_displaymessage(fd, temp); if (DIFF_TICK(timer_data->tick,timer_data2->tick) > 0) sprintf(temp, msg_txt(sd,239), txt_time((timer_data->interval - DIFF_TICK(timer_data->tick, timer_data2->tick)) / 1000)); // Game time: After, the game will be in daylight for %s. else sprintf(temp, msg_txt(sd,239), txt_time(DIFF_TICK(timer_data2->tick, timer_data->tick) / 1000)); // Game time: After, the game will be in daylight for %s. clif_displaymessage(fd, temp); sprintf(temp, msg_txt(sd,238), txt_time(timer_data->interval / 1000)); // Game time: A day cycle has a normal duration of %s. clif_displaymessage(fd, temp); } } return 0; } /*========================================== * @jail <char_name> by [Yor] * Special warp! No check with nowarp and nowarpto flag *------------------------------------------*/ ACMD_FUNC(jail) { struct map_session_data *pl_sd; int x, y; unsigned short m_index; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1134)); // Please enter a player name (usage: @jail <char_name>). return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { // you can jail only lower or same GM clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player. return -1; } if (pl_sd->sc.data[SC_JAILED]) { clif_displaymessage(fd, msg_txt(sd,118)); // Player warped in jails. return -1; } switch(rnd() % 2) { //Jail Locations case 0: m_index = mapindex_name2id(MAP_JAIL); x = 24; y = 75; break; default: m_index = mapindex_name2id(MAP_JAIL); x = 49; y = 75; break; } //Duration of INT_MAX to specify infinity. sc_start4(NULL,&pl_sd->bl,SC_JAILED,100,INT_MAX,m_index,x,y,1000); clif_displaymessage(pl_sd->fd, msg_txt(sd,117)); // GM has send you in jails. clif_displaymessage(fd, msg_txt(sd,118)); // Player warped in jails. return 0; } /*========================================== * @unjail/@discharge <char_name> by [Yor] * Special warp! No check with nowarp and nowarpto flag *------------------------------------------*/ ACMD_FUNC(unjail) { struct map_session_data *pl_sd; memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1135)); // Please enter a player name (usage: @unjail/@discharge <char_name>). return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { // you can jail only lower or same GM clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player. return -1; } if (!pl_sd->sc.data[SC_JAILED]) { clif_displaymessage(fd, msg_txt(sd,119)); // This player is not in jails. return -1; } //Reset jail time to 1 sec. sc_start(NULL,&pl_sd->bl,SC_JAILED,100,1,1000); clif_displaymessage(pl_sd->fd, msg_txt(sd,120)); // A GM has discharged you from jail. clif_displaymessage(fd, msg_txt(sd,121)); // Player unjailed. return 0; } ACMD_FUNC(jailfor) { struct map_session_data *pl_sd = NULL; char * modif_p; int jailtime = 0,x,y; short m_index = 0; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%255s %23[^\n]",atcmd_output,atcmd_player_name) < 2) { clif_displaymessage(fd, msg_txt(sd,400)); //Usage: @jailfor <time> <character name> return -1; } atcmd_output[sizeof(atcmd_output)-1] = '\0'; modif_p = atcmd_output; jailtime = (int)solve_time(modif_p)/60; // Change to minutes if (jailtime == 0) { clif_displaymessage(fd, msg_txt(sd,1136)); // Invalid time for jail command. clif_displaymessage(fd, msg_txt(sd,702)); // Time parameter format is +/-<value> to alter. y/a = Year, m = Month, d/j = Day, h = Hour, n/mn = Minute, s = Second. return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if (pc_get_group_level(pl_sd) > pc_get_group_level(sd)) { clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player. return -1; } // Added by Coltaro if(pl_sd->sc.data[SC_JAILED] && pl_sd->sc.data[SC_JAILED]->val1 != INT_MAX) { // Update the player's jail time jailtime += pl_sd->sc.data[SC_JAILED]->val1; if (jailtime <= 0) { jailtime = 0; clif_displaymessage(pl_sd->fd, msg_txt(sd,120)); // GM has discharge you. clif_displaymessage(fd, msg_txt(sd,121)); // Player unjailed } else { int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0; char timestr[21]; time_t now=time(NULL); split_time(jailtime*60,&year,&month,&day,&hour,&minute,&second); sprintf(atcmd_output,msg_txt(sd,402),msg_txt(sd,1137),year,month,day,hour,minute); // %s in jail for %d years, %d months, %d days, %d hours and %d minutes clif_displaymessage(pl_sd->fd, atcmd_output); sprintf(atcmd_output,msg_txt(sd,402),msg_txt(sd,1138),year,month,day,hour,minute); // This player is now in jail for %d years, %d months, %d days, %d hours and %d minutes clif_displaymessage(fd, atcmd_output); timestamp2string(timestr,20,now+jailtime*60,"%Y-%m-%d %H:%M"); sprintf(atcmd_output,"Release date is: %s",timestr); clif_displaymessage(pl_sd->fd, atcmd_output); clif_displaymessage(fd, atcmd_output); } } else if (jailtime < 0) { clif_displaymessage(fd, msg_txt(sd,1136)); // Invalid time for jail command. return -1; } // Jail locations, add more as you wish. switch(rnd()%2) { case 1: // Jail #1 m_index = mapindex_name2id(MAP_JAIL); x = 49; y = 75; break; default: // Default Jail m_index = mapindex_name2id(MAP_JAIL); x = 24; y = 75; break; } sc_start4(NULL,&pl_sd->bl,SC_JAILED,100,jailtime,m_index,x,y,jailtime?60000:1000); //jailtime = 0: Time was reset to 0. Wait 1 second to warp player out (since it's done in status_change_timer). return 0; } //By Coltaro ACMD_FUNC(jailtime){ int year, month, day, hour, minute, second; char timestr[21]; time_t now = time(NULL); nullpo_retr(-1, sd); if (!sd->sc.data[SC_JAILED]) { clif_displaymessage(fd, msg_txt(sd,1139)); // You are not in jail. return -1; } if (sd->sc.data[SC_JAILED]->val1 == INT_MAX) { clif_displaymessage(fd, msg_txt(sd,1140)); // You have been jailed indefinitely. return 0; } if (sd->sc.data[SC_JAILED]->val1 <= 0) { // Was not jailed with @jailfor (maybe @jail? or warped there? or got recalled?) clif_displaymessage(fd, msg_txt(sd,1141)); // You have been jailed for an unknown amount of time. return -1; } // Get remaining jail time split_time(sd->sc.data[SC_JAILED]->val1*60,&year,&month,&day,&hour,&minute,&second); sprintf(atcmd_output,msg_txt(sd,402),msg_txt(sd,1142),year,month,day,hour,minute); // You will remain in jail for %d years, %d months, %d days, %d hours and %d minutes clif_displaymessage(fd, atcmd_output); timestamp2string(timestr,20,now+sd->sc.data[SC_JAILED]->val1*60,"%Y-%m-%d %H:%M"); sprintf(atcmd_output,"Release date is: %s",timestr); clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * @disguise <mob_id> by [Valaris] (simplified by [Yor]) *------------------------------------------*/ ACMD_FUNC(disguise) { int id = 0; nullpo_retr(-1, sd); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1143)); // Please enter a Monster/NPC name/ID (usage: @disguise <name/ID>). return -1; } if ((id = atoi(message)) > 0) { //Acquired an ID if (!mobdb_checkid(id) && !npcdb_checkid(id)) id = 0; //Invalid id for either mobs or npcs. } else { //Acquired a Name if ((id = mobdb_searchname(message)) == 0) { struct npc_data* nd = npc_name2id(message); if (nd != NULL) id = nd->class_; } } if (id == 0) { clif_displaymessage(fd, msg_txt(sd,123)); // Invalid Monster/NPC name/ID specified. return -1; } if(pc_isriding(sd)) { clif_displaymessage(fd, msg_txt(sd,1144)); // Character cannot be disguised while mounted. return -1; } if (sd->sc.data[SC_MONSTER_TRANSFORM] || sd->sc.data[SC_ACTIVE_MONSTER_TRANSFORM]) { clif_displaymessage(fd, msg_txt(sd,730)); // Character cannot be disguised while in monster transform. return -1; } pc_disguise(sd, id); clif_displaymessage(fd, msg_txt(sd,122)); // Disguise applied. return 0; } /*========================================== * DisguiseAll *------------------------------------------*/ ACMD_FUNC(disguiseall) { int mob_id=0; struct map_session_data *pl_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1145)); // Please enter a Monster/NPC name/ID (usage: @disguiseall <name/ID>). return -1; } if ((mob_id = mobdb_searchname(message)) == 0) // check name first (to avoid possible name beginning by a number) mob_id = atoi(message); if (!mobdb_checkid(mob_id) && !npcdb_checkid(mob_id)) { //if mob or npc... clif_displaymessage(fd, msg_txt(sd,123)); // Monster/NPC name/id not found. return -1; } iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) pc_disguise(pl_sd, mob_id); mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,122)); // Disguise applied. return 0; } /*========================================== * DisguiseGuild *------------------------------------------*/ ACMD_FUNC(disguiseguild) { int id = 0, i; char monster[NAME_LENGTH], guild[NAME_LENGTH]; struct guild *g; memset(monster, '\0', sizeof(monster)); memset(guild, '\0', sizeof(guild)); if( !message || !*message || sscanf(message, "%23[^,], %23[^\r\n]", monster, guild) < 2 ) { clif_displaymessage(fd, msg_txt(sd,1146)); // Please enter a mob name/ID and guild name/ID (usage: @disguiseguild <mob name/ID>, <guild name/ID>). return -1; } if( (id = atoi(monster)) > 0 ) { if( !mobdb_checkid(id) && !npcdb_checkid(id) ) id = 0; } else { if( (id = mobdb_searchname(monster)) == 0 ) { struct npc_data* nd = npc_name2id(monster); if( nd != NULL ) id = nd->class_; } } if( id == 0 ) { clif_displaymessage(fd, msg_txt(sd,123)); // Monster/NPC name/id hasn't been found. return -1; } if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) { clif_displaymessage(fd, msg_txt(sd,94)); // Incorrect name/ID, or no one from the guild is online. return -1; } for( i = 0; i < g->max_member; i++ ){ struct map_session_data *pl_sd; if( (pl_sd = g->member[i].sd) && !pc_isriding(pl_sd) ) pc_disguise(pl_sd, id); } clif_displaymessage(fd, msg_txt(sd,122)); // Disguise applied. return 0; } /*========================================== * @undisguise by [Yor] *------------------------------------------*/ ACMD_FUNC(undisguise) { nullpo_retr(-1, sd); if (sd->disguise) { pc_disguise(sd, 0); clif_displaymessage(fd, msg_txt(sd,124)); // Undisguise applied. } else { clif_displaymessage(fd, msg_txt(sd,125)); // You're not disguised. return -1; } return 0; } /*========================================== * UndisguiseAll *------------------------------------------*/ ACMD_FUNC(undisguiseall) { struct map_session_data *pl_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) if( pl_sd->disguise ) pc_disguise(pl_sd, 0); mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,124)); // Undisguise applied. return 0; } /*========================================== * UndisguiseGuild *------------------------------------------*/ ACMD_FUNC(undisguiseguild) { char guild_name[NAME_LENGTH]; struct guild *g; int i; nullpo_retr(-1, sd); memset(guild_name, '\0', sizeof(guild_name)); if(!message || !*message || sscanf(message, "%23[^\n]", guild_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1147)); // Please enter guild name/ID (usage: @undisguiseguild <guild name/ID>). return -1; } if( (g = guild_searchname(guild_name)) == NULL && (g = guild_search(atoi(message))) == NULL ) { clif_displaymessage(fd, msg_txt(sd,94)); // Incorrect name/ID, or no one from the guild is online. return -1; } for(i = 0; i < g->max_member; i++){ struct map_session_data *pl_sd; if( (pl_sd = g->member[i].sd) && pl_sd->disguise ) pc_disguise(pl_sd, 0); } clif_displaymessage(fd, msg_txt(sd,124)); // Undisguise applied. return 0; } /*========================================== * @exp by [Skotlex] *------------------------------------------*/ ACMD_FUNC(exp) { char output[CHAT_SIZE_MAX]; double nextb, nextj; nullpo_retr(-1, sd); memset(output, '\0', sizeof(output)); nextb = pc_nextbaseexp(sd); if (nextb) nextb = sd->status.base_exp*100.0/nextb; nextj = pc_nextjobexp(sd); if (nextj) nextj = sd->status.job_exp*100.0/nextj; sprintf(output, msg_txt(sd,1148), sd->status.base_level, nextb, sd->status.job_level, nextj); // Base Level: %d (%.3f%%) | Job Level: %d (%.3f%%) clif_displaymessage(fd, output); return 0; } /*========================================== * @broadcast by [Valaris] *------------------------------------------*/ ACMD_FUNC(broadcast) { nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1149)); // Please enter a message (usage: @broadcast <message>). return -1; } sprintf(atcmd_output, "%s: %s", sd->status.name, message); intif_broadcast(atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT); return 0; } /*========================================== * @localbroadcast by [Valaris] *------------------------------------------*/ ACMD_FUNC(localbroadcast) { nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1150)); // Please enter a message (usage: @localbroadcast <message>). return -1; } sprintf(atcmd_output, "%s: %s", sd->status.name, message); clif_broadcast(&sd->bl, atcmd_output, strlen(atcmd_output) + 1, BC_DEFAULT, ALL_SAMEMAP); return 0; } /*========================================== * @email <actual@email> <new@email> by [Yor] *------------------------------------------*/ ACMD_FUNC(email) { char actual_email[100]; char new_email[100]; nullpo_retr(-1, sd); memset(actual_email, '\0', sizeof(actual_email)); memset(new_email, '\0', sizeof(new_email)); if (!message || !*message || sscanf(message, "%99s %99s", actual_email, new_email) < 2) { clif_displaymessage(fd, msg_txt(sd,1151)); // Please enter 2 emails (usage: @email <actual@email> <new@email>). return -1; } if (e_mail_check(actual_email) == 0) { clif_displaymessage(fd, msg_txt(sd,144)); // Invalid actual email. If you have default e-mail, give [email protected]. return -1; } else if (e_mail_check(new_email) == 0) { clif_displaymessage(fd, msg_txt(sd,145)); // Invalid new email. Please enter a real e-mail. return -1; } else if (strcmpi(new_email, "[email protected]") == 0) { clif_displaymessage(fd, msg_txt(sd,146)); // New email must be a real e-mail. return -1; } else if (strcmpi(actual_email, new_email) == 0) { clif_displaymessage(fd, msg_txt(sd,147)); // New email must be different of the actual e-mail. return -1; } chrif_changeemail(sd->status.account_id, actual_email, new_email); clif_displaymessage(fd, msg_txt(sd,148)); // Information sent to login-server via char-server. return 0; } /*========================================== *@effect *------------------------------------------*/ ACMD_FUNC(effect) { int type = 0, flag = 0; nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%11d", &type) < 1) { clif_displaymessage(fd, msg_txt(sd,1152)); // Please enter an effect number (usage: @effect <effect number>). return -1; } clif_specialeffect(&sd->bl, type, (send_target)flag); clif_displaymessage(fd, msg_txt(sd,229)); // Your effect has changed. return 0; } /*========================================== * @killer by MouseJstr * enable killing players even when not in pvp *------------------------------------------*/ ACMD_FUNC(killer) { nullpo_retr(-1, sd); sd->state.killer = !sd->state.killer; if(sd->state.killer) clif_displaymessage(fd, msg_txt(sd,241)); // You can now attack and kill players freely. else { clif_displaymessage(fd, msg_txt(sd,292)); // Killer state reset. pc_stop_attack(sd); } return 0; } /*========================================== * @killable by MouseJstr * enable other people killing you *------------------------------------------*/ ACMD_FUNC(killable) { nullpo_retr(-1, sd); sd->state.killable = !sd->state.killable; if(sd->state.killable) clif_displaymessage(fd, msg_txt(sd,242)); // You can now be attacked and killed by players. else { clif_displaymessage(fd, msg_txt(sd,288)); // You are no longer killable. map_foreachinallrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id); } return 0; } /*========================================== * @skillon by MouseJstr * turn skills on for the map *------------------------------------------*/ ACMD_FUNC(skillon) { nullpo_retr(-1, sd); map[sd->bl.m].flag.noskill = 0; clif_displaymessage(fd, msg_txt(sd,244)); // Skills have been enabled on this map. return 0; } /*========================================== * @skilloff by MouseJstr * Turn skills off on the map *------------------------------------------*/ ACMD_FUNC(skilloff) { nullpo_retr(-1, sd); map[sd->bl.m].flag.noskill = 1; clif_displaymessage(fd, msg_txt(sd,243)); // Skills have been disabled on this map. return 0; } /*========================================== * @npcmove by MouseJstr * move a npc *------------------------------------------*/ ACMD_FUNC(npcmove) { short x = 0, y = 0, m; struct npc_data *nd = 0; char npc_name[NPC_NAME_LENGTH]; nullpo_retr(-1, sd); memset(npc_name, '\0', sizeof npc_name); if (!message || !*message || sscanf(message, "%6hd %6hd %49[^\n]", &x, &y, npc_name) < 3) { clif_displaymessage(fd, msg_txt(sd,1153)); // Usage: @npcmove <X> <Y> <npc_name> return -1; } if ((nd = npc_name2id(npc_name)) == NULL) { clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist. return -1; } if ((m=nd->bl.m) < 0 || nd->bl.prev == NULL) { clif_displaymessage(fd, msg_txt(sd,1154)); // NPC is not on this map. return -1; //Not on a map. } x = cap_value(x, 0, map[m].xs-1); y = cap_value(y, 0, map[m].ys-1); map_foreachinallrange(clif_outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); map_moveblock(&nd->bl, x, y, gettick()); map_foreachinallrange(clif_insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); clif_displaymessage(fd, msg_txt(sd,1155)); // NPC moved. return 0; } /*========================================== * @addwarp by MouseJstr * Create a new static warp point. *------------------------------------------*/ ACMD_FUNC(addwarp) { char mapname[MAP_NAME_LENGTH_EXT], warpname[NPC_NAME_LENGTH]; short x,y; unsigned short m; struct npc_data* nd; nullpo_retr(-1, sd); memset(warpname, '\0', sizeof(warpname)); if (!message || !*message || sscanf(message, "%15s %6hd %6hd %49[^\n]", mapname, &x, &y, warpname) < 4) { clif_displaymessage(fd, msg_txt(sd,1156)); // Usage: @addwarp <mapname> <X> <Y> <npc name> return -1; } m = mapindex_name2id(mapname); if( m == 0 ) { sprintf(atcmd_output, msg_txt(sd,1157), mapname); // Unknown map '%s'. clif_displaymessage(fd, atcmd_output); return -1; } nd = npc_add_warp(warpname, sd->bl.m, sd->bl.x, sd->bl.y, 2, 2, m, x, y); if( nd == NULL ) return -1; sprintf(atcmd_output, msg_txt(sd,1158), nd->exname); // New warp NPC '%s' created. clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * @follow by [MouseJstr] * Follow a player .. staying no more then 5 spaces away *------------------------------------------*/ ACMD_FUNC(follow) { struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { if (sd->followtarget == -1) return -1; pc_stop_following (sd); clif_displaymessage(fd, msg_txt(sd,1159)); // Follow mode OFF. return 0; } if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == NULL ) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if (sd->followtarget == pl_sd->bl.id) { pc_stop_following (sd); clif_displaymessage(fd, msg_txt(sd,1159)); // Follow mode OFF. } else { pc_follow(sd, pl_sd->bl.id); clif_displaymessage(fd, msg_txt(sd,1160)); // Follow mode ON. } return 0; } /*========================================== * @dropall by [MouseJstr] and [Xantara] * Drops all your possession on the ground based on item type *------------------------------------------*/ ACMD_FUNC(dropall) { int8 type = -1; uint16 i, count = 0, count2 = 0; struct item_data *item_data = NULL; nullpo_retr(-1, sd); if( message[0] ) { type = atoi(message); if( type != -1 && type != IT_HEALING && type != IT_USABLE && type != IT_ETC && type != IT_WEAPON && type != IT_ARMOR && type != IT_CARD && type != IT_PETEGG && type != IT_PETARMOR && type != IT_AMMO ) { clif_displaymessage(fd, msg_txt(sd,1492)); // Usage: @dropall {<type>} clif_displaymessage(fd, msg_txt(sd,1493)); // Type List: (default) all = -1, healing = 0, usable = 2, etc = 3, armor = 4, weapon = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10 return -1; } } for( i = 0; i < MAX_INVENTORY; i++ ) { if( sd->inventory.u.items_inventory[i].amount ) { if( (item_data = itemdb_exists(sd->inventory.u.items_inventory[i].nameid)) == NULL ) { ShowDebug("Non-existant item %d on dropall list (account_id: %d, char_id: %d)\n", sd->inventory.u.items_inventory[i].nameid, sd->status.account_id, sd->status.char_id); continue; } if( !pc_candrop(sd,&sd->inventory.u.items_inventory[i]) ) continue; if( type == -1 || type == (uint8)item_data->type ) { if( sd->inventory.u.items_inventory[i].equip != 0 ) pc_unequipitem(sd, i, 3); if(pc_dropitem(sd, i, sd->inventory.u.items_inventory[i].amount)) count += sd->inventory.u.items_inventory[i].amount; else count2 += sd->inventory.u.items_inventory[i].amount; } } } sprintf(atcmd_output, msg_txt(sd,1494), count,count2); // %d items are dropped (%d skipped)! clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * @storeall by [MouseJstr] * Put everything into storage *------------------------------------------*/ ACMD_FUNC(storeall) { int i; nullpo_retr(-1, sd); if (sd->state.storage_flag != 1) { //Open storage. if( storage_storageopen(sd) == 1 ) { clif_displaymessage(fd, msg_txt(sd,1161)); // You currently cannot open your storage. return -1; } } for (i = 0; i < MAX_INVENTORY; i++) { if (sd->inventory.u.items_inventory[i].amount) { if(sd->inventory.u.items_inventory[i].equip != 0) pc_unequipitem(sd, i, 3); storage_storageadd(sd, &sd->storage, i, sd->inventory.u.items_inventory[i].amount); } } storage_storageclose(sd); clif_displaymessage(fd, msg_txt(sd,1162)); // All items stored. return 0; } ACMD_FUNC(clearstorage) { int i, j; nullpo_retr(-1, sd); if (sd->state.storage_flag == 1) { clif_displaymessage(fd, msg_txt(sd,250)); // You have already opened your storage. Close it first. return -1; } if (sd->state.storage_flag == 3) { clif_displaymessage(fd, msg_txt(sd,250)); // You have already opened your storage. Close it first. return -1; } j = sd->storage.amount; for (i = 0; i < j; ++i) { storage_delitem(sd, &sd->storage, i, sd->storage.u.items_storage[i].amount); } sd->state.storage_flag = 1; storage_storageclose(sd); clif_displaymessage(fd, msg_txt(sd,1394)); // Your storage was cleaned. return 0; } ACMD_FUNC(cleargstorage) { int i, j; struct guild *g; struct s_storage *gstorage; nullpo_retr(-1, sd); g = sd->guild; if (g == NULL) { clif_displaymessage(fd, msg_txt(sd,43)); // You're not in a guild. return -1; } if (sd->state.storage_flag == 1) { clif_displaymessage(fd, msg_txt(sd,250)); // You have already opened your storage. Close it first. return -1; } if (sd->state.storage_flag == 2) { clif_displaymessage(fd, msg_txt(sd,251)); // You have already opened your guild storage. Close it first. return -1; } if (sd->state.storage_flag == 3) { clif_displaymessage(fd, msg_txt(sd,250)); // You have already opened your storage. Close it first. return -1; } gstorage = guild2storage2(sd->status.guild_id); if (gstorage == NULL) { // Doesn't have opened @gstorage yet, so we skip the deletion since *shouldn't* have any item there. return -1; } j = gstorage->amount; gstorage->lock = true; // Lock @gstorage: do not allow any item to be retrieved or stored from any guild member for (i = 0; i < j; ++i) { storage_guild_delitem(sd, gstorage, i, gstorage->u.items_guild[i].amount); } storage_guild_storageclose(sd); gstorage->lock = false; // Cleaning done, release lock clif_displaymessage(fd, msg_txt(sd,1395)); // Your guild storage was cleaned. return 0; } ACMD_FUNC(clearcart) { int i; nullpo_retr(-1, sd); if (pc_iscarton(sd) == 0) { clif_displaymessage(fd, msg_txt(sd,1396)); // You do not have a cart to be cleaned. return -1; } if (sd->state.vending == 1) { //Somehow... return -1; } for (i = 0; i < MAX_CART; i++) { if (sd->cart.u.items_cart[i].nameid > 0) pc_cart_delitem(sd, i, sd->cart.u.items_cart[i].amount, 1, LOG_TYPE_OTHER); } clif_clearcart(fd); clif_updatestatus(sd,SP_CARTINFO); clif_displaymessage(fd, msg_txt(sd,1397)); // Your cart was cleaned. return 0; } /*========================================== * @skillid by [MouseJstr] * lookup a skill by name *------------------------------------------*/ #define MAX_SKILLID_PARTIAL_RESULTS 5 #define MAX_SKILLID_PARTIAL_RESULTS_LEN 74 // "skill " (6) + "%d:" (up to 5) + "%s" (up to 30) + " (%s)" (up to 33) ACMD_FUNC(skillid) { int skillen, i, found = 0; DBIterator* iter; DBKey key; DBData *data; char partials[MAX_SKILLID_PARTIAL_RESULTS][MAX_SKILLID_PARTIAL_RESULTS_LEN]; nullpo_retr(-1, sd); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1163)); // Please enter a skill name to look up (usage: @skillid <skill name>). return -1; } skillen = strlen(message); iter = db_iterator(skilldb_name2id); for( data = iter->first(iter,&key); iter->exists(iter); data = iter->next(iter,&key) ) { int idx = skill_get_index(db_data2i(data)); if (strnicmp(key.str, message, skillen) == 0 || strnicmp(skill_db[idx]->desc, message, skillen) == 0) { sprintf(atcmd_output, msg_txt(sd,1164), db_data2i(data), skill_db[idx]->desc, key.str); // skill %d: %s (%s) clif_displaymessage(fd, atcmd_output); } else if ( found < MAX_SKILLID_PARTIAL_RESULTS && ( stristr(key.str,message) || stristr(skill_db[idx]->desc,message) ) ) { snprintf(partials[found++], MAX_SKILLID_PARTIAL_RESULTS_LEN, msg_txt(sd,1164), db_data2i(data), skill_db[idx]->desc, key.str); // // skill %d: %s (%s) } } dbi_destroy(iter); if( found ) { sprintf(atcmd_output, msg_txt(sd,1398), found); // -- Displaying first %d partial matches clif_displaymessage(fd, atcmd_output); } for(i = 0; i < found; i++) { /* partials */ clif_displaymessage(fd, partials[i]); } return 0; } /*========================================== * @useskill by [MouseJstr] * A way of using skills without having to find them in the skills menu *------------------------------------------*/ ACMD_FUNC(useskill) { struct map_session_data *pl_sd = NULL; struct block_list *bl; uint16 skill_id; uint16 skill_lv; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if(!message || !*message || sscanf(message, "%6hu %6hu %23[^\n]", &skill_id, &skill_lv, atcmd_player_name) != 3) { clif_displaymessage(fd, msg_txt(sd,1165)); // Usage: @useskill <skill ID> <skill level> <char name> return -1; } if(!strcmp(atcmd_player_name,"self")) pl_sd = sd; //quick keyword else if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == NULL ){ clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player. return -1; } if (SKILL_CHK_HOMUN(skill_id) && hom_is_active(sd->hd)) // (If used with @useskill, put the homunc as dest) bl = &sd->hd->bl; else bl = &sd->bl; if (skill_get_inf(skill_id)&INF_GROUND_SKILL) unit_skilluse_pos(bl, pl_sd->bl.x, pl_sd->bl.y, skill_id, skill_lv); else unit_skilluse_id(bl, pl_sd->bl.id, skill_id, skill_lv); return 0; } /*========================================== * @displayskill by [Skotlex] * Debug command to locate new skill IDs. It sends the * three possible skill-effect packets to the area. *------------------------------------------*/ ACMD_FUNC(displayskill) { struct status_data * status; unsigned int tick; uint16 skill_id; uint16 skill_lv = 1; nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%6hu %6hu", &skill_id, &skill_lv) < 1) { clif_displaymessage(fd, msg_txt(sd,1166)); // Usage: @displayskill <skill ID> {<skill level>} return -1; } status = status_get_status_data(&sd->bl); tick = gettick(); clif_skill_damage(&sd->bl,&sd->bl, tick, status->amotion, status->dmotion, 1, 1, skill_id, skill_lv, DMG_SPLASH); clif_skill_nodamage(&sd->bl, &sd->bl, skill_id, skill_lv, 1); clif_skill_poseffect(&sd->bl, skill_id, skill_lv, sd->bl.x, sd->bl.y, tick); return 0; } /*========================================== * @skilltree by [MouseJstr] * prints the skill tree for a player required to get to a skill *------------------------------------------*/ ACMD_FUNC(skilltree) { struct map_session_data *pl_sd = NULL; uint16 skill_id; int meets, i, j, c=0; struct skill_tree_entry *ent; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if(!message || !*message || sscanf(message, "%6hu %23[^\n]", &skill_id, atcmd_player_name) != 2) { clif_displaymessage(fd, msg_txt(sd,1167)); // Usage: @skilltree <skill ID> <char name> return -1; } if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == NULL ) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } i = pc_calc_skilltree_normalize_job(pl_sd); c = pc_mapid2jobid(i, pl_sd->status.sex); sprintf(atcmd_output, msg_txt(sd,1168), job_name(c), pc_checkskill(pl_sd, NV_BASIC)); // Player is using %s skill tree (%d basic points). clif_displaymessage(fd, atcmd_output); c = pc_class2idx(c); ARR_FIND( 0, MAX_SKILL_TREE, j, skill_tree[c][j].skill_id == 0 || skill_tree[c][j].skill_id == skill_id ); if( j == MAX_SKILL_TREE || skill_tree[c][j].skill_id == 0 ) { clif_displaymessage(fd, msg_txt(sd,1169)); // The player cannot use that skill. return 0; } ent = &skill_tree[c][j]; meets = 1; for(j=0;j<MAX_PC_SKILL_REQUIRE;j++) { if( ent->need[j].skill_id && pc_checkskill(sd,ent->need[j].skill_id) < ent->need[j].skill_lv) { sprintf(atcmd_output, msg_txt(sd,1170), ent->need[j].skill_lv, skill_db[skill_get_index(ent->need[j].skill_id)]->desc); // Player requires level %d of skill %s. clif_displaymessage(fd, atcmd_output); meets = 0; } } if (meets == 1) { clif_displaymessage(fd, msg_txt(sd,1171)); // The player meets all the requirements for that skill. } return 0; } // Hand a ring with partners name on it to this char void getring (struct map_session_data* sd) { char flag = 0; unsigned short item_id; struct item item_tmp; item_id = (sd->status.sex) ? WEDDING_RING_M : WEDDING_RING_F; memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; item_tmp.identify = 1; item_tmp.card[0] = 255; item_tmp.card[2] = sd->status.partner_id; item_tmp.card[3] = sd->status.partner_id >> 16; if((flag = pc_additem(sd,&item_tmp,1,LOG_TYPE_COMMAND))) { clif_additem(sd,0,0,flag); map_addflooritem(&item_tmp,1,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,4,0); } } /*========================================== * @marry by [MouseJstr], fixed by Lupus * Marry two players *------------------------------------------*/ ACMD_FUNC(marry) { struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1172)); // Usage: @marry <char name> return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if (pc_marriage(sd, pl_sd)) { clif_displaymessage(fd, msg_txt(sd,1173)); // They are married... wish them well. clif_wedding_effect(&pl_sd->bl); //wedding effect and music [Lupus] if( pl_sd->bl.m != sd->bl.m ) clif_wedding_effect(&sd->bl); getring(sd); // Auto-give named rings (Aru) getring(pl_sd); return 0; } clif_displaymessage(fd, msg_txt(sd,1174)); // The two cannot wed because one is either a baby or already married. return -1; } /*========================================== * @divorce by [MouseJstr], fixed by [Lupus] * divorce two players *------------------------------------------*/ ACMD_FUNC(divorce) { nullpo_retr(-1, sd); if (!pc_divorce(sd)) { sprintf(atcmd_output, msg_txt(sd,1175), sd->status.name); // '%s' is not married. clif_displaymessage(fd, atcmd_output); return -1; } sprintf(atcmd_output, msg_txt(sd,1176), sd->status.name); // '%s' and his/her partner are now divorced. clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * @changelook by [Celest] *------------------------------------------*/ ACMD_FUNC(changelook) { int i, j = 0, k = 0; int pos[8] = { LOOK_HEAD_TOP,LOOK_HEAD_MID,LOOK_HEAD_BOTTOM,LOOK_WEAPON,LOOK_SHIELD,LOOK_SHOES,LOOK_ROBE, LOOK_BODY2 }; if((i = sscanf(message, "%11d %11d", &j, &k)) < 1) { clif_displaymessage(fd, msg_txt(sd,1177)); // Usage: @changelook {<position>} <view id> clif_displaymessage(fd, msg_txt(sd,1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe 8-Body return -1; } else if ( i == 2 ) { if (j < 1 || j > 8) j = 1; j = pos[j - 1]; } else if( i == 1 ) { // position not defined, use HEAD_TOP as default k = j; // swap j = LOOK_HEAD_TOP; } clif_changelook(&sd->bl,j,k); return 0; } /*========================================== * @autotrade by durf [Lupus] [Paradox924X] * Turns on/off Autotrade for a specific player *------------------------------------------*/ ACMD_FUNC(autotrade) { nullpo_retr(-1, sd); if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) { clif_displaymessage(fd, msg_txt(sd,1179)); // Autotrade is not allowed on this map. return -1; } if( pc_isdead(sd) ) { clif_displaymessage(fd, msg_txt(sd,1180)); // You cannot autotrade when dead. return -1; } if( !sd->state.vending && !sd->state.buyingstore ) { //check if player is vending or buying clif_displaymessage(fd, msg_txt(sd,549)); // "You should have a shop open to use @autotrade." return -1; } sd->state.autotrade = 1; if (battle_config.autotrade_monsterignore) sd->state.monster_ignore = 1; if( sd->state.vending ){ if( Sql_Query( mmysql_handle, "UPDATE `%s` SET `autotrade` = 1 WHERE `id` = %d;", vendings_table, sd->vender_id ) != SQL_SUCCESS ){ Sql_ShowDebug( mmysql_handle ); } }else if( sd->state.buyingstore ){ if( Sql_Query( mmysql_handle, "UPDATE `%s` SET `autotrade` = 1 WHERE `id` = %d;", buyingstores_table, sd->buyer_id ) != SQL_SUCCESS ){ Sql_ShowDebug( mmysql_handle ); } } if( battle_config.at_timeout ) { int timeout = atoi(message); status_change_start(NULL,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, SCSTART_NONE); } channel_pcquit(sd,0xF); //leave all chan clif_authfail_fd(sd->fd, 15); chrif_save(sd, CSAVE_AUTOTRADE); return 0; } /*========================================== * @changegm by durf (changed by Lupus) * Changes Master of your Guild to a specified guild member *------------------------------------------*/ ACMD_FUNC(changegm) { struct guild *g; struct map_session_data *pl_sd; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (sd->status.guild_id == 0 || (g = sd->guild) == NULL || strcmp(g->master,sd->status.name)) { clif_displaymessage(fd, msg_txt(sd,1181)); // You need to be a Guild Master to use this command. return -1; } if( map[sd->bl.m].flag.guildlock || map[sd->bl.m].flag.gvg_castle ) { clif_displaymessage(fd, msg_txt(sd,1182)); // You cannot change guild leaders on this map. return -1; } if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1183)); // Usage: @changegm <guild_member_name> return -1; } if((pl_sd=map_nick2sd(atcmd_player_name,false)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) { clif_displaymessage(fd, msg_txt(sd,1184)); // Target character must be online and be a guild member. return -1; } guild_gm_change(sd->status.guild_id, pl_sd->status.char_id); return 0; } /*========================================== * @changeleader by Skotlex * Changes the leader of a party. *------------------------------------------*/ ACMD_FUNC(changeleader) { nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1185)); // Usage: @changeleader <party_member_name> return -1; } party_changeleader(sd, map_nick2sd(atcmd_player_name,false),NULL); return 0; } /*========================================== * @partyoption by Skotlex * Used to change the item share setting of a party. *------------------------------------------*/ ACMD_FUNC(partyoption) { struct party_data *p; int mi, option; char w1[16], w2[16]; nullpo_retr(-1, sd); if (sd->status.party_id == 0 || (p = party_search(sd->status.party_id)) == NULL) { clif_displaymessage(fd, msg_txt(sd,282)); // You need to be a party leader to use this command. return -1; } ARR_FIND( 0, MAX_PARTY, mi, p->data[mi].sd == sd ); if (mi == MAX_PARTY) return -1; //Shouldn't happen if (!p->party.member[mi].leader) { clif_displaymessage(fd, msg_txt(sd,282)); // You need to be a party leader to use this command. return -1; } if(!message || !*message || sscanf(message, "%15s %15s", w1, w2) < 2) { clif_displaymessage(fd, msg_txt(sd,1186)); // Usage: @partyoption <pickup share: yes/no> <item distribution: yes/no> return -1; } option = (config_switch(w1)?1:0)|(config_switch(w2)?2:0); //Change item share type. if (option != p->party.item) party_changeoption(sd, p->party.exp, option); else clif_displaymessage(fd, msg_txt(sd,286)); // There's been no change in the setting. return 0; } /*========================================== * @autoloot by Upa-Kun * Turns on/off AutoLoot for a specific player *------------------------------------------*/ ACMD_FUNC(autoloot) { int rate; nullpo_retr(-1, sd); // autoloot command without value if(!message || !*message) { if (sd->state.autoloot) rate = 0; else rate = 10000; } else { double drate; drate = atof(message); rate = (int)(drate*100); } if (rate < 0) rate = 0; if (rate > 10000) rate = 10000; sd->state.autoloot = rate; if (sd->state.autoloot) { snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1187),((double)sd->state.autoloot)/100.); // Autolooting items with drop rates of %0.02f%% and below. clif_displaymessage(fd, atcmd_output); }else clif_displaymessage(fd, msg_txt(sd,1188)); // Autoloot is now off. return 0; } /*========================================== * @alootid *------------------------------------------*/ ACMD_FUNC(autolootitem) { struct item_data *item_data = NULL; int i; int action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset nullpo_retr(-1, sd); if (message && *message) { if (message[0] == '+') { message++; action = 1; } else if (message[0] == '-') { message++; action = 2; } else if (!strcmp(message,"reset")) action = 4; } if (action < 3) // add or remove { if ((item_data = itemdb_exists(atoi(message))) == NULL) item_data = itemdb_searchname(message); if (!item_data) { // No items founds in the DB with Id or Name clif_displaymessage(fd, msg_txt(sd,1189)); // Item not found. return -1; } } switch(action) { case 1: ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid); if (i != AUTOLOOTITEM_SIZE) { clif_displaymessage(fd, msg_txt(sd,1190)); // You're already autolooting this item. return -1; } ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == 0); if (i == AUTOLOOTITEM_SIZE) { clif_displaymessage(fd, msg_txt(sd,1191)); // Your autolootitem list is full. Remove some items first with @autolootid -<item name or ID>. return -1; } sd->state.autolootid[i] = item_data->nameid; // Autoloot Activated sprintf(atcmd_output, msg_txt(sd,1192), item_data->name, item_data->jname, item_data->nameid); // Autolooting item: '%s'/'%s' {%d} clif_displaymessage(fd, atcmd_output); sd->state.autolooting = 1; break; case 2: ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] == item_data->nameid); if (i == AUTOLOOTITEM_SIZE) { clif_displaymessage(fd, msg_txt(sd,1193)); // You're currently not autolooting this item. return -1; } sd->state.autolootid[i] = 0; sprintf(atcmd_output, msg_txt(sd,1194), item_data->name, item_data->jname, item_data->nameid); // Removed item: '%s'/'%s' {%d} from your autolootitem list. clif_displaymessage(fd, atcmd_output); ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0); if (i == AUTOLOOTITEM_SIZE) { sd->state.autolooting = 0; } break; case 3: sprintf(atcmd_output, msg_txt(sd,1195), AUTOLOOTITEM_SIZE); // You can have %d items on your autolootitem list. clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1196)); // To add an item to the list, use "@alootid +<item name or ID>". To remove an item, use "@alootid -<item name or ID>". clif_displaymessage(fd, msg_txt(sd,1197)); // "@alootid reset" will clear your autolootitem list. ARR_FIND(0, AUTOLOOTITEM_SIZE, i, sd->state.autolootid[i] != 0); if (i == AUTOLOOTITEM_SIZE) { clif_displaymessage(fd, msg_txt(sd,1198)); // Your autolootitem list is empty. } else { clif_displaymessage(fd, msg_txt(sd,1199)); // Items on your autolootitem list: for(i = 0; i < AUTOLOOTITEM_SIZE; i++) { if (sd->state.autolootid[i] == 0) continue; if (!(item_data = itemdb_exists(sd->state.autolootid[i]))) { ShowDebug("Non-existant item %d on autolootitem list (account_id: %d, char_id: %d)", sd->state.autolootid[i], sd->status.account_id, sd->status.char_id); continue; } sprintf(atcmd_output, "'%s'/'%s' {%hu}", item_data->name, item_data->jname, item_data->nameid); clif_displaymessage(fd, atcmd_output); } } break; case 4: memset(sd->state.autolootid, 0, sizeof(sd->state.autolootid)); clif_displaymessage(fd, msg_txt(sd,1200)); // Your autolootitem list has been reset. sd->state.autolooting = 0; break; } return 0; } /*========================================== * @autoloottype * Flags: * 1: IT_HEALING, 2: IT_UNKNOWN, 4: IT_USABLE, 8: IT_ETC, * 16: IT_ARMOR, 32: IT_WEAPON, 64: IT_CARD, 128: IT_PETEGG, * 256: IT_PETARMOR, 512: IT_UNKNOWN2, 1024: IT_AMMO, 2048: IT_DELAYCONSUME * 262144: IT_CASH *------------------------------------------ * Credits: * chriser * Aleos *------------------------------------------*/ ACMD_FUNC(autoloottype) { uint8 action = 3; // 1=add, 2=remove, 3=help+list (default), 4=reset enum item_types type = -1; int ITEM_MAX = 1533; nullpo_retr(-1, sd); if (message && *message) { if (message[0] == '+') { message++; action = 1; } else if (message[0] == '-') { message++; action = 2; } else if (!strcmp(message,"reset")) action = 4; } if (action < 3) { // add or remove if ((strncmp(message, "healing", 3) == 0) || (atoi(message) == 0)) type = IT_HEALING; else if ((strncmp(message, "usable", 3) == 0) || (atoi(message) == 2)) type = IT_USABLE; else if ((strncmp(message, "etc", 3) == 0) || (atoi(message) == 3)) type = IT_ETC; else if ((strncmp(message, "armor", 3) == 0) || (atoi(message) == 4)) type = IT_ARMOR; else if ((strncmp(message, "weapon", 3) == 0) || (atoi(message) == 5)) type = IT_WEAPON; else if ((strncmp(message, "card", 3) == 0) || (atoi(message) == 6)) type = IT_CARD; else if ((strncmp(message, "petegg", 4) == 0) || (atoi(message) == 7)) type = IT_PETEGG; else if ((strncmp(message, "petarmor", 4) == 0) || (atoi(message) == 8)) type = IT_PETARMOR; else if ((strncmp(message, "ammo", 3) == 0) || (atoi(message) == 10)) type = IT_AMMO; else { clif_displaymessage(fd, msg_txt(sd,1480)); // Item type not found. return -1; } } switch (action) { case 1: if (sd->state.autoloottype&(1<<type)) { clif_displaymessage(fd, msg_txt(sd,1481)); // You're already autolooting this item type. return -1; } if (sd->state.autoloottype == ITEM_MAX) { clif_displaymessage(fd, msg_txt(sd,1482)); // Your autoloottype list has all item types. You can remove some items with @autoloottype -<type name or ID>. return -1; } sd->state.autoloottype |= (1<<type); // Stores the type sprintf(atcmd_output, msg_txt(sd,1483), itemdb_typename(type), type); // Autolooting item type: '%s' {%d} clif_displaymessage(fd, atcmd_output); break; case 2: if (!(sd->state.autoloottype&(1<<type))) { clif_displaymessage(fd, msg_txt(sd,1484)); // You're currently not autolooting this item type. return -1; } sd->state.autoloottype &= ~(1<<type); sprintf(atcmd_output, msg_txt(sd,1485), itemdb_typename(type), type); // Removed item type: '%s' {%d} from your autoloottype list. clif_displaymessage(fd, atcmd_output); break; case 3: clif_displaymessage(fd, msg_txt(sd,1486)); // To add an item type to the list, use "@aloottype +<type name or ID>". To remove an item type, use "@aloottype -<type name or ID>". clif_displaymessage(fd, msg_txt(sd,1487)); // Type List: healing = 0, usable = 2, etc = 3, armor = 4, weapon = 5, card = 6, petegg = 7, petarmor = 8, ammo = 10 clif_displaymessage(fd, msg_txt(sd,1488)); // "@aloottype reset" will clear your autoloottype list. if (sd->state.autoloottype == 0) clif_displaymessage(fd, msg_txt(sd,1489)); // Your autoloottype list is empty. else { uint8 i = 0; clif_displaymessage(fd, msg_txt(sd,1490)); // Item types on your autoloottype list: while (i < IT_MAX) { if (sd->state.autoloottype&(1<<i)) { sprintf(atcmd_output, " '%s' {%d}", itemdb_typename(i), i); clif_displaymessage(fd, atcmd_output); } i++; } } break; case 4: sd->state.autoloottype = 0; clif_displaymessage(fd, msg_txt(sd,1491)); // Your autoloottype list has been reset. break; } return 0; } /** * No longer available, keeping here just in case it's back someday. [Ind] **/ /*========================================== * It is made to rain. *------------------------------------------*/ //ACMD_FUNC(rain) //{ // nullpo_retr(-1, sd); // if (map[sd->bl.m].flag.rain) { // map[sd->bl.m].flag.rain=0; // clif_weather(sd->bl.m); // clif_displaymessage(fd, msg_txt(sd,1201)); // The rain has stopped. // } else { // map[sd->bl.m].flag.rain=1; // clif_weather(sd->bl.m); // clif_displaymessage(fd, msg_txt(sd,1202)); // It has started to rain. // } // return 0; //} /*========================================== * It is made to snow. *------------------------------------------*/ ACMD_FUNC(snow) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.snow) { map[sd->bl.m].flag.snow=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1203)); // Snow has stopped falling. } else { map[sd->bl.m].flag.snow=1; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1204)); // It has started to snow. } return 0; } /*========================================== * Cherry tree snowstorm is made to fall. (Sakura) *------------------------------------------*/ ACMD_FUNC(sakura) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.sakura) { map[sd->bl.m].flag.sakura=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1205)); // Cherry tree leaves no longer fall. } else { map[sd->bl.m].flag.sakura=1; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1206)); // Cherry tree leaves have begun to fall. } return 0; } /*========================================== * Clouds appear. *------------------------------------------*/ ACMD_FUNC(clouds) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.clouds) { map[sd->bl.m].flag.clouds=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1207)); // The clouds has disappear. } else { map[sd->bl.m].flag.clouds=1; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1208)); // Clouds appear. } return 0; } /*========================================== * Different type of clouds using effect 516 *------------------------------------------*/ ACMD_FUNC(clouds2) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.clouds2) { map[sd->bl.m].flag.clouds2=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1209)); // The alternative clouds disappear. } else { map[sd->bl.m].flag.clouds2=1; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1210)); // Alternative clouds appear. } return 0; } /*========================================== * Fog hangs over. *------------------------------------------*/ ACMD_FUNC(fog) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.fog) { map[sd->bl.m].flag.fog=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1211)); // The fog has gone. } else { map[sd->bl.m].flag.fog=1; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1212)); // Fog hangs over. } return 0; } /*========================================== * Fallen leaves fall. *------------------------------------------*/ ACMD_FUNC(leaves) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.leaves) { map[sd->bl.m].flag.leaves=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1213)); // Leaves no longer fall. } else { map[sd->bl.m].flag.leaves=1; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1214)); // Fallen leaves fall. } return 0; } /*========================================== * Fireworks appear. *------------------------------------------*/ ACMD_FUNC(fireworks) { nullpo_retr(-1, sd); if (map[sd->bl.m].flag.fireworks) { map[sd->bl.m].flag.fireworks=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1215)); // Fireworks have ended. } else { map[sd->bl.m].flag.fireworks=1; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,1216)); // Fireworks have launched. } return 0; } /*========================================== * Clearing Weather Effects by Dexity *------------------------------------------*/ ACMD_FUNC(clearweather) { nullpo_retr(-1, sd); /** * No longer available, keeping here just in case it's back someday. [Ind] **/ //map[sd->bl.m].flag.rain=0; map[sd->bl.m].flag.snow=0; map[sd->bl.m].flag.sakura=0; map[sd->bl.m].flag.clouds=0; map[sd->bl.m].flag.clouds2=0; map[sd->bl.m].flag.fog=0; map[sd->bl.m].flag.fireworks=0; map[sd->bl.m].flag.leaves=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(sd,291)); // Weather effects will dispell on warp/refresh return 0; } /*=============================================================== * Sound Command - plays a sound for everyone around! [Codemaster] *---------------------------------------------------------------*/ ACMD_FUNC(sound) { char sound_file[100]; memset(sound_file, '\0', sizeof(sound_file)); if(!message || !*message || sscanf(message, "%99[^\n]", sound_file) < 1) { clif_displaymessage(fd, msg_txt(sd,1217)); // Please enter a sound filename (usage: @sound <filename>). return -1; } if(strstr(sound_file, ".wav") == NULL) strcat(sound_file, ".wav"); clif_soundeffectall(&sd->bl, sound_file, 0, AREA); return 0; } /*========================================== * MOB Search *------------------------------------------*/ ACMD_FUNC(mobsearch) { char mob_name[100]; int mob_id; int number = 0; struct s_mapiterator* it; nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%99[^\n]", mob_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1218)); // Please enter a monster name (usage: @mobsearch <monster name>). return -1; } if ((mob_id = atoi(mob_name)) == 0) mob_id = mobdb_searchname(mob_name); if(mob_id > 0 && mobdb_checkid(mob_id) == 0){ snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1219),mob_name); // Invalid mob ID %s! clif_displaymessage(fd, atcmd_output); return -1; } if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname) strcpy(mob_name,mob_db(mob_id)->jname); // --ja-- // strcpy(mob_name,mob_db(mob_id)->name); // --en-- snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s clif_displaymessage(fd, atcmd_output); it = mapit_geteachmob(); for(;;) { TBL_MOB* md = (TBL_MOB*)mapit_next(it); if( md == NULL ) break;// no more mobs if( md->bl.m != sd->bl.m ) continue; if( mob_id != -1 && md->mob_id != mob_id ) continue; ++number; if( md->spawn_timer == INVALID_TIMER ) snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%3d:%3d] %s", number, md->bl.x, md->bl.y, md->name); else snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s", number, "dead", md->name); clif_displaymessage(fd, atcmd_output); } mapit_free(it); return 0; } /*========================================== * @cleanmap - cleans items on the ground * @cleanarea - cleans items on the ground within an specified area *------------------------------------------*/ static int atcommand_cleanfloor_sub(struct block_list *bl, va_list ap) { nullpo_ret(bl); map_clearflooritem(bl); return 0; } ACMD_FUNC(cleanmap) { map_foreachinmap(atcommand_cleanfloor_sub, sd->bl.m, BL_ITEM); clif_displaymessage(fd, msg_txt(sd,1221)); // All dropped items have been cleaned up. return 0; } ACMD_FUNC(cleanarea) { short x0 = 0, y0 = 0, x1 = 0, y1 = 0; if (!message || !*message || sscanf(message, "%6hd %6hd %6hd %6hd", &x0, &y0, &x1, &y1) < 1) { map_foreachinallarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - (AREA_SIZE * 2), sd->bl.y - (AREA_SIZE * 2), sd->bl.x + (AREA_SIZE * 2), sd->bl.y + (AREA_SIZE * 2), BL_ITEM); } else if (sscanf(message, "%6hd %6hd %6hd %6hd", &x0, &y0, &x1, &y1) == 1) { map_foreachinallarea(atcommand_cleanfloor_sub, sd->bl.m, sd->bl.x - x0, sd->bl.y - x0, sd->bl.x + x0, sd->bl.y + x0, BL_ITEM); } else if (sscanf(message, "%6hd %6hd %6hd %6hd", &x0, &y0, &x1, &y1) == 4) { map_foreachinallarea(atcommand_cleanfloor_sub, sd->bl.m, x0, y0, x1, y1, BL_ITEM); } clif_displaymessage(fd, msg_txt(sd,1221)); // All dropped items have been cleaned up. return 0; } /*========================================== * make a NPC/PET talk * @npctalkc [SnakeDrak] *------------------------------------------*/ ACMD_FUNC(npctalk) { char name[NPC_NAME_LENGTH],mes[100],temp[100]; struct npc_data *nd; bool ifcolor=(*(command + 8) != 'c' && *(command + 8) != 'C')?0:1; unsigned long color=0; if (sd->sc.cant.chat) return -1; //no "chatting" while muted. if(!ifcolor) { if (!message || !*message || sscanf(message, "%49[^,], %99[^\n]", name, mes) < 2) { clif_displaymessage(fd, msg_txt(sd,1222)); // Please enter the correct parameters (usage: @npctalk <npc name>, <message>). return -1; } } else { if (!message || !*message || sscanf(message, "%16lx %23[^,], %99[^\n]", &color, name, mes) < 3) { clif_displaymessage(fd, msg_txt(sd,1223)); // Please enter the correct parameters (usage: @npctalkc <color> <npc name>, <message>). return -1; } } if (!(nd = npc_name2id(name))) { clif_displaymessage(fd, msg_txt(sd,111)); // This NPC doesn't exist return -1; } strtok(name, "#"); // discard extra name identifier if present snprintf(temp, sizeof(temp), "%s : %s", name, mes); if(ifcolor) clif_messagecolor(&nd->bl,color,temp,true,AREA_CHAT_WOC); else clif_disp_overhead(&nd->bl, temp); return 0; } ACMD_FUNC(pettalk) { char mes[100],temp[100]; struct pet_data *pd; nullpo_retr(-1, sd); if ( battle_config.min_chat_delay ) { if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) return 0; sd->cantalk_tick = gettick() + battle_config.min_chat_delay; } if(!sd->status.pet_id || !(pd=sd->pd)) { clif_displaymessage(fd, msg_txt(sd,184)); // Sorry, but you have no pet. return -1; } if (sd->sc.cant.chat) return -1; //no "chatting" while muted. if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) { clif_displaymessage(fd, msg_txt(sd,1224)); // Please enter a message (usage: @pettalk <message>). return -1; } if (message[0] == '/') {// pet emotion processing const char* emo[] = { "/!", "/?", "/ho", "/lv", "/swt", "/ic", "/an", "/ag", "/$", "/...", "/scissors", "/rock", "/paper", "/korea", "/lv2", "/thx", "/wah", "/sry", "/heh", "/swt2", "/hmm", "/no1", "/??", "/omg", "/O", "/X", "/hlp", "/go", "/sob", "/gg", "/kis", "/kis2", "/pif", "/ok", "-?-", "/indonesia", "/bzz", "/rice", "/awsm", "/meh", "/shy", "/pat", "/mp", "/slur", "/com", "/yawn", "/grat", "/hp", "/philippines", "/malaysia", "/singapore", "/brazil", "/fsh", "/spin", "/sigh", "/dum", "/crwd", "/desp", "/dice", "-dice2", "-dice3", "-dice4", "-dice5", "-dice6", "/india", "/love", "/russia", "-?-", "/mobile", "/mail", "/chinese", "/antenna1", "/antenna2", "/antenna3", "/hum", "/abs", "/oops", "/spit", "/ene", "/panic", "/whisp" }; int i; ARR_FIND( 0, ARRAYLENGTH(emo), i, stricmp(message, emo[i]) == 0 ); if( i == E_DICE1 ) i = rnd()%6 + E_DICE1; // randomize /dice if( i < ARRAYLENGTH(emo) ) { if (sd->emotionlasttime + 1 >= time(NULL)) { // not more than 1 per second sd->emotionlasttime = time(NULL); return 0; } sd->emotionlasttime = time(NULL); clif_emotion(&pd->bl, i); return 0; } } snprintf(temp, sizeof temp ,"%s : %s", pd->pet.name, mes); clif_disp_overhead(&pd->bl, temp); return 0; } /// @users - displays the number of players present on each map (and percentage) /// #users displays on the target user instead of self ACMD_FUNC(users) { char buf[CHAT_SIZE_MAX]; int i; int users[MAX_MAPINDEX]; int users_all; struct s_mapiterator* iter; memset(users, 0, sizeof(users)); users_all = 0; // count users on each map iter = mapit_getallusers(); for(;;) { struct map_session_data* sd2 = (struct map_session_data*)mapit_next(iter); if( sd2 == NULL ) break;// no more users if( sd2->mapindex >= MAX_MAPINDEX ) continue;// invalid mapindex if( users[sd2->mapindex] < INT_MAX ) ++users[sd2->mapindex]; if( users_all < INT_MAX ) ++users_all; } mapit_free(iter); // display results for each map for( i = 0; i < MAX_MAPINDEX; ++i ) { if( users[i] == 0 ) continue;// empty safesnprintf(buf, sizeof(buf), "%s: %d (%.2f%%)", mapindex_id2name(i), users[i], (float)(100.0f*users[i]/users_all)); clif_displaymessage(sd->fd, buf); } // display overall count safesnprintf(buf, sizeof(buf), "all: %d", users_all); clif_displaymessage(sd->fd, buf); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(reset) { pc_resetstate(sd); pc_resetskill(sd,1); sprintf(atcmd_output, msg_txt(sd,208), sd->status.name); // '%s' skill and stats points reseted! clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * *------------------------------------------*/ ACMD_FUNC(summon) { char name[NAME_LENGTH]; int mob_id = 0; int duration = 0; struct mob_data *md; unsigned int tick=gettick(); nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%23s %11d", name, &duration) < 1) { clif_displaymessage(fd, msg_txt(sd,1225)); // Please enter a monster name (usage: @summon <monster name> {duration}). return -1; } if (duration < 1) duration =1; else if (duration > 60) duration =60; if ((mob_id = atoi(name)) == 0) mob_id = mobdb_searchname(name); if(mob_id == 0 || mobdb_checkid(mob_id) == 0) { clif_displaymessage(fd, msg_txt(sd,40)); // Invalid monster ID or name. return -1; } md = mob_once_spawn_sub(&sd->bl, sd->bl.m, -1, -1, "--ja--", mob_id, "", SZ_SMALL, AI_NONE); if(!md) return -1; md->master_id=sd->bl.id; md->special_state.ai=AI_ATTACK; md->deletetimer=add_timer(tick+(duration*60000),mob_timer_delete,md->bl.id,0); clif_specialeffect(&md->bl,344,AREA); mob_spawn(md); sc_start4(NULL,&md->bl, SC_MODECHANGE, 100, 1, 0, MD_AGGRESSIVE, 0, 60000); clif_skill_poseffect(&sd->bl,AM_CALLHOMUN,1,md->bl.x,md->bl.y,tick); clif_displaymessage(fd, msg_txt(sd,39)); // All monster summoned! return 0; } /*========================================== * @adjgroup * Temporarily move player to another group * Useful during beta testing to allow players to use GM commands for short periods of time *------------------------------------------*/ ACMD_FUNC(adjgroup) { int new_group = 0; nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%11d", &new_group) != 1) { clif_displaymessage(fd, msg_txt(sd,1226)); // Usage: @adjgroup <group_id> return -1; } if (!pc_group_exists(new_group)) { clif_displaymessage(fd, msg_txt(sd,1227)); // Specified group does not exist. return -1; } sd->group_id = new_group; pc_group_pc_load(sd);/* update cache */ clif_displaymessage(fd, msg_txt(sd,1228)); // Group changed successfully. clif_displaymessage(sd->fd, msg_txt(sd,1229)); // Your group has changed. return 0; } /*========================================== * @trade by [MouseJstr] * Open a trade window with a remote player *------------------------------------------*/ ACMD_FUNC(trade) { struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1230)); // Please enter a player name (usage: @trade <char name>). return -1; } if ( (pl_sd = map_nick2sd(atcmd_player_name,true)) == NULL ) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } trade_traderequest(sd, pl_sd); return 0; } /*========================================== * @setbattleflag by [MouseJstr] * set a battle_config flag without having to reboot *------------------------------------------*/ ACMD_FUNC(setbattleflag) { char flag[128], value[128]; int reload = 0; nullpo_retr(-1, sd); if (!message || !*message || sscanf(message, "%127s %127s %11d", flag, value, &reload) != 2) { clif_displaymessage(fd, msg_txt(sd,1231)); // Usage: @setbattleflag <flag> <value> {<reload>} return -1; } if (battle_set_value(flag, value) == 0) { clif_displaymessage(fd, msg_txt(sd,1232)); // Unknown battle_config flag. return -1; } clif_displaymessage(fd, msg_txt(sd,1233)); // Set battle_config as requested. if (reload) mob_reload(); return 0; } /*========================================== * @unmute [Valaris] *------------------------------------------*/ ACMD_FUNC(unmute) { struct map_session_data *pl_sd = NULL; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1234)); // Please enter a player name (usage: @unmute <char name>). return -1; } if ( (pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL ) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if(!pl_sd->sc.data[SC_NOCHAT]) { clif_displaymessage(sd->fd,msg_txt(sd,1235)); // Player is not muted. return -1; } pl_sd->status.manner = 0; status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER); clif_displaymessage(sd->fd,msg_txt(sd,1236)); // Player unmuted. return 0; } /*========================================== * @uptime by MC Cameri *------------------------------------------*/ ACMD_FUNC(uptime) { unsigned long seconds = 0, day = 24*60*60, hour = 60*60, minute = 60, days = 0, hours = 0, minutes = 0; nullpo_retr(-1, sd); seconds = get_uptime(); days = seconds/day; seconds -= (seconds/day>0)?(seconds/day)*day:0; hours = seconds/hour; seconds -= (seconds/hour>0)?(seconds/hour)*hour:0; minutes = seconds/minute; seconds -= (seconds/minute>0)?(seconds/minute)*minute:0; snprintf(atcmd_output, sizeof(atcmd_output), msg_txt(sd,245), days, hours, minutes, seconds); // Server Uptime: %ld days, %ld hours, %ld minutes, %ld seconds. clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * @changesex * => Changes one's account sex. Switch from male to female or visversa *------------------------------------------*/ ACMD_FUNC(changesex) { int i; nullpo_retr(-1, sd); pc_resetskill(sd,4); // to avoid any problem with equipment and invalid sex, equipment is unequiped. for (i = 0; i < EQI_MAX; i++) { if (sd->equip_index[i] >= 0) pc_unequipitem(sd, sd->equip_index[i], 3); } chrif_changesex(sd, true); return 0; } /*========================================== * @changecharsex * => Changes one's character sex. Switch from male to female or visversa. *------------------------------------------*/ ACMD_FUNC(changecharsex) { int i; nullpo_retr(-1, sd); pc_resetskill(sd,4); // to avoid any problem with equipment and invalid sex, equipment is unequiped. for (i = 0; i < EQI_MAX; i++) { if (sd->equip_index[i] >= 0) pc_unequipitem(sd, sd->equip_index[i], 3); } chrif_changesex(sd, false); return 0; } /*================================================ * @mute - Mutes a player for a set amount of time *------------------------------------------------*/ ACMD_FUNC(mute) { struct map_session_data *pl_sd = NULL; int manner; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%11d %23[^\n]", &manner, atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,1237)); // Usage: @mute <time> <char name> return -1; } if ( (pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL ) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player. return -1; } clif_manner_message(sd, 0); clif_manner_message(pl_sd, 5); if( pl_sd->status.manner < manner ) { pl_sd->status.manner -= manner; sc_start(NULL,&pl_sd->bl,SC_NOCHAT,100,0,0); } else { pl_sd->status.manner = 0; status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER); } clif_GM_silence(sd, pl_sd, (manner > 0 ? 1 : 0)); return 0; } /*========================================== * @refresh (like @jumpto <<yourself>>) *------------------------------------------*/ ACMD_FUNC(refresh) { nullpo_retr(-1, sd); clif_refresh(sd); return 0; } ACMD_FUNC(refreshall) { struct map_session_data* iter_sd; struct s_mapiterator* iter; nullpo_retr(-1, sd); iter = mapit_getallusers(); for (iter_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); iter_sd = (TBL_PC*)mapit_next(iter)) clif_refresh(iter_sd); mapit_free(iter); return 0; } /*========================================== * @identify * => GM's magnifier. *------------------------------------------*/ ACMD_FUNC(identify) { int i,num; nullpo_retr(-1, sd); for(i=num=0;i<MAX_INVENTORY;i++){ if(sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].identify != 1) { num++; } } if (num > 0) { clif_item_identify_list(sd); } else { clif_displaymessage(fd,msg_txt(sd,1238)); // There are no items to appraise. } return 0; } /*=============================================== * @identifyall * => Indentify all items in inventory - Akinari *-----------------------------------------------*/ ACMD_FUNC(identifyall) { int i; nullpo_retr(-1, sd); for(i=0; i<MAX_INVENTORY; i++) { if (sd->inventory.u.items_inventory[i].nameid > 0 && sd->inventory.u.items_inventory[i].identify != 1) { sd->inventory.u.items_inventory[i].identify = 1; clif_item_identified(sd,i,0); } } return 0; } /*========================================== * @gmotd (Global MOTD) * by davidsiaw :P *------------------------------------------*/ ACMD_FUNC(gmotd) { FILE* fp; if( ( fp = fopen(motd_txt, "r") ) != NULL ) { char buf[CHAT_SIZE_MAX]; size_t len; while( fgets(buf, sizeof(buf), fp) ) { if( buf[0] == '/' && buf[1] == '/' ) { continue; } len = strlen(buf); while( len && ( buf[len-1] == '\r' || buf[len-1] == '\n' ) ) {// strip trailing EOL characters len--; } if( len ) { buf[len] = 0; intif_broadcast(buf, len+1, 0); } } fclose(fp); } return 0; } ACMD_FUNC(misceffect) { int effect = 0; nullpo_retr(-1, sd); if (!message || !*message) return -1; if (sscanf(message, "%11d", &effect) < 1) return -1; clif_misceffect(&sd->bl,effect); return 0; } /*========================================== * MAIL SYSTEM *------------------------------------------*/ ACMD_FUNC(mail) { nullpo_ret(sd); mail_openmail(sd); return 0; } /*========================================== * Show Monster DB Info v 1.0 * originally by [Lupus] *------------------------------------------*/ ACMD_FUNC(mobinfo) { unsigned char msize[SZ_ALL][7] = { "Small", "Medium", "Large" }; unsigned char mrace[RC_ALL][11] = { "Formless", "Undead", "Beast", "Plant", "Insect", "Fish", "Demon", "Demi-Human", "Angel", "Dragon", "Player" }; unsigned char melement[ELE_ALL][8] = { "Neutral", "Water", "Earth", "Fire", "Wind", "Poison", "Holy", "Dark", "Ghost", "Undead" }; char atcmd_output2[CHAT_SIZE_MAX]; struct item_data *item_data; struct mob_db *mob, *mob_array[MAX_SEARCH]; int count; int i, k; memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(atcmd_output2, '\0', sizeof(atcmd_output2)); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1239)); // Please enter a monster name/ID (usage: @mobinfo <monster_name_or_monster_ID>). return -1; } // If monster identifier/name argument is a name if ((i = mobdb_checkid(atoi(message)))) { mob_array[0] = mob_db(i); count = 1; } else count = mobdb_searchname_array(mob_array, MAX_SEARCH, message); if (!count) { clif_displaymessage(fd, msg_txt(sd,40)); // Invalid monster ID or name. return -1; } if (count >= MAX_SEARCH) { sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches clif_displaymessage(fd, atcmd_output); count = MAX_SEARCH; } for (k = 0; k < count; k++) { unsigned int j,base_exp,job_exp; mob = mob_array[k]; base_exp = mob->base_exp; job_exp = mob->job_exp; if (pc_isvip(sd)) { // Display EXP rate increase for VIP base_exp = (base_exp * battle_config.vip_base_exp_increase) / 100; job_exp = (job_exp * battle_config.vip_job_exp_increase) / 100; } #ifdef RENEWAL_EXP if( battle_config.atcommand_mobinfo_type ) { base_exp = base_exp * pc_level_penalty_mod(mob->lv - sd->status.base_level, mob->status.class_, mob->status.mode, 1) / 100; job_exp = job_exp * pc_level_penalty_mod(mob->lv - sd->status.base_level, mob->status.class_, mob->status.mode, 1) / 100; } #endif // stats if (mob->mexp) sprintf(atcmd_output, msg_txt(sd,1240), mob->name, mob->jname, mob->sprite, mob->vd.class_); // MVP Monster: '%s'/'%s'/'%s' (%d) else sprintf(atcmd_output, msg_txt(sd,1241), mob->name, mob->jname, mob->sprite, mob->vd.class_); // Monster: '%s'/'%s'/'%s' (%d) clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1242), mob->lv, mob->status.max_hp, base_exp, job_exp, MOB_HIT(mob), MOB_FLEE(mob)); // Lv:%d HP:%d Base EXP:%u Job EXP:%u HIT:%d FLEE:%d clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1243), // DEF:%d MDEF:%d STR:%d AGI:%d VIT:%d INT:%d DEX:%d LUK:%d mob->status.def, mob->status.mdef,mob->status.str, mob->status.agi, mob->status.vit, mob->status.int_, mob->status.dex, mob->status.luk); clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1244), // ATK:%d~%d Range:%d~%d~%d Size:%s Race: %s Element: %s (Lv:%d) mob->status.rhw.atk, mob->status.rhw.atk2, mob->status.rhw.range, mob->range2 , mob->range3, msize[mob->status.size], mrace[mob->status.race], melement[mob->status.def_ele], mob->status.ele_lv); clif_displaymessage(fd, atcmd_output); // drops clif_displaymessage(fd, msg_txt(sd,1245)); // Drops: strcpy(atcmd_output, " "); j = 0; for (i = 0; i < MAX_MOB_DROP_TOTAL; i++) { int droprate; if (mob->dropitem[i].nameid <= 0 || mob->dropitem[i].p < 1 || (item_data = itemdb_exists(mob->dropitem[i].nameid)) == NULL) continue; droprate = mob->dropitem[i].p; #ifdef RENEWAL_DROP if( battle_config.atcommand_mobinfo_type ) { droprate = droprate * pc_level_penalty_mod(mob->lv - sd->status.base_level, mob->status.class_, mob->status.mode, 2) / 100; if (droprate <= 0 && !battle_config.drop_rate0item) droprate = 1; } #endif if (pc_isvip(sd)) // Display drop rate increase for VIP droprate += (droprate * battle_config.vip_drop_increase) / 100; if (item_data->slot) sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, (float)droprate / 100); else sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, (float)droprate / 100); strcat(atcmd_output, atcmd_output2); if (++j % 3 == 0) { clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output, " "); } } if (j == 0) clif_displaymessage(fd, msg_txt(sd,1246)); // This monster has no drops. else if (j % 3 != 0) clif_displaymessage(fd, atcmd_output); // mvp if (mob->mexp) { float mvppercent, mvpremain; sprintf(atcmd_output, msg_txt(sd,1247), mob->mexp); // MVP Bonus EXP:%u clif_displaymessage(fd, atcmd_output); strcpy(atcmd_output, msg_txt(sd,1248)); // MVP Items: mvpremain = 100.0; //Remaining drop chance for official mvp drop mode j = 0; for (i = 0; i < MAX_MVP_DROP_TOTAL; i++) { if (mob->mvpitem[i].nameid <= 0 || (item_data = itemdb_exists(mob->mvpitem[i].nameid)) == NULL) continue; //Because if there are 3 MVP drops at 50%, the first has a chance of 50%, the second 25% and the third 12.5% mvppercent = (float)mob->mvpitem[i].p * mvpremain / 10000.0f; if(battle_config.item_drop_mvp_mode == 0) { mvpremain -= mvppercent; } if (mvppercent > 0) { j++; if (j == 1) { if (item_data->slot) sprintf(atcmd_output2, " %s[%d] %02.02f%%", item_data->jname, item_data->slot, mvppercent); else sprintf(atcmd_output2, " %s %02.02f%%", item_data->jname, mvppercent); } else { if (item_data->slot) sprintf(atcmd_output2, " - %s[%d] %02.02f%%", item_data->jname, item_data->slot, mvppercent); else sprintf(atcmd_output2, " - %s %02.02f%%", item_data->jname, mvppercent); } strcat(atcmd_output, atcmd_output2); } } if (j == 0) clif_displaymessage(fd, msg_txt(sd,1249)); // This monster has no MVP prizes. else clif_displaymessage(fd, atcmd_output); } } return 0; } /*========================================= * @showmobs by KarLaeda * => For 15 sec displays the mobs on minimap *------------------------------------------*/ ACMD_FUNC(showmobs) { char mob_name[100]; int mob_id; int number = 0; struct s_mapiterator* it; nullpo_retr(-1, sd); if(sscanf(message, "%99[^\n]", mob_name) < 0) return -1; if((mob_id = atoi(mob_name)) == 0) mob_id = mobdb_searchname(mob_name); if(mob_id > 0 && mobdb_checkid(mob_id) == 0){ snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1250),mob_name); // Invalid mob id %s! clif_displaymessage(fd, atcmd_output); return 0; } if(status_has_mode(&mob_db(mob_id)->status,MD_STATUS_IMMUNE) && !pc_has_permission(sd, PC_PERM_SHOW_BOSS)){ // If player group does not have access to boss mobs. clif_displaymessage(fd, msg_txt(sd,1251)); // Can't show boss mobs! return 0; } if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname) strcpy(mob_name,mob_db(mob_id)->jname); // --ja-- //strcpy(mob_name,mob_db(mob_id)->name); // --en-- snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1252), // Mob Search... %s %s mob_name, mapindex_id2name(sd->mapindex)); clif_displaymessage(fd, atcmd_output); it = mapit_geteachmob(); for(;;) { TBL_MOB* md = (TBL_MOB*)mapit_next(it); if( md == NULL ) break;// no more mobs if( md->bl.m != sd->bl.m ) continue; if( mob_id != -1 && md->mob_id != mob_id ) continue; if( md->special_state.ai || md->master_id ) continue; // hide slaves and player summoned mobs if( md->spawn_timer != INVALID_TIMER ) continue; // hide mobs waiting for respawn ++number; clif_viewpoint(sd, 1, 0, md->bl.x, md->bl.y, number, 0xFFFFFF); } mapit_free(it); return 0; } /*========================================== * homunculus level up [orn] *------------------------------------------*/ ACMD_FUNC(homlevel) { TBL_HOM * hd; int level = 0, i = 0; nullpo_retr(-1, sd); if ( !message || !*message || ( level = atoi(message) ) < 1 ) { clif_displaymessage(fd, msg_txt(sd,1253)); // Please enter a level adjustment (usage: @homlevel <number of levels>). return -1; } if ( !hom_is_active(sd->hd) ) { clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus. return -1; } hd = sd->hd; for (i = 1; i <= level && hd->exp_next; i++){ hd->homunculus.exp += hd->exp_next; if( !hom_levelup(hd) ) break; } status_calc_homunculus(hd, SCO_NONE); status_percent_heal(&hd->bl, 100, 100); clif_specialeffect(&hd->bl,568,AREA); return 0; } /*========================================== * homunculus evolution H [orn] *------------------------------------------*/ ACMD_FUNC(homevolution) { nullpo_retr(-1, sd); if ( !hom_is_active(sd->hd) ) { clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus. return -1; } if ( !hom_evolution(sd->hd) ) { clif_displaymessage(fd, msg_txt(sd,1255)); // Your homunculus doesn't evolve. return -1; } clif_homskillinfoblock(sd); return 0; } ACMD_FUNC(hommutate) { int homun_id, m_class = 0, m_id; nullpo_retr(-1, sd); if (!hom_is_active(sd->hd)) { clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus. return -1; } if (!message || !*message) { homun_id = 6048 + (rnd() % 4); } else { homun_id = atoi(message); } m_class = hom_class2mapid(sd->hd->homunculus.class_); m_id = hom_class2mapid(homun_id); if (m_class != -1 && m_id != -1 && m_class&HOM_EVO && m_id&HOM_S && sd->hd->homunculus.level >= 99) { hom_mutate(sd->hd, homun_id); } else { clif_emotion(&sd->hd->bl, E_SWT); } return 0; } /*========================================== * call choosen homunculus [orn] *------------------------------------------*/ ACMD_FUNC(makehomun) { int homunid; nullpo_retr(-1, sd); if ( sd->status.hom_id ) { clif_displaymessage(fd, msg_txt(sd,450)); // You already have a homunculus return -1; } if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1256)); // Please enter a homunculus ID (usage: @makehomun <homunculus id>). return -1; } homunid = atoi(message); if( homunid < HM_CLASS_BASE || homunid > HM_CLASS_BASE + MAX_HOMUNCULUS_CLASS - 1 ) { clif_displaymessage(fd, msg_txt(sd,1257)); // Invalid Homunculus ID. return -1; } hom_create_request(sd,homunid); return 0; } /*========================================== * modify homunculus intimacy [orn] *------------------------------------------*/ ACMD_FUNC(homfriendly) { int friendly = 0; nullpo_retr(-1, sd); if ( !hom_is_active(sd->hd) ) { clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus. return -1; } if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1258)); // Please enter a friendly value (usage: @homfriendly <friendly value [0-1000]>). return -1; } friendly = atoi(message); friendly = cap_value(friendly, 0, 1000); sd->hd->homunculus.intimacy = friendly * 100 ; clif_send_homdata(sd,SP_INTIMATE,friendly); return 0; } /*========================================== * modify homunculus hunger [orn] *------------------------------------------*/ ACMD_FUNC(homhungry) { int hungry = 0; nullpo_retr(-1, sd); if ( !hom_is_active(sd->hd) ) { clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus. return -1; } if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1259)); // Please enter a hunger value (usage: @homhungry <hunger value [0-100]>). return -1; } hungry = atoi(message); hungry = cap_value(hungry, 0, 100); sd->hd->homunculus.hunger = hungry; clif_send_homdata(sd,SP_HUNGRY,hungry); return 0; } /*========================================== * make the homunculus speak [orn] *------------------------------------------*/ ACMD_FUNC(homtalk) { char mes[100],temp[100]; nullpo_retr(-1, sd); if ( battle_config.min_chat_delay ) { if( DIFF_TICK(sd->cantalk_tick, gettick()) > 0 ) return 0; sd->cantalk_tick = gettick() + battle_config.min_chat_delay; } if (sd->sc.cant.chat) return -1; //no "chatting" while muted. if ( !hom_is_active(sd->hd) ) { clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus. return -1; } if (!message || !*message || sscanf(message, "%99[^\n]", mes) < 1) { clif_displaymessage(fd, msg_txt(sd,1260)); // Please enter a message (usage: @homtalk <message>). return -1; } snprintf(temp, sizeof temp ,"%s : %s", sd->hd->homunculus.name, mes); clif_disp_overhead(&sd->hd->bl, temp); return 0; } /*========================================== * Show homunculus stats *------------------------------------------*/ ACMD_FUNC(hominfo) { struct homun_data *hd; struct status_data *status; nullpo_retr(-1, sd); if ( !hom_is_active(sd->hd) ) { clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus. return -1; } hd = sd->hd; status = status_get_status_data(&hd->bl); clif_displaymessage(fd, msg_txt(sd,1261)); // Homunculus stats: snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1262), // HP: %d/%d - SP: %d/%d status->hp, status->max_hp, status->sp, status->max_sp); clif_displaymessage(fd, atcmd_output); snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1263), // ATK: %d - MATK: %d~%d status->rhw.atk2 +status->batk, status->matk_min, status->matk_max); clif_displaymessage(fd, atcmd_output); snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1264), // Hungry: %d - Intimacy: %u hd->homunculus.hunger, hd->homunculus.intimacy/100); clif_displaymessage(fd, atcmd_output); snprintf(atcmd_output, sizeof(atcmd_output) , msg_txt(sd,1265), // Stats: Str %d / Agi %d / Vit %d / Int %d / Dex %d / Luk %d status->str, status->agi, status->vit, status->int_, status->dex, status->luk); clif_displaymessage(fd, atcmd_output); return 0; } ACMD_FUNC(homstats) { struct homun_data *hd; struct s_homunculus_db *db; struct s_homunculus *hom; int lv, min, max, evo; nullpo_retr(-1, sd); if ( !hom_is_active(sd->hd) ) { clif_displaymessage(fd, msg_txt(sd,1254)); // You do not have a homunculus. return -1; } hd = sd->hd; hom = &hd->homunculus; db = hd->homunculusDB; lv = hom->level; snprintf(atcmd_output, sizeof(atcmd_output) , msg_txt(sd,1266), lv, db->name); // Homunculus growth stats (Lv %d %s): clif_displaymessage(fd, atcmd_output); lv--; //Since the first increase is at level 2. evo = (hom->class_ == db->evo_class); min = db->base.HP +lv*db->gmin.HP +(evo?db->emin.HP:0); max = db->base.HP +lv*db->gmax.HP +(evo?db->emax.HP:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1267), hom->max_hp, min, max); // Max HP: %d (%d~%d) clif_displaymessage(fd, atcmd_output); min = db->base.SP +lv*db->gmin.SP +(evo?db->emin.SP:0); max = db->base.SP +lv*db->gmax.SP +(evo?db->emax.SP:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1268), hom->max_sp, min, max); // Max SP: %d (%d~%d) clif_displaymessage(fd, atcmd_output); min = db->base.str +lv*(db->gmin.str/10) +(evo?db->emin.str:0); max = db->base.str +lv*(db->gmax.str/10) +(evo?db->emax.str:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1269), hom->str/10, min, max); // Str: %d (%d~%d) clif_displaymessage(fd, atcmd_output); min = db->base.agi +lv*(db->gmin.agi/10) +(evo?db->emin.agi:0); max = db->base.agi +lv*(db->gmax.agi/10) +(evo?db->emax.agi:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1270), hom->agi/10, min, max); // Agi: %d (%d~%d) clif_displaymessage(fd, atcmd_output); min = db->base.vit +lv*(db->gmin.vit/10) +(evo?db->emin.vit:0); max = db->base.vit +lv*(db->gmax.vit/10) +(evo?db->emax.vit:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1271), hom->vit/10, min, max); // Vit: %d (%d~%d) clif_displaymessage(fd, atcmd_output); min = db->base.int_ +lv*(db->gmin.int_/10) +(evo?db->emin.int_:0); max = db->base.int_ +lv*(db->gmax.int_/10) +(evo?db->emax.int_:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1272), hom->int_/10, min, max); // Int: %d (%d~%d) clif_displaymessage(fd, atcmd_output); min = db->base.dex +lv*(db->gmin.dex/10) +(evo?db->emin.dex:0); max = db->base.dex +lv*(db->gmax.dex/10) +(evo?db->emax.dex:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1273), hom->dex/10, min, max); // Dex: %d (%d~%d) clif_displaymessage(fd, atcmd_output); min = db->base.luk +lv*(db->gmin.luk/10) +(evo?db->emin.luk:0); max = db->base.luk +lv*(db->gmax.luk/10) +(evo?db->emax.luk:0);; snprintf(atcmd_output, sizeof(atcmd_output) ,msg_txt(sd,1274), hom->luk/10, min, max); // Luk: %d (%d~%d) clif_displaymessage(fd, atcmd_output); return 0; } ACMD_FUNC(homshuffle) { nullpo_retr(-1, sd); if(!sd->hd) return -1; // nothing to do if(!hom_shuffle(sd->hd)) return -1; clif_displaymessage(sd->fd, msg_txt(sd,1275)); // Homunculus stats altered. atcommand_homstats(fd, sd, command, message); //Print out the new stats return 0; } /*========================================== * Show Items DB Info v 1.0 * originally by [Lupus] *------------------------------------------*/ ACMD_FUNC(iteminfo) { struct item_data *item_array[MAX_SEARCH]; int i, count = 1; if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1276)); // Please enter an item name/ID (usage: @ii/@iteminfo <item name/ID>). return -1; } if ((item_array[0] = itemdb_exists(atoi(message))) == NULL) count = itemdb_searchname_array(item_array, MAX_SEARCH, message); if (!count) { clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name. return -1; } if (count == MAX_SEARCH) { sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches clif_displaymessage(fd, atcmd_output); } for (i = 0; i < count; i++) { struct item_data * item_data = item_array[i]; sprintf(atcmd_output, msg_txt(sd,1277), // Item: '%s'/'%s'[%d] (%hu) Type: %s | Extra Effect: %s item_data->name,item_data->jname,item_data->slot,item_data->nameid, (item_data->type != IT_AMMO) ? itemdb_typename((enum item_types)item_data->type) : itemdb_typename_ammo((enum e_item_ammo)item_data->look), (item_data->script==NULL)? msg_txt(sd,1278) : msg_txt(sd,1279) // None / With script ); clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(sd,1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f clif_displaymessage(fd, atcmd_output); if (item_data->maxchance == -1) { strcpy(atcmd_output, msg_txt(sd,1281)); // - Available in the shops only. clif_displaymessage(fd, atcmd_output); } else if (!battle_config.atcommand_mobinfo_type) { if (item_data->maxchance) sprintf(atcmd_output, msg_txt(sd,1282), (float)item_data->maxchance / 100 ); // - Maximal monsters drop chance: %02.02f%% else strcpy(atcmd_output, msg_txt(sd,1283)); // - Monsters don't drop this item. clif_displaymessage(fd, atcmd_output); } } return 0; } /*========================================== * Show who drops the item. *------------------------------------------*/ ACMD_FUNC(whodrops) { struct item_data *item_data, *item_array[MAX_SEARCH]; int i,j, count = 1; if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1284)); // Please enter item name/ID (usage: @whodrops <item name/ID>). return -1; } if ((item_array[0] = itemdb_exists(atoi(message))) == NULL) count = itemdb_searchname_array(item_array, MAX_SEARCH, message); if (!count) { clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name. return -1; } if (count == MAX_SEARCH) { sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches clif_displaymessage(fd, atcmd_output); } for (i = 0; i < count; i++) { item_data = item_array[i]; sprintf(atcmd_output, msg_txt(sd,1285), item_data->jname, item_data->slot, item_data->nameid); // Item: '%s'[%d] (ID:%hu) clif_displaymessage(fd, atcmd_output); if (item_data->mob[0].chance == 0) { strcpy(atcmd_output, msg_txt(sd,1286)); // - Item is not dropped by mobs. clif_displaymessage(fd, atcmd_output); } else { sprintf(atcmd_output, msg_txt(sd,1287), MAX_SEARCH); // - Common mobs with highest drop chance (only max %d are listed): clif_displaymessage(fd, atcmd_output); for (j=0; j < MAX_SEARCH && item_data->mob[j].chance > 0; j++) { int dropchance = item_data->mob[j].chance; #ifdef RENEWAL_DROP if( battle_config.atcommand_mobinfo_type ) dropchance = dropchance * pc_level_penalty_mod(mob_db(item_data->mob[j].id)->lv - sd->status.base_level, mob_db(item_data->mob[j].id)->status.class_, mob_db(item_data->mob[j].id)->status.mode, 2) / 100; #endif if (pc_isvip(sd)) // Display item rate increase for VIP dropchance += (dropchance * battle_config.vip_drop_increase) / 100; sprintf(atcmd_output, "- %s (%d): %02.02f%%", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].id, dropchance/100.); clif_displaymessage(fd, atcmd_output); } } } return 0; } ACMD_FUNC(whereis) { struct mob_db *mob_array[MAX_SEARCH]; int count; int i, j, k; if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1288)); // Please enter a monster name/ID (usage: @whereis <monster_name_or_monster_ID>). return -1; } // If monster identifier/name argument is a name if ((i = mobdb_checkid(atoi(message)))) { mob_array[0] = mob_db(i); count = 1; } else count = mobdb_searchname_array(mob_array, MAX_SEARCH, message); if (!count) { clif_displaymessage(fd, msg_txt(sd,40)); // Invalid monster ID or name. return -1; } if (count >= MAX_SEARCH) { sprintf(atcmd_output, msg_txt(sd,269), MAX_SEARCH); // Displaying first %d matches clif_displaymessage(fd, atcmd_output); count = MAX_SEARCH; } for (k = 0; k < count; k++) { struct mob_db *mob = mob_array[k]; snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1289), mob->jname); // %s spawns in: clif_displaymessage(fd, atcmd_output); for (i = 0; i < ARRAYLENGTH(mob->spawn) && mob->spawn[i].qty; i++) { j = map_mapindex2mapid(mob->spawn[i].mapindex); if (j < 0) continue; snprintf(atcmd_output, sizeof atcmd_output, "%s (%d)", map[j].name, mob->spawn[i].qty); clif_displaymessage(fd, atcmd_output); } if (i == 0) clif_displaymessage(fd, msg_txt(sd,1290)); // This monster does not spawn normally. } return 0; } ACMD_FUNC(version) { pc_show_version(sd); return 0; } /*========================================== * @mutearea by MouseJstr *------------------------------------------*/ static int atcommand_mutearea_sub(struct block_list *bl,va_list ap) { int time, id; struct map_session_data *pl_sd = (struct map_session_data *)bl; if (pl_sd == NULL) return 0; id = va_arg(ap, int); time = va_arg(ap, int); if (id != bl->id && !pc_get_group_level(pl_sd)) { pl_sd->status.manner -= time; if (pl_sd->status.manner < 0) sc_start(NULL,&pl_sd->bl,SC_NOCHAT,100,0,0); else status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER); } return 0; } ACMD_FUNC(mutearea) { int time; nullpo_ret(sd); if (!message || !*message) { clif_displaymessage(fd, msg_txt(sd,1297)); // Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>). return -1; } time = atoi(message); map_foreachinallarea(atcommand_mutearea_sub,sd->bl.m, sd->bl.x-AREA_SIZE, sd->bl.y-AREA_SIZE, sd->bl.x+AREA_SIZE, sd->bl.y+AREA_SIZE, BL_PC, sd->bl.id, time); return 0; } ACMD_FUNC(rates) { char buf[CHAT_SIZE_MAX]; nullpo_ret(sd); memset(buf, '\0', sizeof(buf)); snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd,1298), // Experience rates: Base %.2fx / Job %.2fx (battle_config.base_exp_rate + (pc_isvip(sd) ? (battle_config.vip_base_exp_increase * battle_config.base_exp_rate) / 100 : 0)) / 100., (battle_config.job_exp_rate + (pc_isvip(sd) ? (battle_config.vip_job_exp_increase * battle_config.job_exp_rate) / 100 : 0)) / 100.); clif_displaymessage(fd, buf); snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd,1299), // Normal Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx (battle_config.item_rate_common + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_common) / 100 : 0)) / 100., (battle_config.item_rate_heal + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_heal) / 100 : 0)) / 100., (battle_config.item_rate_use + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_use) / 100 : 0)) / 100., (battle_config.item_rate_equip + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_equip) / 100 : 0)) / 100., (battle_config.item_rate_card + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_card) / 100 : 0)) / 100.); clif_displaymessage(fd, buf); snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd,1300), // Boss Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx (battle_config.item_rate_common_boss + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_common_boss) / 100 : 0)) / 100., (battle_config.item_rate_heal_boss + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_heal_boss) / 100 : 0)) / 100., (battle_config.item_rate_use_boss + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_use_boss) / 100 : 0)) / 100., (battle_config.item_rate_equip_boss + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_equip_boss) / 100 : 0)) / 100., (battle_config.item_rate_card_boss + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_card_boss) / 100 : 0)) / 100.); clif_displaymessage(fd, buf); snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd,1024), // MVP Drop Rates: Common %.2fx / Healing %.2fx / Usable %.2fx / Equipment %.2fx / Card %.2fx (battle_config.item_rate_common_mvp + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_common_mvp) / 100 : 0)) / 100., (battle_config.item_rate_heal_mvp + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_heal_mvp) / 100 : 0)) / 100., (battle_config.item_rate_use_mvp + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_use_mvp) / 100 : 0)) / 100., (battle_config.item_rate_equip_mvp + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_equip_mvp) / 100 : 0)) / 100., (battle_config.item_rate_card_mvp + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_card_mvp) / 100 : 0)) / 100.); clif_displaymessage(fd, buf); snprintf(buf, CHAT_SIZE_MAX, msg_txt(sd,1301), // Other Drop Rates: MvP %.2fx / Card-Based %.2fx / Treasure %.2fx (battle_config.item_rate_mvp + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_mvp) / 100 : 0)) / 100., (battle_config.item_rate_adddrop + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_adddrop) / 100 : 0)) / 100., (battle_config.item_rate_treasure + (pc_isvip(sd) ? (battle_config.vip_drop_increase * battle_config.item_rate_treasure) / 100 : 0)) / 100.); clif_displaymessage(fd, buf); return 0; } /*========================================== * @me by lordalfa * => Displays the OUTPUT string on top of the Visible players Heads. *------------------------------------------*/ ACMD_FUNC(me) { char tempmes[CHAT_SIZE_MAX]; nullpo_retr(-1, sd); memset(tempmes, '\0', sizeof(tempmes)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (sd->sc.cant.chat) return -1; //no "chatting" while muted. if (!message || !*message || sscanf(message, "%255[^\n]", tempmes) < 0) { clif_displaymessage(fd, msg_txt(sd,1302)); // Please enter a message (usage: @me <message>). return -1; } sprintf(atcmd_output, msg_txt(sd,270), sd->status.name, tempmes); // *%s %s* clif_disp_overhead(&sd->bl, atcmd_output); return 0; } /*========================================== * @size * => Resize your character sprite. [Valaris] *------------------------------------------*/ ACMD_FUNC(size) { int size = SZ_SMALL; nullpo_retr(-1, sd); size = cap_value(atoi(message),SZ_SMALL,SZ_BIG); if(sd->state.size) { sd->state.size = SZ_SMALL; pc_setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT); } sd->state.size = size; if( size == SZ_MEDIUM ) clif_specialeffect(&sd->bl,420,AREA); else if( size == SZ_BIG ) clif_specialeffect(&sd->bl,422,AREA); clif_displaymessage(fd, msg_txt(sd,1303)); // Size change applied. return 0; } ACMD_FUNC(sizeall) { int size; struct map_session_data *pl_sd; struct s_mapiterator* iter; size = atoi(message); size = cap_value(size,SZ_SMALL,SZ_BIG); iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if( pl_sd->state.size != size ) { if( pl_sd->state.size ) { pl_sd->state.size = SZ_SMALL; pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); } pl_sd->state.size = size; if( size == SZ_MEDIUM ) clif_specialeffect(&pl_sd->bl,420,AREA); else if( size == SZ_BIG ) clif_specialeffect(&pl_sd->bl,422,AREA); } } mapit_free(iter); clif_displaymessage(fd, msg_txt(sd,1303)); // Size change applied. return 0; } ACMD_FUNC(sizeguild) { int size = SZ_SMALL, i; char guild[NAME_LENGTH]; struct map_session_data *pl_sd; struct guild *g; nullpo_retr(-1, sd); memset(guild, '\0', sizeof(guild)); if( !message || !*message || sscanf(message, "%11d %23[^\n]", &size, guild) < 2 ) { clif_displaymessage(fd, msg_txt(sd,1304)); // Please enter guild name/ID (usage: @sizeguild <size> <guild name/ID>). return -1; } if( (g = guild_searchname(guild)) == NULL && (g = guild_search(atoi(guild))) == NULL ) { clif_displaymessage(fd, msg_txt(sd,94)); // Incorrect name/ID, or no one from the guild is online. return -1; } size = cap_value(size,SZ_SMALL,SZ_BIG); for( i = 0; i < g->max_member; i++ ) { if( (pl_sd = g->member[i].sd) && pl_sd->state.size != size ) { if( pl_sd->state.size ) { pl_sd->state.size = SZ_SMALL; pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); } pl_sd->state.size = size; if( size == SZ_MEDIUM ) clif_specialeffect(&pl_sd->bl,420,AREA); else if( size == SZ_BIG ) clif_specialeffect(&pl_sd->bl,422,AREA); } } clif_displaymessage(fd, msg_txt(sd,1303)); // Size change applied. return 0; } /*========================================== * @monsterignore * => Makes monsters ignore you. [Valaris] *------------------------------------------*/ ACMD_FUNC(monsterignore) { nullpo_retr(-1, sd); if (!sd->state.monster_ignore) { sd->state.monster_ignore = 1; clif_displaymessage(sd->fd, msg_txt(sd,1305)); // You are now immune to attacks. } else { sd->state.monster_ignore = 0; clif_displaymessage(sd->fd, msg_txt(sd,1306)); // Returned to normal state. } return 0; } /*========================================== * @fakename * => Gives your character a fake name. [Valaris] *------------------------------------------*/ ACMD_FUNC(fakename) { nullpo_retr(-1, sd); if( !message || !*message ) { if( sd->fakename[0] ) { sd->fakename[0] = '\0'; clif_name_area(&sd->bl); if (sd->disguise) clif_name_self(&sd->bl); clif_displaymessage(sd->fd, msg_txt(sd,1307)); // Returned to real name. return 0; } clif_displaymessage(sd->fd, msg_txt(sd,1308)); // You must enter a name. return -1; } if( strlen(message) < 2 ) { clif_displaymessage(sd->fd, msg_txt(sd,1309)); // Fake name must be at least two characters. return -1; } safestrncpy(sd->fakename, message, sizeof(sd->fakename)); clif_name_area(&sd->bl); if (sd->disguise) // Another packet should be sent so the client updates the name for sd clif_name_self(&sd->bl); clif_displaymessage(sd->fd, msg_txt(sd,1310)); // Fake name enabled. return 0; } /*========================================== * Ragnarok Resources *------------------------------------------*/ ACMD_FUNC(mapflag) { #define checkflag( cmd ) if ( map[ sd->bl.m ].flag.cmd ) clif_displaymessage(sd->fd,#cmd) #define setflag( cmd ) \ if ( strcmp( flag_name , #cmd ) == 0 ){\ map[ sd->bl.m ].flag.cmd = flag;\ sprintf(atcmd_output,"[ @mapflag ] %s flag has been set to %s value = %hd",#cmd,flag?"On":"Off",flag);\ clif_displaymessage(sd->fd,atcmd_output);\ return 0;\ } char flag_name[100]; short flag=0,i; nullpo_retr(-1, sd); memset(flag_name, '\0', sizeof(flag_name)); if (!message || !*message || (sscanf(message, "%99s %6hd", flag_name, &flag) < 1)) { clif_displaymessage(sd->fd,msg_txt(sd,1311)); // Enabled Mapflags in this map: clif_displaymessage(sd->fd,"----------------------------------"); checkflag(town); checkflag(autotrade); checkflag(allowks); checkflag(nomemo); checkflag(noteleport); checkflag(noreturn); checkflag(monster_noteleport); checkflag(nosave); checkflag(nobranch); checkflag(noexppenalty); checkflag(pvp); checkflag(pvp_noparty); checkflag(pvp_noguild); checkflag(pvp_nightmaredrop); checkflag(pvp_nocalcrank); checkflag(gvg_castle); checkflag(gvg); checkflag(gvg_dungeon); checkflag(gvg_noparty); checkflag(battleground); checkflag(nozenypenalty); checkflag(notrade); checkflag(noskill); checkflag(nowarp); checkflag(nowarpto); checkflag(noicewall); checkflag(snow); checkflag(clouds); checkflag(clouds2); checkflag(fog); checkflag(fireworks); checkflag(sakura); checkflag(leaves); checkflag(nogo); checkflag(nobaseexp); checkflag(nojobexp); checkflag(nomobloot); checkflag(nomvploot); checkflag(nightenabled); checkflag(restricted); checkflag(nodrop); checkflag(novending); checkflag(loadevent); checkflag(nochat); checkflag(partylock); checkflag(guildlock); checkflag(reset); checkflag(chmautojoin); checkflag(nousecart); checkflag(noitemconsumption); checkflag(nosumstarmiracle); checkflag(nomineeffect); checkflag(nolockon); checkflag(notomb); checkflag(nocostume); checkflag(gvg_te); checkflag(gvg_te_castle); checkflag(hidemobhpbar); #ifdef ADJUST_SKILL_DAMAGE checkflag(skill_damage); #endif clif_displaymessage(sd->fd," "); clif_displaymessage(sd->fd,msg_txt(sd,1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On) clif_displaymessage(sd->fd,msg_txt(sd,1313)); // Type "@mapflag available" to list the available mapflags. return 1; } for (i = 0; flag_name[i]; i++) flag_name[i] = (char)tolower(flag_name[i]); //lowercase setflag(town); setflag(autotrade); setflag(allowks); setflag(nomemo); setflag(noteleport); setflag(noreturn); setflag(monster_noteleport); setflag(nosave); setflag(nobranch); setflag(noexppenalty); setflag(pvp); setflag(pvp_noparty); setflag(pvp_noguild); setflag(pvp_nightmaredrop); setflag(pvp_nocalcrank); setflag(gvg_castle); setflag(gvg); setflag(gvg_dungeon); setflag(gvg_noparty); setflag(battleground); setflag(nozenypenalty); setflag(notrade); setflag(noskill); setflag(nowarp); setflag(nowarpto); setflag(noicewall); setflag(snow); setflag(clouds); setflag(clouds2); setflag(fog); setflag(fireworks); setflag(sakura); setflag(leaves); setflag(nogo); setflag(nobaseexp); setflag(nojobexp); setflag(nomobloot); setflag(nomvploot); setflag(nightenabled); setflag(restricted); setflag(nodrop); setflag(novending); setflag(loadevent); setflag(nochat); setflag(partylock); setflag(guildlock); setflag(reset); setflag(chmautojoin); setflag(nousecart); setflag(noitemconsumption); setflag(nosumstarmiracle); setflag(nomineeffect); setflag(nolockon); setflag(notomb); setflag(nocostume); setflag(gvg_te); setflag(gvg_te_castle); setflag(hidemobhpbar); #ifdef ADJUST_SKILL_DAMAGE setflag(skill_damage); #endif clif_displaymessage(sd->fd,msg_txt(sd,1314)); // Invalid flag name or flag. clif_displaymessage(sd->fd,msg_txt(sd,1312)); // Usage: "@mapflag monster_noteleport 1" (0=Off | 1=On) clif_displaymessage(sd->fd,msg_txt(sd,1315)); // Available Flags: clif_displaymessage(sd->fd,"----------------------------------"); clif_displaymessage(sd->fd,"town, autotrade, allowks, nomemo, noteleport, noreturn, monster_noteleport, nosave,"); clif_displaymessage(sd->fd,"nobranch, noexppenalty, pvp, pvp_noparty, pvp_noguild, pvp_nightmaredrop,"); clif_displaymessage(sd->fd,"pvp_nocalcrank, gvg_castle, gvg, gvg_dungeon, gvg_noparty, battleground,"); clif_displaymessage(sd->fd,"nozenypenalty, notrade, noskill, nowarp, nowarpto, noicewall, snow, clouds, clouds2,"); clif_displaymessage(sd->fd,"fog, fireworks, sakura, leaves, nogo, nobaseexp, nojobexp, nomobloot, nomvploot,"); clif_displaymessage(sd->fd,"nightenabled, restricted, nodrop, novending, loadevent, nochat, partylock, guildlock,"); clif_displaymessage(sd->fd,"reset, chmautojoin, nousecart, noitemconsumption, nosumstarmiracle, nolockon, notomb,"); clif_displaymessage(sd->fd,"nocostume, gvg_te, gvg_te_castle, hidemobhpbar"); #ifdef ADJUST_SKILL_DAMAGE clif_displaymessage(sd->fd,"skill_damage"); #endif #undef checkflag #undef setflag return 0; } /*=================================== * Remove some messages *-----------------------------------*/ ACMD_FUNC(showexp) { if (sd->state.showexp) { sd->state.showexp = 0; clif_displaymessage(fd, msg_txt(sd,1316)); // Gained exp will not be shown. return 0; } sd->state.showexp = 1; clif_displaymessage(fd, msg_txt(sd,1317)); // Gained exp is now shown. return 0; } ACMD_FUNC(showzeny) { if (sd->state.showzeny) { sd->state.showzeny = 0; clif_displaymessage(fd, msg_txt(sd,1318)); // Gained zeny will not be shown. return 0; } sd->state.showzeny = 1; clif_displaymessage(fd, msg_txt(sd,1319)); // Gained zeny is now shown. return 0; } ACMD_FUNC(showdelay) { if (sd->state.showdelay) { sd->state.showdelay = 0; clif_displaymessage(fd, msg_txt(sd,1320)); // Skill delay failures will not be shown. return 0; } sd->state.showdelay = 1; clif_displaymessage(fd, msg_txt(sd,1321)); // Skill delay failures are now shown. return 0; } /*========================================== * Duel organizing functions [LuzZza] * * @duel [limit|nick] - create a duel * @invite <nick> - invite player * @accept - accept invitation * @reject - reject invitation * @leave - leave duel *------------------------------------------*/ ACMD_FUNC(invite) { unsigned int did = sd->duel_group; struct map_session_data *target_sd = NULL; memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { sprintf(atcmd_output, msg_txt(sd, 435), command); // Please enter a player name (usage: %s <char name>). clif_displaymessage(fd, atcmd_output); return -1; } if(did == 0) { clif_displaymessage(fd, msg_txt(sd,350)); // "Duel: @invite without @duel." return 0; } if(duel_list[did].max_players_limit > 0 && duel_list[did].members_count >= duel_list[did].max_players_limit) { clif_displaymessage(fd, msg_txt(sd,351)); // "Duel: Limit of players is reached." return 0; } if((target_sd = map_nick2sd(atcmd_player_name, true)) == NULL) { clif_displaymessage(fd, msg_txt(sd,352)); // "Duel: Player not found." return 0; } if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) { clif_displaymessage(fd, msg_txt(sd,353)); // "Duel: Player already in duel." return 0; } if(battle_config.duel_only_on_same_map && target_sd->bl.m != sd->bl.m) { sprintf(atcmd_output, msg_txt(sd,364), atcmd_player_name); // Duel: You can't invite %s because he/she isn't on the same map. clif_displaymessage(fd, atcmd_output); return 0; } duel_invite(did, sd, target_sd); clif_displaymessage(fd, msg_txt(sd,354)); // "Duel: Invitation has been sent." return 0; } ACMD_FUNC(duel) { unsigned int maxpl = 0; if(sd->duel_group > 0) { duel_showinfo(sd->duel_group, sd); return 0; } if(sd->duel_invite > 0) { clif_displaymessage(fd, msg_txt(sd,355)); // "Duel: @duel without @reject." return 0; } if(!duel_checktime(sd)) { char output[CHAT_SIZE_MAX]; sprintf(output, msg_txt(sd,356), battle_config.duel_time_interval); // "Duel: You can take part in duel only one time per %d minutes." clif_displaymessage(fd, output); return 0; } if( message[0] ) { if(sscanf(message, "%11u", &maxpl) >= 1) { if(maxpl < 2 || maxpl > 65535) { clif_displaymessage(fd, msg_txt(sd,357)); // "Duel: Invalid value." return 0; } duel_create(sd, maxpl); } else { struct map_session_data *target_sd = NULL; memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { sprintf(atcmd_output, msg_txt(sd, 435), command); // Please enter a player name (usage: %s <char name>). clif_displaymessage(fd, atcmd_output); return -1; } target_sd = map_nick2sd(atcmd_player_name,true); if(target_sd != NULL) { unsigned int newduel; if((newduel = duel_create(sd, 2)) != -1) { if(target_sd->duel_group > 0 || target_sd->duel_invite > 0) { clif_displaymessage(fd, msg_txt(sd,353)); // "Duel: Player already in duel." return 0; } duel_invite(newduel, sd, target_sd); clif_displaymessage(fd, msg_txt(sd,354)); // "Duel: Invitation has been sent." } } else { clif_displaymessage(fd, msg_txt(sd,352)); // "Duel: Player not found." return 0; } } } else duel_create(sd, 0); return 0; } ACMD_FUNC(leave) { if(sd->duel_group <= 0) { clif_displaymessage(fd, msg_txt(sd,358)); // "Duel: @leave without @duel." return 0; } duel_leave(sd->duel_group, sd); clif_displaymessage(fd, msg_txt(sd,359)); // "Duel: You left the duel." return 0; } ACMD_FUNC(accept) { if(!duel_checktime(sd)) { char output[CHAT_SIZE_MAX]; sprintf(output, msg_txt(sd,356), battle_config.duel_time_interval); // "Duel: You can take part in duel only one time per %d minutes." clif_displaymessage(fd, output); return 0; } if(sd->duel_invite <= 0) { clif_displaymessage(fd, msg_txt(sd,360)); // "Duel: @accept without invititation." return 0; } if( duel_list[sd->duel_invite].max_players_limit > 0 && duel_list[sd->duel_invite].members_count >= duel_list[sd->duel_invite].max_players_limit ) { clif_displaymessage(fd, msg_txt(sd,351)); // "Duel: Limit of players is reached." return 0; } duel_accept(sd->duel_invite, sd); clif_displaymessage(fd, msg_txt(sd,361)); // "Duel: Invitation has been accepted." return 0; } ACMD_FUNC(reject) { if(sd->duel_invite <= 0) { clif_displaymessage(fd, msg_txt(sd,362)); // "Duel: @reject without invititation." return 0; } duel_reject(sd->duel_invite, sd); clif_displaymessage(fd, msg_txt(sd,363)); // "Duel: Invitation has been rejected." return 0; } /*=================================== * Cash Points *-----------------------------------*/ ACMD_FUNC(cash) { char output[128]; int value; int ret=0; nullpo_retr(-1, sd); // Since there is no cashpoint update packet we need to force updating like this if( sd->state.cashshop_open ){ clif_displaymessage(fd, msg_txt(sd, 1376)); // Please close the cashshop before using this command. return -1; } if( !message || !*message || (value = atoi(message)) == 0 ) { clif_displaymessage(fd, msg_txt(sd,1322)); // Please enter an amount. return -1; } parent_cmd = atcommand_checkalias(command+1); if( !strcmpi(parent_cmd,"cash") ) { if( value > 0 ) { if( (ret=pc_getcash(sd, value, 0, LOG_TYPE_COMMAND)) >= 0){ // If this option is set, the message is already sent by pc function if( !battle_config.cashshop_show_points ){ sprintf(output, msg_txt(sd,505), ret, sd->cashPoints); // Gained %d cash points. Total %d points. clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF); } } else clif_displaymessage(fd, msg_txt(sd,149)); // Impossible to increase the number/value. } else { if (-value > sd->cashPoints) //By command, if cash < value, force it to remove all value = -sd->cashPoints; if( (ret=pc_paycash(sd, -value, 0, LOG_TYPE_COMMAND)) >= 0){ // If this option is set, the message is already sent by pc function if( !battle_config.cashshop_show_points ){ sprintf(output, msg_txt(sd,410), ret, sd->cashPoints); // Removed %d cash points. Total %d points. clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF); } } else clif_displaymessage(fd, msg_txt(sd,41)); // Unable to decrease the number/value. } } else { // @points if( value > 0 ) { if( (ret=pc_getcash(sd, 0, value, LOG_TYPE_COMMAND)) >= 0){ sprintf(output, msg_txt(sd,506), ret, sd->kafraPoints); // Gained %d kafra points. Total %d points. clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF); } else clif_displaymessage(fd, msg_txt(sd,149)); // Impossible to increase the number/value. } else { if( (ret=pc_paycash(sd, -value, -value, LOG_TYPE_COMMAND)) >= 0){ sprintf(output, msg_txt(sd,411), ret, sd->kafraPoints); // Removed %d kafra points. Total %d points. clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], output, false, SELF); } else clif_displaymessage(fd, msg_txt(sd,41)); // Unable to decrease the number/value. } } return 0; } // @clone/@slaveclone/@evilclone <playername> [Valaris] ACMD_FUNC(clone) { int x=0,y=0,flag=0,master=0,i=0; struct map_session_data *pl_sd=NULL; memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(sd->fd,msg_txt(sd,1323)); // You must enter a player name or ID. return 0; } if((pl_sd=map_nick2sd(atcmd_player_name,true)) == NULL && (pl_sd=map_charid2sd(atoi(atcmd_player_name))) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return 0; } if(pc_get_group_level(pl_sd) > pc_get_group_level(sd)) { clif_displaymessage(fd, msg_txt(sd,126)); // Cannot clone a player of higher GM level than yourself. return 0; } parent_cmd = atcommand_checkalias(command+1); if (strcmpi(parent_cmd, "clone") == 0) flag = 1; else if (strcmpi(parent_cmd, "slaveclone") == 0) { flag = 2; if(pc_isdead(sd)){ clif_displaymessage(fd, msg_txt(sd,129+flag*2)); return 0; } master = sd->bl.id; if (battle_config.atc_slave_clone_limit && mob_countslave(&sd->bl) >= battle_config.atc_slave_clone_limit) { clif_displaymessage(fd, msg_txt(sd,127)); // You've reached your slave clones limit. return 0; } } do { x = sd->bl.x + (rnd() % 10 - 5); y = sd->bl.y + (rnd() % 10 - 5); } while (map_getcell(sd->bl.m,x,y,CELL_CHKNOPASS) && i++ < 10); if (i >= 10) { x = sd->bl.x; y = sd->bl.y; } if((x = mob_clone_spawn(pl_sd, sd->bl.m, x, y, "", master, 0, flag?1:0, 0)) > 0) { clif_displaymessage(fd, msg_txt(sd,128+flag*2)); // Evil Clone spawned. Clone spawned. Slave clone spawned. return 0; } clif_displaymessage(fd, msg_txt(sd,129+flag*2)); // Unable to spawn evil clone. Unable to spawn clone. Unable to spawn slave clone. return 0; } /*===================================== * Autorejecting Invites/Deals [LuzZza] * Usage: @noask *-------------------------------------*/ ACMD_FUNC(noask) { if(sd->state.noask) { clif_displaymessage(fd, msg_txt(sd,391)); // Autorejecting is deactivated. sd->state.noask = 0; } else { clif_displaymessage(fd, msg_txt(sd,390)); // Autorejecting is activated. sd->state.noask = 1; } return 0; } /*===================================== * Send a @request message to all GMs of lowest_gm_level. * Usage: @request <petition> *-------------------------------------*/ ACMD_FUNC(request) { if (!message || !*message) { clif_displaymessage(sd->fd,msg_txt(sd,277)); // Usage: @request <petition/message to online GMs>. return -1; } sprintf(atcmd_output, msg_txt(sd,278), message); // (@request): %s intif_wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output); clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], atcmd_output, false, SELF); clif_displaymessage(sd->fd,msg_txt(sd,279)); // @request sent. return 0; } /*========================================== * Feel (SG save map) Reset [HiddenDragon] *------------------------------------------*/ ACMD_FUNC(feelreset) { pc_resetfeel(sd); clif_displaymessage(fd, msg_txt(sd,1324)); // Reset 'Feeling' maps. return 0; } /*========================================== * AUCTION SYSTEM *------------------------------------------*/ ACMD_FUNC(auction) { nullpo_ret(sd); if (!battle_config.feature_auction) { clif_messagecolor(&sd->bl, color_table[COLOR_RED], msg_txt(sd, 517), false, SELF); return 0; } clif_Auction_openwindow(sd); return 0; } /*========================================== * Kill Steal Protection *------------------------------------------*/ ACMD_FUNC(ksprotection) { nullpo_retr(-1,sd); if( sd->state.noks ) { sd->state.noks = 0; clif_displaymessage(fd, msg_txt(sd,1325)); // [ K.S Protection Inactive ] } else { if( !message || !*message || !strcmpi(message, "party") ) { // Default is Party sd->state.noks = 2; clif_displaymessage(fd, msg_txt(sd,1326)); // [ K.S Protection Active - Option: Party ] } else if( !strcmpi(message, "self") ) { sd->state.noks = 1; clif_displaymessage(fd, msg_txt(sd,1327)); // [ K.S Protection Active - Option: Self ] } else if( !strcmpi(message, "guild") ) { sd->state.noks = 3; clif_displaymessage(fd, msg_txt(sd,1328)); // [ K.S Protection Active - Option: Guild ] } else clif_displaymessage(fd, msg_txt(sd,1329)); // Usage: @noks <self|party|guild> } return 0; } /*========================================== * Map Kill Steal Protection Setting *------------------------------------------*/ ACMD_FUNC(allowks) { nullpo_retr(-1,sd); if( map[sd->bl.m].flag.allowks ) { map[sd->bl.m].flag.allowks = 0; clif_displaymessage(fd, msg_txt(sd,1330)); // [ Map K.S Protection Active ] } else { map[sd->bl.m].flag.allowks = 1; clif_displaymessage(fd, msg_txt(sd,1331)); // [ Map K.S Protection Inactive ] } return 0; } ACMD_FUNC(resetstat) { nullpo_retr(-1, sd); pc_resetstate(sd); sprintf(atcmd_output, msg_txt(sd,207), sd->status.name); // '%s' stats points reset. clif_displaymessage(fd, atcmd_output); return 0; } ACMD_FUNC(resetskill) { nullpo_retr(-1,sd); pc_resetskill(sd,1); sprintf(atcmd_output, msg_txt(sd,206), sd->status.name); // '%s' skill points reset. clif_displaymessage(fd, atcmd_output); return 0; } /*========================================== * #storagelist: Displays the items list of a player's storage. * #cartlist: Displays contents of target's cart. * #itemlist: Displays contents of target's inventory. *------------------------------------------*/ ACMD_FUNC(itemlist) { int i, j, count, counter; const char* location; const struct item* items; int size; StringBuf buf; nullpo_retr(-1, sd); parent_cmd = atcommand_checkalias(command+1); if( strcmp(parent_cmd, "storagelist") == 0 ) { location = "storage"; items = sd->storage.u.items_storage; size = sd->storage.max_amount; } else if( strcmp(parent_cmd, "cartlist") == 0 ) { location = "cart"; items = sd->cart.u.items_cart; size = MAX_CART; } else if( strcmp(parent_cmd, "itemlist") == 0 ) { location = "inventory"; items = sd->inventory.u.items_inventory; size = MAX_INVENTORY; } else return 1; StringBuf_Init(&buf); count = 0; // total slots occupied counter = 0; // total items found for( i = 0; i < size; ++i ) { const struct item* it = &items[i]; struct item_data* itd; if( it->nameid == 0 || (itd = itemdb_exists(it->nameid)) == NULL ) continue; counter += it->amount; count++; if( count == 1 ) { StringBuf_Printf(&buf, msg_txt(sd,1332), location, sd->status.name); // ------ %s items list of '%s' ------ clif_displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); } if( it->refine ) StringBuf_Printf(&buf, "%d %s %+d (%s, id: %d)", it->amount, itd->jname, it->refine, itd->name, it->nameid); else StringBuf_Printf(&buf, "%d %s (%s, id: %d)", it->amount, itd->jname, itd->name, it->nameid); if( it->equip ) { char equipstr[CHAT_SIZE_MAX]; strcpy(equipstr, msg_txt(sd,1333)); // | Equipped: if( it->equip&EQP_GARMENT ) strcat(equipstr, msg_txt(sd,1334)); // Robe, if( it->equip&EQP_ACC_L ) strcat(equipstr, msg_txt(sd,1335)); // Left Accessory, if( it->equip&EQP_ARMOR ) strcat(equipstr, msg_txt(sd,1336)); // Body/Armor, if( (it->equip&EQP_ARMS) == EQP_HAND_R ) strcat(equipstr, msg_txt(sd,1337)); // Right Hand, if( (it->equip&EQP_ARMS) == EQP_HAND_L ) strcat(equipstr, msg_txt(sd,1338)); // Left Hand, if( (it->equip&EQP_ARMS) == EQP_ARMS ) strcat(equipstr, msg_txt(sd,1339)); // Both Hands, if( it->equip&EQP_SHOES ) strcat(equipstr, msg_txt(sd,1340)); // Shoes, if( it->equip&EQP_ACC_R ) strcat(equipstr, msg_txt(sd,1341)); // Right Accessory, if( (it->equip&EQP_HELM) == EQP_HEAD_LOW ) strcat(equipstr, msg_txt(sd,1342)); // Lower Head, if( (it->equip&EQP_HELM) == EQP_HEAD_TOP ) strcat(equipstr, msg_txt(sd,1343)); // Top Head, if( (it->equip&EQP_HELM) == (EQP_HEAD_LOW|EQP_HEAD_TOP) ) strcat(equipstr, msg_txt(sd,1344)); // Top/Lower Head, if( (it->equip&EQP_HELM) == EQP_HEAD_MID ) strcat(equipstr, msg_txt(sd,1345)); // Mid Head, if( (it->equip&EQP_HELM) == (EQP_HEAD_LOW|EQP_HEAD_MID) ) strcat(equipstr, msg_txt(sd,1346)); // Mid/Lower Head, if( (it->equip&EQP_HELM) == EQP_HELM ) strcat(equipstr, msg_txt(sd,1347)); // Top/Mid/Lower Head, if( (it->equip&EQP_COSTUME_HELM) == EQP_COSTUME_HEAD_LOW ) strcat(equipstr, msg_txt(sd,518)); // Lower Costume Head, if( (it->equip&EQP_COSTUME_HELM) == EQP_COSTUME_HEAD_TOP ) strcat(equipstr, msg_txt(sd,519)); // Top Costume Head, if( (it->equip&EQP_COSTUME_HELM) == (EQP_COSTUME_HEAD_LOW|EQP_COSTUME_HEAD_TOP) ) strcat(equipstr, msg_txt(sd,520)); // Top/Lower Costume Head, if( (it->equip&EQP_COSTUME_HELM) == EQP_COSTUME_HEAD_MID ) strcat(equipstr, msg_txt(sd,521)); // Mid Costume Head, if( (it->equip&EQP_COSTUME_HELM) == (EQP_COSTUME_HEAD_LOW|EQP_COSTUME_HEAD_MID) ) strcat(equipstr, msg_txt(sd,522)); // Mid/Lower Costume Head, if( (it->equip&EQP_COSTUME_HELM) == EQP_COSTUME_HELM ) strcat(equipstr, msg_txt(sd,523)); // Top/Mid/Lower Costume Head, if( it->equip&EQP_COSTUME_GARMENT ) strcat(equipstr, msg_txt(sd,524)); // Costume Robe, //if( it->equip&EQP_COSTUME_FLOOR ) //strcat(equipstr, msg_txt(sd,525)); // Costume Floor, if( it->equip&EQP_AMMO ) strcat(equipstr, msg_txt(sd,526)); // Ammo, if( it->equip&EQP_SHADOW_ARMOR ) strcat(equipstr, msg_txt(sd,527)); // Shadow Body, if( (it->equip&EQP_SHADOW_ARMS) == EQP_SHADOW_WEAPON ) strcat(equipstr, msg_txt(sd,528)); // Shadow Right Hand, if( (it->equip&EQP_SHADOW_ARMS) == EQP_SHADOW_SHIELD ) strcat(equipstr, msg_txt(sd,529)); // Shadow Left Hand, if( (it->equip&EQP_SHADOW_ARMS) == EQP_SHADOW_ARMS ) strcat(equipstr, msg_txt(sd,530)); // Shadow Both Hands, if( it->equip&EQP_SHADOW_SHOES ) strcat(equipstr, msg_txt(sd,531)); // Shadow Shoes, if( it->equip&EQP_SHADOW_ACC_R ) strcat(equipstr, msg_txt(sd,532)); // Shadow Right Accessory, if( it->equip&EQP_SHADOW_ACC_L ) strcat(equipstr, msg_txt(sd,533)); // Shadow Left Accessory, // remove final ', ' equipstr[strlen(equipstr) - 2] = '\0'; StringBuf_AppendStr(&buf, equipstr); } clif_displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); if( it->card[0] == CARD0_PET ) { // pet egg if (it->card[3]) StringBuf_Printf(&buf, msg_txt(sd,1348), (unsigned int)MakeDWord(it->card[1], it->card[2])); // -> (pet egg, pet id: %u, named) else StringBuf_Printf(&buf, msg_txt(sd,1349), (unsigned int)MakeDWord(it->card[1], it->card[2])); // -> (pet egg, pet id: %u, unnamed) } else if(it->card[0] == CARD0_FORGE) { // forged item StringBuf_Printf(&buf, msg_txt(sd,1350), (unsigned int)MakeDWord(it->card[2], it->card[3]), it->card[1]>>8, it->card[1]&0x0f); // -> (crafted item, creator id: %u, star crumbs %d, element %d) } else if(it->card[0] == CARD0_CREATE) { // created item StringBuf_Printf(&buf, msg_txt(sd,1351), (unsigned int)MakeDWord(it->card[2], it->card[3])); // -> (produced item, creator id: %u) } else { // normal item int counter2 = 0; for( j = 0; j < itd->slot; ++j ) { struct item_data* card; if( it->card[j] == 0 || (card = itemdb_exists(it->card[j])) == NULL ) continue; counter2++; if( counter2 == 1 ) StringBuf_AppendStr(&buf, msg_txt(sd,1352)); // -> (card(s): if( counter2 != 1 ) StringBuf_AppendStr(&buf, ", "); StringBuf_Printf(&buf, "#%d %s (id: %d)", counter2, card->jname, card->nameid); } if( counter2 > 0 ) StringBuf_AppendStr(&buf, ")"); } if( StringBuf_Length(&buf) > 0 ) clif_displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Clear(&buf); } if( count == 0 ) StringBuf_Printf(&buf, msg_txt(sd,1353), location); // No item found in this player's %s. else StringBuf_Printf(&buf, msg_txt(sd,1354), counter, count, location); // %d item(s) found in %d %s slots. clif_displaymessage(fd, StringBuf_Value(&buf)); StringBuf_Destroy(&buf); return 0; } ACMD_FUNC(stats) { char job_jobname[100]; char output[CHAT_SIZE_MAX]; int i; struct { const char* format; int value; } output_table[] = { { "Base Level - %d", 0 }, { NULL, 0 }, { "Hp - %d", 0 }, { "MaxHp - %d", 0 }, { "Sp - %d", 0 }, { "MaxSp - %d", 0 }, { "Str - %3d", 0 }, { "Agi - %3d", 0 }, { "Vit - %3d", 0 }, { "Int - %3d", 0 }, { "Dex - %3d", 0 }, { "Luk - %3d", 0 }, { "Zeny - %d", 0 }, { "Free SK Points - %d", 0 }, { "JobChangeLvl (2nd) - %d", 0 }, { "JobChangeLvl (3rd) - %d", 0 }, { NULL, 0 } }; memset(job_jobname, '\0', sizeof(job_jobname)); memset(output, '\0', sizeof(output)); //direct array initialization with variables is not standard C compliant. output_table[0].value = sd->status.base_level; output_table[1].format = job_jobname; output_table[1].value = sd->status.job_level; output_table[2].value = sd->status.hp; output_table[3].value = sd->status.max_hp; output_table[4].value = sd->status.sp; output_table[5].value = sd->status.max_sp; output_table[6].value = sd->status.str; output_table[7].value = sd->status.agi; output_table[8].value = sd->status.vit; output_table[9].value = sd->status.int_; output_table[10].value = sd->status.dex; output_table[11].value = sd->status.luk; output_table[12].value = sd->status.zeny; output_table[13].value = sd->status.skill_point; output_table[14].value = sd->change_level_2nd; output_table[15].value = sd->change_level_3rd; sprintf(job_jobname, "Job - %s %s", job_name(sd->status.class_), "(level %d)"); sprintf(output, msg_txt(sd,53), sd->status.name); // '%s' stats: clif_displaymessage(fd, output); for (i = 0; output_table[i].format != NULL; i++) { sprintf(output, output_table[i].format, output_table[i].value); clif_displaymessage(fd, output); } return 0; } ACMD_FUNC(delitem) { char item_name[100]; unsigned short nameid; int amount = 0, total, idx; struct item_data* id; nullpo_retr(-1, sd); if( !message || !*message || ( sscanf(message, "\"%99[^\"]\" %11d", item_name, &amount) < 2 && sscanf(message, "%99s %11d", item_name, &amount) < 2 ) || amount < 1 ) { clif_displaymessage(fd, msg_txt(sd,1355)); // Please enter an item name/ID, a quantity, and a player name (usage: #delitem <player> <item_name_or_ID> <quantity>). return -1; } if( ( id = itemdb_searchname(item_name) ) != NULL || ( id = itemdb_exists(atoi(item_name)) ) != NULL ) { nameid = id->nameid; } else { clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name. return -1; } total = amount; // delete items while( amount && ( idx = pc_search_inventory(sd, nameid) ) != -1 ) { int delamount = ( amount < sd->inventory.u.items_inventory[idx].amount ) ? amount : sd->inventory.u.items_inventory[idx].amount; if( sd->inventory_data[idx]->type == IT_PETEGG && sd->inventory.u.items_inventory[idx].card[0] == CARD0_PET ) {// delete pet intif_delete_petdata(MakeDWord(sd->inventory.u.items_inventory[idx].card[1], sd->inventory.u.items_inventory[idx].card[2])); } pc_delitem(sd, idx, delamount, 0, 0, LOG_TYPE_COMMAND); amount-= delamount; } // notify target sprintf(atcmd_output, msg_txt(sd,113), total-amount); // %d item(s) removed by a GM. clif_displaymessage(sd->fd, atcmd_output); // notify source if( amount == total ) { clif_displaymessage(fd, msg_txt(sd,116)); // Character does not have the item. } else if( amount ) { sprintf(atcmd_output, msg_txt(sd,115), total-amount, total-amount, total); // %d item(s) removed. Player had only %d on %d items. clif_displaymessage(fd, atcmd_output); } else { sprintf(atcmd_output, msg_txt(sd,114), total); // %d item(s) removed from the player. clif_displaymessage(fd, atcmd_output); } return 0; } /*========================================== * Custom Fonts *------------------------------------------*/ ACMD_FUNC(font) { int font_id; nullpo_retr(-1,sd); font_id = atoi(message); if( font_id == 0 ) { if( sd->status.font ) { sd->status.font = 0; clif_displaymessage(fd, msg_txt(sd,1356)); // Returning to normal font. clif_font(sd); } else { clif_displaymessage(fd, msg_txt(sd,1357)); // Use @font <1-9> to change your message font. clif_displaymessage(fd, msg_txt(sd,1358)); // Use 0 or no parameter to return to normal font. } } else if( font_id < 0 || font_id > 9 ) clif_displaymessage(fd, msg_txt(sd,1359)); // Invalid font. Use a value from 0 to 9. else if( font_id != sd->status.font ) { sd->status.font = font_id; clif_font(sd); clif_displaymessage(fd, msg_txt(sd,1360)); // Font changed. } else clif_displaymessage(fd, msg_txt(sd,1361)); // Already using this font. return 0; } /*========================================== * type: 1 = commands (@), 2 = charcommands (#) *------------------------------------------*/ static void atcommand_commands_sub(struct map_session_data* sd, const int fd, AtCommandType type) { char line_buff[CHATBOX_SIZE]; char* cur = line_buff; AtCommandInfo* cmd; DBIterator *iter = db_iterator(atcommand_db); int count = 0; memset(line_buff,' ',CHATBOX_SIZE); line_buff[CHATBOX_SIZE-1] = 0; clif_displaymessage(fd, msg_txt(sd,273)); // "Commands available:" for (cmd = (AtCommandInfo*)dbi_first(iter); dbi_exists(iter); cmd = (AtCommandInfo*)dbi_next(iter)) { unsigned int slen = 0; switch( type ) { case COMMAND_CHARCOMMAND: if( cmd->char_groups[sd->group_pos] == 0 ) continue; break; case COMMAND_ATCOMMAND: if( cmd->at_groups[sd->group_pos] == 0 ) continue; break; default: continue; } slen = strlen(cmd->command); // flush the text buffer if this command won't fit into it if (slen + cur - line_buff >= CHATBOX_SIZE) { clif_displaymessage(fd,line_buff); cur = line_buff; memset(line_buff,' ',CHATBOX_SIZE); line_buff[CHATBOX_SIZE-1] = 0; } memcpy(cur,cmd->command,slen); cur += slen+(10-slen%10); count++; } dbi_destroy(iter); clif_displaymessage(fd,line_buff); if ( atcmd_binding_count ) { int i, count_bind, gm_lvl = pc_get_group_level(sd); for( i = count_bind = 0; i < atcmd_binding_count; i++ ) { if ( gm_lvl >= ( (type - 1) ? atcmd_binding[i]->level2 : atcmd_binding[i]->level ) ) { unsigned int slen = strlen(atcmd_binding[i]->command); if ( count_bind == 0 ) { cur = line_buff; memset(line_buff,' ',CHATBOX_SIZE); line_buff[CHATBOX_SIZE-1] = 0; clif_displaymessage(fd, "-----------------"); clif_displaymessage(fd, msg_txt(sd,509)); // Script-bound commands: } if (slen + cur - line_buff >= CHATBOX_SIZE) { clif_displaymessage(fd,line_buff); cur = line_buff; memset(line_buff,' ',CHATBOX_SIZE); line_buff[CHATBOX_SIZE-1] = 0; } memcpy(cur,atcmd_binding[i]->command,slen); cur += slen+(10-slen%10); count_bind++; } } if ( count_bind ) clif_displaymessage(fd,line_buff);// last one count += count_bind; } sprintf(atcmd_output, msg_txt(sd,274), count); // "%d commands found." clif_displaymessage(fd, atcmd_output); return; } /*========================================== * @commands Lists available @ commands to you *------------------------------------------*/ ACMD_FUNC(commands) { atcommand_commands_sub(sd, fd, COMMAND_ATCOMMAND); return 0; } /*========================================== * @charcommands Lists available # commands to you *------------------------------------------*/ ACMD_FUNC(charcommands) { atcommand_commands_sub(sd, fd, COMMAND_CHARCOMMAND); return 0; } /* for new mounts */ ACMD_FUNC(mount2) { clif_displaymessage(sd->fd,msg_txt(sd,1362)); // NOTICE: If you crash with mount your LUA is outdated. if (!&sd->sc || !(sd->sc.data[SC_ALL_RIDING])) { clif_displaymessage(sd->fd,msg_txt(sd,1363)); // You have mounted. sc_start(NULL, &sd->bl, SC_ALL_RIDING, 10000, 1, INVALID_TIMER); } else { clif_displaymessage(sd->fd,msg_txt(sd,1364)); // You have released your mount. if (&sd->sc) status_change_end(&sd->bl, SC_ALL_RIDING, INVALID_TIMER); } return 0; } ACMD_FUNC(accinfo) { char query[NAME_LENGTH]; char type = 0; // type = 1, get only account name if (!message || !*message || strlen(message) > NAME_LENGTH || ( sscanf(message, "%23s %c", query, &type) < 1)) { clif_displaymessage(fd, msg_txt(sd,1365)); // Usage: @accinfo/@accountinfo <account_id/char name> clif_displaymessage(fd, msg_txt(sd,1366)); // You may search partial name by making use of '%' in the search, ex. "@accinfo %Mario%" lists all characters whose name contains "Mario". return -1; } else if (type != 0) { type = type-'0'; //make it int if (type != 1) { clif_displaymessage(fd, "accinfo : Unknow type specified\n"); return -1; } } intif_request_accinfo( sd->fd, sd->bl.id, pc_get_group_level(sd), query, type); return 0; } /** * @set <variable name{[index]}>{ <value>} * * Gets or sets a value of a non server variable. * If a value is specified it is used to set the variable's value, * if not the variable's value is read. * In any case it reads and displays the variable's value. * * Original implementation by Ind */ ACMD_FUNC(set) { char reg[46], val[128], name[32]; int toset = 0, len, index; bool is_str = false; int64 uid; if( !message || !*message || (toset = sscanf(message, "%45s %127[^\n]s", reg, val)) < 1 ) { clif_displaymessage(fd, msg_txt(sd,1367)); // Usage: @set <variable name> <value> clif_displaymessage(fd, msg_txt(sd,1368)); // Usage: ex. "@set PoringCharVar 50" clif_displaymessage(fd, msg_txt(sd,1369)); // Usage: ex. "@set PoringCharVarSTR$ Super Duper String" clif_displaymessage(fd, msg_txt(sd,1370)); // Usage: ex. "@set PoringCharVarSTR$" outputs its value, Super Duper String. return -1; } /* disabled variable types (they require a proper script state to function, so allowing them would crash the server) */ if( reg[0] == '.' ) { clif_displaymessage(fd, msg_txt(sd,1371)); // NPC variables may not be used with @set. return -1; } else if( reg[0] == '\'' ) { clif_displaymessage(fd, msg_txt(sd,1372)); // Instance variables may not be used with @set. return -1; } // Check if the user wanted to set an array if( sscanf( reg, "%31[^[][%11d]", name, &index ) < 2 ){ // The user did not specify array brackets, so we set the index to zero index = 0; } is_str = is_string_variable(name); if( ( len = strlen(val) ) > 1 ) { if( val[0] == '"' && val[len-1] == '"') { val[len-1] = '\0'; //Strip quotes. memmove(val, val+1, len-1); } } // Only set the variable if there is a value for it if( toset >= 2 ){ setd_sub( NULL, sd, name, index, is_str ? (void*)val : (void*)__64BPRTSIZE((atoi(val))), NULL ); } uid = reference_uid( add_str( name ), index ); if( is_str ) {// string variable char* value; switch( reg[0] ) { case '@': value = pc_readregstr(sd, uid); break; case '$': value = mapreg_readregstr(uid); break; case '#': if( reg[1] == '#' ) value = pc_readaccountreg2str(sd, uid);// global else value = pc_readaccountregstr(sd, uid);// local break; default: value = pc_readglobalreg_str(sd, uid); break; } if( value == NULL || *value == '\0' ){// empty string sprintf(atcmd_output,msg_txt(sd,1375),reg); // %s is empty }else{ sprintf(atcmd_output,msg_txt(sd,1374),reg,value); // %s value is now :%s } } else {// integer variable int value; switch( reg[0] ) { case '@': value = pc_readreg(sd, uid); break; case '$': value = mapreg_readreg(uid); break; case '#': if( reg[1] == '#' ) value = pc_readaccountreg2(sd, uid);// global else value = pc_readaccountreg(sd, uid);// local break; default: value = pc_readglobalreg(sd, uid); break; } sprintf(atcmd_output,msg_txt(sd,1373),reg,value); // %s value is now :%d } clif_displaymessage(fd, atcmd_output); return 0; } ACMD_FUNC(addperm) { int perm_size = ARRAYLENGTH(pc_g_permission_name); bool add; int i; parent_cmd = atcommand_checkalias(command+1); add = (strcmpi(parent_cmd, "addperm") == 0); if( !message || !*message ) { sprintf(atcmd_output, msg_txt(sd,1378),command); // Usage: %s <permission_name> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1379)); // -- Permission List for( i = 0; i < perm_size; i++ ) { sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name); clif_displaymessage(fd, atcmd_output); } return -1; } ARR_FIND(0, perm_size, i, strcmpi(pc_g_permission_name[i].name, message) == 0); if( i == perm_size ) { sprintf(atcmd_output,msg_txt(sd,1380),message); // '%s' is not a known permission. clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1379)); // -- Permission List for( i = 0; i < perm_size; i++ ) { sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name); clif_displaymessage(fd, atcmd_output); } return -1; } if( add && (sd->permissions&pc_g_permission_name[i].permission) ) { sprintf(atcmd_output, msg_txt(sd,1381),sd->status.name,pc_g_permission_name[i].name); // User '%s' already possesses the '%s' permission. clif_displaymessage(fd, atcmd_output); return -1; } else if ( !add && !(sd->permissions&pc_g_permission_name[i].permission) ) { sprintf(atcmd_output, msg_txt(sd,1382),sd->status.name,pc_g_permission_name[i].name); // User '%s' doesn't possess the '%s' permission. clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output,msg_txt(sd,1383),sd->status.name); // -- User '%s' Permissions clif_displaymessage(fd, atcmd_output); for( i = 0; i < perm_size; i++ ) { if( sd->permissions&pc_g_permission_name[i].permission ) { sprintf(atcmd_output,"- %s",pc_g_permission_name[i].name); clif_displaymessage(fd, atcmd_output); } } return -1; } if( add ) sd->permissions |= pc_g_permission_name[i].permission; else sd->permissions &=~ pc_g_permission_name[i].permission; sprintf(atcmd_output, msg_txt(sd,1384),sd->status.name); // User '%s' permissions updated successfully. The changes are temporary. clif_displaymessage(fd, atcmd_output); return 0; } ACMD_FUNC(unloadnpcfile) { if( !message || !*message ) { clif_displaymessage(fd, msg_txt(sd,1385)); // Usage: @unloadnpcfile <file name> return -1; } if( npc_unloadfile(message) ) clif_displaymessage(fd, msg_txt(sd,1386)); // File unloaded. Be aware that mapflags and monsters spawned directly are not removed. else { clif_displaymessage(fd, msg_txt(sd,1387)); // File not found. return -1; } return 0; } ACMD_FUNC(cart) { #define MC_CART_MDFY(idx, x) \ sd->status.skill[(idx)].id = (x)?MC_PUSHCART:0; \ sd->status.skill[(idx)].lv = (x)?1:0; \ sd->status.skill[(idx)].flag = (x)?SKILL_FLAG_TEMPORARY:SKILL_FLAG_PERMANENT; int val = atoi(message); bool need_skill = (pc_checkskill(sd, MC_PUSHCART) == 0); uint16 sk_idx = 0; if( !message || !*message || val < 0 || val > MAX_CARTS ) { sprintf(atcmd_output, msg_txt(sd,1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>). clif_displaymessage(fd, atcmd_output); return -1; } if( val == 0 && !pc_iscarton(sd) ) { clif_displaymessage(fd, msg_txt(sd,1391)); // You do not possess a cart to be removed return -1; } if (!(sk_idx = skill_get_index(MC_PUSHCART))) return -1; if( need_skill ) { MC_CART_MDFY(sk_idx,1); } if( !pc_setcart(sd, val) ) { if( need_skill ) { MC_CART_MDFY(sk_idx,0); } return -1;/* @cart failed */ } if( need_skill ) { MC_CART_MDFY(sk_idx,0); } clif_displaymessage(fd, msg_txt(sd,1392)); // Cart Added return 0; #undef MC_CART_MDFY } /* Channel System [Ind] */ ACMD_FUNC(join){ char chname[CHAN_NAME_LENGTH], pass[CHAN_NAME_LENGTH]; if( !message || !*message || sscanf(message, "%19s %19s", chname, pass) < 1 ) { sprintf(atcmd_output, msg_txt(sd,1399),command); // Unknown channel (usage: %s <#channel_name>). clif_displaymessage(fd, atcmd_output); return -1; } return channel_pcjoin(sd, chname, pass); } /* * Display available option for @channel command * @command : the name of used command (for alias case) */ static inline void atcmd_channel_help(struct map_session_data *sd, const char *command) { int fd = sd->fd; bool can_delete = pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN); bool can_create = (can_delete || channel_config.private_channel.allow); clif_displaymessage(fd, msg_txt(sd,1414));// ---- Available options: //option create if( can_create ) { sprintf(atcmd_output, msg_txt(sd,1415),command);// * %s create <#channel_name> <channel_password> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1416));// -- Creates a new channel. } //option delete if(can_delete){ sprintf(atcmd_output, msg_txt(sd,1469),command);// * %s delete <#channel_name> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1470)); // -- Destroys the specified channel. } //option list sprintf(atcmd_output, msg_txt(sd,1417),command);// * %s list clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1418));// -- Lists all public channels. sprintf(atcmd_output, msg_txt(sd,1471),command);// * %s list mine clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1472));// -- Lists all channels you have joined. if( can_create ) { sprintf(atcmd_output, msg_txt(sd,1419),command);// * %s list colors clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1420));// -- Lists all available colors for custom channels. } //option setcolor if(can_create){ sprintf(atcmd_output, msg_txt(sd,1421),command);// * %s setcolor <#channel_name> <color_name> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1422));// -- Changes channel text to the specified color (channel owners only). } //option join sprintf(atcmd_output, msg_txt(sd,1473),command);// * %s join <#channel_name> <channel_password> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1474));// -- Joins the specified channel. //option leave sprintf(atcmd_output, msg_txt(sd,1423),command);// * %s leave <#channel_name> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1424));// -- Leaves the specified channel. //option bindto sprintf(atcmd_output, msg_txt(sd,1427),command);// * %s bindto <#channel_name> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1428));// -- Binds your global chat to the specified channel, sending all global messages to that channel. //option unbind sprintf(atcmd_output, msg_txt(sd,1429),command);// * %s unbind clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1430));// -- Unbinds your global chat from the attached channel, if any. //option ban/unban/banlist if( can_create ) { sprintf(atcmd_output, msg_txt(sd,1456),command);// * %s ban <#channel_name> <player> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1457));// -- Bans the specified player from the channel. sprintf(atcmd_output, msg_txt(sd,1458),command);// * %s banlist <#channel_name> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1459));// -- Lists all players banned from the specified channel. sprintf(atcmd_output, msg_txt(sd,1460),command);// * %s unban <#channel_name> <player> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1461));// -- Unbans the specified player from the channel. sprintf(atcmd_output, msg_txt(sd,1467),command);// * %s unbanall <#channel_name> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1468));// -- Clears all bans from the specified channel. } //option setopt if(can_create){ sprintf(atcmd_output, msg_txt(sd,1462),command);// * %s setopt <#channel_name> <option> <value> clif_displaymessage(fd, atcmd_output); clif_displaymessage(fd, msg_txt(sd,1463));// -- Sets an option and value for the specified channel. } sprintf(atcmd_output, msg_txt(sd,1404),command); // %s failed. clif_displaymessage(fd, atcmd_output); } ACMD_FUNC(channel) { char key[NAME_LENGTH], sub1[CHAN_NAME_LENGTH], sub2[64]; sub1[0] = sub2[0] = '\0'; if( !message || !*message || sscanf(message, "%23s %19s %63[^\n]", key, sub1, sub2) < 1 ) { atcmd_channel_help(sd,command); return 0; } if( strcmpi(key,"delete") == 0 && pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) ) { return channel_pcdelete(sd,sub1); } else if ( strcmpi(key,"list") == 0 ) { return channel_display_list(sd,sub1); } else if ( strcmpi(key,"setcolor") == 0 ) { return channel_pccolor(sd, sub1, sub2); } else if ( strcmpi(key,"join") == 0 ) { return channel_pcjoin(sd, sub1, sub2); }else if ( strcmpi(key,"leave") == 0 ) { return channel_pcleave(sd, sub1); } else if ( strcmpi(key,"bindto") == 0 ) { return channel_pcbind(sd, sub1); } else if ( strcmpi(key,"unbind") == 0 ) { return channel_pcunbind(sd); } else if ( strcmpi(key,"ban") == 0 ) { return channel_pcban(sd,sub1,sub2,0); } else if ( strcmpi(key,"kick") == 0 ) { return channel_pckick(sd,sub1,sub2); } else if ( strcmpi(key,"banlist") == 0 ) { return channel_pcban(sd,sub1,NULL,3); } else if ( strcmpi(key,"unban") == 0 ) { return channel_pcban(sd,sub1,sub2,1); } else if ( strcmpi(key,"unbanall") == 0 ) { return channel_pcban(sd,sub1,NULL,2); } else { char sub3[CHAN_NAME_LENGTH], sub4[CHAN_NAME_LENGTH]; sub3[0] = sub4[0] = '\0'; sscanf(sub2, "%19s %19s", sub3, sub4); if( strcmpi(key,"create") == 0 && ( channel_config.private_channel.allow || pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) ) ) { if (sub4[0] != '\0') { clif_displaymessage(fd, msg_txt(sd, 1408)); // Channel password may not contain spaces. return -1; } return channel_pccreate(sd,sub1,sub3); } else if ( strcmpi(key,"setopt") == 0 ) { return channel_pcsetopt(sd,sub1,sub3,sub4); } atcmd_channel_help(sd,command); } return 0; } ACMD_FUNC(fontcolor) { if( !message || !*message ) { channel_display_list(sd,"colors"); return -1; } if( strcmpi(message,"Normal") == 0 ) { sd->fontcolor = 0; } else { unsigned char k; ARR_FIND(0,channel_config.colors_count,k,( strcmpi(message,channel_config.colors_name[k]) == 0 )); if( k == channel_config.colors_count ) { sprintf(atcmd_output, msg_txt(sd,1411), message);// Unknown color '%s'. clif_displaymessage(fd, atcmd_output); return -1; } sd->fontcolor = k; } sprintf(atcmd_output, msg_txt(sd,1454), message);// Color set to '%s'. clif_displaymessage(fd, atcmd_output); return 0; } ACMD_FUNC(langtype) { char langstr[8]; int i=0, fail=0; memset(langstr, '\0', sizeof(langstr)); if(sscanf(message, "%3s", langstr) >= 1){ int lang=0; lang = msg_langstr2langtype(langstr); //Switch langstr to associated langtype if( msg_checklangtype(lang,false) == 1 ){ //Verify it's enabled and set it char output[100]; pc_setaccountreg(sd, add_str("#langtype"), lang); //For login/char sd->langtype = lang; sprintf(output,msg_txt(sd,461),msg_langtype2langstr(lang)); // Language is now set to %s. clif_displaymessage(fd,output); return 0; } else if (lang != -1) { //defined langage but failed check clif_displaymessage(fd,msg_txt(sd,462)); // This langage is currently disabled. return -1; } } //wrong or no entry clif_displaymessage(fd,msg_txt(sd,460)); // Please enter a valid language (usage: @langtype <language>). clif_displaymessage(fd,msg_txt(sd,464)); // ---- Available languages: while(fail != -1){ //out of range fail = msg_checklangtype(i,false); if(fail == 1) clif_displaymessage(fd,msg_langtype2langstr(i)); i++; } return -1; } #ifdef VIP_ENABLE ACMD_FUNC(vip) { struct map_session_data *pl_sd = NULL; char * modif_p; int32 vipdifftime = 0; time_t now=time(NULL); nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%255s %23[^\n]",atcmd_output,atcmd_player_name) < 2) { clif_displaymessage(fd, msg_txt(sd,700)); //Usage: @vip <timef> <character name> return -1; } atcmd_output[sizeof(atcmd_output)-1] = '\0'; modif_p = atcmd_output; vipdifftime = (int32)solve_time(modif_p); if (vipdifftime == 0) { clif_displaymessage(fd, msg_txt(sd,701)); // Invalid time for vip command. clif_displaymessage(fd, msg_txt(sd,702)); // Time parameter format is +/-<value> to alter. y/a = Year, m = Month, d/j = Day, h = Hour, n/mn = Minute, s = Second. return -1; } if ((pl_sd = map_nick2sd(atcmd_player_name,false)) == NULL) { clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } if (pc_get_group_level(pl_sd) > pc_get_group_level(sd)) { clif_displaymessage(fd, msg_txt(sd,81)); // Your GM level don't authorise you to do this action on this player. return -1; } if(pl_sd->vip.time==0) pl_sd->vip.time=now; pl_sd->vip.time += vipdifftime; //increase or reduce VIP duration if (pl_sd->vip.time <= now) { clif_displaymessage(pl_sd->fd, msg_txt(pl_sd,703)); // GM has removed your VIP time. clif_displaymessage(fd, msg_txt(sd,704)); // Player is no longer VIP. } else { int year,month,day,hour,minute,second; char timestr[21]; split_time((int)(pl_sd->vip.time-now),&year,&month,&day,&hour,&minute,&second); sprintf(atcmd_output,msg_txt(pl_sd,705),year,month,day,hour,minute); // Your VIP status is valid for %d years, %d months, %d days, %d hours and %d minutes. clif_displaymessage(pl_sd->fd,atcmd_output); timestamp2string(timestr,20,pl_sd->vip.time,"%Y-%m-%d %H:%M"); sprintf(atcmd_output,msg_txt(pl_sd,707),timestr); // You are VIP until : %s clif_displaymessage(pl_sd->fd,atcmd_output); if (pl_sd != sd) { sprintf(atcmd_output,msg_txt(sd,706),pl_sd->status.name,year,month,day,hour,minute); // Player '%s' is now VIP for %d years, %d months, %d days, %d hours and %d minutes. clif_displaymessage(fd,atcmd_output); sprintf(atcmd_output,msg_txt(sd,708),timestr); // The player is now VIP until : %s clif_displaymessage(fd,atcmd_output); } } chrif_req_login_operation(pl_sd->status.account_id, pl_sd->status.name, CHRIF_OP_LOGIN_VIP, vipdifftime, 7, 0); return 0; } /** Enable/disable rate info */ ACMD_FUNC(showrate) { nullpo_retr(-1,sd); if (!sd->vip.disableshowrate) { safestrncpy(atcmd_output,msg_txt(sd,718),CHAT_SIZE_MAX); //Personal rate information is not displayed now. sd->vip.disableshowrate = 1; } else { safestrncpy(atcmd_output,msg_txt(sd,719),CHAT_SIZE_MAX); //Personal rate information will be shown. sd->vip.disableshowrate = 0; } clif_displaymessage(fd,atcmd_output); return 0; } #endif ACMD_FUNC(fullstrip) { int i; TBL_PC *tsd; nullpo_retr(-1,sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { clif_displaymessage(fd, msg_txt(sd,349)); // Please enter a player name (usage: @fullstrip/@warpto/@goto <char name/ID>). return -1; } if((tsd=map_nick2sd(atcmd_player_name,false)) == NULL && (tsd=map_id2sd(atoi(atcmd_player_name))) == NULL){ clif_displaymessage(fd, msg_txt(sd,3)); // Character not found. return -1; } for( i = 0; i < EQI_MAX; i++ ) { if( tsd->equip_index[ i ] >= 0 ) pc_unequipitem( tsd , tsd->equip_index[ i ] , 2 ); } return 0; } ACMD_FUNC(costume) { const char* names[] = { "Wedding", "Xmas", "Summer", "Hanbok", "Oktoberfest", }; const int name2id[] = { SC_WEDDING, SC_XMAS, SC_SUMMER, SC_HANBOK, SC_OKTOBERFEST }; unsigned short k = 0, len = ARRAYLENGTH(names); if( !message || !*message ) { for( k = 0; k < len; k++ ) { if( sd->sc.data[name2id[k]] ) { sprintf(atcmd_output, msg_txt(sd, 727), names[k]); // '%s' Costume removed. clif_displaymessage(sd->fd, atcmd_output); status_change_end(&sd->bl, (sc_type)name2id[k], INVALID_TIMER); return 0; } } clif_displaymessage(sd->fd, msg_txt(sd, 726)); // Available Costumes for( k = 0; k < len; k++ ) { sprintf(atcmd_output, msg_txt(sd, 725), names[k]); // -- %s clif_displaymessage(sd->fd, atcmd_output); } return -1; } for( k = 0; k < len; k++ ) { if( sd->sc.data[name2id[k]] ) { sprintf(atcmd_output, msg_txt(sd, 724), names[k]); // You're already wearing a(n) '%s' costume, type '@costume' to remove it. clif_displaymessage(sd->fd, atcmd_output); return -1; } } for( k = 0; k < len; k++ ) if( strcmpi(message, names[k]) == 0 ) break; if( k == len ) { sprintf(atcmd_output, msg_txt(sd, 723), message); // '%s' is an unknown costume clif_displaymessage(sd->fd, atcmd_output); return -1; } sc_start(&sd->bl, &sd->bl, (sc_type)name2id[k], 100, 0, -1); return 0; } /** * Clone other player's equipments * Usage: @cloneequip <char name/ID> * http://rathena.org/board/topic/95076-new-atcommands-suggestion/ * @author [Cydh], [Antares] */ ACMD_FUNC(cloneequip) { struct map_session_data *pl_sd; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { sprintf(atcmd_output, msg_txt(sd, 735), command); // Usage: %s <char name/ID> clif_displaymessage(fd, atcmd_output); return -1; } if (!(pl_sd = map_nick2sd(atcmd_player_name, true)) && !(pl_sd = map_charid2sd(atoi(atcmd_player_name)))) { clif_displaymessage(fd, msg_txt(sd, 3)); return -1; } if (sd == pl_sd) { memset(atcmd_output, '\0', sizeof(atcmd_output)); sprintf(atcmd_output, msg_txt(sd, 734), "equip"); // Cannot clone your own %. clif_displaymessage(fd, atcmd_output); return -1; } if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { memset(atcmd_output, '\0', sizeof(atcmd_output)); sprintf(atcmd_output, msg_txt(sd, 736), "equip"); // Cannot clone %s from this player. clif_displaymessage(fd, atcmd_output); return -1; } else { int8 i; for (i = 0; i < EQI_MAX; i++) { short idx; char flag = 0; struct item tmp_item; if ((idx = pl_sd->equip_index[i]) < 0) continue; if (i == EQI_AMMO) continue; if (pc_is_same_equip_index((enum equip_index) i, pl_sd->equip_index, idx)) continue; tmp_item = pl_sd->inventory.u.items_inventory[idx]; if (itemdb_isspecial(tmp_item.card[0])) memset(tmp_item.card, 0, sizeof(tmp_item.card)); tmp_item.bound = 0; tmp_item.expire_time = 0; tmp_item.unique_id = 0; tmp_item.favorite = 0; tmp_item.amount = 1; if ((flag = pc_additem(sd, &tmp_item, 1, LOG_TYPE_COMMAND))) clif_additem(sd, 0, 0, flag); else pc_equipitem(sd, sd->last_addeditem_index, itemdb_equip(tmp_item.nameid)); } } memset(atcmd_output, '\0', sizeof(atcmd_output)); sprintf(atcmd_output, msg_txt(sd, 738), "equip"); // Clone '%s' is done. clif_displaymessage(fd, atcmd_output); return 0; } /** * Clone other player's statuses/parameters using method same like ACMD_FUNC(param), doesn't use stat point * Usage: @clonestat <char name/ID> * http://rathena.org/board/topic/95076-new-atcommands-suggestion/ * @author [Cydh], [Antares] */ ACMD_FUNC(clonestat) { struct map_session_data *pl_sd; nullpo_retr(-1, sd); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); memset(atcmd_output, '\0', sizeof(atcmd_output)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { sprintf(atcmd_output, msg_txt(sd, 735), command); // Usage: %s <char name/ID> clif_displaymessage(fd, atcmd_output); return -1; } if (!(pl_sd = map_nick2sd(atcmd_player_name, true)) && !(pl_sd = map_charid2sd(atoi(atcmd_player_name)))) { clif_displaymessage(fd, msg_txt(sd, 3)); // Character not found. return -1; } if (sd == pl_sd) { memset(atcmd_output, '\0', sizeof(atcmd_output)); sprintf(atcmd_output, msg_txt(sd, 734), "status"); // Cannot clone your own %. clif_displaymessage(fd, atcmd_output); return -1; } if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { memset(atcmd_output, '\0', sizeof(atcmd_output)); sprintf(atcmd_output, msg_txt(sd, 736), "status"); // Cannot clone %s from this player. clif_displaymessage(fd, atcmd_output); return -1; } else { uint8 i; short max_status[6]; pc_resetstate(sd); if (pc_has_permission(sd, PC_PERM_BYPASS_STAT_ONCLONE)) max_status[0] = max_status[1] = max_status[2] = max_status[3] = max_status[4] = max_status[5] = SHRT_MAX; else { max_status[0] = pc_maxparameter(sd, PARAM_STR); max_status[1] = pc_maxparameter(sd, PARAM_AGI); max_status[2] = pc_maxparameter(sd, PARAM_VIT); max_status[3] = pc_maxparameter(sd, PARAM_INT); max_status[4] = pc_maxparameter(sd, PARAM_DEX); max_status[5] = pc_maxparameter(sd, PARAM_LUK); } #define clonestat_check(cmd,stat)\ {\ memset(atcmd_output, '\0', sizeof(atcmd_output));\ if (pl_sd->status.cmd > max_status[(stat)]) {\ sprintf(atcmd_output, msg_txt(sd, 737), #cmd, pl_sd->status.cmd, max_status[(stat)]);\ clif_displaymessage(fd, atcmd_output);\ sd->status.cmd = max_status[(stat)];\ }\ else\ sd->status.cmd = pl_sd->status.cmd;\ } clonestat_check(str, PARAM_STR); clonestat_check(agi, PARAM_AGI); clonestat_check(vit, PARAM_VIT); clonestat_check(int_, PARAM_INT); clonestat_check(dex, PARAM_DEX); clonestat_check(luk, PARAM_LUK); for (i = 0; i < PARAM_MAX; i++) { clif_updatestatus(sd, SP_STR + i); clif_updatestatus(sd, SP_USTR + i); } status_calc_pc(sd, SCO_FORCE); } memset(atcmd_output, '\0', sizeof(atcmd_output)); sprintf(atcmd_output, msg_txt(sd, 738), "status"); // Clone '%s' is done. clif_displaymessage(fd, atcmd_output); #undef clonestat_check return 0; } /** * Adopt a character. * Usage: @adopt <char name> * https://rathena.org/board/topic/104014-suggestion-add-adopt-or-etc/ */ ACMD_FUNC(adopt) { TBL_PC *b_sd; enum adopt_responses response; nullpo_retr(-1, sd); memset(atcmd_output, '\0', sizeof(atcmd_output)); memset(atcmd_player_name, '\0', sizeof(atcmd_player_name)); if (!message || !*message || sscanf(message, "%23[^\n]", atcmd_player_name) < 1) { sprintf(atcmd_output, msg_txt(sd, 435), command); // Please enter a player name (usage: %s <char name>). clif_displaymessage(fd, atcmd_output); return -1; } if ((b_sd = map_nick2sd(atcmd_player_name,false)) == NULL) { clif_displaymessage(fd, msg_txt(sd, 3)); // Character not found. return -1; } response = pc_try_adopt(sd, map_charid2sd(sd->status.partner_id), b_sd); if (response == ADOPT_ALLOWED) { TBL_PC *p_sd = map_charid2sd(sd->status.partner_id); b_sd->adopt_invite = sd->status.account_id; clif_Adopt_request(b_sd, sd, p_sd->status.account_id); return 0; } if (response < ADOPT_MORE_CHILDREN) // No displaymessage for client-type responses clif_displaymessage(fd, msg_txt(sd, 744 + response - 1)); return -1; } #include "../custom/atcommand.inc" /** * Fills the reference of available commands in atcommand DBMap **/ #define ACMD_DEF(x) { #x, atcommand_ ## x, NULL, NULL, 0 } #define ACMD_DEF2(x2, x) { x2, atcommand_ ## x, NULL, NULL, 0 } // Define with restriction #define ACMD_DEFR(x, r) { #x, atcommand_ ## x, NULL, NULL, r } #define ACMD_DEF2R(x2, x, r) { x2, atcommand_ ## x, NULL, NULL, r } void atcommand_basecommands(void) { /** * Command reference list, place the base of your commands here * TODO: List all commands that causing crash **/ AtCommandInfo atcommand_base[] = { #include "../custom/atcommand_def.inc" ACMD_DEF2R("warp", mapmove, ATCMD_NOCONSOLE), ACMD_DEF(where), ACMD_DEF(jumpto), ACMD_DEF(jump), ACMD_DEF(who), ACMD_DEF2("who2", who), ACMD_DEF2("who3", who), ACMD_DEF2("whomap", who), ACMD_DEF2("whomap2", who), ACMD_DEF2("whomap3", who), ACMD_DEF(whogm), ACMD_DEF(save), ACMD_DEF(load), ACMD_DEF(speed), ACMD_DEF(storage), ACMD_DEF(guildstorage), ACMD_DEF(option), ACMD_DEF(hide), // + /hide ACMD_DEFR(jobchange, ATCMD_NOCONSOLE), ACMD_DEF(kill), ACMD_DEF(alive), ACMD_DEF(kami), ACMD_DEF2("kamib", kami), ACMD_DEF2("kamic", kami), ACMD_DEF2("lkami", kami), ACMD_DEF(heal), ACMD_DEF(item), ACMD_DEF(item2), ACMD_DEF2("itembound",item), ACMD_DEF2("itembound2",item2), ACMD_DEF(itemreset), ACMD_DEF(clearstorage), ACMD_DEF(cleargstorage), ACMD_DEF(clearcart), ACMD_DEF2R("blvl", baselevelup, ATCMD_NOCONSOLE), ACMD_DEF2("jlvl", joblevelup), ACMD_DEF(help), ACMD_DEF(pvpoff), ACMD_DEF(pvpon), ACMD_DEF(gvgoff), ACMD_DEF(gvgon), ACMD_DEF(model), ACMD_DEFR(go, ATCMD_NOCONSOLE), ACMD_DEF(monster), ACMD_DEF2("monstersmall", monster), ACMD_DEF2("monsterbig", monster), ACMD_DEF(killmonster), ACMD_DEF2("killmonster2", killmonster), ACMD_DEF(refine), ACMD_DEF(produce), ACMD_DEF(memo), ACMD_DEF(gat), ACMD_DEF(displaystatus), ACMD_DEF2("stpoint", statuspoint), ACMD_DEF2("skpoint", skillpoint), ACMD_DEF(zeny), ACMD_DEF2("str", param), ACMD_DEF2("agi", param), ACMD_DEF2("vit", param), ACMD_DEF2("int", param), ACMD_DEF2("dex", param), ACMD_DEF2("luk", param), ACMD_DEF2("glvl", guildlevelup), ACMD_DEF(makeegg), ACMD_DEF(hatch), ACMD_DEF(petfriendly), ACMD_DEF(pethungry), ACMD_DEF(petrename), ACMD_DEF(recall), // + /recall ACMD_DEF(night), ACMD_DEF(day), ACMD_DEF(doom), ACMD_DEF(doommap), ACMD_DEF(raise), ACMD_DEF(raisemap), ACMD_DEFR(kick,ATCMD_NOAUTOTRADE), // + right click menu for GM "(name) force to quit" ACMD_DEF(kickall), ACMD_DEF(allskill), ACMD_DEF(questskill), ACMD_DEF(lostskill), ACMD_DEF(spiritball), ACMD_DEF(party), ACMD_DEF(guild), ACMD_DEF(breakguild), ACMD_DEF(agitstart), ACMD_DEF(agitend), ACMD_DEF(mapexit), ACMD_DEF(idsearch), ACMD_DEF(broadcast), // + /b and /nb ACMD_DEF(localbroadcast), // + /lb and /nlb ACMD_DEF(recallall), ACMD_DEFR(reload,ATCMD_NOSCRIPT), ACMD_DEF2("reloaditemdb", reload), ACMD_DEF2("reloadmobdb", reload), ACMD_DEF2("reloadskilldb", reload), ACMD_DEF2R("reloadscript", reload, ATCMD_NOSCRIPT), ACMD_DEF2("reloadatcommand", reload), ACMD_DEF2("reloadbattleconf", reload), ACMD_DEF2("reloadstatusdb", reload), ACMD_DEF2("reloadpcdb", reload), ACMD_DEF2("reloadmotd", reload), ACMD_DEF2("reloadquestdb", reload), ACMD_DEF2("reloadmsgconf", reload), ACMD_DEF2("reloadinstancedb", reload), ACMD_DEF2("reloadachievementdb",reload), ACMD_DEF(partysharelvl), ACMD_DEF(mapinfo), ACMD_DEF(dye), ACMD_DEF2("hairstyle", hair_style), ACMD_DEF2("haircolor", hair_color), ACMD_DEF2("allstats", stat_all), ACMD_DEF2("block", char_block), ACMD_DEF2("ban", char_ban), ACMD_DEF2("unblock", char_unblock), ACMD_DEF2("unban", char_unban), ACMD_DEF2("charban", char_ban), ACMD_DEF2("charunban", char_unban), ACMD_DEF2("mount", mount_peco), ACMD_DEF(guildspy), ACMD_DEF(partyspy), ACMD_DEF(clanspy), ACMD_DEF(repairall), ACMD_DEF(guildrecall), ACMD_DEF(partyrecall), ACMD_DEF(nuke), ACMD_DEF(shownpc), ACMD_DEF(hidenpc), ACMD_DEF(loadnpc), ACMD_DEF(unloadnpc), ACMD_DEF(reloadnpcfile), ACMD_DEF2("time", servertime), ACMD_DEF(jail), ACMD_DEF(unjail), ACMD_DEF(jailfor), ACMD_DEF(jailtime), ACMD_DEF(disguise), ACMD_DEF(undisguise), ACMD_DEF(email), ACMD_DEF(effect), ACMD_DEF(follow), ACMD_DEF(addwarp), ACMD_DEF(skillon), ACMD_DEF(skilloff), ACMD_DEF(killer), ACMD_DEF(npcmove), ACMD_DEF(killable), ACMD_DEF(dropall), ACMD_DEF(storeall), ACMD_DEF(skillid), ACMD_DEF(useskill), ACMD_DEF(displayskill), ACMD_DEF(snow), ACMD_DEF(sakura), ACMD_DEF(clouds), ACMD_DEF(clouds2), ACMD_DEF(fog), ACMD_DEF(fireworks), ACMD_DEF(leaves), ACMD_DEF(summon), ACMD_DEF(adjgroup), ACMD_DEF(trade), ACMD_DEF(send), ACMD_DEF(setbattleflag), ACMD_DEF(unmute), ACMD_DEF(clearweather), ACMD_DEF(uptime), ACMD_DEF(changesex), ACMD_DEF(changecharsex), ACMD_DEF(mute), ACMD_DEF(refresh), ACMD_DEF(refreshall), ACMD_DEF(identify), ACMD_DEF(identifyall), ACMD_DEF(gmotd), ACMD_DEF(misceffect), ACMD_DEF(mobsearch), ACMD_DEF(cleanmap), ACMD_DEF(cleanarea), ACMD_DEF(npctalk), ACMD_DEF(pettalk), ACMD_DEF(users), ACMD_DEF(reset), ACMD_DEF(skilltree), ACMD_DEF(marry), ACMD_DEF(divorce), ACMD_DEF(sound), ACMD_DEF(undisguiseall), ACMD_DEF(disguiseall), ACMD_DEF(changelook), ACMD_DEF(autoloot), ACMD_DEF2("alootid", autolootitem), ACMD_DEF(autoloottype), ACMD_DEF(mobinfo), ACMD_DEF(exp), ACMD_DEF(version), ACMD_DEF(mutearea), ACMD_DEF(rates), ACMD_DEF(iteminfo), ACMD_DEF(whodrops), ACMD_DEF(whereis), ACMD_DEF(mapflag), ACMD_DEF(me), ACMD_DEF(monsterignore), ACMD_DEF(fakename), ACMD_DEF(size), ACMD_DEF(showexp), ACMD_DEF(showzeny), ACMD_DEF(showdelay), ACMD_DEF(autotrade), ACMD_DEF(changegm), ACMD_DEF(changeleader), ACMD_DEF(partyoption), ACMD_DEF(invite), ACMD_DEF(duel), ACMD_DEF(leave), ACMD_DEF(accept), ACMD_DEF(reject), ACMD_DEF(clone), ACMD_DEF2("slaveclone", clone), ACMD_DEF2("evilclone", clone), ACMD_DEF(tonpc), ACMD_DEF(commands), ACMD_DEF(noask), ACMD_DEF(request), ACMD_DEF(homlevel), ACMD_DEF(homevolution), ACMD_DEF(hommutate), ACMD_DEF(makehomun), ACMD_DEF(homfriendly), ACMD_DEF(homhungry), ACMD_DEF(homtalk), ACMD_DEF(hominfo), ACMD_DEF(homstats), ACMD_DEF(homshuffle), ACMD_DEF(showmobs), ACMD_DEF(feelreset), ACMD_DEF(auction), ACMD_DEF(mail), ACMD_DEF2("noks", ksprotection), ACMD_DEF(allowks), ACMD_DEF(cash), ACMD_DEF2("points", cash), ACMD_DEF(agitstart2), ACMD_DEF(agitend2), ACMD_DEF(resetskill), ACMD_DEF(resetstat), ACMD_DEF2("storagelist", itemlist), ACMD_DEF2("cartlist", itemlist), ACMD_DEF2("itemlist", itemlist), ACMD_DEF(stats), ACMD_DEF(delitem), ACMD_DEF(charcommands), ACMD_DEF(font), ACMD_DEF(accinfo), ACMD_DEF(set), ACMD_DEF(undisguiseguild), ACMD_DEF(disguiseguild), ACMD_DEF(sizeall), ACMD_DEF(sizeguild), ACMD_DEF(addperm), ACMD_DEF2("rmvperm", addperm), ACMD_DEF(unloadnpcfile), ACMD_DEF(cart), ACMD_DEF(mount2), ACMD_DEF(join), ACMD_DEFR(channel,ATCMD_NOSCRIPT), ACMD_DEF(fontcolor), ACMD_DEF(langtype), #ifdef VIP_ENABLE ACMD_DEF(vip), ACMD_DEF(showrate), #endif ACMD_DEF(fullstrip), ACMD_DEF(costume), ACMD_DEF(cloneequip), ACMD_DEF(clonestat), ACMD_DEF(bodystyle), ACMD_DEF(adopt), ACMD_DEF(agitstart3), ACMD_DEF(agitend3), ACMD_DEF(whosell), }; AtCommandInfo* atcommand; int i; for( i = 0; i < ARRAYLENGTH(atcommand_base); i++ ) { if(atcommand_exists(atcommand_base[i].command)) { // Should not happen if atcommand_base[] array is OK ShowDebug("atcommand_basecommands: duplicate ACMD_DEF for '%s'.\n", atcommand_base[i].command); continue; } CREATE(atcommand, AtCommandInfo, 1); safestrncpy(atcommand->command, atcommand_base[i].command, sizeof(atcommand->command)); atcommand->func = atcommand_base[i].func; atcommand->restriction = atcommand_base[i].restriction; strdb_put(atcommand_db, atcommand->command, atcommand); } return; } /*========================================== * Command lookup functions *------------------------------------------*/ bool atcommand_exists(const char* name) { return strdb_exists(atcommand_db, name); } static AtCommandInfo* get_atcommandinfo_byname(const char *name) { if (strdb_exists(atcommand_db, name)) return (AtCommandInfo*)strdb_get(atcommand_db, name); return NULL; } static const char* atcommand_checkalias(const char *aliasname) { AliasInfo *alias_info = NULL; if ((alias_info = (AliasInfo*)strdb_get(atcommand_alias_db, aliasname)) != NULL) return alias_info->command->command; return aliasname; } /// AtCommand suggestion static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand) { DBIterator* atcommand_iter; DBIterator* alias_iter; AtCommandInfo* command_info = NULL; AliasInfo* alias_info = NULL; AtCommandType type = atcommand ? COMMAND_ATCOMMAND : COMMAND_CHARCOMMAND; char* full_match[MAX_SUGGESTIONS]; char* suggestions[MAX_SUGGESTIONS]; char* match; int prefix_count = 0, full_count = 0; bool can_use; if (!battle_config.atcommand_suggestions_enabled) return; atcommand_iter = db_iterator(atcommand_db); alias_iter = db_iterator(atcommand_alias_db); // Build the matches for (command_info = (AtCommandInfo*)dbi_first(atcommand_iter); dbi_exists(atcommand_iter); command_info = (AtCommandInfo*)dbi_next(atcommand_iter)) { match = strstr(command_info->command, name); can_use = pc_can_use_command(sd, command_info->command, type); if ( prefix_count < MAX_SUGGESTIONS && match == command_info->command && can_use ) { suggestions[prefix_count] = command_info->command; ++prefix_count; } if ( full_count < MAX_SUGGESTIONS && match != NULL && match != command_info->command && can_use ) { full_match[full_count] = command_info->command; ++full_count; } } for (alias_info = (AliasInfo *)dbi_first(alias_iter); dbi_exists(alias_iter); alias_info = (AliasInfo *)dbi_next(alias_iter)) { match = strstr(alias_info->alias, name); can_use = pc_can_use_command(sd, alias_info->command->command, type); if ( prefix_count < MAX_SUGGESTIONS && match == alias_info->alias && can_use) { suggestions[prefix_count] = alias_info->alias; ++prefix_count; } if ( full_count < MAX_SUGGESTIONS && match != NULL && match != alias_info->alias && can_use ) { full_match[full_count] = alias_info->alias; ++full_count; } } if ((full_count+prefix_count) > 0) { char buffer[512]; int i; // Merge full match and prefix match results if (prefix_count < MAX_SUGGESTIONS) { memmove(&suggestions[prefix_count], full_match, sizeof(char*) * (MAX_SUGGESTIONS-prefix_count)); prefix_count = min(prefix_count+full_count, MAX_SUGGESTIONS); } // Build the suggestion string strcpy(buffer, msg_txt(sd,205)); // Maybe you meant: strcat(buffer,"\n"); for(i=0; i < prefix_count; ++i) { strcat(buffer,suggestions[i]); strcat(buffer," "); } clif_displaymessage(sd->fd, buffer); } dbi_destroy(atcommand_iter); dbi_destroy(alias_iter); } /** * Executes an at-command * @param fd * @param sd * @param message * @param type * 0 : script call (atcommand) * 1 : normal player @atcommand * 2 : console (admin:@atcommand) * 3 : script call (useatcmd) */ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type) { char command[CHAT_SIZE_MAX], params[CHAT_SIZE_MAX]; char output[CHAT_SIZE_MAX]; //Reconstructed message char atcmd_msg[CHAT_SIZE_MAX]; TBL_PC * ssd = NULL; //sd for target AtCommandInfo * info; bool is_atcommand = true; // false if it's a charcommand nullpo_retr(false, sd); //Shouldn't happen if ( !message || !*message ) return false; //If cannot use atcomamnd while talking with NPC [Kichi] if (type == 1 && sd->npc_id && sd->state.disable_atcommand_on_npc) return false; //Block NOCHAT but do not display it as a normal message if ( sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCOMMAND ) return true; // skip 10/11-langtype's codepage indicator, if detected if ( message[0] == '|' && strlen(message) >= 4 && (message[3] == atcommand_symbol || message[3] == charcommand_symbol) ) message += 3; //Should display as a normal message if ( *message != atcommand_symbol && *message != charcommand_symbol ) return false; // type value 0|2 = script|console invoked: bypass restrictions if ( type == 1 || type == 3) { //Commands are disabled on maps flagged as 'nocommand' if ( map[sd->bl.m].nocommand && pc_get_group_level(sd) < map[sd->bl.m].nocommand ) { clif_displaymessage(fd, msg_txt(sd,143)); // Commands are disabled on this map. return false; } } if (*message == charcommand_symbol) is_atcommand = false; if (is_atcommand) { // @command sprintf(atcmd_msg, "%s", message); ssd = sd; } else { // #command char charname[NAME_LENGTH]; int n; //Checks to see if #command has a name or a name + parameters. if ((n = sscanf(message, "%255s \"%23[^\"]\" %255[^\n]", command, charname, params)) < 2 && (n = sscanf(message, "%255s %23s %255[^\n]", command, charname, params)) < 2 ) { if (pc_get_group_level(sd) == 0) { if (n < 1) return false; // No command found. Display as normal message. info = get_atcommandinfo_byname(atcommand_checkalias(command + 1)); if (!info || info->char_groups[sd->group_pos] == 0) // If we can't use or doesn't exist: don't even display the command failed message return false; } sprintf(output, msg_txt(sd,1388), charcommand_symbol); // Charcommand failed (usage: %c<command> <char name> <parameters>). clif_displaymessage(fd, output); return true; } ssd = map_nick2sd(charname,true); if (ssd == NULL) { sprintf(output, msg_txt(sd,1389), command); // %s failed. Player not found. clif_displaymessage(fd, output); return true; } if (n > 2) sprintf(atcmd_msg, "%s %s", command, params); else sprintf(atcmd_msg, "%s", command); } if (battle_config.idletime_option&IDLE_ATCOMMAND) sd->idletime = last_tick; //Clearing these to be used once more. memset(command, '\0', sizeof(command)); memset(params, '\0', sizeof(params)); //check to see if any params exist within this command if( sscanf(atcmd_msg, "%255s %255[^\n]", command, params) < 2 ) params[0] = '\0'; // @commands (script based) if((type == 1 || type == 3) && atcmd_binding_count > 0) { struct atcmd_binding_data *binding = get_atcommandbind_byname(command); // Check if the binding isn't NULL and there is a NPC event, level of usage met, et cetera if( binding != NULL && binding->npc_event[0] && ((is_atcommand && pc_get_group_level(sd) >= binding->level) || (!is_atcommand && pc_get_group_level(sd) >= binding->level2))) { // Check if self or character invoking; if self == character invoked, then self invoke. npc_do_atcmd_event(ssd, command, params, binding->npc_event); return true; } } //Grab the command information and check for the proper GM level required to use it or if the command exists info = get_atcommandinfo_byname(atcommand_checkalias(command + 1)); if (info == NULL) { if (pc_get_group_level(sd) == 0) // TODO: remove or replace with proper permission return false; sprintf(output, msg_txt(sd,153), command); // "%s is Unknown Command." clif_displaymessage(fd, output); atcommand_get_suggestions(sd, command + 1, is_atcommand); return true; } //check restriction if (info->restriction) { if (info->restriction&ATCMD_NOCONSOLE && type == 2) //console prevent return true; if (info->restriction&ATCMD_NOSCRIPT && (type == 0 || type == 3)) //scripts prevent return true; if (info->restriction&ATCMD_NOAUTOTRADE && (type == 0 || type == 3) && ((is_atcommand && sd && sd->state.autotrade) || (ssd && ssd->state.autotrade))) return true; } // type == 1 : player invoked if (type == 1) { if ((is_atcommand && info->at_groups[sd->group_pos] == 0) || (!is_atcommand && info->char_groups[sd->group_pos] == 0) ) return false; if( pc_isdead(sd) && pc_has_permission(sd,PC_PERM_DISABLE_CMD_DEAD) ) { clif_displaymessage(fd, msg_txt(sd,1393)); // You can't use commands while dead return true; } } //Attempt to use the command if ( (info->func(fd, ssd, command, params) != 0) ) { sprintf(output,msg_txt(sd,154), command); // %s failed. clif_displaymessage(fd, output); return true; } //Log only if successful. log_atcommand(sd, is_atcommand ? atcmd_msg : message); return true; } /*========================================== * *------------------------------------------*/ static void atcommand_config_read(const char* config_filename) { config_setting_t *aliases = NULL, *help = NULL; const char *symbol = NULL; int num_aliases = 0; if (conf_read_file(&atcommand_config, config_filename)) return; // Command symbols if (config_lookup_string(&atcommand_config, "atcommand_symbol", &symbol)) { if (ISPRINT(*symbol) && // no control characters *symbol != '/' && // symbol of client commands *symbol != '%' && // symbol of party chat *symbol != '$' && // symbol of guild chat *symbol != charcommand_symbol) atcommand_symbol = *symbol; } if (config_lookup_string(&atcommand_config, "charcommand_symbol", &symbol)) { if (ISPRINT(*symbol) && // no control characters *symbol != '/' && // symbol of client commands *symbol != '%' && // symbol of party chat *symbol != '$' && // symbol of guild chat *symbol != atcommand_symbol) charcommand_symbol = *symbol; } // Command aliases aliases = config_lookup(&atcommand_config, "aliases"); if (aliases != NULL) { int i = 0; int count = config_setting_length(aliases); for (i = 0; i < count; ++i) { config_setting_t *command; const char *commandname = NULL; int j = 0, alias_count = 0; AtCommandInfo *commandinfo = NULL; command = config_setting_get_elem(aliases, i); if (config_setting_type(command) != CONFIG_TYPE_ARRAY) continue; commandname = config_setting_name(command); if (!atcommand_exists(commandname)) { ShowConfigWarning(command, "atcommand_config_read: can not set alias for non-existent command %s", commandname); continue; } commandinfo = get_atcommandinfo_byname(commandname); alias_count = config_setting_length(command); for (j = 0; j < alias_count; ++j) { const char *alias = config_setting_get_string_elem(command, j); if (alias != NULL) { AliasInfo *alias_info; if (strdb_exists(atcommand_alias_db, alias)) { ShowConfigWarning(command, "atcommand_config_read: alias %s already exists", alias); continue; } CREATE(alias_info, AliasInfo, 1); alias_info->command = commandinfo; safestrncpy(alias_info->alias, alias, sizeof(alias_info->alias)); strdb_put(atcommand_alias_db, alias, alias_info); ++num_aliases; } } } } // Commands help // We only check if all commands exist help = config_lookup(&atcommand_config, "help"); if (help != NULL) { int count = config_setting_length(help); int i; for (i = 0; i < count; ++i) { config_setting_t *command; const char *commandname; command = config_setting_get_elem(help, i); commandname = config_setting_name(command); if (!atcommand_exists(commandname)) ShowConfigWarning(command, "atcommand_config_read: command %s does not exist", commandname); } } ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' command aliases in '"CL_WHITE"%s"CL_RESET"'.\n", num_aliases, config_filename); return; } void atcommand_db_load_groups(int* group_ids) { DBIterator *iter = db_iterator(atcommand_db); AtCommandInfo* cmd; int i; for (cmd = (AtCommandInfo*)dbi_first(iter); dbi_exists(iter); cmd = (AtCommandInfo*)dbi_next(iter)) { cmd->at_groups = (char*)aMalloc( pc_group_max * sizeof(char) ); cmd->char_groups = (char*)aMalloc( pc_group_max * sizeof(char) ); for(i = 0; i < pc_group_max; i++) { if( pc_group_can_use_command(group_ids[i], cmd->command, COMMAND_ATCOMMAND ) ) cmd->at_groups[i] = 1; else cmd->at_groups[i] = 0; if( pc_group_can_use_command(group_ids[i], cmd->command, COMMAND_CHARCOMMAND ) ) cmd->char_groups[i] = 1; else cmd->char_groups[i] = 0; } } dbi_destroy(iter); return; } void atcommand_db_clear(void) { if (atcommand_db != NULL) { DBIterator *iter = db_iterator(atcommand_db); AtCommandInfo* cmd; for (cmd = (AtCommandInfo*)dbi_first(iter); dbi_exists(iter); cmd = (AtCommandInfo*)dbi_next(iter)) { aFree(cmd->at_groups); aFree(cmd->char_groups); } dbi_destroy(iter); db_destroy(atcommand_db); } if (atcommand_alias_db != NULL) db_destroy(atcommand_alias_db); config_destroy(&atcommand_config); } void atcommand_doload(void) { atcommand_db_clear(); atcommand_db = stridb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, ATCOMMAND_LENGTH); atcommand_alias_db = stridb_alloc(DB_OPT_DUP_KEY|DB_OPT_RELEASE_DATA, ATCOMMAND_LENGTH); atcommand_basecommands(); //fills initial atcommand_db with known commands atcommand_config_read(ATCOMMAND_CONF_FILENAME); } void do_init_atcommand(void) { atcommand_doload(); } void do_final_atcommand(void) { atcommand_db_clear(); } and now i got these error when i try to rebuild my server with 1. ./configure 2. make clean 3. make server >>>> Here's the error Please help me?! @java
-
How can I control the redirect of pages? [Fluxcp]
Diana replied to Diana's question in General Support
Okay , from $this->loginRequired(); and when i want to make it redirect to userlogin not to login what i should add or edit in this line?? -
How can I control the redirect of pages? [Fluxcp]
Diana replied to Diana's question in General Support
Only want to know how it can be ,, And Okay it's automatic anyway but i think there is a file that understand if i entered only " ?module=account " it must redirect me to ?module=account&action=login ?? -
How can I control the redirect of pages? [Fluxcp]
Diana replied to Diana's question in General Support
@Akkarin I only want to know how to change the redirect from ?module=account to something else like ?module=account&action=userlogin -
Please , How can I manage the redirect urls like when I type : localhost/cp/?module=account it redirect me to : localhost/cp/?module=account&action=login can i edit that to redirect from localhost/cp/?module=account to localhost/cp/?module=account&action=userlogin ( I know that i must edit the page in themes and modules and i already edited it but flux still not redirecting me to the new page )
-
That's the like @sakura125 : https://cloud.google.com/
-
-
can i host my ragnarok online and website fluxcp using my own pc?
Diana replied to raste28's question in General Support
Yes , You can do it but at least you need 150 Mpbs of internet to make all players able to connect to your Server ( PC ) -
Error while enabling reCAPTCHA " Google Captcha " my application.conf : 'EnableReCaptcha' => true, // Enables the use of reCAPTCHA instead of Flux's native GD2 library (http://www.google.com/recaptcha) 'ReCaptchaPublicKey' => 'my Site key here 6LeQNysUAAAAAKATqugr4J6F4C**********', // This is your reCAPTCHA public key [REQUIRED FOR RECAPTCHA] (sign up at http://www.google.com/recaptcha) 'ReCaptchaPrivateKey' => 'My Secret Key here 6LeQNysUAAAAAAGtxyzBdefOy4PjqtsE6*******', // This is your reCAPTCHA private key [REQUIRED FOR RECAPTCHA] (sign up at http://www.google.com/recaptcha) 'ReCaptchaTheme' => 'light', // ReCaptcha theme to use (Value: dark or light) (see: https://developers.google.com/recaptcha/docs/display#render_param) Any help ?
-
Google cloud server is the best ! 4 Years of using it without any problem !
-
I Need cutin daily reward or normal Daily Reward NPC With IP and if Cutin , how can I add it to my server?
-
Oh thanks @Cyro
-
I Need Soul Linker Buffer with 50K of zeny Any one can help?
-
Working!! Thanks @sader1992
-
The application has failed to start because its side-by-side configuration is incorrect. Please seethe application event log or use the command-line sxstrace.exe tool for more details Any help please ?
-
What's this @sader1992 https://github.com/rathena/rathena/blob/master/src/map/atcommand.c#L1748 ? and if there is a npc , Please can you post it here?
-
Can i make the player choose Chibi Mode or normal mode for his char with a NPC or something else??
-
Custom maps not working with client 2015-10-29?
Diana replied to Diana's question in General Support
Working , I'm sorry I'm feeling dummy becouse i forgot to upload map_cache.dat -
Custom maps not working with client 2015-10-29? I tried to add custom map but not working ,
-
Error while using command make server
-
It works but . . .
-
When i login to my server via client 2012-04-10 db/packet_db.txt // Client<->Map Packet Database // // Structure of Database: // PacketType,PacketLength[,Name,FieldIndex1:FieldIndex2:FieldIndex3:...] // // 01. PacketType ID of the packet. // 02. PacketLength Length of the packet. If 0, packet is disabled in current packet version. If -1, packet has variable size. // 03. Name Name of the packet parser function (optional, for incoming packets only). // 04. FieldIndex Specifies the offset of a packet field in bytes from the begin of the packet (only specified when Name is given). // Can be 0, when the layout is not known. // ... // // NOTE: Up to MAX_PACKET_POS (typically 20) field indexes may be used. // // The packet database allows you to add support for new clients, // because packets change every release. // // Note: Every packet version needs a wanttoconnection specification, since // that is the packet used to identify a client's version. // If multiple versions have the same connection packet, the higher version // will be used (unless the lower one is specified as the default) // // Incoming packets have their parser function and layout specified, which enables // them for the current and all higher versions, unless explicitely disabled. // // Outgoing packets must be specified in order to enable them for the current // and all higher versions, unless explicitely disabled. Packets that are not // enabled for a packet version are silently discarded when sent as multicast. // // Every packet version inherits packet definitions from the previous (lower) // packet version. // // Main packet version of the DB to use (default = max available version) // Client detection is faster when all clients use this version. // Version 23 is the latest Sakexe (above versions are for Renewal clients) // // packet_keys values are default value for each packet version, if no value // or value is 'default' in packet_keys_use, server will uses default keys // according to used packet_db_ver. packet_keys_use is user-defined keys. // Maximum key value is 0x7FFFFFFF. // NOTE: Keys won't be reloaded, initialized on first load only. // //packet_db_ver: 46 packet_db_ver: default packet_keys_use: default packet_ver: 30 0x0064,55 0x0065,17 0x0066,6 0x0067,37 0x0068,46 0x0069,-1 0x006a,23 0x006b,-1 0x006c,3 0x006d,108 0x006e,3 0x006f,2 0x0070,6 0x0071,28 0x0072,19,wanttoconnection,2:6:10:14:18 0x0073,11 0x0074,3 0x0075,-1 0x0076,9 0x0077,5 0x0078,54 0x0079,53 0x007a,58 0x007b,60 0x007c,41 0x007d,2,loadendack,0 0x007e,6,ticksend,2 0x007f,6 0x0080,7 0x0081,3 0x0082,2 0x0083,2 0x0084,2 0x0085,5,walktoxy,2 0x0086,16 0x0087,12 0x0088,10 0x0089,7,actionrequest,2:6 0x008a,29 0x008b,2 0x008c,-1,globalmessage,2:4 0x008d,-1 0x008e,-1 //0x008f,-1 0x0090,7,npcclicked,2:6 0x0091,22 0x0092,28 0x0093,2 0x0094,6,getcharnamerequest,2 0x0095,30 0x0096,-1,wis,2:4:28 0x0097,-1 0x0098,3 0x0099,-1,broadcast,2:4 0x009a,-1 0x009b,5,changedir,2:4 0x009c,9 0x009d,17 0x009e,17 0x009f,6,takeitem,2 0x00a0,23 0x00a1,6 0x00a2,6,dropitem,2:4 0x00a3,-1 0x00a4,-1 0x00a5,-1 0x00a6,-1 0x00a7,8,useitem,2:4 0x00a8,7 0x00a9,6,equipitem,2:4 0x00aa,7,ZC_WEAR_EQUIP_ACK,2:4:6 0x00ab,4,unequipitem,2 0x00ac,7 //0x00ad,-1 0x00ae,-1 0x00af,6 0x00b0,8 0x00b1,8 0x00b2,3,restart,2 0x00b3,3 0x00b4,-1 0x00b5,6 0x00b6,6 0x00b7,-1 0x00b8,7,npcselectmenu,2:6 0x00b9,6,npcnextclicked,2 0x00ba,2 0x00bb,5,statusup,2:4 0x00bc,6 0x00bd,44 0x00be,5 0x00bf,3,emotion,2 0x00c0,7 0x00c1,2,howmanyconnections,0 0x00c2,6 0x00c3,8 0x00c4,6 0x00c5,7,npcbuysellselected,2:6 0x00c6,-1 0x00c7,-1 0x00c8,-1,npcbuylistsend,2:4 0x00c9,-1,npcselllistsend,2:4 0x00ca,3 0x00cb,3 0x00cc,6,gmkick,2 0x00cd,3 0x00ce,2,killall,0 0x00cf,27,wisexin,2:26 0x00d0,3,wisall,2 0x00d1,4 0x00d2,4 0x00d3,2,wisexlist,0 0x00d4,-1 0x00d5,-1,createchatroom,2:4:6:7:15 0x00d6,3 0x00d7,-1 0x00d8,6 0x00d9,14,chataddmember,2:6 0x00da,3 0x00db,-1 0x00dc,28 0x00dd,29 0x00de,-1,chatroomstatuschange,2:4:6:7:15 0x00df,-1 0x00e0,30,changechatowner,2:6 0x00e1,30 0x00e2,26,kickfromchat,2 0x00e3,2,chatleave,0 0x00e4,6,traderequest,2 0x00e5,26 0x00e6,3,tradeack,2 0x00e7,3 0x00e8,8,tradeadditem,2:4 0x00e9,19 0x00ea,5 0x00eb,2,tradeok,0 0x00ec,3 0x00ed,2,tradecancel,0 0x00ee,2 0x00ef,2,tradecommit,0 0x00f0,3 0x00f1,2 0x00f2,6 0x00f3,8,movetokafra,2:4 0x00f4,21 0x00f5,8,movefromkafra,2:4 0x00f6,8 0x00f7,2,closekafra,0 0x00f8,2 0x00f9,26,createparty,2 0x00fa,3 0x00fb,-1 0x00fc,6,partyinvite,2 0x00fd,27 0x00fe,30 0x00ff,10,replypartyinvite,2:6 0x0100,2,leaveparty,0 0x0101,6 0x0102,6,partychangeoption,2 0x0103,30,removepartymember,2:6 0x0104,79 0x0105,31 0x0106,10 0x0107,10 0x0108,-1,partymessage,2:4 0x0109,-1 0x010a,4 0x010b,6 0x010c,6 0x010d,2 0x010e,11 0x010f,-1 0x0110,10 0x0111,39 0x0112,4,skillup,2 0x0113,10,useskilltoid,2:4:6 0x0114,31 0x0115,35 0x0116,10,useskilltopos,2:4:6:8 0x0117,18 0x0118,2,stopattack,0 0x0119,13 0x011a,15 0x011b,20,useskillmap,2:4 0x011c,68 0x011d,2,requestmemo,0 0x011e,3 0x011f,16 0x0120,6 0x0121,14 0x0122,-1 0x0123,-1 0x0124,21 0x0125,8 0x0126,8,putitemtocart,2:4 0x0127,8,getitemfromcart,2:4 0x0128,8,movefromkafratocart,2:4 0x0129,8,movetokafrafromcart,2:4 0x012a,2,removeoption,0 0x012b,2 0x012c,3 0x012d,4 0x012e,2,closevending,0 0x012f,-1,openvending,2:4:0:84 0x0130,6,vendinglistreq,2 0x0131,86 0x0132,6 0x0133,-1 0x0134,-1,purchasereq,2:4:8 0x0135,7 0x0136,-1 0x0137,6 0x0138,3 0x0139,16 0x013a,4 0x013b,4 0x013c,4 0x013d,6 0x013e,24 0x013f,26,itemmonster,2 0x0140,22,mapmove,2:18:20 0x0141,14 0x0142,6 0x0143,10,npcamountinput,2:6 0x0144,23 0x0145,19 0x0146,6,npccloseclicked,2 0x0147,39 0x0148,8 0x0149,9,gmreqnochat,2:6:7 0x014a,6 0x014b,27 0x014c,-1 0x014d,2,guildcheckmaster,0 0x014e,6 0x014f,6,guildrequestinfo,2 0x0150,110 0x0151,6,guildrequestemblem,2 0x0152,-1 0x0153,-1,guildchangeemblem,2:4 0x0154,-1 0x0155,-1,guildchangememberposition,2:4 0x0156,-1 0x0157,6 0x0158,-1 0x0159,54,guildleave,2:6:10:14 0x015a,66 0x015b,54,guildexpulsion,2:6:10:14 0x015c,90 0x015d,42,guildbreak,2 0x015e,6 0x015f,42 0x0160,-1 0x0161,-1,guildchangepositioninfo,2:4 0x0162,-1 0x0163,-1 0x0164,-1 0x0165,30,createguild,2:6 0x0166,-1 0x0167,3 0x0168,14,guildinvite,2:6:10 0x0169,3 0x016a,30 0x016b,10,guildreplyinvite,2:6 0x016c,43 0x016d,14 0x016e,186,guildchangenotice,2:6:66 0x016f,182 0x0170,14,guildrequestalliance,2:6:10 0x0171,30 0x0172,10,guildreplyalliance,2:6 0x0173,3 0x0174,-1 0x0175,6 0x0176,106 0x0177,-1 0x0178,4,itemidentify,2 0x0179,5 0x017a,4,usecard,2 0x017b,-1 0x017c,6,insertcard,2:4 0x017d,7 0x017e,-1,guildmessage,2:4 0x017f,-1 0x0180,6,guildopposition,2 0x0181,3 0x0182,106 0x0183,10,guilddelalliance,2:6 0x0184,10 0x0185,34 //0x0186,-1 0x0187,6 0x0188,8 0x0189,4 0x018a,4,quitgame,2 0x018b,4 0x018c,29 0x018d,-1 0x018e,10,producemix,2:4:6:8 0x018f,6 0x0190,90,useskilltoposinfo,2:4:6:8:10 0x0191,86 0x0192,24 0x0193,6,solvecharname,2 0x0194,30 0x0195,102 0x0196,9 0x0197,4,resetchar,2 0x0198,8,changemaptype,2:4:6 0x0199,4 0x019a,14 0x019b,10 0x019c,-1,localbroadcast,2:4 0x019d,6,gmhide,2 0x019e,2 0x019f,6,catchpet,2 0x01a0,3 0x01a1,3,petmenu,2 0x01a2,35 0x01a3,5 0x01a4,11 0x01a5,26,changepetname,2 0x01a6,-1 0x01a7,4,selectegg,2 0x01a8,4 0x01a9,6,sendemotion,2 0x01aa,10 0x01ab,12 0x01ac,6 0x01ad,-1 0x01ae,4,selectarrow,2 0x01af,4,changecart,2 0x01b0,11 0x01b1,7 0x01b2,-1,openvending,2:4:84:85 0x01b3,67 0x01b4,12 0x01b5,18 0x01b6,114 0x01b7,6 0x01b8,3 0x01b9,6 0x01ba,26,remove,2 0x01bb,26,shift,2 0x01bc,26,recall,2 0x01bd,26,summon,2 0x01be,2 0x01bf,3 0x01c0,2 0x01c1,14 0x01c2,10 0x01c3,-1 0x01c4,22 0x01c5,22 0x01c6,4 0x01c7,2 0x01c8,13 0x01c9,97 //0x01ca,-1 0x01cb,9 0x01cc,9 0x01cd,30 0x01ce,6,autospell,2 0x01cf,28 0x01d0,8 0x01d1,14 0x01d2,10 0x01d3,35 0x01d4,6 0x01d5,-1,npcstringinput,2:4:8 0x01d6,4 0x01d7,11 0x01d8,54 0x01d9,53 0x01da,60 0x01db,2 0x01dc,-1 0x01dd,47 0x01de,33 0x01df,6,gmreqaccname,2 0x01e0,30 0x01e1,8 0x01e2,34 0x01e3,14 0x01e4,2 0x01e5,6 0x01e6,26 0x01e7,2,sndoridori,0 0x01e8,28,createparty2,2:26:27 0x01e9,81 0x01ea,6 0x01eb,10 0x01ec,26 0x01ed,2,snexplosionspirits,0 0x01ee,-1 0x01ef,-1 0x01f0,-1 0x01f1,-1 0x01f2,20 0x01f3,10 0x01f4,32 0x01f5,9 0x01f6,34 0x01f7,14,adoptreply,2:6:10 0x01f8,2 0x01f9,6,adoptrequest,2 0x01fa,48 0x01fb,56 0x01fc,-1 0x01fd,4,repairitem,2 0x01fe,5 0x01ff,10 0x0200,26 0x0201,-1 0x0202,26,friendslistadd,2 0x0203,10,friendslistremove,2:6 0x0204,18 0x0205,26 0x0206,11 0x0207,34 0x0208,11,friendslistreply,2:6:10 0x0209,36 0x020a,10 //0x020b,-1 //0x020c,-1 0x020d,-1 0x8b3,-1 0x8d6,6,ZC_CLEAR_DIALOG,2 //2004-07-05aSakexe packet_ver: 6 0x0072,22,wanttoconnection,5:9:13:17:21 0x0085,8,walktoxy,5 0x00a7,13,useitem,5:9 0x0113,15,useskilltoid,4:9:11 0x0116,15,useskilltopos,4:9:11:13 0x0190,95,useskilltoposinfo,4:9:11:13:15 0x0208,14,friendslistreply,2:6:10 0x020e,24 //2004-07-13aSakexe packet_ver: 7 0x0072,39,wanttoconnection,12:22:30:34:38 0x0085,9,walktoxy,6 0x009b,13,changedir,5:12 0x009f,10,takeitem,6 0x00a7,17,useitem,6:13 0x0113,19,useskilltoid,7:9:15 0x0116,19,useskilltopos,7:9:15:17 0x0190,99,useskilltoposinfo,7:9:15:17:19 //2004-07-26aSakexe packet_ver: 8 0x0072,14,dropitem,5:12 0x007e,33,wanttoconnection,12:18:24:28:32 0x0085,20,useskilltoid,7:12:16 0x0089,15,getcharnamerequest,11 0x008c,23,useskilltopos,3:6:17:21 0x0094,10,takeitem,6 0x009b,6,walktoxy,3 0x009f,13,changedir,5:12 0x00a2,103,useskilltoposinfo,3:6:17:21:23 0x00a7,12,solvecharname,8 0x00f3,-1,globalmessage,2:4 0x00f5,17,useitem,6:12 0x00f7,10,ticksend,6 0x0113,16,movetokafra,5:12 0x0116,2,closekafra,0 0x0190,26,movefromkafra,10:22 0x0193,9,actionrequest,3:8 //2004-08-09aSakexe packet_ver: 9 0x0072,17,dropitem,8:15 0x007e,37,wanttoconnection,9:21:28:32:36 0x0085,26,useskilltoid,11:18:22 0x0089,12,getcharnamerequest,8 0x008c,40,useskilltopos,5:15:29:38 0x0094,13,takeitem,9 0x009b,15,walktoxy,12 0x009f,12,changedir,7:11 0x00a2,120,useskilltoposinfo,5:15:29:38:40 0x00a7,11,solvecharname,7 0x00f5,24,useitem,9:20 0x00f7,13,ticksend,9 0x0113,23,movetokafra,5:19 0x0190,26,movefromkafra,11:22 0x0193,18,actionrequest,7:17 //2004-08-16aSakexe 0x0212,26,rc,2 0x0213,26,check,2 0x0214,42 //2004-08-17aSakexe 0x020f,10,pvpinfo,2:6 0x0210,22 //2004-09-06aSakexe packet_ver: 10 0x0072,20,useitem,9:20 0x007e,19,movetokafra,3:15 0x0085,23,actionrequest,9:22 0x0089,9,walktoxy,6 0x008c,105,useskilltoposinfo,10:14:18:23:25 0x0094,17,dropitem,6:15 0x009b,14,getcharnamerequest,10 0x009f,-1,globalmessage,2:4 0x00a2,14,solvecharname,10 0x00a7,25,useskilltopos,10:14:18:23 0x00f3,10,changedir,4:9 0x00f5,34,wanttoconnection,7:15:25:29:33 0x00f7,2,closekafra,0 0x0113,11,takeitem,7 0x0116,11,ticksend,7 0x0190,22,useskilltoid,9:15:18 0x0193,17,movefromkafra,3:13 //2004-09-20aSakexe packet_ver: 11 0x0072,18,useitem,10:14 0x007e,25,movetokafra,6:21 0x0085,9,actionrequest,3:8 0x0089,14,walktoxy,11 0x008c,109,useskilltoposinfo,16:20:23:27:29 0x0094,19,dropitem,12:17 0x009b,10,getcharnamerequest,6 0x00a2,10,solvecharname,6 0x00a7,29,useskilltopos,6:20:23:27 0x00f3,18,changedir,8:17 0x00f5,32,wanttoconnection,10:17:23:27:31 0x0113,14,takeitem,10 0x0116,14,ticksend,10 0x0190,14,useskilltoid,4:7:10 0x0193,12,movefromkafra,4:8 //2004-10-05aSakexe packet_ver: 12 0x0072,17,useitem,6:13 0x007e,16,movetokafra,5:12 0x0089,6,walktoxy,3 0x008c,103,useskilltoposinfo,2:6:17:21:23 0x0094,14,dropitem,5:12 0x009b,15,getcharnamerequest,11 0x00a2,12,solvecharname,8 0x00a7,23,useskilltopos,3:6:17:21 0x00f3,13,changedir,5:12 0x00f5,33,wanttoconnection,12:18:24:28:32 0x0113,10,takeitem,6 0x0116,10,ticksend,6 0x0190,20,useskilltoid,7:12:16 0x0193,26,movefromkafra,10:22 //2004-10-25aSakexe packet_ver: 13 0x0072,13,useitem,5:9 0x007e,13,movetokafra,6:9 0x0085,15,actionrequest,4:14 0x008c,108,useskilltoposinfo,6:9:23:26:28 0x0094,12,dropitem,6:10 0x009b,10,getcharnamerequest,6 0x00a2,16,solvecharname,12 0x00a7,28,useskilltopos,6:9:23:26 0x00f3,15,changedir,6:14 0x00f5,29,wanttoconnection,5:14:20:24:28 0x0113,9,takeitem,5 0x0116,9,ticksend,5 0x0190,26,useskilltoid,4:10:22 0x0193,22,movefromkafra,12:18 //2004-11-01aSakexe 0x0084,-1 0x0215,6 //2004-11-08aSakexe 0x0084,2 0x0216,6 0x0217,2,blacksmith,0 0x0218,2,alchemist,0 0x0219,282 0x021a,282 0x021b,10 0x021c,10 //2004-11-15aSakexe 0x021d,6,lesseffect,2 //2004-11-29aSakexe packet_ver: 14 0x0072,22,useskilltoid,8:12:18 0x007e,30,useskilltopos,4:9:22:28 0x0085,-1,globalmessage,2:4 0x0089,7,ticksend,3 0x008c,13,getcharnamerequest,9 0x0094,14,movetokafra,4:10 0x009b,2,closekafra,0 0x009f,18,actionrequest,6:17 0x00a2,7,takeitem,3 0x00a7,7,walktoxy,4 0x00f3,8,changedir,3:7 0x00f5,29,wanttoconnection,3:10:20:24:28 0x00f7,14,solvecharname,10 0x0113,110,useskilltoposinfo,4:9:22:28:30 0x0116,12,dropitem,4:10 0x0190,15,useitem,3:11 0x0193,21,movefromkafra,4:17 0x0221,-1 0x0222,6,weaponrefine,2 0x0223,8 //2004-12-13aSakexe //skipped: many packets being set to -1 0x0066,3 0x0070,3 0x01ca,3 0x021e,6 0x021f,66 0x0220,10 //2005-01-10bSakexe packet_ver: 15 0x0072,26,useskilltoid,8:16:22 0x007e,114,useskilltoposinfo,10:18:22:32:34 0x0085,23,changedir,12:22 0x0089,9,ticksend,5 0x008c,8,getcharnamerequest,4 0x0094,20,movetokafra,10:16 0x009b,32,wanttoconnection,3:12:23:27:31 0x009f,17,useitem,5:13 0x00a2,11,solvecharname,7 0x00a7,13,walktoxy,10 0x00f3,-1,globalmessage,2:4 0x00f5,9,takeitem,5 0x00f7,21,movefromkafra,11:17 0x0113,34,useskilltopos,10:18:22:32 0x0116,20,dropitem,15:18 0x0190,20,actionrequest,9:19 0x0193,2,closekafra,0 //2005-03-28aSakexe 0x0224,10 0x0225,2,taekwon,0 0x0226,282 //2005-04-04aSakexe 0x0227,18 0x0228,18 //2005-04-11aSakexe 0x0229,15 0x022a,58 0x022b,57 0x022c,64 //2005-04-25aSakexe 0x022d,5,hommenu,2:4 0x0232,9,hommoveto,2:6 0x0233,11,homattack,2:6:10 0x0234,6,hommovetomaster,2 //2005-05-09aSakexe packet_ver: 16 0x0072,25,useskilltoid,6:10:21 0x007e,102,useskilltoposinfo,5:9:12:20:22 0x0085,11,changedir,7:10 0x0089,8,ticksend,4 0x008c,11,getcharnamerequest,7 0x0094,14,movetokafra,7:10 0x009b,26,wanttoconnection,4:9:17:21:25 0x009f,14,useitem,4:10 0x00a2,15,solvecharname,11 0x00a7,8,walktoxy,5 0x00f5,8,takeitem,4 0x00f7,22,movefromkafra,14:18 0x0113,22,useskilltopos,5:9:12:20 0x0116,10,dropitem,5:8 0x0190,19,actionrequest,5:18 //2005-05-23aSakexe 0x022e,69 0x0230,12 //2005-05-30aSakexe 0x022e,71 0x0235,-1 0x0236,10 0x0237,2,rankingpk,0 0x0238,282 //2005-05-31aSakexe 0x0216,2 0x0239,11 //2005-06-08aSakexe 0x0216,6 0x0217,2,blacksmith,0 0x022f,5 0x0231,26,changehomunculusname,2 0x023a,4 0x023b,36,storagepassword,2:4:20 0x023c,6 //2005-06-22aSakexe 0x022e,71 //2005-06-28aSakexe packet_ver: 17 0x0072,34,useskilltoid,6:17:30 0x007e,113,useskilltoposinfo,12:15:18:31:33 0x0085,17,changedir,8:16 0x0089,13,ticksend,9 0x008c,8,getcharnamerequest,4 0x0094,31,movetokafra,16:27 0x009b,32,wanttoconnection,9:15:23:27:31 0x009f,19,useitem,9:15 0x00a2,9,solvecharname,5 0x00a7,11,walktoxy,8 0x00f5,13,takeitem,9 0x00f7,18,movefromkafra,11:14 0x0113,33,useskilltopos,12:15:18:31 0x0116,12,dropitem,3:10 0x0190,24,actionrequest,11:23 0x0216,-1 0x023d,-1 0x023e,4 //2005-07-18aSakexe packet_ver: 18 0x0072,19,useskilltoid,5:11:15 0x007e,110,useskilltoposinfo,9:15:23:28:30 0x0085,11,changedir,6:10 0x0089,7,ticksend,3 0x008c,11,getcharnamerequest,7 0x0094,21,movetokafra,12:17 0x009b,31,wanttoconnection,3:13:22:26:30 0x009f,12,useitem,3:8 0x00a2,18,solvecharname,14 0x00a7,15,walktoxy,12 0x00f5,7,takeitem,3 0x00f7,13,movefromkafra,5:9 0x0113,30,useskilltopos,9:15:23:28 0x0116,12,dropitem,6:10 0x0190,21,actionrequest,5:20 0x0216,6 0x023f,2,mailrefresh,0 0x0240,8 0x0241,6,mailread,2 0x0242,-1 0x0243,6,maildelete,2 0x0244,6,mailgetattach,2 0x0245,7 0x0246,4,mailwinopen,2 0x0247,8,mailsetattach,2:4 0x0248,68 0x0249,3 0x024a,70 0x024b,4,auctioncancelreg,2 0x024c,8,auctionsetitem,2:4 0x024d,14 0x024e,6,auctioncancel,2 0x024f,10,auctionbid,2:6 0x0250,3 0x0251,2 0x0252,-1 //2005-07-19bSakexe packet_ver: 19 0x0072,34,useskilltoid,6:17:30 0x007e,113,useskilltoposinfo,12:15:18:31:33 0x0085,17,changedir,8:16 0x0089,13,ticksend,9 0x008c,8,getcharnamerequest,4 0x0094,31,movetokafra,16:27 0x009b,32,wanttoconnection,9:15:23:27:31 0x009f,19,useitem,9:15 0x00a2,9,solvecharname,5 0x00a7,11,walktoxy,8 0x00f5,13,takeitem,9 0x00f7,18,movefromkafra,11:14 0x0113,33,useskilltopos,12:15:18:31 0x0116,12,dropitem,3:10 0x0190,24,actionrequest,11:23 //2005-08-01aSakexe 0x0245,3 0x0251,4 //2005-08-08aSakexe 0x024d,12,auctionregister,2:6:10 0x024e,4 //2005-08-17aSakexe 0x0253,3 0x0254,3,feelsaveok,2 //2005-08-29aSakexe 0x0240,-1 0x0248,-1,mailsend,2:4:28:68:69 0x0255,5 0x0256,-1 0x0257,8 //2005-09-12bSakexe 0x0256,5 0x0258,2 0x0259,3 //2005-10-10aSakexe 0x020e,32 0x025a,-1 0x025b,6,cooking,2:4 //2005-10-13aSakexe 0x007a,6 0x0251,32 0x025c,4,auctionbuysell,2 //2005-10-17aSakexe 0x007a,58 0x025d,6,auctionclose,2 0x025e,4 //2005-10-24aSakexe 0x025f,6 0x0260,6 //2005-11-07aSakexe 0x024e,6,auctioncancel,2 0x0251,34,auctionsearch,2:4:8:32 //2006-01-09aSakexe 0x0261,11 0x0262,11 0x0263,11 0x0264,20 0x0265,20 0x0266,30 0x0267,4 0x0268,4 0x0269,4 0x026a,4 0x026b,4 0x026c,4 0x026d,4 0x026f,2 0x0270,2 0x0271,38 0x0272,44 //2006-01-26aSakexe 0x0271,40 //2006-03-06aSakexe 0x0273,6 0x0274,8 //2006-03-13aSakexe 0x0273,30,mailreturn,2:6 //2006-03-27aSakexe packet_ver: 20 0x0072,26,useskilltoid,11:18:22 0x007e,120,useskilltoposinfo,5:15:29:38:40 0x0085,12,changedir,7:11 //0x0089,13,ticksend,9 0x008c,12,getcharnamerequest,8 0x0094,23,movetokafra,5:19 0x009b,37,wanttoconnection,9:21:28:32:36 0x009f,24,useitem,9:20 0x00a2,11,solvecharname,7 0x00a7,15,walktoxy,12 0x00f5,13,takeitem,9 0x00f7,26,movefromkafra,11:22 0x0113,40,useskilltopos,5:15:29:38 0x0116,17,dropitem,8:15 0x0190,18,actionrequest,7:17 //2006-10-23aSakexe 0x006d,110 //2006-04-24aSakexe to 2007-01-02aSakexe 0x023e,8 0x0277,84 0x0278,2 0x0279,2 0x027a,-1 0x027b,14 0x027c,60 0x027d,62 0x027e,-1 0x027f,8 0x0280,12 0x0281,4 0x0282,284 0x0283,6 0x0284,14 0x0285,6 0x0286,4 0x0287,-1 0x0288,6 0x0289,8 0x028a,18 0x028b,-1 0x028c,46 0x028d,34 0x028e,4 0x028f,6 0x0290,4 0x0291,4 0x0292,2,autorevive,0 0x0293,70 0x0294,10 0x0295,-1 0x0296,-1 0x0297,-1 0x0298,8 0x0299,6 0x029a,27 0x029c,66 0x029d,-1 0x029e,11 0x029f,3,mermenu,2 0x02a0,-1 0x02a1,-1 0x02a2,8 //2007-01-08aSakexe packet_ver: 21 0x0072,30,useskilltoid,10:14:26 0x007e,120,useskilltoposinfo,10:19:23:38:40 0x0085,14,changedir,10:13 0x0089,11,ticksend,7 0x008c,17,getcharnamerequest,13 0x0094,17,movetokafra,4:13 0x009b,35,wanttoconnection,7:21:26:30:34 0x009f,21,useitem,7:17 0x00a2,10,solvecharname,6 0x00a7,8,walktoxy,5 0x00f5,11,takeitem,7 0x00f7,15,movefromkafra,3:11 0x0113,40,useskilltopos,10:19:23:38 0x0116,19,dropitem,11:17 0x0190,10,actionrequest,4:9 //2007-01-22aSakexe 0x02a3,18 0x02a4,2 //2007-01-29aSakexe 0x029b,72 0x02a3,-1 0x02a4,-1 0x02a5,8 // 2007-02-05aSakexe 0x02aa,4 0x02ab,36 0x02ac,6 //2007-02-12aSakexe packet_ver: 22 0x0072,25,useskilltoid,6:10:21 0x007e,102,useskilltoposinfo,5:9:12:20:22 0x0085,11,changedir,7:10 0x0089,8,ticksend,4 0x008c,11,getcharnamerequest,7 0x0094,14,movetokafra,7:10 0x009b,26,wanttoconnection,4:9:17:21:25 0x009f,14,useitem,4:10 0x00a2,15,solvecharname,11 //0x00a7,8,walktoxy,5 0x00f5,8,takeitem,4 0x00f7,22,movefromkafra,14:18 0x0113,22,useskilltopos,5:9:12:20 0x0116,10,dropitem,5:8 0x0190,19,actionrequest,5:18 //2007-05-07aSakexe 0x01fd,15,repairitem,2:4:6:7:9:11:13 //2007-02-27aSakexe to 2007-10-02aSakexe 0x0288,10,cashshopbuy,2:4:6 0x0289,12 0x02a6,22 0x02a7,22 0x02a8,162 0x02a9,58 0x02ad,8 0x02b0,85 0x02b1,-1 0x02b2,-1 0x02b3,107 0x02b4,6 0x02b5,-1 0x02b6,7,queststate,2:6 0x02b7,7 0x02b8,22 0x02b9,191 0x02ba,11,hotkey,2:4:5:9 0x02bb,8 0x02bc,6 0x02bf,10 0x02c0,2 0x02c1,-1 0x02c2,-1 0x02c4,26,partyinvite2,2 0x02c5,30 0x02c6,30 0x02c7,7,replypartyinvite2,2:6 0x02c8,3,partytick,2 0x02c9,3 0x02ca,3 0x02cb,20 0x02cc,4 0x02cd,26 0x02ce,10 0x02cf,6 0x02d0,-1 0x02d1,-1 0x02d2,-1 0x02d3,4,ZC_NOTIFY_BIND_ON_EQUIP,2 0x02d4,29 0x02d5,2 0x02d6,6,viewplayerequip,2 0x02d7,-1 0x02d8,10,equiptickbox,2:6 0x02d9,10 0x02da,3 0x02db,-1,battlechat,2:4 0x02dc,-1 0x02dd,32 0x02de,6 0x02df,36 0x02e0,34 //2007-10-23aSakexe 0x02cb,65 0x02cd,71 //2007-11-06aSakexe 0x0078,55 0x007c,42 0x022c,65 0x029b,80 //2007-11-13aSakexe 0x02e1,33 //2007-11-20aSakexe //0x01df,10 <- ??? 0x02e2,14 0x02e3,25 0x02e4,8 0x02e5,8 0x02e6,6 //2007-11-27aSakexe 0x02e7,-1 //2008-01-02aSakexe 0x01df,6,gmreqaccname,2 0x02e8,-1 0x02e9,-1 0x02ea,-1 0x02eb,13 0x02ec,67 0x02ed,59 0x02ee,60 0x02ef,8 //2008-03-18aSakexe 0x02bf,-1 0x02c0,-1 0x02f0,10 0x02f1,2,progressbar,0 0x02f2,2 //2008-03-25bSakexe 0x02f3,-1 0x02f4,-1 0x02f5,-1 0x02f6,-1 0x02f7,-1 0x02f8,-1 0x02f9,-1 0x02fa,-1 0x02fb,-1 0x02fc,-1 0x02fd,-1 0x02fe,-1 0x02ff,-1 0x0300,-1 //2008-04-01aSakexe 0x0301,-1 0x0302,-1 0x0303,-1 0x0304,-1 0x0305,-1 0x0306,-1 0x0307,-1 0x0308,-1 0x0309,-1 0x030a,-1 0x030b,-1 0x030c,-1 0x030d,-1 0x030e,-1 0x030f,-1 0x0310,-1 0x0311,-1 0x0312,-1 0x0313,-1 0x0314,-1 0x0315,-1 0x0316,-1 0x0317,-1 0x0318,-1 0x0319,-1 0x031a,-1 0x031b,-1 0x031c,-1 0x031d,-1 0x031e,-1 0x031f,-1 0x0320,-1 0x0321,-1 0x0322,-1 0x0323,-1 0x0324,-1 0x0325,-1 0x0326,-1 0x0327,-1 0x0328,-1 0x0329,-1 0x032a,-1 0x032b,-1 0x032c,-1 0x032d,-1 0x032e,-1 0x032f,-1 0x0330,-1 0x0331,-1 0x0332,-1 0x0333,-1 0x0334,-1 0x0335,-1 0x0336,-1 0x0337,-1 0x0338,-1 0x0339,-1 0x033a,-1 0x033b,-1 0x033c,-1 0x033d,-1 0x033e,-1 0x033f,-1 0x0340,-1 0x0341,-1 0x0342,-1 0x0343,-1 0x0344,-1 0x0345,-1 0x0346,-1 0x0347,-1 0x0348,-1 0x0349,-1 0x034a,-1 0x034b,-1 0x034c,-1 0x034d,-1 0x034e,-1 0x034f,-1 0x0350,-1 0x0351,-1 0x0352,-1 0x0353,-1 0x0354,-1 0x0355,-1 0x0356,-1 0x0357,-1 0x0358,-1 0x0359,-1 0x035a,-1 //2008-05-27aSakexe 0x035b,-1 0x035c,2 0x035d,-1 0x035e,2 0x035f,-1 0x0389,-1 //2008-08-20aSakexe 0x040c,-1 0x040d,-1 0x040e,-1 0x040f,-1 0x0410,-1 0x0411,-1 0x0412,-1 0x0413,-1 0x0414,-1 0x0415,-1 0x0416,-1 0x0417,-1 0x0418,-1 0x0419,-1 0x041a,-1 0x041b,-1 0x041c,-1 0x041d,-1 0x041e,-1 0x041f,-1 0x0420,-1 0x0421,-1 0x0422,-1 0x0423,-1 0x0424,-1 0x0425,-1 0x0426,-1 0x0427,-1 0x0428,-1 0x0429,-1 0x042a,-1 0x042b,-1 0x042c,-1 0x042d,-1 0x042e,-1 0x042f,-1 0x0430,-1 0x0431,-1 0x0432,-1 0x0433,-1 0x0434,-1 0x0435,-1 //2008-09-10aSakexe packet_ver: 23 0x0436,19,wanttoconnection,2:6:10:14:18 0x0437,7,actionrequest,2:6 0x0438,10,useskilltoid,2:4:6 0x0439,8,useitem,2:4 //2008-11-13aSakexe 0x043d,8 0x043e,-1 0x043f,8 //2008-11-26aSakexe 0x01a2,37 0x0440,10 0x0441,4 //2008-12-10aSakexe 0x0442,-1 0x0443,8,skillselectmenu,2:6 //2009-01-14aSakexe 0x043f,25 0x0444,-1 0x0445,10 //2009-02-18aSakexe 0x0446,14 //2009-02-25aSakexe 0x0448,-1 //2009-03-30aSakexe 0x0449,4 //2009-04-08aSakexe 0x02a6,-1 0x02a7,-1 0x044a,6,clientversion,2 //Renewal Clients //2008-08-27aRagexeRE packet_ver: 24 0x0072,22,useskilltoid,9:15:18 0x007c,44 0x007e,105,useskilltoposinfo,10:14:18:23:25 0x0085,10,changedir,4:9 0x0089,11,ticksend,7 0x008c,14,getcharnamerequest,10 0x0094,19,movetokafra,3:15 0x009b,34,wanttoconnection,7:15:25:29:33 0x009f,20,useitem,7:20 0x00a2,14,solvecharname,10 0x00a7,9,walktoxy,6 0x00f5,11,takeitem,7 0x00f7,17,movefromkafra,3:13 0x0113,25,useskilltopos,10:14:18:23 0x0116,17,dropitem,6:15 0x0190,23,actionrequest,9:22 0x02e2,20 0x02e3,22 0x02e4,11 0x02e5,9 //2008-09-10aRagexeRE packet_ver: 25 0x0436,19,wanttoconnection,2:6:10:14:18 0x0437,7,actionrequest,2:6 0x0438,10,useskilltoid,2:4:6 0x0439,8,useitem,2:4 //2008-11-12aRagexeRE 0x043d,8 //0x043e,-1 0x043f,8 //2008-12-17aRagexeRE 0x01a2,37 //0x0440,10 //0x0441,4 //0x0442,8 //0x0443,8 //2008-12-17bRagexeRE 0x006d,114 //2009-01-21aRagexeRE 0x043f,25 //0x0444,-1 //0x0445,10 //2009-02-18aRagexeRE //0x0446,14 //2009-02-26cRagexeRE //0x0448,-1 //2009-04-01aRagexeRE //0x0449,4 //2009-05-14aRagexeRE //0x044b,2 //2009-05-20aRagexeRE //0x07d0,6 //0x07d1,2 //0x07d2,-1 //0x07d3,4 //0x07d4,4 //0x07d5,4 //0x07d6,4 //0x0447,2 //2009-06-03aRagexeRE 0x07d7,8,partychangeoption,2:6:7 0x07d8,8 0x07d9,254 0x07da,6,partychangeleader,2 //2009-06-10aRagexeRE //0x07db,8 //2009-06-17aRagexeRE 0x07d9,268 //0x07dc,6 //0x07dd,54 //0x07de,30 //0x07df,54 //2009-07-01aRagexeRE //0x0275,37 //0x0276,-1 //2009-07-08aRagexeRE //0x07e0,58 //2009-07-15aRagexeRE 0x07e1,15 //2009-08-05aRagexeRE 0x07e2,8 //2009-08-18aRagexeRE 0x07e3,6 0x07e4,-1,itemlistwindowselected,2:4:8:12 0x07e6,8 //2009-08-25aRagexeRE //0x07e6,28 0x07e7,5 //2009-09-22aRagexeRE 0x07e5,8 0x07e6,8 0x07e7,32 0x07e8,-1 0x07e9,5 //2009-09-29aRagexeRE //0x07ea,2 //0x07eb,-1 //0x07ec,6 //0x07ed,8 //0x07ee,6 //0x07ef,8 //0x07f0,4 //0x07f2,4 //0x07f3,3 //2009-10-06aRagexeRE //0x07ec,8 //0x07ed,10 //0x07f0,8 //0x07f1,15 //0x07f2,6 //0x07f3,4 //0x07f4,3 //2009-10-27aRagexeRE 0x07f5,6,gmfullstrip,2 0x07f6,14 //2009-11-03aRagexeRE 0x07f7,-1 0x07f8,-1 0x07f9,-1 //2009-11-17aRagexeRE 0x07fa,8 //2009-11-24aRagexeRE 0x07fb,25 //2009-12-01aRagexeRE 0x07fc,10 0x07fd,-1,ZC_BROADCASTING_SPECIAL_ITEM_OBTAIN,0 0x07fe,26 //0x07ff,-1 //2009-12-15aRagexeRE 0x0800,-1 //0x0801,-1 //2009-12-22aRagexeRE 0x0802,18,bookingregreq,2:4:6 // Booking System 0x0803,4 0x0804,8 // Booking System 0x0805,-1 0x0806,4,bookingdelreq,2 // Booking System //0x0807,2 0x0808,4 // Booking System //0x0809,14 //0x080A,50 //0x080B,18 //0x080C,6 //2009-12-29aRagexeRE 0x0804,14,bookingsearchreq,2:4:6:8:12 // Booking System 0x0806,2,bookingdelreq,0 // Booking System 0x0807,4 0x0808,14,bookingupdatereq,2 // Booking System 0x0809,50 0x080A,18 0x080B,6 // Booking System //2010-01-05aRagexeRE 0x0801,-1,purchasereq2,2:4:8:12 //2010-01-26aRagexeRE //0x080C,2 //0x080D,3 0x080E,14 //2010-02-09aRagexeRE //0x07F0,6 //2010-02-23aRagexeRE 0x080F,20 //2010-03-03aRagexeRE 0x0810,3 0x0811,-1,reqopenbuyingstore,2:4:8:9:89 //0x0812,86 //0x0813,6 //0x0814,6 //0x0815,-1 //0x0817,-1 //0x0818,6 //0x0819,4 //2010-03-09aRagexeRE 0x0813,-1 //0x0814,2 //0x0815,6 0x0816,6 0x0818,-1 //0x0819,10 //0x081A,4 //0x081B,4 //0x081C,6 0x081d,22 0x081e,8 //2010-03-23aRagexeRE //0x081F,-1 //2010-04-06aRagexeRE //0x081A,6 //2010-04-13aRagexeRE //0x081A,10 0x0820,11 //0x0821,2 //0x0822,9 //0x0823,-1 //2010-04-14dRagexeRE //0x081B,8 //2010-04-20aRagexeRE 0x0812,8 0x0814,86 0x0815,2,reqclosebuyingstore,0 0x0817,6,reqclickbuyingstore,2 0x0819,-1,reqtradebuyingstore,2:4:8:12 0x081a,4 0x081b,10 0x081c,10 0x0824,6 //2010-06-01aRagexeRE //0x0825,-1 //0x0826,4 0x0835,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0836,-1 0x0837,3 //0x0838,3 //2010-06-08aRagexeRE 0x0838,2,searchstoreinfonextpage,0 0x083A,4 // Search Stalls Feature 0x083B,2,closesearchstoreinfo,0 0x083C,12,searchstoreinfolistitemclick,2:6:10 0x083D,6 //2010-06-15aRagexeRE //0x083E,26 //2010-06-22aRagexeRE //0x083F,22 //2010-06-29aRagexeRE 0x00AA,9,ZC_WEAR_EQUIP_ACK,2:4:6:8 //0x07F1,18 //0x07F2,8 //0x07F3,6 //2010-07-01aRagexeRE 0x083A,5 // Search Stalls Feature //2010-07-13aRagexeRE //0x0827,6 //0x0828,14 //0x0829,6 //0x082A,10 //0x082B,6 //0x082C,14 //0x0840,-1 //0x0841,19 //2010-07-14aRagexeRE //0x0841,4 //2010-08-03aRagexeRE 0x0839,66 0x0842,6,recall2,2 0x0843,6,remove2,2 //2010-11-24aRagexeRE packet_ver: 26 0x0288,-1,cashshopbuy,2:4:8:10 0x0436,19,wanttoconnection,2:6:10:14:18 0x035f,5,walktoxy,2 0x0360,6,ticksend,2 0x0361,5,changedir,2:4 0x0362,6,takeitem,2 0x0363,6,dropitem,2:4 0x0364,8,movetokafra,2:4 0x0365,8,movefromkafra,2:4 0x0366,10,useskilltopos,2:4:6:8 0x0367,90,useskilltoposinfo,2:4:6:8:10 0x0368,6,getcharnamerequest,2 0x0369,6,solvecharname,2 0x0856,-1 0x0857,-1 0x0858,-1 0x0859,-1 0x08d0,9,ZC_WEAR_EQUIP_ACK,2:4:6:8 //2011-10-05aRagexeRE packet_ver: 27 packet_keys: 0x291E6762,0x77CD391A,0x60AC2F16 // [Shakto] 0x0364,5,walktoxy,2 0x0817,6,ticksend,2 0x0366,5,changedir,2:4 0x0815,6,takeitem,2 0x0885,6,dropitem,2:4 0x0893,8,movetokafra,2:4 0x0897,8,movefromkafra,2:4 0x0369,10,useskilltopos,2:4:6:8 0x08ad,90,useskilltoposinfo,2:4:6:8:10 0x088a,6,getcharnamerequest,2 0x0838,6,solvecharname,2 0x0439,8,useitem,2:4 0x08d2,10 0x08d1,7 0x0846,4,cashshopreqtab,2 //2011-07-18 // 2011-11-02aRagexe packet_ver: 28 packet_keys: 0x5324329D,0x5D545D52,0x06137269 // [Shakto] 0x0436,26,friendslistadd,2 0x0898,5,hommenu,2:4 0x0281,36,storagepassword,2:4:20 0x088d,26,partyinvite2,2 0x083c,19,wanttoconnection,2:6:10:14:18 0x08aa,7,actionrequest,2:6 0x02c4,10,useskilltoid,2:4:6 0x0811,-1,itemlistwindowselected,2:4:8:12 0x0890,8 0x08a5,18,bookingregreq,2:4:6 0x0835,-1,reqopenbuyingstore,2:4:8:9:89 0x089b,2,reqclosebuyingstore,0 0x08a1,6,reqclickbuyingstore,2 0x089e,-1,reqtradebuyingstore,2:4:8:12 0x08ab,-1,searchstoreinfo,2:4:5:9:13:14:15 0x088b,2,searchstoreinfonextpage,0 0x08a2,12,searchstoreinfolistitemclick,2:6:10 0x08cf,10 //Amulet spirits //2012-03-07fRagexeRE packet_ver:29 packet_keys: 0x382A6DEF,0x5CBE7202,0x61F46637 // [Shakto] 0x086A,19,wanttoconnection,2:6:10:14:18 0x0437,5,walktoxy,2 0x0887,6,ticksend,2 0x0890,5,changedir,2:4 0x0865,6,takeitem,2 0x02C4,6,dropitem,2:4 0x093B,8,movetokafra,2:4 0x0963,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0369,26,friendslistadd,2 0x0863,5,hommenu,2:4 0x0861,36,storagepassword,2:4:20 0x0929,26,partyinvite2,2 0x0885,7,actionrequest,2:6 0x0889,10,useskilltoid,2:4:6 0x0870,-1,itemlistwindowselected,2:4:8:12 //0x0926,41,bookingregreq,2:4:6 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0817,2,reqclosebuyingstore,0 0x0360,6,reqclickbuyingstore,2 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0884,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0835,2,searchstoreinfonextpage,0 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0439,8,useitem,2:4 0x0365,41,bookingregreq,2:4:6 // New Packet 0x090F,-1 // ZC_NOTIFY_NEWENTRY7 0x0914,-1 // ZC_NOTIFY_MOVEENTRY8 0x0915,-1 // ZC_NOTIFY_STANDENTRY9 //2012-04-10aRagexeRE packet_ver: 30 packet_keys: 0x01581359,0x452D6FFA,0x6AFB6E2E // [Shakto] 0x01fd,15,repairitem,2:4:6:7:9:11:13 0x089c,26,friendslistadd,2 0x0885,5,hommenu,2:4 0x0961,36,storagepassword,2:4:20 0x0288,-1,cashshopbuy,2:4:8:10 0x091c,26,partyinvite2,2 0x094b,19,wanttoconnection,2:6:10:14:18 0x0369,7,actionrequest,2:6 0x083c,10,useskilltoid,2:4:6 0x0439,8,useitem,2:4 0x0945,-1,itemlistwindowselected,2:4:8:12 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0817,2,reqclosebuyingstore,0 0x0360,6,reqclickbuyingstore,2 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0835,2,searchstoreinfonextpage,0 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0437,5,walktoxy,2 0x0886,6,ticksend,2 0x0871,5,changedir,2:4 0x0938,6,takeitem,2 0x0891,6,dropitem,2:4 0x086c,8,movetokafra,2:4 0x08a6,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x0889,6,getcharnamerequest,2 0x0884,6,solvecharname,2 0x08e6,4 0x08e7,10,bookingsearchreq,2:4:6:8:12 0x08e8,-1 0x08e9,2,bookingdelreq,0 0x08ea,4 0x08eb,39,bookingupdatereq,2 0x08ec,73 0x08ed,43 0x08ee,6 0x08ef,6,bookingignorereq,2 0x08f0,6 0x08f1,6,bookingjoinpartyreq,2 0x08f2,36 0x08f3,-1 0x08f4,6 0x08f5,-1,bookingsummonmember,2:4 0x08f6,22 0x08f7,3 0x08f8,7 0x08f9,6 0x08fa,6 0x08fb,6,bookingcanceljoinparty,2 0x0907,5,moveitem,2:4 0x0908,5 0x08d7,28,battlegroundreg,2:4 0x0977,14 //Monster HP Bar 0x0916,26,guildinvite2,2 0x091d,41,bookingregreq,2:4:6 0x08cb,10,ZC_PERSONAL_INFOMATION,2:4:6:8:10:11:13:15 //Still need further information // Merge Item 0x096D,-1,ZC_MERGE_ITEM_OPEN,2:4 // ZC_MERGE_ITEM_OPEN 0x096E,-1,mergeitem_req,2:4 // CZ_REQ_MERGE_ITEM 0x096F,7,ZC_ACK_MERGE_ITEM,2:4:6 // ZC_ACK_MERGE_ITEM 0x0974,2,mergeitem_cancel,0 // CZ_CANCEL_MERGE_ITEM 0x0844,2,cashshopopen,0 0x0849,16 //clif_cashshop_result 0x0848,-1,cashshopbuy,2:6:4:10 0x084a,2,cashshopclose,0 0x08c9,2,cashshopitemlist,0 //2012-04-18aRagexeRE [Special Thanks to Judas!] packet_ver: 31 packet_keys: 0x01540E48,0x13041224,0x31247924 // [Shakto] 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2:4 0x08A8,36,storagepassword,2:4:20 0x0802,26,partyinvite2,2 0x022D,19,wanttoconnection,2:6:10:14:18 0x0281,-1,itemlistwindowselected,2:4:8:12 0x035F,6,ticksend,2 0x0202,5,changedir,2:4 0x07E4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07EC,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x08E5,41,bookingregreq,2:4:6 //Added to prevent disconnections 0x08d2,10 //2012-06-18 packet_ver: 32 packet_keys: 0x261F261F,0x261F261F,0x261F261F // [Shakto] 0x0983,29 // ZC_MSG_STATE_CHANGE3 0x0861,41,bookingregreq,2:4:6 //actually 12-05-03 //2012-07-02aRagexeRE (unstable) packet_ver: 33 packet_keys: 0x25733B31,0x53486CFD,0x398649BD // [Shakto] 0x0363,19,wanttoconnection,2:6:10:14:18 0x0364,6,ticksend,2 0x085a,7,actionrequest,2:6 0x0861,8,movefromkafra,2:4 0x0862,10,useskilltoid,2:4:6 0x0863,10,useskilltopos,2:4:6:8 0x0886,6,solvecharname,2 0x0889,90,useskilltoposinfo,2:4:6:8:10 0x089e,6,dropitem,2:4 0x089f,6,takeitem,2 0x08a0,8,movetokafra,2:4 0x094a,6,getcharnamerequest,2 0x0953,5,walktoxy,2 0x0960,5,changedir,2:4 0x0879,41,bookingregreq,2:4:6 //2013-03-20Ragexe (Judas) packet_ver: 34 packet_keys: 0x3F094C49,0x55F86C1E,0x58AA359A // [Shakto] 0x014f,6,guildrequestinfo,2 0x01fd,15,repairitem,2:4:6:7:9:11:13 //0x0281,-1,itemlistwindowselected,2:4:8:12 0x035f,6,reqclickbuyingstore,2 0x0363,6,ticksend,2 0x0365,12,searchstoreinfolistitemclick,2:6:10 0x0438,6,dropitem,2:4 0x0447,2,booking_playcancel,0 // CZ_BLOCKING_PLAY_CANCEL 0x044A,6,clientversion,2 0x0844,2,cashshopopen,0 0x0849,16 //clif_cashshop_result 0x0848,-1,cashshopbuy,2:6:4:10 0x084a,2,cashshopclose,0 0x084b,19 //fallitem4 0x085a,90,useskilltoposinfo,2:4:6:8:10 0x085d,18,bookingregreq,2:4:6 0x0868,-1,itemlistwindowselected,2:4:8:12 0x086d,26,partyinvite2,2 0x086f,26,friendslistadd,2 0x0874,8,movefromkafra,2:4 0x0881,5,walktoxy,2 0x0886,2,reqclosebuyingstore,0 0x0888,19,wanttoconnection,2:6:10:14:18 0x088e,7,actionrequest,2:6 0x0897,5,changedir,2:4 0x0898,6,getcharnamerequest,2 0x089b,10,useskilltoid,2:4:6 0x08ac,8,movetokafra,2:4 0x08c9,2,cashshopitemlist,0 0x08cf,10 //Amulet spirits 0x08d2,10 0x0907,5,moveitem,2:4 0x0908,5 0x0922,-1,reqtradebuyingstore,2:4:8:12 //0x092e,2,searchstoreinfonextpage,0 0x0933,6,takeitem,2 0x0938,-1,reqopenbuyingstore,2:4:8:9:89 0x093f,5,hommenu,2:4 0x0947,36,storagepassword,2:4:20 0x094c,6,solvecharname,2 0x094e,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0959,10,useskilltopos,2:4:6:8 //0x095a,8,mailsetattach,2:4 0x0977,14 //Monster HP Bar 0x0978,6,reqworldinfo,2 0x0979,50 //ackworldinfo 0x097b,16,ZC_PERSONAL_INFOMATION,2:4:8:12:16:17:21:25 //Still need further information //0x0981,12,ZC_PERSONAL_INFOMATION_CHN,2:4:6:8:12:13:15:17:10 // Disabled until further information is found. 0x0990,31 //additem 0x0991,-1 //inv itemlist normal 0x0992,-1 //inv itemlist equip 0x0993,-1 //cart itemlist normal 0x0994,-1 //cart itemlist equip 0x0995,-1 //store itemlist normal 0x0996,-1 //store itemlist equip 0x0997,-1 //ZC_EQUIPWIN_MICROSCOPE_V5 0x0998,8,equipitem,2:4 // CZ_REQ_WEAR_EQUIP_V5 0x0999,11,ZC_WEAR_EQUIP_ACK,2:4:8:10 // cz_wear_equipv5 0x099a,9 // take_off_equipv5 0x099b,8 //maptypeproperty2 // New Packets 0x08C8,34 // ZC_NOTIFY_ACT3 0x08ff,24 // ZC_EFST_SET_ENTER 0x0984,28 // ZC_EFST_SET_ENTER2 0x099f,22 // ZC_SKILL_ENTRY4 //2013-05-15aRagexe (Yommy) packet_ver: 35 packet_keys: 0x75794A38,0x58A96BC1,0x296E6FB8 // [Shakto] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x0362,5,changedir,2:4 0x08A1,6,takeitem,2 0x0944,6,dropitem,2:4 0x0887,8,movetokafra,2:4 0x08AC,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x092D,18,bookingregreq,2:4:6 //0x08AA,8 CZ_JOIN_BATTLE_FIELD 0x0963,-1,itemlistwindowselected,2:4:8:12 0x0943,19,wanttoconnection,2:6:10:14:18 0x0947,26,partyinvite2,2 //0x0862,4 CZ_GANGSI_RANK 0x0962,26,friendslistadd,2 0x0931,5,hommenu,2:4 0x093e,36,storagepassword,2:4:20 //2013-05-22Ragexe (Yommy) packet_ver: 36 packet_keys: 0x6948050B,0x06511D9D,0x725D4DF1 // [Shakto] 0x08A2,7,actionrequest,2:6 0x095C,10,useskilltoid,2:4:6 0x0360,5,walktoxy,2 0x07EC,6,ticksend,2 0x0925,5,changedir,2:4 0x095E,6,takeitem,2 0x089C,6,dropitem,2:4 0x08a3,8,movetokafra,2:4 0x087E,8,movefromkafra,2:4 0x0811,10,useskilltopos,2:4:6:8 0x0964,90,useskilltoposinfo,2:4:6:8:10 0x08a6,6,getcharnamerequest,2 0x0369,6,solvecharname,2 0x093e,12,searchstoreinfolistitemclick,2:6:10 0x08aa,2,searchstoreinfonextpage,0 0x095b,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0952,-1,reqtradebuyingstore,2:4:8:12 0x0368,6,reqclickbuyingstore,2 0x086E,2,reqclosebuyingstore,0 0x0874,-1,reqopenbuyingstore,2:4:8:9:89 0x089B,18,bookingregreq,2:4:6 //0x0965,8 CZ_JOIN_BATTLE_FIELD 0x086A,-1,itemlistwindowselected,2:4:8:12 0x08A9,19,wanttoconnection,2:6:10:14:18 0x0950,26,partyinvite2,2 //0x08AC,4 CZ_GANGSI_RANK 0x0362,26,friendslistadd,2 0x0926,5,hommenu,2:4 0x088e,36,storagepassword,2:4:20 //2013-05-29Ragexe (Shakto) packet_ver: 37 packet_keys: 0x023A6C87,0x14BF1F1E,0x5CC70CC9 // [Shakto] 0x0890,7,actionrequest,2:6 0x0438,10,useskilltoid,2:4:6 0x0876,5,walktoxy,2 0x0897,6,ticksend,2 0x0951,5,changedir,2:4 0x0895,6,takeitem,2 0x08A7,6,dropitem,2:4 0x0938,8,movetokafra,2:4 0x0957,8,movefromkafra,2:4 0x0917,10,useskilltopos,2:4:6:8 0x085E,90,useskilltoposinfo,2:4:6:8:10 0x0863,6,getcharnamerequest,2 0x0937,6,solvecharname,2 0x085A,12,searchstoreinfolistitemclick,2:6:10 0x0941,2,searchstoreinfonextpage,0 0x0918,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0936,-1,reqtradebuyingstore,2:4:8:12 0x0892,6,reqclickbuyingstore,2 0x0964,2,reqclosebuyingstore,0 0x0869,-1,reqopenbuyingstore,2:4:8:9:89 0x0874,18,bookingregreq,2,4:6 //0x088E,8 // CZ_JOIN_BATTLE_FIELD 0x0958,-1,itemlistwindowselected,2:4:8:12 0x0919,19,wanttoconnection,2:6:10:14:18 0x08A8,26,partyinvite2,2 //0x0888,4 // CZ_GANGSI_RANK 0x0877,26,friendslistadd,2 0x023B,5,hommenu,2:4 0x0956,36,storagepassword,2:4:20 //2013-06-05Ragexe (Shakto) packet_ver: 38 packet_keys: 0x646E08D9,0x5F153AB5,0x61B509B5 // [Shakto] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x0202,5,changedir,2:4 0x07E4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07EC,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 //0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 //0x0436,4 // CZ_GANGSI_RANK 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2,4 0x0883,36,storagepassword,2:4:20 0x097C,4,ranklist,2 //2013-06-12Ragexe (Shakto) packet_ver: 39 packet_keys: 0x6D166F66,0x3C000FCF,0x295B0FCB // [Shakto] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x087E,5,changedir,2:4 0x07E4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07EC,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 //0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x0919,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 //0x0436,4 // CZ_GANGSI_RANK 0x0940,26,friendslistadd,2 0x093A,5,hommenu,2:4 0x0964,36,storagepassword,2:4:20 //2013-06-18Ragexe (Shakto) packet_ver: 40 packet_keys: 0x434115DE,0x34A10FE9,0x6791428E // [Shakto] 0x0889,7,actionrequest,2:6 0x0951,10,useskilltoid,2:4:6 0x088E,5,walktoxy,2 0x0930,6,ticksend,2 0x08A6,5,changedir,2:4 0x0962,6,takeitem,2 0x0917,6,dropitem,2:4 0x0885,8,movetokafra,2:4 0x0936,8,movefromkafra,2:4 0x096A,10,useskilltopos,2:4:6:8 0x094F,90,useskilltoposinfo,2:4:6:8:10 0x0944,6,getcharnamerequest,2 0x0945,6,solvecharname,2 0x0890,12,searchstoreinfolistitemclick,2:6:10 0x0363,2,searchstoreinfonextpage,0 0x0281,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0891,-1,reqtradebuyingstore,2:4:8:12 0x0862,6,reqclickbuyingstore,2 0x085A,2,reqclosebuyingstore,0 0x0932,-1,reqopenbuyingstore,2:4:8:9:89 0x08A7,18,bookingregreq,2:4:6 //0x087A,8 // CZ_JOIN_BATTLE_FIELD 0x0942,-1,itemlistwindowselected,2:4:8:12 0x095B,19,wanttoconnection,2:6:10:14:18 0x0887,26,partyinvite2,2 //0x0878,4 // CZ_GANGSI_RANK 0x0953,26,friendslistadd,2 0x02C4,5,hommenu,2:4 0x0864,36,storagepassword,2:4:20 //2013-06-26Ragexe packet_ver: 41 packet_keys: 0x38F453EF,0x6A040FD8,0X65BD6668 // [Shakto] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x094D,5,changedir,2:4 0x088B,6,takeitem,2 0x0952,6,dropitem,2:4 0x0921,8,movetokafra,2:4 0x0817,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0365,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0894,18,bookingregreq,2:4:6 //0x0860,8 // CZ_JOIN_BATTLE_FIELD 0x08A5,-1,itemlistwindowselected,2:4:8:12 0x088C,19,wanttoconnection,2:6:10:14:18 0x0895,26,partyinvite2,2 //0x088F,4 // CZ_GANGSI_RANK 0x08AB,26,friendslistadd,2 0x0960,5,hommenu,2:4 0x0930,36,storagepassword,2:4:20 //2013-07-03Ragexe packet_ver: 42 packet_keys: 0x4FF90E23,0x0F1432F2,0x4CFA1EDA // [Shakto] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x0930,5,changedir,2:4 0x07E4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07EC,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0202,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 //0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 //0x0436,4 // CZ_GANGSI_RANK 0x0360,26,friendslistadd,2 0x094A,5,hommenu,2:4 0x0873,36,storagepassword,2:4:20 //2013-07-10Ragexe packet_ver: 43 packet_keys: 0x458F758F,0x4CCF3F8F,0x4A9C4237 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x0202,5,changedir,2:4 0x07E4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07EC,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 //0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 //0x0436,4 // CZ_GANGSI_RANK 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2:4 0x0880,36,storagepassword,2:4:20 0x0848,-1,cashshopbuy,2:6:4:10 0x097D,288 //ZC_ACK_RANKING //2013-07-17Ragexe packet_ver: 44 packet_keys: 0x2BED4F91,0x5F9E00CF,0x5EE5520C 0x0918,7,actionrequest,2:6 0x091E,10,useskilltoid,2:4:6 0x083C,5,walktoxy,2 0x02C4,6,ticksend,2 0x088C,5,changedir,2:4 0x08A9,6,takeitem,2 0x0917,6,dropitem,2:4 0x089B,8,movetokafra,2:4 0x0956,8,movefromkafra,2:4 0x0882,10,useskilltopos,2:4:6:8 0x0952,90,useskilltoposinfo,2:4:6:8:10 0x0958,6,getcharnamerequest,2 0x0967,6,solvecharname,2 0x0960,12,searchstoreinfolistitemclick,2:6:10 0x0819,2,searchstoreinfonextpage,0 0x086B,-1,searchstoreinfo,2:4:5:9:13:14:15 0x093B,-1,reqtradebuyingstore,2:4:8:12 0x0898,6,reqclickbuyingstore,2 0x096A,2,reqclosebuyingstore,0 0x08AA,-1,reqopenbuyingstore,2:4:8:9:89 0x0862,18,bookingregreq,2:4:6 //0x08A6,8 // CZ_JOIN_BATTLE_FIELD 0x0897,-1,itemlistwindowselected,2:4:8:12 0x091D,19,wanttoconnection,2:6:10:14:18 0x092F,26,partyinvite2,2 //0x086C,4 // CZ_GANGSI_RANK 0x0863,26,friendslistadd,2 0x088A,5,hommenu,2:4 0x095B,36,storagepassword,2:4:20 0x09A6,12,ZC_BANKING_CHECK,2:10 0x09A7,10,bankdeposit,2:6 0x09A8,16,ZC_ACK_BANKING_DEPOSIT,2:4:12 0x09A9,10,bankwithdrawal,2:6 0x09AA,16,ZC_ACK_BANKING_WITHDRAW,2:4:12 0x09AB,6,bankcheck,2 0x09B6,6,bankopen,2 0x09B7,4,ZC_ACK_OPEN_BANKING,2 0x09B8,6,bankclose,2 0x09B9,4,ZC_ACK_CLOSE_BANKING,2 //2013-07-31cRagexe 0x09ca,23 // ZC_SKILL_ENTRY5 0x09cb,17 // ZC_USE_SKILL2 //2013-08-07Ragexe packet_ver: 45 packet_keys: 0x7E241DE0,0x5E805580,0x3D807D80 // [Shakto] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x0202,5,changedir,2:4 0x07E4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07EC,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 //0x363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 //0x436,4 // CZ_GANGSI_RANK 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2:4 0x0887,36,storagepassword,2:4:20 0x09C1,10,ZC_C_MARKERINFO,2:6:8 // Merge Item 0x096D,-1,ZC_MERGE_ITEM_OPEN,2:4 // ZC_MERGE_ITEM_OPEN 0x096E,-1,mergeitem_req,2:4 // CZ_REQ_MERGE_ITEM 0x096F,7,ZC_ACK_MERGE_ITEM,2:4:6:7 // ZC_ACK_MERGE_ITEM 0x0974,2,mergeitem_cancel,0 // CZ_CANCEL_MERGE_ITEM //2013-12-23Ragexe packet_ver: 46 packet_keys: 0x631C511C,0x111C111C,0x111C111C // [Shakto] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x0202,5,changedir,2:4 0x07E4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07EC,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4:6 //0x363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022D,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 //0x436,4 // CZ_GANGSI_RANK 0x023B,26,friendslistadd,2 0x0361,5,hommenu,2:4 0x08A4,36,storagepassword,2:4:20 //New Packets //0x097E,12 //ZC_UPDATE_RANKING_POINT 0x09CE,102,itemmonster,2 0x09D4,2,npcshopclosed,0 //NPC Market 0x09D5,-1 0x09D6,-1,npcmarketpurchase,2:4:6 0x09D7,-1 0x09D8,2,npcmarketclosed,0 // Clan System 0x0988,6 0x0989,2 0x098A,-1 0x098D,-1,clanchat,2:4 0x098E,-1 // Sale 0x09AC,-1,salesearch,2:4:8 0x09AD,8 0x09AE,17,saleadd,2:6:8:12:16 0x09AF,4 0x09B0,8,saleremove,2:6 0x09B1,4 0x09B2,8 0x09B3,4 0x09B4,6,saleopen,2 0x09BC,6,saleclose,2 0x09C3,8,salerefresh,2:6 0x09C4,8 // New Packet 0x097A,-1 // ZC_ALL_QUEST_LIST2 0x09DB,-1 // ZC_NOTIFY_MOVEENTRY10 0x09DC,-1 // ZC_NOTIFY_NEWENTRY10 0x09DD,-1 // ZC_NOTIFY_STANDENTRY10 0x09DF,7 // ZC_ACK_WHISPER02 //2014-10-16Ragexe packet_ver: 50 packet_keys: 0x2DFF467C,0x444B37EE,0x2C1B634F // [YomRawr] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x0967,5,changedir,2:4 0x07E4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07EC,8,movetokafra,2:4 0x022D,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,bookingregreq,2:4 // 0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8 0x086E,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite,2 // 0x0922,4 // CZ_GANGSI_RANK 0x094B,26,friendslistadd,2 0x0364,5,hommenu,2:4 0x0936,36,storagepassword,0 0x09DF,7 // New packet 0x0A00,269 // ZC_SHORTCUT_KEY_LIST_V3 0x0A01,3,hotkeyrowshift,2 // CZ_SHORTCUTKEYBAR_ROTATE 0x0A02,4 // ZC_DRESSROOM_OPEN 0x0A0E,14 // ZC_BATTLEFIELD_NOTIFY_HP2 0x09F7,75 // ZC_PROPERTY_HOMUN_2 0x09E5,18 // ZC_DELETEITEM_FROM_MCSTORE2 0x09E6,22 // ZC_UPDATE_ITEM_FROM_BUYING_STORE2 // Roulette System [Yommy] 0x0A19,2,rouletteopen,0 // CZ_REQ_OPEN_ROULETTE 0x0A1A,23 // ZC_ACK_OPEN_ROULETTE 0x0A1B,2,rouletteinfo,0 // CZ_REQ_ROULETTE_INFO 0x0A1C,-1 // ZC_ACK_ROULETTE_INFO 0x0A1D,2,rouletteclose,0 // CZ_REQ_CLOSE_ROULETTE 0x0A1E,3 // ZC_ACK_CLOSE_ROULETTE 0x0A1F,2,roulettegenerate,0 // CZ_REQ_GENERATE_ROULETTE 0x0A20,21 // ZC_ACK_GENERATE_ROULETTE 0x0A21,3,rouletterecvitem,2 // CZ_RECV_ROULETTE_ITEM 0x0A22,5 // ZC_RECV_ROULETTE_ITEM //2014-10-22bRagexe packet_ver: 51 packet_keys: 0x290551EA,0x2B952C75,0x2D67669B // [YomRawr] 0x006d,149 0x023b,10,useskilltopos,2:4:6:8 0x0281,-1,itemlistwindowselected,2:4:8:12 0x035f,6,ticksend,2 0x0360,6,reqclickbuyingstore,2 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x0368,6,solvecharname,2 0x0369,7,actionrequest,2:6 0x0437,5,walktoxy,2 0x0438,36,storagepassword,2:4:20 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0817,2,reqclosebuyingstore,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0835,12,searchstoreinfolistitemclick,2:6:10 0x083c,10,useskilltoid,2:4:6 0x0878,8,movetokafra,2:4 0x087d,6,dropitem,2:4 0x0896,26,partyinvite2,2 0x0899,5,hommenu,2:4 0x08aa,8,movefromkafra,2:4 //0x08ab,4 // CZ_GANGSI_RANK 0x08ad,5,changedir,2:4 0x08e3,149 0x091a,26,friendslistadd,2 //0x092b,8 // CZ_JOIN_BATTLE_FIELD 0x093b,19,wanttoconnection,2:6:10:14:18 0x0940,2,searchstoreinfonextpage,0 0x094e,6,takeitem,2 0x0955,18,bookingregreq,2:4:6 0x096a,6,getcharnamerequest,2 // New Packet 0x0A18,14 // ZC_ACCEPT_ENTER3 0x0A28,3 // ZC_ACK_OPENSTORE2 0x09FD,-1 // ZC_NOTIFY_MOVEENTRY11 0x09FE,-1 // ZC_NOTIFY_NEWENTRY11 0x09FF,-1 // ZC_NOTIFY_STANDENTRY11 //0x09F8,-1 // ZC_ALL_QUEST_LIST3 //2015-05-13aRagexe packet_ver: 52 packet_keys: 0x62C86D09,0x75944F17,0x112C133D // [YomRawr] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035F,6,ticksend,2 0x0924,5,changedir,2:4 0x0958,6,takeitem,2 0x0885,6,dropitem,2:4 0x0879,8,movetokafra,2:4 0x0864,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x096A,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x022D,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0883,18,bookingregreq,2:4:6 // 0x02C4,8 CZ_JOIN_BATTLE_FIELD 0x0960,-1,itemlistwindowselected,2:4:8:12 0x0363,19,wanttoconnection,2:6:10:14:18 0x094A,26,partyinvite2,2 // 0x0927,4 CZ_GANGSI_RANK 0x08A8,26,friendslistadd,2 0x0817,5,hommenu,2:4 0x0923,36,storagepassword,2:4:20 // New Packets 0xA3B,-1 // ZC_HAT_EFFECT // RODEX Mail system 0x09E7,3 // ZC_NOTIFY_UNREADMAIL 0x09E8,11,mailrefresh,2:3 // CZ_OPEN_MAILBOX 0x09E9,2,dull,0 // CZ_CLOSE_MAILBOX 0x09EA,11,mailread,2:3 // CZ_REQ_READ_MAIL 0x09EB,-1 // ZC_ACK_READ_MAIL 0x09EC,-1,mailsend,2:4:28:52:60:62:64 // CZ_REQ_WRITE_MAIL 0x09ED,3 // ZC_ACK_WRITE_MAIL 0x09EE,11,mailrefresh,2:3 // CZ_REQ_NEXT_MAIL_LIST 0x09EF,11,mailrefresh,2:3 // CZ_REQ_REFRESH_MAIL_LIST 0x09F0,-1 // ZC_ACK_MAIL_LIST 0x09F1,11,mailgetattach,0 // CZ_REQ_ZENY_FROM_MAIL 0x09F2,12 // ZC_ACK_ZENY_FROM_MAIL 0x09F3,11,mailgetattach,0 // CZ_REQ_ITEM_FROM_MAIL 0x09F4,12 // ZC_ACK_ITEM_FROM_MAIL 0x09F5,11,maildelete,0 // CZ_REQ_DELETE_MAIL 0x09F6,11 // ZC_ACK_DELETE_MAIL 0x0A03,2,mailcancel,0 // CZ_REQ_CANCEL_WRITE_MAIL 0x0A04,6,mailsetattach,2:4 // CZ_REQ_ADD_ITEM_TO_MAIL 0x0A05,53 // ZC_ACK_ADD_ITEM_TO_MAIL 0x0A06,6,mailwinopen,2:4 // CZ_REQ_REMOVE_ITEM_MAIL 0x0A07,9 // ZC_ACK_REMOVE_ITEM_MAIL 0x0A08,26,mailbegin,0 // CZ_REQ_OPEN_WRITE_MAIL 0x0A12,27 // ZC_ACK_OPEN_WRITE_MAIL 0x0A13,26,mailreceiver,2 // CZ_CHECK_RECEIVE_CHARACTER_NAME 0x0A14,10 // ZC_CHECK_RECEIVE_CHARACTER_NAME 0x0A32,2 // ZC_OPEN_RODEX_THROUGH_NPC_ONLY // New EquipPackets Support 0x0A09,45 // ZC_ADD_EXCHANGE_ITEM3 0x0A0A,47 // ZC_ADD_ITEM_TO_STORE3 0x0A0B,47 // ZC_ADD_ITEM_TO_CART3 0x0A0C,56 // ZC_ITEM_PICKUP_ACK_V6 0x0A0D,-1 // ZC_INVENTORY_ITEMLIST_EQUIP_V6 0x0A0F,-1 // ZC_CART_ITEMLIST_EQUIP_V6 0x0A10,-1 // ZC_STORE_ITEMLIST_EQUIP_V6 0x0A2D,-1 // ZC_EQUIPWIN_MICROSCOPE_V6 // OneClick Itemidentify 0x0A35,4,oneclick_itemidentify,2 // CZ_REQ_ONECLICK_ITEMIDENTIFY // Achievement System 0x0A23,-1 // ZC_ALL_ACH_LIST 0x0A24,66 // ZC_ACH_UPDATE 0x0A25,6,dull,0 // CZ_REQ_ACH_REWARD 0x0A26,7 // ZC_REQ_ACH_REWARD_ACK // Title System 0x0A2E,6,dull,0 // CZ_REQ_CHANGE_TITLE 0x0A2F,7 // ZC_ACK_CHANGE_TITLE 0x0A30,106 // ZC_ACK_REQNAMEALL2 // Pet Evolution System 0x09FB,-1,dull,0 // CZ_PET_EVOLUTION 0x09FC,6 // ZC_PET_EVOLUTION_RESULT //2015-05-20aRagexe 0x0A3D,18,saleadd,2:6:8:12:16 //2015-09-16Ragexe packet_ver: 53 packet_keys: 0x17F83A19,0x116944F4,0x1CC541E9 // [Napster] 0x0869,7,actionrequest,2:6 0x093E,10,useskilltoid,2:4:6 0x0877,5,walktoxy,2 0x08AC,6,ticksend,2 0x0936,5,changedir,2:4 0x089C,6,takeitem,2 0x092F,6,dropitem,2:4 0x0934,8,movetokafra,2:4 0x085E,8,movefromkafra,2:4 0x022D,10,useskilltopos,2:4:6:8 0x0873,90,useskilltoposinfo,2:4:6:8:10 0x095A,6,getcharnamerequest,2 0x0942,6,solvecharname,2 0x087F,12,searchstoreinfolistitemclick,2:6:10 0x0817,2,searchstoreinfonextpage,0 0x0920,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0881,-1,reqtradebuyingstore,2:4:8:12 0x0835,6,reqclickbuyingstore,2 0x092E,2,reqclosebuyingstore,0 0x0948,-1,reqopenbuyingstore,2:4:8:9:89 0x089B,18,bookingregreq,2:4:6 // 0x094F,8 CZ_JOIN_BATTLE_FIELD 0x0961,-1,itemlistwindowselected,2:4:8:12 0x0969,19,wanttoconnection,2:6:10:14:18 0x0924,26,partyinvite2,2 // 0x0938,4 CZ_GANGSI_RANK 0x089E,26,friendslistadd,2 0x0960,5,hommenu,2:4 0x0941,36,storagepassword,2:4:20 // New Packet 0x097F,-1 // ZC_SELECTCART 0x0980,7,selectcart,2:6 // CZ_SELECTCART //2015-10-01bRagexeRE packet_ver: 54 packet_keys: 0x45B945B9,0x45B945B9,0x45B945B9 // [Dastgir] 0x0369,7,actionrequest,2:6 0x083c,10,useskilltoid,2:4:6 0x0437,5,walktoxy,2 0x035f,6,ticksend,2 0x0202,5,changedir,2:4 0x07e4,6,takeitem,2 0x0362,6,dropitem,2:4 0x07ec,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposmoreinfo,2:4:6:8:10 0x096a,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0811,-1,reqtradebuyingstore,2:4:8:12 0x0360,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x0815,-1,reqopenbuyingstore,2:4:8:9:89 0x0365,18,partybookingregisterreq,2:4:6 //0x0363,8 // CZ_JOIN_BATTLE_FIELD 0x0281,-1,itemlistwindowselected,2:4:8:12 0x022d,19,wanttoconnection,2:6:10:14:18 0x0802,26,partyinvite2,2 //0x0436,4 // CZ_GANGSI_RANK 0x023b,26,friendslistadd,2 0x0361,5,hommenu,2:4 0x0860,36,storagepassword,2:4:20 //2015-11-04aRagexe packet_ver: 55 packet_keys: 0x4C17382A,0x7ED174C9,0x29961E4F // [Winnie] 0x0369,7,actionrequest,2:6 0x083C,10,useskilltoid,2:4:6 0x0363,5,walktoxy,2 0x0886,6,ticksend,2 0x0928,5,changedir,2:4 0x0964,6,takeitem,2 0x0437,6,dropitem,2:4 0x088B,8,movetokafra,2:4 0x0364,8,movefromkafra,2:4 0x0438,10,useskilltopos,2:4:6:8 0x0366,90,useskilltoposinfo,2:4:6:8:10 0x0887,6,getcharnamerequest,2 0x0368,6,solvecharname,2 0x0838,12,searchstoreinfolistitemclick,2:6:10 0x0835,2,searchstoreinfonextpage,0 0x0819,-1,searchstoreinfo,2:4:5:9:13:14:15 0x0815,-1,reqtradebuyingstore,2:4:8:12 0x0436,6,reqclickbuyingstore,2 0x0817,2,reqclosebuyingstore,0 0x023B,-1,reqopenbuyingstore,2:4:8:9:89 0x0811,18,bookingregreq,2:4:6 //0x0939,8 CZ_JOIN_BATTLE_FIELD 0x093A,-1,itemlistwindowselected,2:4:8:12 0x0360,19,wanttoconnection,2:6:10:14:18 0x08A5,26,partyinvite2,2 //0x08A3,4 CZ_GANGSI_RANK 0x07EC,26,friendslistadd,2 0x088D,5,hommenu,2:4 0x0940,36,storagepassword,2:4:20 // 2016-03-02bRagexe 0x0A51,34 // 2016-03-30aRagexe 0x0A6E,-1,mailsend,2:4:28:52:60:62:64:68 // CZ_REQ_WRITE_MAIL2 // 2016-06-01aRagexe 0x0A7D,-1 // 2017-05-02dRagexeRE 0x0A43,85 0x0A44,-1 0x0ABD,10 //Add new packets here //packet_ver: 56 src/common/mmo.h // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder #ifndef _MMO_H_ #define _MMO_H_ #include "cbasetypes.h" #include "../config/core.h" #include "db.h" #include <time.h> // server->client protocol version // 0 - pre-? // 1 - ? - 0x196 // 2 - ? - 0x78, 0x79 // 3 - ? - 0x1c8, 0x1c9, 0x1de // 4 - ? - 0x1d7, 0x1d8, 0x1d9, 0x1da // 5 - 2003-12-18aSakexe+ - 0x1ee, 0x1ef, 0x1f0, ?0x1c4, 0x1c5? // 6 - 2004-03-02aSakexe+ - 0x1f4, 0x1f5 // 7 - 2005-04-11aSakexe+ - 0x229, 0x22a, 0x22b, 0x22c // see conf/battle/client.conf for other version #ifndef PACKETVER #define PACKETVER 20120410 //#define PACKETVER 20120410 #endif // Check if the specified packetversion supports the pincode system #define PACKETVER_SUPPORTS_PINCODE PACKETVER>=20110309 /// Check if the client needs delete_date as remaining time and not the actual delete_date (actually it was tested for clients since 2013) #define PACKETVER_CHAR_DELETEDATE (PACKETVER > 20130000 && PACKETVER < 20141016) || PACKETVER >= 20150513 // Check if the specified packetvresion supports the cashshop sale system #define PACKETVER_SUPPORTS_SALES PACKETVER>=20131223 ///Remove/Comment this line to disable sc_data saving. [Skotlex] #define ENABLE_SC_SAVING /** Remove/Comment this line to disable server-side hot-key saving support [Skotlex] * Note that newer clients no longer save hotkeys in the registry! */ #define HOTKEY_SAVING #if PACKETVER < 20090603 // (27 = 9 skills x 3 bars) (0x02b9,191) #define MAX_HOTKEYS 27 #elif PACKETVER < 20090617 // (36 = 9 skills x 4 bars) (0x07d9,254) #define MAX_HOTKEYS 36 #else // (38 = 9 skills x 4 bars & 2 Quickslots)(0x07d9,268) #define MAX_HOTKEYS 38 #endif #define MAX_MAP_PER_SERVER 1500 /// Increased to allow creation of Instance Maps #define MAX_INVENTORY 100 ///Maximum items in player inventory /** Max number of characters per account. Note that changing this setting alone is not enough if the client is not hexed to support more characters as well. * Max value tested was 265 */ #define MAX_CHARS 9 /** Number of slots carded equipment can have. Never set to less than 4 as they are also used to keep the data of forged items/equipment. [Skotlex] * Note: The client seems unable to receive data for more than 4 slots due to all related packets having a fixed size. */ #define MAX_SLOTS 4 #define MAX_AMOUNT 30000 ////Max amount of a single stacked item #define MAX_ZENY 1000000000 ///Max zeny #define MAX_BANK_ZENY SINT32_MAX ///Max zeny in Bank #define MAX_FAME 1000000000 ///Max fame points #define MAX_CART 100 ///Maximum item in cart #define MAX_SKILL 1200 ///Maximum skill can be hold by Player, Homunculus, & Mercenary (skill list) AND skill_db limit #define DEFAULT_WALK_SPEED 150 ///Default walk speed #define MIN_WALK_SPEED 20 ///Min walk speed #define MAX_WALK_SPEED 1000 ///Max walk speed #define MAX_STORAGE 600 ///Max number of storage slots a player can have #define MAX_GUILD_STORAGE 600 ///Max number of storage slots a guild #define MAX_PARTY 12 ///Max party member #define MAX_GUILD 16+10*6 ///Increased max guild members +6 per 1 extension levels [Lupus] #define MAX_GUILDPOSITION 20 ///Increased max guild positions to accomodate for all members [Valaris] (removed) [PoW] #define MAX_GUILDEXPULSION 32 ///Max Guild expulsion #define MAX_GUILDALLIANCE 16 ///Max Guild alliance #define MAX_GUILDSKILL 15 ///Increased max guild skills because of new skills [Sara-chan] #define MAX_GUILDLEVEL 50 ///Max Guild level #define MAX_GUARDIANS 8 ///Local max per castle. If this value is increased, need to add more fields on MySQL `guild_castle` table [Skotlex] #define MAX_QUEST_OBJECTIVES 3 ///Max quest objectives for a quest #define MAX_QUEST_DROPS 3 ///Max quest drops for a quest #define MAX_PC_BONUS_SCRIPT 50 ///Max bonus script can be fetched from `bonus_script` table on player load [Cydh] #define MAX_ITEM_RDM_OPT 5 /// Max item random option [Napster] #define DB_NAME_LEN 256 //max len of dbs #define MAX_CLAN 500 #define MAX_CLANALLIANCE 6 // for produce #define MIN_ATTRIBUTE 0 #define MAX_ATTRIBUTE 4 #define ATTRIBUTE_NORMAL 0 #define MIN_STAR 0 #define MAX_STAR 3 #define MAX_STATUS_TYPE 5 #define WEDDING_RING_M 2634 #define WEDDING_RING_F 2635 //For character names, title names, guilds, maps, etc. //Includes null-terminator as it is the length of the array. #define NAME_LENGTH (23 + 1) #define PASSWD_LENGTH (32+1) //NPC names can be longer than it's displayed on client (NAME_LENGTH). #define NPC_NAME_LENGTH 50 // <NPC_NAME_LENGTH> for npc name + 2 for a "::" + <NAME_LENGTH> for label + 1 for EOS #define EVENT_NAME_LENGTH ( NPC_NAME_LENGTH + 2 + NAME_LENGTH + 1 ) //For item names, which tend to have much longer names. #define ITEM_NAME_LENGTH 50 //For Map Names, which the client considers to be 16 in length including the .gat extension #define MAP_NAME_LENGTH (11 + 1) #define MAP_NAME_LENGTH_EXT (MAP_NAME_LENGTH + 4) //Pincode Length #define PINCODE_LENGTH 4 #define MAX_FRIENDS 40 #define MAX_MEMOPOINTS 3 #define MAX_SKILLCOOLDOWN 20 //Size of the fame list arrays. #define MAX_FAME_LIST 10 //Limits to avoid ID collision with other game objects #define START_ACCOUNT_NUM 2000000 #define END_ACCOUNT_NUM 100000000 #define START_CHAR_NUM 150000 //Guilds #define MAX_GUILDMES1 60 #define MAX_GUILDMES2 120 //Base Homun skill. #define HM_SKILLBASE 8001 #define MAX_HOMUNSKILL 43 #define MAX_HOMUNCULUS_CLASS 52 //[orn], Increased to 60 from 16 to allow new Homun-S. #define HM_CLASS_BASE 6001 #define HM_CLASS_MAX (HM_CLASS_BASE+MAX_HOMUNCULUS_CLASS-1) //Mail System #define MAIL_MAX_INBOX 30 #define MAIL_TITLE_LENGTH 40 #if PACKETVER < 20150513 #define MAIL_BODY_LENGTH 200 #define MAIL_MAX_ITEM 1 #else #define MAIL_BODY_LENGTH 500 #define MAIL_MAX_ITEM 5 #define MAIL_PAGE_SIZE 7 #endif //Mercenary System #define MC_SKILLBASE 8201 #define MAX_MERCSKILL 40 #define MAX_MERCENARY_CLASS 61 //Elemental System #define MAX_ELEMENTALSKILL 42 #define EL_SKILLBASE 8401 #define MAX_ELESKILLTREE 3 #define MAX_ELEMENTAL_CLASS 12 #define EL_CLASS_BASE 2114 #define EL_CLASS_MAX (EL_CLASS_BASE+MAX_ELEMENTAL_CLASS-1) enum item_types { IT_HEALING = 0, IT_UNKNOWN, //1 IT_USABLE, //2 IT_ETC, //3 IT_ARMOR, //4 IT_WEAPON, //5 IT_CARD, //6 IT_PETEGG, //7 IT_PETARMOR,//8 IT_UNKNOWN2,//9 IT_AMMO, //10 IT_DELAYCONSUME,//11 IT_SHADOWGEAR, //12 IT_CASH = 18, IT_MAX }; // Questlog states enum quest_state { Q_INACTIVE, ///< Inactive quest (the user can toggle between active and inactive quests) Q_ACTIVE, ///< Active quest Q_COMPLETE, ///< Completed quest }; /// Questlog entry struct quest { int quest_id; ///< Quest ID unsigned int time; ///< Expiration time int count[MAX_QUEST_OBJECTIVES]; ///< Kill counters of each quest objective enum quest_state state; ///< Current quest state }; struct s_item_randomoption { short id; short value; char param; }; struct item { int id; unsigned short nameid; short amount; unsigned int equip; // location(s) where item is equipped (using enum equip_pos for bitmasking) char identify; char refine; char attribute; unsigned short card[MAX_SLOTS]; struct s_item_randomoption option[MAX_ITEM_RDM_OPT]; // max of 5 random options can be supported. unsigned int expire_time; char favorite, bound; uint64 unique_id; }; //Equip position constants enum equip_pos { EQP_HEAD_LOW = 0x000001, EQP_HEAD_MID = 0x000200, // 512 EQP_HEAD_TOP = 0x000100, // 256 EQP_HAND_R = 0x000002, // 2 EQP_HAND_L = 0x000020, // 32 EQP_ARMOR = 0x000010, // 16 EQP_SHOES = 0x000040, // 64 EQP_GARMENT = 0x000004, // 4 EQP_ACC_L = 0x000008, // 8 EQP_ACC_R = 0x000080, // 128 EQP_COSTUME_HEAD_TOP = 0x000400, // 1024 EQP_COSTUME_HEAD_MID = 0x000800, // 2048 EQP_COSTUME_HEAD_LOW = 0x001000, // 4096 EQP_COSTUME_GARMENT = 0x002000, // 8192 //EQP_COSTUME_FLOOR = 0x004000, // 16384 EQP_AMMO = 0x008000, // 32768 EQP_SHADOW_ARMOR = 0x010000, // 65536 EQP_SHADOW_WEAPON = 0x020000, // 131072 EQP_SHADOW_SHIELD = 0x040000, // 262144 EQP_SHADOW_SHOES = 0x080000, // 524288 EQP_SHADOW_ACC_R = 0x100000, // 1048576 EQP_SHADOW_ACC_L = 0x200000, // 2097152 // Combined EQP_ACC_RL = EQP_ACC_R|EQP_ACC_L, EQP_SHADOW_ACC_RL = EQP_SHADOW_ACC_R|EQP_SHADOW_ACC_L, }; struct point { unsigned short map; short x,y; }; struct startitem { unsigned short nameid, amount; short pos; }; enum e_skill_flag { SKILL_FLAG_PERMANENT, SKILL_FLAG_TEMPORARY, SKILL_FLAG_PLAGIARIZED, SKILL_FLAG_PERM_GRANTED, // Permanent, granted through someway e.g. script SKILL_FLAG_TMP_COMBO, //@FIXME for homunculus combo atm //! NOTE: This flag be the last flag, and don't change the value if not needed! SKILL_FLAG_REPLACED_LV_0 = 10, // temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0', }; enum e_mmo_charstatus_opt { OPT_NONE = 0x0, OPT_SHOW_EQUIP = 0x1, OPT_ALLOW_PARTY = 0x2, }; struct s_skill { uint16 id; uint8 lv; uint8 flag; // see enum e_skill_flag }; struct script_reg_state { unsigned int type : 1; // because I'm a memory hoarder and having them in the same struct would be a 8-byte/instance waste while ints outnumber str on a 10000-to-1 ratio. unsigned int update : 1; // whether it needs to be sent to char server for insertion/update/delete }; struct script_reg_num { struct script_reg_state flag; int value; }; struct script_reg_str { struct script_reg_state flag; char *value; }; //For saving status changes across sessions. [Skotlex] struct status_change_data { unsigned short type; //SC_type long val1, val2, val3, val4, tick; //Remaining duration. }; #define MAX_BONUS_SCRIPT_LENGTH 512 struct bonus_script_data { char script_str[MAX_BONUS_SCRIPT_LENGTH]; //< Script string uint32 tick; ///< Tick uint16 flag; ///< Flags @see enum e_bonus_script_flags int16 icon; ///< Icon SI uint8 type; ///< 0 - None, 1 - Buff, 2 - Debuff }; struct skill_cooldown_data { unsigned short skill_id; long tick; }; enum storage_type { TABLE_INVENTORY = 1, TABLE_CART, TABLE_STORAGE, TABLE_GUILD_STORAGE, }; enum e_storage_mode { STOR_MODE_NONE = 0x0, STOR_MODE_GET = 0x1, STOR_MODE_PUT = 0x2, STOR_MODE_ALL = 0x3, }; struct s_storage { bool dirty; ///< Dirty status, data needs to be saved bool status; ///< Current status of storage (opened or closed) uint16 amount; ///< Amount of items in storage bool lock; ///< If locked, can't use storage when item bound retrieval uint32 id; ///< Account ID / Character ID / Guild ID (owner of storage) enum storage_type type; ///< Type of storage (inventory, cart, storage, guild storage) uint16 max_amount; uint8 stor_id; ///< Storage ID struct { unsigned get : 1; unsigned put : 1; } state; union { // Max for inventory, storage, cart, and guild storage are 1637 each without changing this struct and struct item [2014/10/27] struct item items_inventory[MAX_INVENTORY]; struct item items_storage[MAX_STORAGE]; struct item items_cart[MAX_CART]; struct item items_guild[MAX_GUILD_STORAGE]; } u; }; struct s_storage_table { char name[NAME_LENGTH]; char table[DB_NAME_LEN]; uint16 max_num; uint8 id; }; struct s_pet { uint32 account_id; uint32 char_id; int pet_id; short class_; short level; unsigned short egg_id;//pet egg id unsigned short equip;//pet equip name_id short intimate;//pet friendly short hungry;//pet hungry char name[NAME_LENGTH]; char rename_flag; char incubate; }; struct s_homunculus { //[orn] char name[NAME_LENGTH]; int hom_id; uint32 char_id; short class_; short prev_class; int hp,max_hp,sp,max_sp; unsigned int intimacy; //[orn] short hunger; struct s_skill hskill[MAX_HOMUNSKILL]; //albator short skillpts; short level; unsigned int exp; short rename_flag; short vaporize; //albator int str; int agi; int vit; int int_; int dex; int luk; int str_value; int agi_value; int vit_value; int int_value; int dex_value; int luk_value; char spiritball; //for homun S [lighta] }; struct s_mercenary { int mercenary_id; uint32 char_id; short class_; int hp, sp; unsigned int kill_count; unsigned int life_time; }; struct s_elemental { int elemental_id; uint32 char_id; short class_; int mode; int hp, sp, max_hp, max_sp, matk, atk, atk2; short hit, flee, amotion, def, mdef; int life_time; }; struct s_friend { uint32 account_id; uint32 char_id; char name[NAME_LENGTH]; }; #ifdef HOTKEY_SAVING struct hotkey { unsigned int id; unsigned short lv; unsigned char type; // 0: item, 1: skill }; #endif struct mmo_charstatus { uint32 char_id; uint32 account_id; uint32 partner_id; uint32 father; uint32 mother; uint32 child; unsigned int base_exp,job_exp; int zeny; short class_; ///< Player's JobID unsigned int status_point,skill_point; int hp,max_hp,sp,max_sp; unsigned int option; short manner; // Defines how many minutes a char will be muted, each negative point is equivalent to a minute. unsigned char karma; short hair,hair_color,clothes_color,body; int party_id,guild_id,pet_id,hom_id,mer_id,ele_id,clan_id; int fame; // Mercenary Guilds Rank int arch_faith, arch_calls; int spear_faith, spear_calls; int sword_faith, sword_calls; short weapon; // enum weapon_type short shield; // view-id short head_top,head_mid,head_bottom; short robe; char name[NAME_LENGTH]; unsigned int base_level,job_level; unsigned short str,agi,vit,int_,dex,luk; unsigned char slot,sex; uint32 mapip; uint16 mapport; struct point last_point,save_point,memo_point[MAX_MEMOPOINTS]; struct s_skill skill[MAX_SKILL]; struct s_friend friends[MAX_FRIENDS]; //New friend system [Skotlex] #ifdef HOTKEY_SAVING struct hotkey hotkeys[MAX_HOTKEYS]; #endif bool show_equip,allow_party; short rename; time_t delete_date; time_t unban_time; // Char server addon system unsigned int character_moves; unsigned char font; bool cashshop_sent; // Whether the player has received the CashShop list uint32 uniqueitem_counter; unsigned char hotkey_rowshift; }; typedef enum mail_status { MAIL_NEW, MAIL_UNREAD, MAIL_READ, } mail_status; enum mail_inbox_type { MAIL_INBOX_NORMAL = 0, MAIL_INBOX_ACCOUNT, MAIL_INBOX_RETURNED }; enum mail_attachment_type { MAIL_ATT_NONE = 0, MAIL_ATT_ZENY = 1, MAIL_ATT_ITEM = 2, MAIL_ATT_ALL = MAIL_ATT_ZENY | MAIL_ATT_ITEM }; struct mail_message { int id; uint32 send_id; //hold char_id of sender char send_name[NAME_LENGTH]; //sender nickname uint32 dest_id; //hold char_id of receiver char dest_name[NAME_LENGTH]; //receiver nickname char title[MAIL_TITLE_LENGTH]; char body[MAIL_BODY_LENGTH]; int type; // enum mail_inbox_type time_t scheduled_deletion; mail_status status; time_t timestamp; // marks when the message was sent uint32 zeny; struct item item[MAIL_MAX_ITEM]; }; struct mail_data { short amount; bool full; short unchecked, unread; struct mail_message msg[MAIL_MAX_INBOX]; }; struct auction_data { unsigned int auction_id; int seller_id; char seller_name[NAME_LENGTH]; int buyer_id; char buyer_name[NAME_LENGTH]; struct item item; // This data is required for searching, as itemdb is not read by char server char item_name[ITEM_NAME_LENGTH]; short type; unsigned short hours; int price, buynow; time_t timestamp; // auction's end time int auction_end_timer; }; struct party_member { uint32 account_id; uint32 char_id; char name[NAME_LENGTH]; unsigned short class_; unsigned short map; unsigned short lv; unsigned leader : 1, online : 1; }; struct party { int party_id; char name[NAME_LENGTH]; unsigned char count; //Count of online characters. unsigned exp : 1, item : 2; //&1: Party-Share (round-robin), &2: pickup style: shared. struct party_member member[MAX_PARTY]; }; struct map_session_data; struct guild_member { uint32 account_id, char_id; short hair,hair_color,gender,class_,lv; uint64 exp; int exp_payper; short online,position; char name[NAME_LENGTH]; struct map_session_data *sd; unsigned char modified; uint32 last_login; }; struct guild_position { char name[NAME_LENGTH]; int mode; int exp_mode; unsigned char modified; }; struct guild_alliance { int opposition; int guild_id; char name[NAME_LENGTH]; }; struct guild_expulsion { char name[NAME_LENGTH]; char mes[40]; uint32 account_id; }; struct guild_skill { int id,lv; }; struct Channel; struct guild { int guild_id; short guild_lv, connect_member, max_member, average_lv; uint64 exp; unsigned int next_exp; int skill_point; char name[NAME_LENGTH],master[NAME_LENGTH]; struct guild_member member[MAX_GUILD]; struct guild_position position[MAX_GUILDPOSITION]; char mes1[MAX_GUILDMES1],mes2[MAX_GUILDMES2]; int emblem_len,emblem_id; char emblem_data[2048]; struct guild_alliance alliance[MAX_GUILDALLIANCE]; struct guild_expulsion expulsion[MAX_GUILDEXPULSION]; struct guild_skill skill[MAX_GUILDSKILL]; struct Channel *channel; unsigned short instance_id; time_t last_leader_change; /* Used by char-server to save events for guilds */ unsigned short save_flag; }; struct guild_castle { int castle_id; int mapindex; char castle_name[NAME_LENGTH]; char castle_event[EVENT_NAME_LENGTH]; int guild_id; int economy; int defense; int triggerE; int triggerD; int nextTime; int payTime; int createTime; int visibleC; struct { unsigned visible : 1; int id; // object id } guardian[MAX_GUARDIANS]; int* temp_guardians; // ids of temporary guardians (mobs) int temp_guardians_max; }; struct fame_list { int id; int fame; char name[NAME_LENGTH]; }; enum e_guild_info { //Change Guild Infos GBI_EXP =1, // Guild Experience (EXP) GBI_GUILDLV, // Guild level GBI_SKILLPOINT, // Guild skillpoints GBI_SKILLLV, // Guild skill_lv ?? seem unused }; enum e_guild_member_info { //Change Member Infos GMI_POSITION =0, GMI_EXP, GMI_HAIR, GMI_HAIR_COLOR, GMI_GENDER, GMI_CLASS, GMI_LEVEL, }; enum e_guild_skill { GD_SKILLBASE=10000, GD_APPROVAL=10000, GD_KAFRACONTRACT=10001, GD_GUARDRESEARCH=10002, GD_GUARDUP=10003, GD_EXTENSION=10004, GD_GLORYGUILD=10005, GD_LEADERSHIP=10006, GD_GLORYWOUNDS=10007, GD_SOULCOLD=10008, GD_HAWKEYES=10009, GD_BATTLEORDER=10010, GD_REGENERATION=10011, GD_RESTORE=10012, GD_EMERGENCYCALL=10013, GD_DEVELOPMENT=10014, GD_ITEMEMERGENCYCALL=10015, GD_MAX, }; #define MAX_SKILL_ID GD_MAX //These mark the ID of the jobs, as expected by the client. [Skotlex] enum e_job { JOB_NOVICE, JOB_SWORDMAN, JOB_MAGE, JOB_ARCHER, JOB_ACOLYTE, JOB_MERCHANT, JOB_THIEF, JOB_KNIGHT, JOB_PRIEST, JOB_WIZARD, JOB_BLACKSMITH, JOB_HUNTER, JOB_ASSASSIN, JOB_KNIGHT2, JOB_CRUSADER, JOB_MONK, JOB_SAGE, JOB_ROGUE, JOB_ALCHEMIST, JOB_BARD, JOB_DANCER, JOB_CRUSADER2, JOB_WEDDING, JOB_SUPER_NOVICE, JOB_GUNSLINGER, JOB_NINJA, JOB_XMAS, JOB_SUMMER, JOB_HANBOK, JOB_OKTOBERFEST, JOB_MAX_BASIC, JOB_NOVICE_HIGH = 4001, JOB_SWORDMAN_HIGH, JOB_MAGE_HIGH, JOB_ARCHER_HIGH, JOB_ACOLYTE_HIGH, JOB_MERCHANT_HIGH, JOB_THIEF_HIGH, JOB_LORD_KNIGHT, JOB_HIGH_PRIEST, JOB_HIGH_WIZARD, JOB_WHITESMITH, JOB_SNIPER, JOB_ASSASSIN_CROSS, JOB_LORD_KNIGHT2, JOB_PALADIN, JOB_CHAMPION, JOB_PROFESSOR, JOB_STALKER, JOB_CREATOR, JOB_CLOWN, JOB_GYPSY, JOB_PALADIN2, JOB_BABY, JOB_BABY_SWORDMAN, JOB_BABY_MAGE, JOB_BABY_ARCHER, JOB_BABY_ACOLYTE, JOB_BABY_MERCHANT, JOB_BABY_THIEF, JOB_BABY_KNIGHT, JOB_BABY_PRIEST, JOB_BABY_WIZARD, JOB_BABY_BLACKSMITH, JOB_BABY_HUNTER, JOB_BABY_ASSASSIN, JOB_BABY_KNIGHT2, JOB_BABY_CRUSADER, JOB_BABY_MONK, JOB_BABY_SAGE, JOB_BABY_ROGUE, JOB_BABY_ALCHEMIST, JOB_BABY_BARD, JOB_BABY_DANCER, JOB_BABY_CRUSADER2, JOB_SUPER_BABY, JOB_TAEKWON, JOB_STAR_GLADIATOR, JOB_STAR_GLADIATOR2, JOB_SOUL_LINKER, JOB_GANGSI, JOB_DEATH_KNIGHT, JOB_DARK_COLLECTOR, JOB_RUNE_KNIGHT = 4054, JOB_WARLOCK, JOB_RANGER, JOB_ARCH_BISHOP, JOB_MECHANIC, JOB_GUILLOTINE_CROSS, JOB_RUNE_KNIGHT_T, JOB_WARLOCK_T, JOB_RANGER_T, JOB_ARCH_BISHOP_T, JOB_MECHANIC_T, JOB_GUILLOTINE_CROSS_T, JOB_ROYAL_GUARD, JOB_SORCERER, JOB_MINSTREL, JOB_WANDERER, JOB_SURA, JOB_GENETIC, JOB_SHADOW_CHASER, JOB_ROYAL_GUARD_T, JOB_SORCERER_T, JOB_MINSTREL_T, JOB_WANDERER_T, JOB_SURA_T, JOB_GENETIC_T, JOB_SHADOW_CHASER_T, JOB_RUNE_KNIGHT2, JOB_RUNE_KNIGHT_T2, JOB_ROYAL_GUARD2, JOB_ROYAL_GUARD_T2, JOB_RANGER2, JOB_RANGER_T2, JOB_MECHANIC2, JOB_MECHANIC_T2, JOB_BABY_RUNE = 4096, JOB_BABY_WARLOCK, JOB_BABY_RANGER, JOB_BABY_BISHOP, JOB_BABY_MECHANIC, JOB_BABY_CROSS, JOB_BABY_GUARD, JOB_BABY_SORCERER, JOB_BABY_MINSTREL, JOB_BABY_WANDERER, JOB_BABY_SURA, JOB_BABY_GENETIC, JOB_BABY_CHASER, JOB_BABY_RUNE2, JOB_BABY_GUARD2, JOB_BABY_RANGER2, JOB_BABY_MECHANIC2, JOB_SUPER_NOVICE_E = 4190, JOB_SUPER_BABY_E, JOB_KAGEROU = 4211, JOB_OBORO, JOB_REBELLION = 4215, JOB_SUMMONER = 4218, JOB_BABY_SUMMONER = 4220, JOB_BABY_NINJA = 4222, JOB_BABY_KAGEROU, JOB_BABY_OBORO, JOB_BABY_TAEKWON, JOB_BABY_STAR_GLADIATOR, JOB_BABY_SOUL_LINKER, JOB_BABY_GUNSLINGER, JOB_BABY_REBELLION, JOB_BABY_STAR_GLADIATOR2 = 4238, JOB_MAX, }; enum e_sex { SEX_FEMALE = 0, SEX_MALE, SEX_SERVER, SEX_ACCOUNT = 99 }; /// Item Bound Type enum bound_type { BOUND_NONE = 0, /// No bound BOUND_ACCOUNT, /// 1- Account Bound BOUND_GUILD, /// 2 - Guild Bound BOUND_PARTY, /// 3 - Party Bound BOUND_CHAR, /// 4 - Character Bound BOUND_MAX, BOUND_ONEQUIP = 1, ///< Show notification when item will be bound on equip BOUND_DISPYELLOW = 2, /// Shows the item name in yellow color }; enum e_pc_reg_loading { PRL_NONE = 0x0, PRL_CHAR = 0x1, PRL_ACCL = 0x2, // local PRL_ACCG = 0x4, // global PRL_ALL = 0xFF, }; enum e_party_member_withdraw { PARTY_MEMBER_WITHDRAW_LEAVE, ///< /leave PARTY_MEMBER_WITHDRAW_EXPEL, ///< Kicked PARTY_MEMBER_WITHDRAW_CANT_LEAVE, ///< TODO: Cannot /leave PARTY_MEMBER_WITHDRAW_CANT_EXPEL, ///< TODO: Cannot be kicked }; enum e_rank { RANK_BLACKSMITH = 0, RANK_ALCHEMIST = 1, RANK_TAEKWON = 2, RANK_KILLER = 3 }; struct clan_alliance { int opposition; int clan_id; char name[NAME_LENGTH]; }; struct clan{ int id; char name[NAME_LENGTH]; char master[NAME_LENGTH]; char map[MAP_NAME_LENGTH_EXT]; short max_member, connect_member; struct map_session_data *members[MAX_CLAN]; struct clan_alliance alliance[MAX_CLANALLIANCE]; unsigned short instance_id; }; // Sanity checks... #if MAX_ZENY > INT_MAX #error MAX_ZENY is too big #endif // This sanity check is required, because some other places(like skill.c) rely on this #if MAX_PARTY < 2 #error MAX_PARTY is too small, you need at least 2 players for a party #endif #ifndef VIP_ENABLE #define MIN_STORAGE MAX_STORAGE // If the VIP system is disabled the min = max. #define MIN_CHARS MAX_CHARS // Default number of characters per account. #define MAX_CHAR_BILLING 0 #define MAX_CHAR_VIP 0 #endif #if (MIN_CHARS + MAX_CHAR_VIP + MAX_CHAR_BILLING) > MAX_CHARS #error Config of MAX_CHARS is invalid #endif #if MIN_STORAGE > MAX_STORAGE #error Config of MIN_STORAGE is invalid #endif #ifdef PACKET_OBFUSCATION #if PACKETVER < 20110817 #undef PACKET_OBFUSCATION #endif #endif /* Feb 1st 2012 */ #if PACKETVER >= 20120201 #define NEW_CARTS #ifndef ENABLE_SC_SAVING #warning "Cart won't be able to be saved for relog" #endif #if PACKETVER >= 20150826 #define MAX_CARTS 12 // used for 3 new cart design #else #define MAX_CARTS 9 #endif #else #define MAX_CARTS 5 #endif #endif /* _MMO_H_ */ Help please if you can