From 85ae075fd230f7e1d08a84dde6a2cfdce8280ecd Mon Sep 17 00:00:00 2001 From: glighta Date: Thu, 1 Nov 2012 01:40:29 +0000 Subject: -Fix bugreport:6547 (bloodylust) upd bloodylust effect to berserk -Fix bugreport:6208, bugreport:6805 (chaos panic) fix range effect -Partial Fix bugreport:5275 (toxin now won't interupt unbreackable castskill) -Folllow up r16847 fix UNT_ZEPHYR get some unwanted bonus, fix Insignia unit range -Add UF_RANGEDSINGLEUNIT unit propriety thx to 3ceam, workaround to fix ranged unit without timer. -Prevent WM_SOUND_OF_DESTRUCTION, SC_MANHOLE, WM_LULLABY_DEEPSLEEP being cast in non pvp map -Fix SC_MAGICMUSHROOM shouldn't force skill if sit -Replace some hardcoded mobid by enum -add some mob_is definition for quicker search (gvg and treasure) -Remove some duplicate check for status_heal (if berserk already done in status heal) -Upd few documentation git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16855 54d463be-8e91-2dee-dedb-b68131a5f0ec --- db/re/skill_cast_db.txt | 4 +- db/re/skill_unit_db.txt | 13 +- src/map/atcommand.c | 514 ++++++++++++++++++++--------------------- src/map/battle.c | 334 +++++++++++++-------------- src/map/clif.c | 449 ++++++++++++++++++------------------ src/map/map.c | 189 ++++++++-------- src/map/map.h | 34 ++- src/map/mob.c | 322 +++++++++++++------------- src/map/mob.h | 10 +- src/map/pc.c | 344 ++++++++++++++-------------- src/map/pc.h | 1 + src/map/skill.c | 592 +++++++++++++++++++++++++----------------------- src/map/skill.h | 1 + src/map/status.c | 555 +++++++++++++++++++++++---------------------- 14 files changed, 1717 insertions(+), 1645 deletions(-) diff --git a/db/re/skill_cast_db.txt b/db/re/skill_cast_db.txt index 4366817c7..1b69feab3 100644 --- a/db/re/skill_cast_db.txt +++ b/db/re/skill_cast_db.txt @@ -1368,8 +1368,8 @@ 2301,2000,2000,0,5000:10000:15000,4000:8000:12000,0,-1 //-- SC_MAELSTROM 2302,2000,2000,0,7000:14000:21000,0,0,-1 -//-- SC_BLOODYLUST -2303,2000,2000,0,10000:20000:30000,30000,0,-1 +//-- SC_BLOODYLUST //dur2=intr +2303,2000,2000,0,10000:20000:30000,0,0,-1 //-- SC_FEINTBOMB 2304,1000,0,0,1000,0,5000,-1 //========================================== diff --git a/db/re/skill_unit_db.txt b/db/re/skill_unit_db.txt index 511a60f4d..3b7d9c26c 100644 --- a/db/re/skill_unit_db.txt +++ b/db/re/skill_unit_db.txt @@ -15,6 +15,7 @@ // 0x200(UF_ENSEMBLE) Ensemble skill // 0x400(UF_SONG) Song skill // 0x800(UF_DUALMODE) Spell has effects both at an interval and when you step in/out +// 0x2000(UF_RANGEDSINGLEUNIT) Layout hack, use layout range propriety but only display center. // Example: 0x006 = 0x002+0x004 -> Cannot be stacked nor cast near targets // // Notes: @@ -121,9 +122,9 @@ 2299,0xcc, , 0, 1,1000,all, 0x006 //SC_MANHOLE 2300,0xcd, , 0, 1,1000,all, 0x006 //SC_DIMENSIONDOOR -2301,0xce, , 0, 2, -1,enemy, 0x00E //SC_CHAOSPANIC +2301,0xce, , 2, 0, -1,enemy, 0x200E //SC_CHAOSPANIC 2302,0xcf, , 0, 2, -1,enemy, 0x002 //SC_MAELSTROM -2303,0xd0, , 0, 2, -1,enemy, 0x018 //SC_BLOODYLUST +2303,0xd0, , 3, 0, -1,all, 0x2018 //SC_BLOODYLUST 2304,0xd1, , 0, 2, -1,enemy, 0x000 //SC_FEINTBOMB 2319,0xec, , 0, 3,5000,all, 0x000 //LG_BANDING @@ -140,10 +141,10 @@ 2450,0xe0, , 3, 0, 500,enemy, 0x010 //SO_CLOUD_KILL 2452,0xe4, , 0, 3,3000,all, 0x010 //SO_WARMER 2453,0xeb, , 0, 1:1:2:2:3,1000,enemy,0x010 //SO_VACUUM_EXTREME -2465,0xf1, , 0, 2,1000,all, 0x010 //SO_FIRE_INSIGNIA -2466,0xf2, , 0, 2,1000,all, 0x010 //SO_WATER_INSIGNIA -2467,0xf3, , 0, 2,1000,all, 0x010 //SO_WIND_INSIGNIA -2468,0xf4, , 0, 2,1000,all, 0x010 //SO_EARTH_INSIGNIA +2465,0xf1, , 0, 1,1000,all, 0x010 //SO_FIRE_INSIGNIA +2466,0xf2, , 0, 1,1000,all, 0x010 //SO_WATER_INSIGNIA +2467,0xf3, , 0, 1,1000,all, 0x010 //SO_WIND_INSIGNIA +2468,0xf4, , 0, 1,1000,all, 0x010 //SO_EARTH_INSIGNIA 2479,0xe5, , 0, 1,1000,enemy, 0x000 //GN_THORNS_TRAP 2482,0xe6,0x7f, -1, 1, -1,all, 0x000 //GN_WALLOFTHORN diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 0d92ef156..75afd4a46 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -61,7 +61,7 @@ typedef struct AliasInfo AliasInfo; int atcmd_binding_count = 0; struct AtCommandInfo { - char command[ATCOMMAND_LENGTH]; + char command[ATCOMMAND_LENGTH]; AtCommandFunc func; char* at_groups;/* quick @commands "can-use" lookup */ char* char_groups;/* quick @charcommands "can-use" lookup */ @@ -91,12 +91,12 @@ static void atcommand_get_suggestions(struct map_session_data* sd, const char *n // @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, strcmp(atcmd_binding[i]->command, name) == 0 ); - + return ( i < atcmd_binding_count ) ? atcmd_binding[i] : NULL; } @@ -193,7 +193,7 @@ static const char* atcommand_help_string(const char* command) {// 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; @@ -454,7 +454,7 @@ ACMD_FUNC(mapmove) if (!message || !*message || (sscanf(message, "%15s %hd %hd", map_name, &x, &y) < 3 && sscanf(message, "%15[^,],%hd,%hd", map_name, &x, &y) < 1)) { - + clif_displaymessage(fd, msg_txt(909)); // Please enter a map (usage: @warp/@rura/@mapmove ). return -1; } @@ -462,7 +462,7 @@ ACMD_FUNC(mapmove) 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(1)); // Map not found. return -1; @@ -540,13 +540,13 @@ ACMD_FUNC(jumpto) clif_displaymessage(fd, msg_txt(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(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(248)); // You are not authorized to warp from your current map. @@ -768,10 +768,10 @@ ACMD_FUNC(whogm) 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 = guild_search(pl_sd->status.guild_id); - + sprintf(atcmd_output,msg_txt(916), // Party: '%s' | Guild: '%s' p?p->party.name:msg_txt(917), g?g->name:msg_txt(917)); // None. @@ -804,7 +804,7 @@ ACMD_FUNC(save) intif_save_petdata(sd->status.account_id, &sd->pd->pet); chrif_save(sd,0); - + clif_displaymessage(fd, msg_txt(6)); // Your save point has been changed. return 0; @@ -864,7 +864,7 @@ ACMD_FUNC(speed) 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; @@ -873,9 +873,9 @@ ACMD_FUNC(storage) clif_displaymessage(fd, msg_txt(250)); return -1; } - + clif_displaymessage(fd, msg_txt(919)); // Storage opened. - + return 0; } @@ -939,7 +939,7 @@ ACMD_FUNC(option) sd->sc.opt1 = param1; sd->sc.opt2 = param2; pc_setoption(sd, param3); - + clif_displaymessage(fd, msg_txt(9)); // Options changed. return 0; @@ -1226,7 +1226,7 @@ ACMD_FUNC(kami) clif_displaymessage(fd, msg_txt(981)); // Please enter color and message (usage: @kamic ). return -1; } - + if(color > 0xFFFFFF) { clif_displaymessage(fd, msg_txt(982)); // Invalid color. return -1; @@ -1511,7 +1511,7 @@ ACMD_FUNC(joblevelup) { int level=0; nullpo_retr(-1, sd); - + level = atoi(message); if (!message || !*message || !level) { @@ -1588,7 +1588,7 @@ ACMD_FUNC(help) atcommand_get_suggestions(sd, command_name, true); return -1; } - + if (!config_setting_lookup_string(help, command_name, &text)) { sprintf(atcmd_output, msg_txt(988), atcommand_symbol, command_name); // There is no help for %c%s. clif_displaymessage(fd, atcmd_output); @@ -1723,7 +1723,7 @@ ACMD_FUNC(gvgoff) clif_displaymessage(fd, msg_txt(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); @@ -1743,7 +1743,7 @@ ACMD_FUNC(gvgon) clif_displaymessage(fd, msg_txt(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(34)); // GvG: On. @@ -1873,7 +1873,7 @@ ACMD_FUNC(go) int town; char map_name[MAP_NAME_LENGTH]; int m; - + const struct { char map[MAP_NAME_LENGTH]; int x, y; @@ -1919,20 +1919,20 @@ ACMD_FUNC(go) { MAP_MALAYA, 242, 211 }, // 34=Malaya Port { MAP_ECLAGE, 110, 39 }, // 35=Eclage }; - + 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(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; @@ -1946,7 +1946,7 @@ ACMD_FUNC(go) {// send the text to the client clif_displaymessage( fd, text ); } - + return -1; } @@ -2060,7 +2060,7 @@ ACMD_FUNC(go) clif_displaymessage(fd, msg_txt(38)); // Invalid location number or name. return -1; } - + return 0; } @@ -2165,13 +2165,13 @@ 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 @@ -2323,9 +2323,9 @@ ACMD_FUNC(produce) clif_displaymessage(fd, msg_txt(170)); //This item is not an equipment. return -1; } - + item_id = item_data->nameid; - + if (itemdb_isequip2(item_data)) { if (attribute < MIN_ATTRIBUTE || attribute > MAX_ATTRIBUTE) attribute = ATTRIBUTE_NORMAL; @@ -2378,7 +2378,7 @@ ACMD_FUNC(memo) } return 0; } - + if( position < 0 || position >= MAX_MEMOPOINTS ) { sprintf(atcmd_output, msg_txt(1008), 0, MAX_MEMOPOINTS-1); // Please enter a valid position (usage: @memo ). @@ -2422,7 +2422,7 @@ ACMD_FUNC(displaystatus) { int i, type, flag, tick, val1 = 0, val2 = 0, val3 = 0; nullpo_retr(-1, sd); - + if (!message || !*message || (i = sscanf(message, "%d %d %d %d %d %d", &type, &flag, &tick, &val1, &val2, &val3)) < 1) { clif_displaymessage(fd, msg_txt(1009)); // Please enter a status type/flag (usage: @displaystatus { { {}}}). return -1; @@ -2576,7 +2576,7 @@ ACMD_FUNC(param) short* 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, "%d", &value) < 1 || value == 0) { @@ -2637,7 +2637,7 @@ ACMD_FUNC(stat_all) short* status[6]; //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; @@ -2664,7 +2664,7 @@ ACMD_FUNC(stat_all) new_value = 1; else new_value = *status[index] +value; - + if (new_value != (int)*status[index]) { *status[index] = new_value; clif_updatestatus(sd, SP_STR + index); @@ -2803,13 +2803,13 @@ ACMD_FUNC(petfriendly) clif_displaymessage(fd, msg_txt(184)); // Sorry, but you have no pet. return -1; } - + if (friendly < 0 || friendly > 1000) { clif_displaymessage(fd, msg_txt(37)); // An invalid number was specified. return -1; } - + if (friendly == pd->pet.intimate) { clif_displaymessage(fd, msg_txt(183)); // Pet intimacy is already at maximum. return -1; @@ -2905,7 +2905,7 @@ ACMD_FUNC(recall) { clif_displaymessage(fd, msg_txt(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(1019)); // You are not authorized to warp someone to this map. return -1; @@ -3173,9 +3173,9 @@ ACMD_FUNC(doommap) * *------------------------------------------*/ 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(63)); // Mercy has been shown. } @@ -3187,7 +3187,7 @@ ACMD_FUNC(raise) { struct map_session_data* pl_sd; struct s_mapiterator* iter; - + nullpo_retr(-1, sd); iter = mapit_getallusers(); @@ -3248,9 +3248,9 @@ ACMD_FUNC(kick) clif_displaymessage(fd, msg_txt(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; } @@ -3350,7 +3350,7 @@ ACMD_FUNC(lostskill) // 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(1027)); // Please enter a quest skill number. @@ -3390,9 +3390,9 @@ ACMD_FUNC(spiritball) int max_spiritballs; int number; nullpo_retr(-1, sd); - + max_spiritballs = min(ARRAYLENGTH(sd->spirit_timer), 0x7FFF); - + if( !message || !*message || (number = atoi(message)) < 0 || number > max_spiritballs ) { char msg[CHAT_SIZE_MAX]; @@ -3791,16 +3791,16 @@ ACMD_FUNC(reloadatcommand) { clif_displaymessage(fd, msg_txt(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(1037)); // Error reading atcommand_athena.conf, reload failed. return -1; } config_destroy(&run_test); - + atcommand_doload(); pc_groups_reload(); clif_displaymessage(fd, msg_txt(254)); @@ -3946,7 +3946,7 @@ ACMD_FUNC(mapinfo) return -1; } m_index = mapindex_name2id(mapname); //This one shouldn't fail since the previous seek did not. - + clif_displaymessage(fd, msg_txt(1039)); // ------ Map Info ------ // count chats (for initial message) @@ -3967,49 +3967,49 @@ ACMD_FUNC(mapinfo) clif_displaymessage(fd, msg_txt(1043)); // Autotrade Enabled else clif_displaymessage(fd, msg_txt(1044)); // Autotrade Disabled - + if (map[m_id].flag.battleground) clif_displaymessage(fd, msg_txt(1045)); // Battlegrounds ON - - strcpy(atcmd_output,msg_txt(1046)); // PvP Flags: + + strcpy(atcmd_output,msg_txt(1046)); // PvP Flags: if (map[m_id].flag.pvp) - strcat(atcmd_output, msg_txt(1047)); // Pvp ON | + strcat(atcmd_output, msg_txt(1047)); // Pvp ON | if (map[m_id].flag.pvp_noguild) - strcat(atcmd_output, msg_txt(1048)); // NoGuild | + strcat(atcmd_output, msg_txt(1048)); // NoGuild | if (map[m_id].flag.pvp_noparty) - strcat(atcmd_output, msg_txt(1049)); // NoParty | + strcat(atcmd_output, msg_txt(1049)); // NoParty | if (map[m_id].flag.pvp_nightmaredrop) - strcat(atcmd_output, msg_txt(1050)); // NightmareDrop | + strcat(atcmd_output, msg_txt(1050)); // NightmareDrop | if (map[m_id].flag.pvp_nocalcrank) - strcat(atcmd_output, msg_txt(1051)); // NoCalcRank | + strcat(atcmd_output, msg_txt(1051)); // NoCalcRank | clif_displaymessage(fd, atcmd_output); - strcpy(atcmd_output,msg_txt(1052)); // GvG Flags: + strcpy(atcmd_output,msg_txt(1052)); // GvG Flags: if (map[m_id].flag.gvg) - strcat(atcmd_output, msg_txt(1053)); // GvG ON | + strcat(atcmd_output, msg_txt(1053)); // GvG ON | if (map[m_id].flag.gvg_dungeon) - strcat(atcmd_output, msg_txt(1054)); // GvG Dungeon | + strcat(atcmd_output, msg_txt(1054)); // GvG Dungeon | if (map[m_id].flag.gvg_castle) - strcat(atcmd_output, msg_txt(1055)); // GvG Castle | + strcat(atcmd_output, msg_txt(1055)); // GvG Castle | if (map[m_id].flag.gvg_noparty) - strcat(atcmd_output, msg_txt(1056)); // NoParty | + strcat(atcmd_output, msg_txt(1056)); // NoParty | clif_displaymessage(fd, atcmd_output); - strcpy(atcmd_output,msg_txt(1057)); // Teleport Flags: + strcpy(atcmd_output,msg_txt(1057)); // Teleport Flags: if (map[m_id].flag.noteleport) - strcat(atcmd_output, msg_txt(1058)); // NoTeleport | + strcat(atcmd_output, msg_txt(1058)); // NoTeleport | if (map[m_id].flag.monster_noteleport) - strcat(atcmd_output, msg_txt(1059)); // Monster NoTeleport | + strcat(atcmd_output, msg_txt(1059)); // Monster NoTeleport | if (map[m_id].flag.nowarp) - strcat(atcmd_output, msg_txt(1060)); // NoWarp | + strcat(atcmd_output, msg_txt(1060)); // NoWarp | if (map[m_id].flag.nowarpto) - strcat(atcmd_output, msg_txt(1061)); // NoWarpTo | + strcat(atcmd_output, msg_txt(1061)); // NoWarpTo | if (map[m_id].flag.noreturn) - strcat(atcmd_output, msg_txt(1062)); // NoReturn | + strcat(atcmd_output, msg_txt(1062)); // NoReturn | if (map[m_id].flag.nogo) - strcat(atcmd_output, msg_txt(1063)); // NoGo | + strcat(atcmd_output, msg_txt(1063)); // NoGo | if (map[m_id].flag.nomemo) - strcat(atcmd_output, msg_txt(1064)); // NoMemo | + strcat(atcmd_output, msg_txt(1064)); // NoMemo | clif_displaymessage(fd, atcmd_output); sprintf(atcmd_output, msg_txt(1065), // No Exp Penalty: %s | No Zeny Penalty: %s @@ -4030,64 +4030,64 @@ ACMD_FUNC(mapinfo) } } - strcpy(atcmd_output,msg_txt(1071)); // Weather Flags: + strcpy(atcmd_output,msg_txt(1071)); // Weather Flags: if (map[m_id].flag.snow) - strcat(atcmd_output, msg_txt(1072)); // Snow | + strcat(atcmd_output, msg_txt(1072)); // Snow | if (map[m_id].flag.fog) - strcat(atcmd_output, msg_txt(1073)); // Fog | + strcat(atcmd_output, msg_txt(1073)); // Fog | if (map[m_id].flag.sakura) - strcat(atcmd_output, msg_txt(1074)); // Sakura | + strcat(atcmd_output, msg_txt(1074)); // Sakura | if (map[m_id].flag.clouds) - strcat(atcmd_output, msg_txt(1075)); // Clouds | + strcat(atcmd_output, msg_txt(1075)); // Clouds | if (map[m_id].flag.clouds2) - strcat(atcmd_output, msg_txt(1076)); // Clouds2 | + strcat(atcmd_output, msg_txt(1076)); // Clouds2 | if (map[m_id].flag.fireworks) - strcat(atcmd_output, msg_txt(1077)); // Fireworks | + strcat(atcmd_output, msg_txt(1077)); // Fireworks | if (map[m_id].flag.leaves) - strcat(atcmd_output, msg_txt(1078)); // Leaves | + strcat(atcmd_output, msg_txt(1078)); // Leaves | /** * No longer available, keeping here just in case it's back someday. [Ind] **/ //if (map[m_id].flag.rain) - // strcat(atcmd_output, msg_txt(1079)); // Rain | + // strcat(atcmd_output, msg_txt(1079)); // Rain | if (map[m_id].flag.nightenabled) - strcat(atcmd_output, msg_txt(1080)); // Displays Night | + strcat(atcmd_output, msg_txt(1080)); // Displays Night | clif_displaymessage(fd, atcmd_output); - strcpy(atcmd_output,msg_txt(1081)); // Other Flags: + strcpy(atcmd_output,msg_txt(1081)); // Other Flags: if (map[m_id].flag.nobranch) - strcat(atcmd_output, msg_txt(1082)); // NoBranch | + strcat(atcmd_output, msg_txt(1082)); // NoBranch | if (map[m_id].flag.notrade) - strcat(atcmd_output, msg_txt(1083)); // NoTrade | + strcat(atcmd_output, msg_txt(1083)); // NoTrade | if (map[m_id].flag.novending) - strcat(atcmd_output, msg_txt(1084)); // NoVending | + strcat(atcmd_output, msg_txt(1084)); // NoVending | if (map[m_id].flag.nodrop) - strcat(atcmd_output, msg_txt(1085)); // NoDrop | + strcat(atcmd_output, msg_txt(1085)); // NoDrop | if (map[m_id].flag.noskill) - strcat(atcmd_output, msg_txt(1086)); // NoSkill | + strcat(atcmd_output, msg_txt(1086)); // NoSkill | if (map[m_id].flag.noicewall) - strcat(atcmd_output, msg_txt(1087)); // NoIcewall | + strcat(atcmd_output, msg_txt(1087)); // NoIcewall | if (map[m_id].flag.allowks) - strcat(atcmd_output, msg_txt(1088)); // AllowKS | + strcat(atcmd_output, msg_txt(1088)); // AllowKS | if (map[m_id].flag.reset) - strcat(atcmd_output, msg_txt(1089)); // Reset | + strcat(atcmd_output, msg_txt(1089)); // Reset | clif_displaymessage(fd, atcmd_output); - strcpy(atcmd_output,msg_txt(1090)); // Other Flags: + strcpy(atcmd_output,msg_txt(1090)); // Other Flags: if (map[m_id].nocommand) - strcat(atcmd_output, msg_txt(1091)); // NoCommand | + strcat(atcmd_output, msg_txt(1091)); // NoCommand | if (map[m_id].flag.nobaseexp) - strcat(atcmd_output, msg_txt(1092)); // NoBaseEXP | + strcat(atcmd_output, msg_txt(1092)); // NoBaseEXP | if (map[m_id].flag.nojobexp) - strcat(atcmd_output, msg_txt(1093)); // NoJobEXP | + strcat(atcmd_output, msg_txt(1093)); // NoJobEXP | if (map[m_id].flag.nomobloot) - strcat(atcmd_output, msg_txt(1094)); // NoMobLoot | + strcat(atcmd_output, msg_txt(1094)); // NoMobLoot | if (map[m_id].flag.nomvploot) - strcat(atcmd_output, msg_txt(1095)); // NoMVPLoot | + strcat(atcmd_output, msg_txt(1095)); // NoMVPLoot | if (map[m_id].flag.partylock) - strcat(atcmd_output, msg_txt(1096)); // PartyLock | + strcat(atcmd_output, msg_txt(1096)); // PartyLock | if (map[m_id].flag.guildlock) - strcat(atcmd_output, msg_txt(1097)); // GuildLock | + strcat(atcmd_output, msg_txt(1097)); // GuildLock | clif_displaymessage(fd, atcmd_output); switch (list) { @@ -4803,7 +4803,7 @@ ACMD_FUNC(jailfor) } //Added by Coltaro - if(pl_sd->sc.data[SC_JAILED] && + 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; @@ -4847,7 +4847,7 @@ ACMD_FUNC(jailtime) int year, month, day, hour, minute; nullpo_retr(-1, sd); - + if (!sd->sc.data[SC_JAILED]) { clif_displaymessage(fd, msg_txt(1139)); // You are not in jail. return -1; @@ -5043,9 +5043,9 @@ ACMD_FUNC(undisguiseguild) 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(1147)); // Please enter guild name/ID (usage: @undisguiseguild ). return -1; @@ -5055,7 +5055,7 @@ ACMD_FUNC(undisguiseguild) clif_displaymessage(fd, msg_txt(94)); // Incorrect name/ID, or no one from the guild is online. return -1; } - + for(i = 0; i < g->max_member; i++) if( (pl_sd = g->member[i].sd) && pl_sd->disguise ) pc_disguise(pl_sd, 0); @@ -5074,15 +5074,15 @@ ACMD_FUNC(exp) 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(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; @@ -5271,7 +5271,7 @@ ACMD_FUNC(npcmove) clif_displaymessage(fd, msg_txt(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_foreachinrange(clif_outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl); @@ -5334,7 +5334,7 @@ ACMD_FUNC(follow) clif_displaymessage(fd, msg_txt(1159)); // Follow mode OFF. return 0; } - + if ( (pl_sd = map_nick2sd((char *)message)) == NULL ) { clif_displaymessage(fd, msg_txt(3)); // Character not found. @@ -5348,7 +5348,7 @@ ACMD_FUNC(follow) pc_follow(sd, pl_sd->bl.id); clif_displaymessage(fd, msg_txt(1160)); // Follow mode ON. } - + return 0; } @@ -5464,7 +5464,7 @@ ACMD_FUNC(useskill) bl = &sd->hd->bl; else bl = &sd->bl; - + if (skill_get_inf(skillnum)&INF_GROUND_SKILL) unit_skilluse_pos(bl, pl_sd->bl.x, pl_sd->bl.y, skillnum, skilllv); else @@ -5583,9 +5583,9 @@ ACMD_FUNC(marry) { struct map_session_data *pl_sd = NULL; char player_name[NAME_LENGTH] = ""; - + nullpo_retr(-1, sd); - + if (!message || !*message || sscanf(message, "%23s", player_name) != 1) { clif_displaymessage(fd, msg_txt(1172)); // Usage: @marry return -1; @@ -5621,7 +5621,7 @@ ACMD_FUNC(divorce) clif_displaymessage(fd, atcmd_output); return -1; } - + sprintf(atcmd_output, msg_txt(1176), sd->status.name); // '%s' and his/her partner are now divorced. clif_displaymessage(fd, atcmd_output); return 0; @@ -5634,7 +5634,7 @@ ACMD_FUNC(changelook) { int i, j = 0, k = 0; int pos[7] = { LOOK_HEAD_TOP,LOOK_HEAD_MID,LOOK_HEAD_BOTTOM,LOOK_WEAPON,LOOK_SHIELD,LOOK_SHOES,LOOK_ROBE }; - + if((i = sscanf(message, "%d %d", &j, &k)) < 1) { clif_displaymessage(fd, msg_txt(1177)); // Usage: @changelook {} clif_displaymessage(fd, msg_txt(1178)); // Position: 1-Top 2-Middle 3-Bottom 4-Weapon 5-Shield 6-Shoes 7-Robe @@ -5660,7 +5660,7 @@ ACMD_FUNC(changelook) ACMD_FUNC(autotrade) { nullpo_retr(-1, sd); - + if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) { clif_displaymessage(fd, msg_txt(1179)); // Autotrade is not allowed on this map. return -1; @@ -5670,12 +5670,12 @@ ACMD_FUNC(autotrade) clif_displaymessage(fd, msg_txt(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(549)); // "You should have a shop open to use @autotrade." return -1; } - + sd->state.autotrade = 1; if( battle_config.at_timeout ) { @@ -5683,7 +5683,7 @@ ACMD_FUNC(autotrade) status_change_start(&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } clif_authfail_fd(fd, 15); - + return 0; } @@ -5711,7 +5711,7 @@ ACMD_FUNC(changegm) clif_displaymessage(fd, msg_txt(1183)); // Usage: @changegm return -1; } - + if((pl_sd=map_nick2sd((char *) message)) == NULL || pl_sd->status.guild_id != sd->status.guild_id) { clif_displaymessage(fd, msg_txt(1184)); // Target character must be online and be a guild member. return -1; @@ -5728,7 +5728,7 @@ ACMD_FUNC(changegm) ACMD_FUNC(changeleader) { nullpo_retr(-1, sd); - + if( !message[0] ) { clif_displaymessage(fd, msg_txt(1185)); // Usage: @changeleader @@ -5772,7 +5772,7 @@ ACMD_FUNC(partyoption) clif_displaymessage(fd, msg_txt(1186)); // Usage: @partyoption return -1; } - + option = (config_switch(w1)?1:0)|(config_switch(w2)?2:0); //Change item share type. @@ -6083,7 +6083,7 @@ ACMD_FUNC(clearweather) map[sd->bl.m].flag.leaves=0; clif_weather(sd->bl.m); clif_displaymessage(fd, msg_txt(291)); - + return 0; } @@ -6197,7 +6197,7 @@ ACMD_FUNC(npctalk) unsigned long color=0; if (sd->sc.count && //no "chatting" while muted. - (sd->sc.data[SC_BERSERK] || + (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT))) return -1; @@ -6218,10 +6218,10 @@ ACMD_FUNC(npctalk) clif_displaymessage(fd, msg_txt(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); else clif_message(&nd->bl, temp); @@ -6248,7 +6248,7 @@ ACMD_FUNC(pettalk) } if (sd->sc.count && //no "chatting" while muted. - (sd->sc.data[SC_BERSERK] || + (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT))) return -1; @@ -6280,7 +6280,7 @@ ACMD_FUNC(pettalk) return 0; } sd->emotionlasttime = time(NULL); - + clif_emotion(&pd->bl, i); return 0; } @@ -6373,7 +6373,7 @@ ACMD_FUNC(summon) 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) @@ -6386,7 +6386,7 @@ ACMD_FUNC(summon) if(!md) return -1; - + md->master_id=sd->bl.id; md->special_state.ai=1; md->deletetimer=add_timer(tick+(duration*60000),mob_timer_delete,md->bl.id,0); @@ -6395,7 +6395,7 @@ ACMD_FUNC(summon) sc_start4(&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(39)); // All monster summoned! - + return 0; } @@ -6418,7 +6418,7 @@ ACMD_FUNC(adjgroup) clif_displaymessage(fd, msg_txt(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(1228)); // Group changed successfully. @@ -6502,7 +6502,7 @@ ACMD_FUNC(unmute) pl_sd->status.manner = 0; status_change_end(&pl_sd->bl, SC_NOCHAT, INVALID_TIMER); clif_displaymessage(sd->fd,msg_txt(1236)); // Player unmuted. - + return 0; } @@ -6737,7 +6737,7 @@ ACMD_FUNC(mobinfo) 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(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], @@ -7006,7 +7006,7 @@ ACMD_FUNC(homtalk) } if (sd->sc.count && //no "chatting" while muted. - (sd->sc.data[SC_BERSERK] || + (sd->sc.data[SC_BERSERK] || sd->sc.data[SC__BLOODYLUST] || (sd->sc.data[SC_NOCHAT] && sd->sc.data[SC_NOCHAT]->val1&MANNER_NOCHAT))) return -1; @@ -7080,7 +7080,7 @@ ACMD_FUNC(homstats) } hd = sd->hd; - + hom = &hd->homunculus; db = hd->homunculusDB; lv = hom->level; @@ -7089,7 +7089,7 @@ ACMD_FUNC(homstats) msg_txt(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);; @@ -7179,12 +7179,12 @@ ACMD_FUNC(iteminfo) item_data = item_array[i]; sprintf(atcmd_output, msg_txt(1277), // Item: '%s'/'%s'[%d] (%d) Type: %s | Extra Effect: %s item_data->name,item_data->jname,item_data->slot,item_data->nameid, - itemdb_typename(item_data->type), + itemdb_typename(item_data->type), (item_data->script==NULL)? msg_txt(1278) : msg_txt(1279) // None / With script ); clif_displaymessage(fd, atcmd_output); - sprintf(atcmd_output, msg_txt(1280), item_data->value_buy, item_data->value_sell, item_data->weight/10. ); // NPC Buy:%dz, Sell:%dz | Weight: %.1f + sprintf(atcmd_output, msg_txt(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) @@ -7235,7 +7235,7 @@ ACMD_FUNC(whodrops) } else { sprintf(atcmd_output, msg_txt(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++) { sprintf(atcmd_output, "- %s (%02.02f%%)", mob_db(item_data->mob[j].id)->jname, item_data->mob[j].chance/100.); @@ -7325,7 +7325,7 @@ ACMD_FUNC(adopt) clif_displaymessage(fd, output); return -1; } - + if((pl_sd3=map_nick2sd((char *) player3)) == NULL) { sprintf(output, msg_txt(1293), player3); // Cannot find player %s online. clif_displaymessage(fd, output); @@ -7335,7 +7335,7 @@ ACMD_FUNC(adopt) if( !pc_adoption(pl_sd1, pl_sd2, pl_sd3) ) { return -1; } - + clif_displaymessage(fd, msg_txt(1294)); // They are family... wish them luck. return 0; } @@ -7347,7 +7347,7 @@ ACMD_FUNC(version) if ((revision = get_svn_revision()) != 0) { sprintf(atcmd_output,msg_txt(1295),revision); // rAthena Version SVN r%s clif_displaymessage(fd,atcmd_output); - } else + } else clif_displaymessage(fd,msg_txt(1296)); // Cannot determine SVN revision. return 0; @@ -7358,7 +7358,7 @@ ACMD_FUNC(version) *------------------------------------------*/ 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) @@ -7386,11 +7386,11 @@ ACMD_FUNC(mutearea) clif_displaymessage(fd, msg_txt(1297)); // Please enter a time in minutes (usage: @mutearea/@stfu