From 7a9aa7fbcfe40080c1b743137fc68aebb596e632 Mon Sep 17 00:00:00 2001 From: aleos89 Date: Mon, 30 Dec 2013 13:20:33 -0500 Subject: [PATCH] Bugfixes * Fixed WE_MALE and WE_FEMALE up to You to not consume HP/SP when it's below 10%. (bugreport:3546) * Fixed WE_CALLPARTNER, WE_CALLPARENT, and WE_CALLBABY to not recall target if they are autotrading. (bugreport:2479) * Fixed WE_BABY not checking for parents if they are in the same party and in the area. (bugreport:2518) * Fixed Dragon Breath - Water not requiring a dragon. (bugreport:8237) * Added a new config 'char_del_option' to set whether email or birthdate should be used for deleting characters. (bugreport:8240) * Follow up to 9a5a6b9. Fixed a missing define check for 2013 clients when deleting a character. (bugreport:8399) * Fixed Weapon Refining to use clif_upgrademessage. (bugreport:2135) * Fixed script command 'prompt' not ending script state when player selects Cancel from menu. (bugreport:7932) * Fixed nomineeffect display on GvG enabled maps. (bugreport:7754) Others * All items, except for Cash items, can no longer be used when storage is open. * Defined constants for a lot of item and monster IDs used throughout the source. * Follow up to 0f2dd7f. Corrected a change to the wrong hostname array. --- conf/char_athena.conf | 8 ++ conf/msg_conf/map_msg.conf | 4 +- db/re/skill_require_db.txt | 2 +- src/char/char.c | 17 ++- src/login/account_sql.c | 4 +- src/map/clif.c | 24 ++-- src/map/elemental.c | 24 ++-- src/map/elemental.h | 15 +++ src/map/guild.c | 2 +- src/map/itemdb.h | 258 +++++++++++++++++++++++++++++++++---- src/map/mob.h | 17 +++ src/map/pc.c | 94 +++++++------- src/map/script.c | 2 +- src/map/skill.c | 210 ++++++++++++++++-------------- src/map/skill.h | 10 -- src/map/status.c | 1 + 16 files changed, 477 insertions(+), 215 deletions(-) diff --git a/conf/char_athena.conf b/conf/char_athena.conf index df68af1746..7c975c0b26 100644 --- a/conf/char_athena.conf +++ b/conf/char_athena.conf @@ -152,6 +152,14 @@ char_del_level: 0 // NOTE: Requires client 2010-08-03aragexeRE or newer. char_del_delay: 86400 +// Restrict character deletion by email address or birthdate. +// This restricts players from changing the langtype and deleting characters. +// For birthdate, the client must be 20100803 or newer. +// 1: Email address +// 2: Birthdate (default) +// 3: Email address or Birthdate +char_del_option: 2 + // What folder the DB files are in (item_db.txt, etc.) db_path: db diff --git a/conf/msg_conf/map_msg.conf b/conf/msg_conf/map_msg.conf index d66069ec57..ad61508d60 100644 --- a/conf/msg_conf/map_msg.conf +++ b/conf/msg_conf/map_msg.conf @@ -406,7 +406,9 @@ 385: You're not allowed to change emblem during WOE 386: The chosen emblem was detected invalid 387: The chosen emblem was detected invalid as it contain too much transparency (limit=%d) -//388-389 free +//etc +388: You cannot use this item while storage is open. +//389-389 free //NoAsk 390: Autorejecting is activated. 391: Autorejecting is deactivated. diff --git a/db/re/skill_require_db.txt b/db/re/skill_require_db.txt index 08399a3723..e1f11ebe49 100644 --- a/db/re/skill_require_db.txt +++ b/db/re/skill_require_db.txt @@ -960,7 +960,7 @@ 5001,0,0,22:34:46:58:70,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //GC_DARKCROW#Dark Claw# 5002,0,0,100:120:140:160:180,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //RA_UNLIMIT#Unlimited# 5003,0,0,60:70:80:90:100,0,0,0,99,0,0,none,0,0,970,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //GN_ILLUSIONDOPING#Illusion Doping# -5004,0,0,30:35:40:45:50:55:60:65:70:75,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //RK_DRAGONBREATH_WATER#Dragon Breath - Water# +5004,0,0,30:35:40:45:50:55:60:65:70:75,0,0,0,99,0,0,dragon,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //RK_DRAGONBREATH_WATER#Dragon Breath - Water# 5005,0,0,1,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //RK_LUXANIMA#Lux Anima# 5006,0,0,60:70:80:90:100,0,0,0,99,0,0,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //NC_MAGMA_ERUPTION#Magma Eruption# 5007,0,0,200:230:260:290:320,0,0,0,13:14,0,0,none,0,0,6144,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WM_FRIGG_SONG#Frigg's Song# diff --git a/src/char/char.c b/src/char/char.c index a7f3a598cb..d6fedbdcd8 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -110,8 +110,9 @@ char unknown_char_name[NAME_LENGTH] = "Unknown"; // Name to use when the request #define TRIM_CHARS "\255\xA0\032\t\x0A\x0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex] char char_name_letters[1024] = ""; // list of letters/symbols allowed (or not) in a character name. by [Yor] -int char_del_level = 0; //From which level u can delete character [Lupus] +int char_del_level = 0; //From which level you can delete character [Lupus] int char_del_delay = 86400; +int char_del_option = 2; // Character deletion type, email = 1, birthdate = 2 (default) int log_char = 1; // loggin char or not [devil] int log_inter = 1; // loggin inter or not [devil] @@ -1924,7 +1925,11 @@ int mmo_char_tobuf(uint8* buffer, struct mmo_charstatus* p) offset += MAP_NAME_LENGTH_EXT; #endif #if PACKETVER >= 20100803 +#if PACKETVER > 201300000 WBUFL(buf,124) = (p->delete_date?TOL(p->delete_date-time(NULL)):0); +#else + WBUFL(buf,124) = TOL(p->delete_date); +#endif offset += 4; #endif #if PACKETVER >= 20110111 @@ -4132,7 +4137,7 @@ static void char_delete2_accept(int fd, struct char_session_data* sd) return; } - if( ( char_del_level > 0 && base_level >= (unsigned int)char_del_level ) || ( char_del_level < 0 && base_level <= (unsigned int)(-char_del_level) ) ) + if( ( char_del_level > 0 && base_level >= (unsigned int)char_del_level ) || ( char_del_level < 0 && base_level <= (unsigned int)(-char_del_level) ) || !char_del_option&2 ) {// character level config restriction char_delete2_accept_ack(fd, char_id, 2); return; @@ -4522,11 +4527,13 @@ int parse_char(int fd) RFIFOSKIP(fd,( cmd == 0x68) ? 46 : 56); // Check if e-mail is correct - if(strcmpi(email, sd->email) && //email does not matches and + if((strcmpi(email, sd->email) && //email does not matches and ( strcmp("a@a.com", sd->email) || //it is not default email, or (strcmp("a@a.com", email) && strcmp("", email)) //email sent does not matches default - )) { //Fail + )) + || !char_del_option&1 + ) { //Fail WFIFOHEAD(fd,3); WFIFOW(fd,0) = 0x70; WFIFOB(fd,2) = 0; // 00 = Incorrect Email address @@ -5602,6 +5609,8 @@ int char_config_read(const char* cfgName) char_del_level = atoi(w2); } else if (strcmpi(w1, "char_del_delay") == 0) { char_del_delay = atoi(w2); + } else if (strcmpi(w1, "char_del_option") == 0) { + char_del_option = atoi(w2); } else if(strcmpi(w1,"db_path")==0) { safestrncpy(db_path, w2, sizeof(db_path)); } else if (strcmpi(w1, "console") == 0) { diff --git a/src/login/account_sql.c b/src/login/account_sql.c index 32ebad7175..c00d8c4dff 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -23,14 +23,14 @@ typedef struct AccountDB_SQL Sql* accounts; // SQL accounts storage // global sql settings - char global_db_hostname[64]; // Doubled for long hostnames (bugreport:8003) + char global_db_hostname[32]; uint16 global_db_port; char global_db_username[32]; char global_db_password[32]; char global_db_database[32]; char global_codepage[32]; // local sql settings - char db_hostname[32]; + char db_hostname[64]; // Doubled for long hostnames (bugreport:8003) uint16 db_port; char db_username[32]; char db_password[32]; diff --git a/src/map/clif.c b/src/map/clif.c index 9d33c5c6dd..90f8ccc90a 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5710,7 +5710,7 @@ void clif_maptypeproperty2(struct block_list *bl,enum send_target t) { WBUFB(buf,4) = ((map_flag_vs(bl->m))?0x01:0); //tvt ? WBUFB(buf,4) |= ((map_flag_gvg(bl->m))?0x02:0); //gvg WBUFB(buf,4) |= ((map_flag_gvg2(bl->m))?0x04:0); //siege - WBUFB(buf,4) |= ((map[bl->m].flag.nomineeffect)?0:0x08); //mineffect @FIXME what this do + WBUFB(buf,4) |= (map[bl->m].flag.nomineeffect || !map_flag_gvg2(bl->m))?0:0x08; //disable mine effect on nomineeffect map and enable it on gvgmap by default WBUFB(buf,4) |= ((map[bl->m].flag.nolockon)?0x10:0); //nolockon 0x10 @FIXME what this do WBUFB(buf,4) |= ((map[bl->m].flag.pvp)?0x20:0); //countpk WBUFB(buf,4) |= 0; //nopartyformation 0x40 @@ -6084,9 +6084,9 @@ void clif_item_refine_list(struct map_session_data *sd) fd=sd->fd; refine_item[0] = -1; - refine_item[1] = pc_search_inventory(sd,1010); - refine_item[2] = pc_search_inventory(sd,1011); - refine_item[3] = refine_item[4] = pc_search_inventory(sd,984); + refine_item[1] = pc_search_inventory(sd,ITEMID_PHARCON); + refine_item[2] = pc_search_inventory(sd,ITEMID_EMVERETARCON); + refine_item[3] = refine_item[4] = pc_search_inventory(sd,ITEMID_ORIDECON); WFIFOHEAD(fd, MAX_INVENTORY * 13 + 4); WFIFOW(fd,0)=0x221; @@ -8201,20 +8201,14 @@ void clif_callpartner(struct map_session_data *sd) WBUFW(buf,0) = 0x1e6; - if( sd->status.partner_id ) - { - const char *p; - if( ( p = map_charid2nick(sd->status.partner_id) ) != NULL ) - { + if( sd->status.partner_id ) { + const char *p = map_charid2nick(sd->status.partner_id); + struct map_session_data *p_sd = pc_get_partner(sd); + if( p != NULL && p_sd != NULL && !p_sd->state.autotrade ) memcpy(WBUFP(buf,2), p, NAME_LENGTH); - } else - { WBUFB(buf,2) = 0; - } - } - else - {// Send zero-length name if no partner, to initialize the client buffer. + } else {// Send zero-length name if no partner, to initialize the client buffer. WBUFB(buf,2) = 0; } diff --git a/src/map/elemental.c b/src/map/elemental.c index 027d35e700..d55b573c00 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -101,24 +101,24 @@ int elemental_create(struct map_session_data *sd, int class_, unsigned int lifet //per individual bonuses switch(db->class_){ - case 2114: case 2115: - case 2116: //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10) + case ELEMENTALID_AGNI_S: case ELEMENTALID_AGNI_M: + case ELEMENTALID_AGNI_L: //ATK + (Summon Agni Skill Level x 20) / HIT + (Summon Agni Skill Level x 10) ele.atk += i * 20; ele.atk2 += i * 20; ele.hit += i * 10; break; - case 2117: case 2118: - case 2119: //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20) + case ELEMENTALID_AQUA_S: case ELEMENTALID_AQUA_M: + case ELEMENTALID_AQUA_L: //MDEF + (Summon Aqua Skill Level x 10) / MATK + (Summon Aqua Skill Level x 20) ele.mdef += i * 10; ele.matk += i * 20; break; - case 2120: case 2121: - case 2122: //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10) + case ELEMENTALID_VENTUS_S: case ELEMENTALID_VENTUS_M: + case ELEMENTALID_VENTUS_L: //FLEE + (Summon Ventus Skill Level x 20) / MATK + (Summon Ventus Skill Level x 10) ele.flee += i * 20; ele.matk += i * 10; break; - case 2123: case 2124: - case 2125: //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5) + case ELEMENTALID_TERA_S: case ELEMENTALID_TERA_M: + case ELEMENTALID_TERA_L: //DEF + (Summon Tera Skill Level x 25) / ATK + (Summon Tera Skill Level x 5) ele.def += i * 25; ele.atk += i * 5; ele.atk2 += i * 5; @@ -659,12 +659,12 @@ static int elemental_ai_sub_timer(struct elemental_data *ed, struct map_session_ int sp = 5; switch(ed->vd->class_){ - case 2115: case 2118: - case 2121: case 2124: + case ELEMENTALID_AGNI_M: case ELEMENTALID_AQUA_M: + case ELEMENTALID_VENTUS_M: case ELEMENTALID_TERA_M: sp = 8; break; - case 2116: case 2119: - case 2122: case 2125: + case ELEMENTALID_AGNI_L: case ELEMENTALID_AQUA_L: + case ELEMENTALID_VENTUS_L: case ELEMENTALID_TERA_L: sp = 11; break; } diff --git a/src/map/elemental.h b/src/map/elemental.h index 5033b461a4..431ab6336d 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -19,6 +19,21 @@ #define EL_SKILLMODE_ASSIST 0x2 #define EL_SKILLMODE_AGGRESSIVE 0x4 +elemental_elementalid { + ELEMENTALID_AGNI_S = 2114, + ELEMENTALID_AGNI_M, + ELEMENTALID_AGNI_L, + ELEMENTALID_AQUA_S, + ELEMENTALID_AQUA_M, + ELEMENTALID_AQUA_L, + ELEMENTALID_VENTUS_S, + ELEMENTALID_VENTUS_M, + ELEMENTALID_VENTUS_L, + ELEMENTALID_TERA_S, + ELEMENTALID_TERA_M, + ELEMENTALID_TERA_L, +}; + struct elemental_skill { unsigned short id, lv; short mode; diff --git a/src/map/guild.c b/src/map/guild.c index 9b0bdbb274..513c3baeed 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -383,7 +383,7 @@ int guild_create(struct map_session_data *sd, const char *name) clif_guild_created(sd,1); return 0; } - if( battle_config.guild_emperium_check && pc_search_inventory(sd,714) == -1 ) + if( battle_config.guild_emperium_check && pc_search_inventory(sd,ITEMID_EMPERIUM) == -1 ) {// item required clif_guild_created(sd,3); return 0; diff --git a/src/map/itemdb.h b/src/map/itemdb.h index bd80ab0f09..78387a820a 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -41,26 +41,128 @@ ///Enum of item id (for hardcoded purpose) enum item_itemid { - ITEMID_EMPERIUM = 714, - ITEMID_YELLOW_GEMSTONE = 715, - ITEMID_RED_GEMSTONE = 716, - ITEMID_BLUE_GEMSTONE = 717, - ITEMID_TRAP = 1065, - ITEMID_STRANGE_EMBRYO = 6415, - ITEMID_STONE = 7049, - ITEMID_SKULL_ = 7420, - ITEMID_TOKEN_OF_SIEGFRIED = 7621, - ITEMID_TRAP_ALLOY = 7940, - ITEMID_ANCILLA = 12333, - ITEMID_REINS_OF_MOUNT = 12622, + ITEMID_RED_POTION = 501, + ITEMID_YELLOW_POTION = 503, + ITEMID_WHITE_POTION = 504, + ITEMID_BLUE_POTION = 505, + ITEMID_RED_SLIM_POTION = 545, + ITEMID_YELLOW_SLIM_POTION = 546, + ITEMID_WHITE_SLIM_POTION = 547, + ITEMID_WING_OF_FLY = 601, + ITEMID_WING_OF_BUTTERFLY = 602, + ITEMID_BRANCH_OF_DEAD_TREE = 604, + ITEMID_ANODYNE = 605, + ITEMID_ALOEBERA = 606, + ITEMID_EMPTY_BOTTLE = 713, + ITEMID_EMPERIUM = 714, + ITEMID_YELLOW_GEMSTONE = 715, + ITEMID_RED_GEMSTONE = 716, + ITEMID_BLUE_GEMSTONE = 717, + ITEMID_ALCOHOL = 970, + ITEMID_ORIDECON = 984, + ITEMID_ANVIL = 986 + ITEMID_ORIDECON_AVNIL = 987, + ITEMID_GOLDEN_ANVIL = 988, + ITEMID_EMPERIUM_ANVIL = 989, + ITEMID_BLOODY_RED = 990, + ITEMID_CRYSTAL_BLUE = 991, + ITEMID_WIND_OF_VERDURE = 992, + ITEMID_YELLOW_LIVE = 993, + ITEMID_FLAME_HEART = 994, + ITEMID_MISTIC_FROZEN = 995, + ITEMID_ROUGH_WIND = 996, + ITEMID_GREAT_NATURE = 997, + ITEMID_IRON = 998, + ITEMID_STEEL = 999, + ITEMID_STAR_CRUMB = 1000, + ITEMID_PHRACON = 1010, + ITEMID_EMVERETARCON = 1011, + ITEMID_TRAP = 1065, + ITEMID_STRANGE_EMBRYO = 6415, + ITEMID_STONE = 7049, + ITEMID_FIRE_BOTTLE = 7135, + ITEMID_ACID_BOTTLE = 7136, + ITEMID_MAN_EATER_BOTTLE = 7137, + ITEMID_MINI_BOTTLE = 7138, + ITEMID_COATING_BOTTLE = 7139, + ITEMID_FRAGMENT_OF_CRYSTAL = 7321, + ITEMID_SKULL_ = 7420, + ITEMID_TOKEN_OF_SIEGFRIED = 7621, + ITEMID_TRAP_ALLOY = 7940, + ITEMID_RED_POUCH_OF_SURPRISE = 12024, + ITEMID_BLOODY_DEAD_BRANCH = 12103, + ITEMID_PORING_BOX = 12109, + ITEMID_MERCENARY_RED_POTION = 12184, + ITEMID_MERCENARY_BLUE_POTION = 12185, + ITEMID_BATTLE_MANUAL = 12208, + ITEMID_BUBBLE_GUM = 12210, + ITEMID_GIANT_FLY_WING = 12212, + ITEMID_NEURALIZER = 12213, + ITEMID_M_CENTER_POTION = 12241, + ITEMID_M_AWAKENING_POTION = 12242, + ITEMID_M_BERSERK_POTION = 12243, + ITEMID_COMP_BATTLE_MANUAL = 12263, + ITEMID_THICK_BATTLE_MANUAL = 12312, + ITEMID_ANCILLA = 12333, + ITEMID_DUN_TELE_SCROLL3 = 12352, + ITEMID_REINS_OF_MOUNT = 12622, + ITEMID_COMP_BUBBLE_GUM = 12264, + ITEMID_NOBLE_NAMEPLATE = 12705, + ITEMID_TREASURE_CHEST_SUMMONED_II = 12863, + ITEMID_DUN_TELE_SCROLL1 = 14527, + ITEMID_BATTLE_MANUAL25 = 14532, + ITEMID_BATTLE_MANUAL100 = 14533, + ITEMID_BATTLE_MANUAL300 = 14545, + ITEMID_DUN_TELE_SCROLL2 = 14581, + ITEMID_WOB_RUNE = 14582, + ITEMID_WOB_SCHWALTZ = 14583, + ITEMID_WOB_RACHEL = 14584, + ITEMID_WOB_LOCAL = 14585, + ITEMID_SIEGE_TELEPORT_SCROLL = 14591, + ITEMID_JOB_MANUAL50 = 14592, +}; + +/** + * Mercenary Scrolls + */ +enum mercenary_scroll_item_list { + ITEMID_BOW_MERCENARY_SCROLL1 = 12153, + ITEMID_BOW_MERCENARY_SCROLL2, + ITEMID_BOW_MERCENARY_SCROLL3, + ITEMID_BOW_MERCENARY_SCROLL4, + ITEMID_BOW_MERCENARY_SCROLL5, + ITEMID_BOW_MERCENARY_SCROLL6, + ITEMID_BOW_MERCENARY_SCROLL7, + ITEMID_BOW_MERCENARY_SCROLL8, + ITEMID_BOW_MERCENARY_SCROLL9, + ITEMID_BOW_MERCENARY_SCROLL10, + ITEMID_SWORDMERCENARY_SCROLL1, + ITEMID_SWORDMERCENARY_SCROLL2, + ITEMID_SWORDMERCENARY_SCROLL3, + ITEMID_SWORDMERCENARY_SCROLL4, + ITEMID_SWORDMERCENARY_SCROLL5, + ITEMID_SWORDMERCENARY_SCROLL6, + ITEMID_SWORDMERCENARY_SCROLL7, + ITEMID_SWORDMERCENARY_SCROLL8, + ITEMID_SWORDMERCENARY_SCROLL9, + ITEMID_SWORDMERCENARY_SCROLL10, + ITEMID_SPEARMERCENARY_SCROLL1, + ITEMID_SPEARMERCENARY_SCROLL2, + ITEMID_SPEARMERCENARY_SCROLL3, + ITEMID_SPEARMERCENARY_SCROLL4, + ITEMID_SPEARMERCENARY_SCROLL5, + ITEMID_SPEARMERCENARY_SCROLL6, + ITEMID_SPEARMERCENARY_SCROLL7, + ITEMID_SPEARMERCENARY_SCROLL8, + ITEMID_SPEARMERCENARY_SCROLL9, + ITEMID_SPEARMERCENARY_SCROLL10, }; /** * Rune Knight - **/ - -enum rune_list { - ITEMID_NAUTHIZ = 12725, + */ +enum rune_item_list { + ITEMID_NAUTHIZ = 12725, ITEMID_RAIDO, ITEMID_BERKANA, ITEMID_ISA, @@ -69,13 +171,13 @@ enum rune_list { ITEMID_THURISAZ, ITEMID_WYRD, ITEMID_HAGALAZ, - ITEMID_LUX_ANIMA = 22540 + ITEMID_LUX_ANIMA = 22540, }; /** * Mechanic - **/ -enum mecha_item_list { + */ +enum mechanic_item_list { ITEMID_ACCELERATOR = 2800, ITEMID_HOVERING_BOOSTER, ITEMID_SUICIDAL_DEVICE, @@ -89,6 +191,112 @@ enum mecha_item_list { ITEMID_SPECIAL_COOLER, }; +/** + * Genetic + */ +enum genetic_item_list { + ITEMID_SEED_OF_HORNY_PLANT = 6210, + ITEMID_BLOODSUCK_PLANT_SEED = 6211, + ITEMID_BOMB_MUSHROOM_SPORE = 6212, + ITEMID_HP_INCREASE_POTION_SMALL = 12422, + ITEMID_HP_INCREASE_POTION_MEDIUM, + ITEMID_HP_INCREASE_POTION_LARGE, + ITEMID_SP_INCREASE_POTION_SMALL, + ITEMID_SP_INCREASE_POTION_MEDIUM, + ITEMID_SP_INCREASE_POTION_LARGE, + ITEMID_CONCENTRATED_WHITE_POTION_Z, + ITEMID_SAVAGE_FULL_ROAST, + ITEMID_COCKTAIL_WARG_BLOOD, + ITEMID_MINOR_STEW, + ITEMID_SIROMA_ICED_TEA, + ITEMID_DROSERA_HERB_SALAD, + ITEMID_PETITE_TAIL_NOODLES, + ITEMID_BLACK_MASS, + ITEMID_VITATA500, + ITEMID_CONCENTRATED_CEROMAIN_SOUP, + ITEMID_CURE_FREE = 12475, + ITEMID_APPLE_BOMB = 13260, + ITEMID_COCONUT_BOMB, + ITEMID_MELON_BOMB, + ITEMID_PINEAPPLE_BOMB, + ITEMID_BANANA_BOMB, + ITEMID_BLACK_LUMP, + ITEMID_BLACK_HARD_LUMP, + ITEMID_VERY_HARD_LUMP, + ITEMID_MYSTERIOUS_POWDER, + ITEMID_BOOST500_TO_THROW, + ITEMID_FULL_SWINGK_TO_THROW, + ITEMID_MANA_PLUS_TO_THROW, + ITEMID_CURE_FREE_TO_THROW, + ITEMID_STAMINA_UP_M_TO_THROW, + ITEMID_DIGESTIVE_F_TO_THROW, + ITEMID_HP_INC_POTS_TO_THROW, + ITEMID_HP_INC_POTM_TO_THROW, + ITEMID_HP_INC_POTL_TO_THROW, + ITEMID_SP_INC_POTS_TO_THROW, + ITEMID_SP_INC_POTM_TO_THROW, + ITEMID_SP_INC_POTL_TO_THROW, + ITEMID_EN_WHITE_POTZ_TO_THROW, + ITEMID_VITATA500_TO_THROW, + ITEMID_EN_CEL_JUICE_TO_THROW, + ITEMID_SAVAGE_BBQ_TO_THROW, + ITEMID_WUG_COCKTAIL_TO_THROW, + ITEMID_M_BRISKET_TO_THROW, + ITEMID_SIROMA_ICETEA_TO_THROW, + ITEMID_DROCERA_STEW_TO_THROW, + ITEMID_PETTI_NOODLE_TO_THROW, + ITEMID_BLACK_THING_TO_THROW, +}; + +/** + * Guillotine Cross + */ +enum poison_item_list { + ITEMID_PARALYSE = 12717, + ITEMID_LEECHESEND, + ITEMID_OBLIVIONCURSE, + ITEMID_DEATHHURT, + ITEMID_TOXIN, + ITEMID_PYREXIA, + ITEMID_MAGICMUSHROOM, + ITEMID_VENOMBLEED, +}; + +/** + * Spell Books + */ +enum spell_book_item_list { + ITEMID_MAGIC_BOOK_FB = 6189, + ITEMID_MAGIC_BOOK_CB, + ITEMID_MAGIC_BOOK_LB, + ITEMID_MAGIC_BOOK_SG, + ITEMID_MAGIC_BOOK_LOV, + ITEMID_MAGIC_BOOK_MS, + ITEMID_MAGIC_BOOK_CM, + ITEMID_MAGIC_BOOK_TV, + ITEMID_MAGIC_BOOK_TS, + ITEMID_MAGIC_BOOK_JT, + ITEMID_MAGIC_BOOK_WB, + ITEMID_MAGIC_BOOK_HD, + ITEMID_MAGIC_BOOK_ES, + ITEMID_MAGIC_BOOK_ES_, + ITEMID_MAGIC_BOOK_CL, + ITEMID_MAGIC_BOOK_CR, + ITEMID_MAGIC_BOOK_DL, +}; + +/** + * Cash Food + */ +enum cash_food_item_list { + ITEMID_STR_DISH10_ = 12202, + ITEMID_AGI_DISH10_, + ITEMID_INT_DISH10_, + ITEMID_DEX_DISH10_, + ITEMID_LUK_DISH10_, + ITEMID_VIT_DISH10_, +}; + enum item_nouse_list { NOUSE_SITTING = 0x01, }; @@ -213,13 +421,13 @@ struct item_data* itemdb_exists(int nameid); #define itemdb_viewid(n) (itemdb_search(n)->view_id) #define itemdb_autoequip(n) (itemdb_search(n)->flag.autoequip) #define itemdb_is_rune(n) ((n >= ITEMID_NAUTHIZ && n <= ITEMID_HAGALAZ) || n == ITEMID_LUX_ANIMA) -#define itemdb_is_element(n) (n >= 990 && n <= 993) -#define itemdb_is_spellbook(n) (n >= 6188 && n <= 6205) -#define itemdb_is_poison(n) (n >= 12717 && n <= 12724) +#define itemdb_is_element(n) (n >= ITEMID_CRYSTAL_BLUE && n <= ITEMID_YELLOW_LIVE) +#define itemdb_is_spellbook(n) (n >= ITEMID_MAGIC_BOOK_FB && n <= ITEMID_MAGIC_BOOK_DL) +#define itemdb_is_poison(n) (n >= ITEMID_PARALYSE && n <= ITEMID_VENOMBLEED) #define itemid_isgemstone(id) ( (id) >= ITEMID_YELLOW_GEMSTONE && (id) <= ITEMID_BLUE_GEMSTONE ) -#define itemdb_iscashfood(id) ( (id) >= 12202 && (id) <= 12207 ) -#define itemdb_is_GNbomb(n) (n >= 13260 && n <= 13267) -#define itemdb_is_GNthrowable(n) (n >= 13268 && n <= 13290) +#define itemdb_iscashfood(id) ( (id) >= ITEMID_STR_DISH10_ && (id) <= ITEMID_VIT_DISH10_ ) +#define itemdb_is_GNbomb(n) (n >= ITEMID_APPLE_BOMB && n <= ITEMID_VERY_HARD_LUMP) +#define itemdb_is_GNthrowable(n) (n >= ITEMID_MYSTERIOUS_POWDER && n <= ITEMID_BLACK_THING_TO_THROW) const char* itemdb_typename(int type); int itemdb_group_bonus(struct map_session_data* sd, int itemid); diff --git a/src/map/mob.h b/src/map/mob.h index 13193d9beb..e0189da523 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -42,6 +42,23 @@ extern const int mob_manuk[8]; extern const int mob_splendide[5]; +mob_mobid { + MOBID_MARINE_SPHERE = 1142, + MOBID_G_PARASITE = 1555, + MOBID_G_FLORA = 1575, + MOBID_G_HYDRA = 1579, + MOBID_G_MANDRAGORA = 1589, + MOBID_G_GEOGRAPHER = 1590, + MOBID_SILVERSNIPER = 2042, + MOBID_MAGICDECOY_FIRE, + MOBID_MAGICDECOY_WATER, + MOBID_MAGICDECOY_EARTH, + MOBID_MAGICDECOY_WIND, + MOBID_S_HORNET = 2158, + MOBID_S_GIANT_HORNET, + MOBID_S_LUCIOLA_VESPA, +}; + //Mob skill states. enum MobSkillState { MSS_ANY = -1, diff --git a/src/map/pc.c b/src/map/pc.c index 753d23b271..f8e8d46d60 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -4288,91 +4288,90 @@ int pc_isUseitem(struct map_session_data *sd,int n) return 0; // You cannot use this item while sitting. } - switch( nameid ) //@TODO, lot of hardcoded nameid here - { - case 605: // Anodyne + if (sd->state.storage_flag && item->type != IT_CASH) { + clif_colormes(sd, color_table[COLOR_RED], msg_txt(sd,388)); + return 0; // You cannot use this item while storage is open. + } + + switch( nameid ) { + case ITEMID_ANODYNE: if( map_flag_gvg(sd->bl.m) ) return 0; - case 606: + case ITEMID_ALOEBERA: if( pc_issit(sd) ) return 0; break; - case 601: // Fly Wing - case 12212: // Giant Fly Wing - if( map[sd->bl.m].flag.noteleport || map_flag_gvg(sd->bl.m) ) - { + case ITEMID_WING_OF_FLY: + case ITEMID_GIANT_FLY_WING: + if( map[sd->bl.m].flag.noteleport || map_flag_gvg(sd->bl.m) ) { clif_skill_teleportmessage(sd,0); return 0; } - case 602: // ButterFly Wing - case 14527: // Dungeon Teleport Scroll - case 14581: // Dungeon Teleport Scroll 2 - case 12352: // Dungeon Teleport Scroll 3 - case 14582: // Yellow Butterfly Wing - case 14583: // Green Butterfly Wing - case 14584: // Red Butterfly Wing - case 14585: // Blue Butterfly Wing - case 14591: // Siege Teleport Scroll - if( sd->duel_group && !battle_config.duel_allow_teleport ) - { + case ITEMID_WING_OF_BUTTERFLY: + case ITEMID_DUN_TELE_SCROLL1: + case ITEMID_DUN_TELE_SCROLL2: + case ITEMID_DUN_TELE_SCROLL3: + case ITEMID_WOB_RUNE: + case ITEMID_WOB_SCHWALTZ: + case ITEMID_WOB_RACHEL: + case ITEMID_WOB_LOCAL: + case ITEMID_SIEGE_TELEPORT_SCROLL: + if( sd->duel_group && !battle_config.duel_allow_teleport ) { clif_displaymessage(sd->fd, msg_txt(sd,663)); return 0; } if( nameid != 601 && nameid != 12212 && map[sd->bl.m].flag.noreturn ) return 0; break; - case 604: // Dead Branch - case 12024: // Red Pouch - case 12103: // Bloody Branch - case 12109: // Poring Box - case 12863: // Treasure_Chest_Summoned_II + case ITEMID_BRANCH_OF_DEAD_TREE: + case ITEMID_RED_POUCH_OF_SURPRISE: + case ITEMID_BLOODY_DEAD_BRANCH: + case ITEMID_PORING_BOX: + case ITEMID_TREASURE_CHEST_SUMMONED_II: if( map[sd->bl.m].flag.nobranch || map_flag_gvg(sd->bl.m) ) return 0; break; - case 12210: // Bubble Gum - case 12264: // Comp Bubble Gum + case ITEMID_BUBBLE_GUM: + case ITEMID_COMP_BUBBLE_GUM: if( sd->sc.data[SC_ITEMBOOST] ) return 0; break; - case 12208: // Battle Manual - case 12263: // Comp Battle Manual - case 12312: // Thick Battle Manual - case 12705: // Noble Nameplate - case 14532: // Battle_Manual25 - case 14533: // Battle_Manual100 - case 14545: // Battle_Manual300 + case ITEMID_BATTLE_MANUAL: + case ITEMID_COMP_BATTLE_MANUAL: + case ITEMID_THICK_BATTLE_MANUAL: + case ITEMID_NOBLE_NAMEPLATE: + case ITEMID_BATTLE_MANUAL25: + case ITEMID_BATTLE_MANUAL100: + case ITEMID_BATTLE_MANUAL300: if( sd->sc.data[SC_EXPBOOST] ) return 0; break; - case 14592: // JOB_Battle_Manual + case ITEMID_JOB_MANUAL50: if( sd->sc.data[SC_JEXPBOOST] ) return 0; break; - - // Mercenary Items - - case 12184: // Mercenary's Red Potion - case 12185: // Mercenary's Blue Potion - case 12241: // Mercenary's Concentration Potion - case 12242: // Mercenary's Awakening Potion - case 12243: // Mercenary's Berserk Potion + case ITEMID_MERCENARY_RED_POTION: + case ITEMID_MERCENARY_BLUE_POTION: + case ITEMID_M_CENTER_POTION: + case ITEMID_M_AWAKENING_POTION: + case ITEMID_M_BERSERK_POTION: if( sd->md == NULL || sd->md->db == NULL ) return 0; if (sd->md->sc.data[SC_BERSERK] || sd->md->sc.data[SC_SATURDAYNIGHTFEVER]) return 0; - if( nameid == 12242 && sd->md->db->lv < 40 ) + if( nameid == ITEMID_M_AWAKENING_POTION && sd->md->db->lv < 40 ) return 0; - if( nameid == 12243 && sd->md->db->lv < 80 ) + if( nameid == ITEMID_M_BERSERK_POTION && sd->md->db->lv < 80 ) return 0; break; - case 12213: //Neuralizer + case ITEMID_NEURALIZER: if( !map[sd->bl.m].flag.reset ) return 0; break; } - if( nameid >= 12153 && nameid <= 12182 && sd->md != NULL ) + if( nameid >= ITEMID_BOW_MERCENARY_SCROLL1 && nameid <= ITEMID_SPEARMERCENARY_SCROLL10 && sd->md != NULL ) return 0; // Mercenary Scrolls /** @@ -4422,8 +4421,7 @@ int pc_isUseitem(struct map_session_data *sd,int n) return 0; //Dead Branch & Bloody Branch & Porings Box - // FIXME: outdated, use constants or database - if( nameid == 604 || nameid == 12103 || nameid == 12109 || nameid == 12863 ) + if( nameid == ITEMID_BRANCH_OF_DEAD_TREE || nameid == ITEMID_BLOODY_DEAD_BRANCH || nameid == ITEMID_PORING_BOX || nameid == ITEMID_TREASURE_CHEST_SUMMONED_II ) log_branch(sd); return 1; diff --git a/src/map/script.c b/src/map/script.c index f9d313b578..575703681b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -4796,7 +4796,7 @@ BUILDIN_FUNC(prompt) sd->state.menu_or_input = 0; pc_setreg(sd, add_str("@menu"), 0xff); script_pushint(st, 0xff); - st->state = RUN; + st->state = END; } else {// return selected option diff --git a/src/map/skill.c b/src/map/skill.c index 9f13508bc7..e01620808d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2619,7 +2619,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list * //Spirit of Wizard blocks Kaite's reflection if( type == 2 && tsc && tsc->data[SC_SPIRIT] && tsc->data[SC_SPIRIT]->val2 == SL_WIZARD ) { //Consume one Fragment per hit of the casted skill? [Skotlex] - type = tsd?pc_search_inventory (tsd, 7321):0; + type = tsd?pc_search_inventory (tsd, ITEMID_FRAGMENT_OF_CRYSTAL):0; if (type >= 0) { if ( tsd ) pc_delitem(tsd, type, 1, 0, 1, LOG_TYPE_CONSUME); dmg.damage = dmg.damage2 = 0; @@ -6784,7 +6784,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui if (sd) { clif_skill_nodamage(src,bl,skill_id,skill_lv,1); //Prepare 200 White Potions. - if (!skill_produce_mix(sd, skill_id, 504, 0, 0, 0, 200)) + if (!skill_produce_mix(sd, skill_id, ITEMID_WHITE_POTION, 0, 0, 0, 200)) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); } break; @@ -6792,28 +6792,28 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui if (sd) { clif_skill_nodamage(src,bl,skill_id,skill_lv,1); //Prepare 200 Slim White Potions. - if (!skill_produce_mix(sd, skill_id, 547, 0, 0, 0, 200)) + if (!skill_produce_mix(sd, skill_id, ITEMID_WHITE_SLIM_POTION, 0, 0, 0, 200)) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); } break; case AM_TWILIGHT3: if (sd) { - int ebottle = pc_search_inventory(sd,713); + int ebottle = pc_search_inventory(sd,ITEMID_EMPTY_BOTTLE); if( ebottle >= 0 ) ebottle = sd->status.inventory[ebottle].amount; //check if you can produce all three, if not, then fail: - if (!skill_can_produce_mix(sd,970,-1, 100) //100 Alcohol - || !skill_can_produce_mix(sd,7136,-1, 50) //50 Acid Bottle - || !skill_can_produce_mix(sd,7135,-1, 50) //50 Flame Bottle + if (!skill_can_produce_mix(sd,ITEMID_ALCOHOL,-1, 100) //100 Alcohol + || !skill_can_produce_mix(sd,ITEMID_ACID_BOTTLE,-1, 50) //50 Acid Bottle + || !skill_can_produce_mix(sd,ITEMID_FIRE_BOTTLE,-1, 50) //50 Flame Bottle || ebottle < 200 //200 empty bottle are required at total. ) { clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); break; } clif_skill_nodamage(src,bl,skill_id,skill_lv,1); - skill_produce_mix(sd, skill_id, 970, 0, 0, 0, 100); - skill_produce_mix(sd, skill_id, 7136, 0, 0, 0, 50); - skill_produce_mix(sd, skill_id, 7135, 0, 0, 0, 50); + skill_produce_mix(sd, skill_id, ITEMID_ALCOHOL, 0, 0, 0, 100); + skill_produce_mix(sd, skill_id, ITEMID_ACID_BOTTLE, 0, 0, 0, 50); + skill_produce_mix(sd, skill_id, ITEMID_FIRE_BOTTLE, 0, 0, 0, 50); } break; case SA_DISPELL: @@ -7253,14 +7253,14 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui break; case WE_MALE: - { + if( status_get_hp(bl) < status_get_max_hp(bl) / 10 ) { int hp_rate=(!skill_lv)? 0:skill_get_hp_rate(skill_id, skill_lv); int gain_hp= tstatus->max_hp*abs(hp_rate)/100; // The earned is the same % of the target HP than it costed the caster. [Skotlex] clif_skill_nodamage(src,bl,skill_id,status_heal(bl, gain_hp, 0, 0),1); } break; case WE_FEMALE: - { + if( status_get_sp(bl) < status_get_max_sp(bl) / 10 ) { int sp_rate=(!skill_lv)? 0:skill_get_sp_rate(skill_id, skill_lv); int gain_sp=tstatus->max_sp*abs(sp_rate)/100;// The earned is the same % of the target SP than it costed the caster. [Skotlex] clif_skill_nodamage(src,bl,skill_id,status_heal(bl, 0, gain_sp, 0),1); @@ -7272,8 +7272,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui if(sd){ struct map_session_data *f_sd = pc_get_father(sd); struct map_session_data *m_sd = pc_get_mother(sd); + struct block_list *b_bl = map_id2bl(sd->bl.id); + struct block_list *f_bl = map_id2bl(f_sd->bl.id); + struct block_list *m_bl = map_id2bl(m_sd->bl.id); // if neither was found - if(!f_sd && !m_sd){ + if( (!f_sd && !m_sd) || (sd->status.party_id != 0 && sd->status.party_id != f_sd->status.party_id && sd->status.party_id != m_sd->status.party_id) || (!check_distance_bl(b_bl, f_bl, AREA_SIZE) && !check_distance_bl(b_bl, m_bl, AREA_SIZE)) ) { clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); map_freeblock_unlock(); return 0; @@ -9728,7 +9731,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui skill_blockhomun_start(hd, skill_id, skill_get_cooldown(skill_id, skill_lv)); break; case MH_SUMMON_LEGION: { - int summons[5] = {2158, 2159, 2159, 2160, 2160}; + int summons[5] = {MOBID_S_HORNET, MOBID_S_GIANT_HORNET, MOBID_S_GIANT_HORNET, MOBID_S_LUCIOLA_VESPA, MOBID_S_LUCIOLA_VESPA}; int qty[5] = {3 , 3 , 4 , 4 , 5}; struct mob_data *sum_md; int i,c=0; @@ -9914,7 +9917,20 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data) case WE_CALLPARTNER: if(sd) clif_callpartner(sd); case WE_CALLPARENT: + if(sd) { + struct map_session_data *f_sd = pc_get_father(sd); + struct map_session_data *m_sd = pc_get_mother(sd); + + if( f_sd->state.autotrade || m_sd->state.autotrade ) + break; + } case WE_CALLBABY: + if(sd) { + struct map_session_data *c_sd = pc_get_child(sd); + + if( c_sd->state.autotrade ) + break; + } case AM_RESURRECTHOMUN: case PF_SPIDERWEB: //Find a random spot to place the skill. [Skotlex] @@ -10652,9 +10668,8 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case AM_SPHEREMINE: case AM_CANNIBALIZE: { - int summons[5] = { 1589, 1579, 1575, 1555, 1590 }; - //int summons[5] = { 1020, 1068, 1118, 1500, 1368 }; - int class_ = skill_id==AM_SPHEREMINE?1142:summons[skill_lv-1]; + int summons[5] = { MOBID_G_MANDRAGORA, MOBID_G_HYDRA, MOBID_G_FLORA, , MOBID_G_GEOGRAPHER }; + int class_ = skill_id==AM_SPHEREMINE?MOBID_MARINE_SPHERE:summons[skill_lv-1]; int ai = (skill_id == AM_SPHEREMINE) ? AI_SPHERE : AI_FLORA; struct mob_data *md; @@ -14135,10 +14150,9 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, case AM_CANNIBALIZE: case AM_SPHEREMINE: { int c=0; - int summons[5] = { 1589, 1579, 1575, 1555, 1590 }; - //int summons[5] = { 1020, 1068, 1118, 1500, 1368 }; + int summons[5] = { MOBID_G_MANDRAGORA, MOBID_G_HYDRA, MOBID_G_FLORA, MOBID_G_PARASITE, MOBID_G_MANDRAGORA }; int maxcount = (skill_id==AM_CANNIBALIZE)? 6-skill_lv : skill_get_maxcount(skill_id,skill_lv); - int mob_class = (skill_id==AM_CANNIBALIZE)? summons[skill_lv-1] :1142; + int mob_class = (skill_id==AM_CANNIBALIZE)? summons[skill_lv-1] :MOBID_MARINE_SPHERE; if(battle_config.land_skill_limit && maxcount>0 && (battle_config.land_skill_limit&BL_PC)) { i = map_foreachinmap(skill_check_condition_mob_master_sub ,sd->bl.m, BL_MOB, sd->bl.id, mob_class, skill_id, &c); if(c >= maxcount || @@ -14154,13 +14168,13 @@ int skill_check_condition_castend(struct map_session_data* sd, uint16 skill_id, case NC_MAGICDECOY: { int c = 0, j; int maxcount = skill_get_maxcount(skill_id,skill_lv); - int mob_class = 2042; + int mob_class = MOBID_SILVERSNIPER; if( skill_id == NC_MAGICDECOY ) - mob_class = 2043; + mob_class = MOBID_MAGICDECOY_FIRE; if( battle_config.land_skill_limit && maxcount > 0 && ( battle_config.land_skill_limit&BL_PC ) ) { if( skill_id == NC_MAGICDECOY ) { - for( j = mob_class; j <= 2046; j++ ) + for( j = mob_class; j <= MOBID_MAGICDECOY_WIND; j++ ) map_foreachinmap(skill_check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, j, skill_id, &c); } else map_foreachinmap(skill_check_condition_mob_master_sub, sd->bl.m, BL_MOB, sd->bl.id, mob_class, skill_id, &c); @@ -15212,21 +15226,25 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) if (idx >= 0 && idx < MAX_INVENTORY) { int i = 0, ep = 0, per; - int material[5] = { 0, 1010, 1011, 984, 984 }; + int material[5] = { 0, ITEMID_PHRACON, ITEMID_EMVERETARCON, ITEMID_ORIDECON, ITEMID_ORIDECON, }; struct item *item; struct item_data *ditem = sd->inventory_data[idx]; item = &sd->status.inventory[idx]; if(item->nameid > 0 && ditem->type == IT_WEAPON) { - if( item->refine >= sd->menuskill_val - || item->refine >= 10 // if it's no longer refineable - || ditem->flag.no_refine // if the item isn't refinable - || (i = pc_search_inventory(sd, material [ditem->wlv])) < 0 ) - { + if( ditem->flag.no_refine ) { // if the item isn't refinable clif_skill_fail(sd,sd->menuskill_id,USESKILL_FAIL_LEVEL,0); return; } + if( item->refine >= sd->menuskill_val || item->refine >= 10 ) { + clif_upgrademessage(sd->fd, 2, item->nameid); + return; + } + if( (i = pc_search_inventory(sd, material [ditem->wlv])) < 0 ) { + clif_upgrademessage(sd->fd, 3, material[ditem->wlv]); + return; + } per = status_get_refine_chance(ditem->wlv, (int)item->refine); if( sd->class_&JOBL_THIRD ) per += 10; @@ -15242,9 +15260,10 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) ep = item->equip; pc_unequipitem(sd,idx,3); } - clif_refine(sd->fd,0,idx,item->refine); clif_delitem(sd,idx,1,3); - clif_additem(sd,idx,1,0); + clif_upgrademessage(sd->fd, 0, item->nameid); + clif_inventorylist(sd); + clif_refine(sd->fd,0,idx,item->refine); if (ep) pc_equipitem(sd,idx,ep); clif_misceffect(&sd->bl,3); @@ -15268,6 +15287,7 @@ void skill_weaponrefine (struct map_session_data *sd, int idx) item->refine = 0; if(item->equip) pc_unequipitem(sd,idx,3); + clif_upgrademessage(sd->fd, 1, item->nameid); clif_refine(sd->fd,1,idx,item->refine); pc_delitem(sd,idx,1,0,2, LOG_TYPE_OTHER); clif_misceffect(&sd->bl,2); @@ -16964,14 +16984,14 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid, j = pc_search_inventory(sd,slot[i]); if(j < 0) continue; - if(slot[i]==1000){ /* Star Crumb */ + if(slot[i]==ITEMID_STAR_CRUMB){ pc_delitem(sd,j,1,1,0,LOG_TYPE_PRODUCE); sc++; } - if(slot[i]>=994 && slot[i]<=997 && ele==0){ /* Flame Heart . . . Great Nature */ + if(slot[i]>=ITEMID_FLAME_HEART && slot[i]<=ITEMID_GREAT_NATURE && ele==0){ static const int ele_table[4]={3,1,4,2}; pc_delitem(sd,j,1,1,0,LOG_TYPE_PRODUCE); - ele=ele_table[slot[i]-994]; + ele=ele_table[slot[i]-ITEMID_FLAME_HEART]; } } @@ -17037,13 +17057,13 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid, i = pc_checkskill(sd,skill_id); make_per = sd->status.job_level*20 + status->dex*10 + status->luk*10; //Base chance switch(nameid){ - case 998: // Iron + case ITEMID_IRON: make_per += 4000+i*500; // Temper Iron bonus: +26/+32/+38/+44/+50 break; - case 999: // Steel + case ITEMID_STEEL: make_per += 3000+i*500; // Temper Steel bonus: +35/+40/+45/+50/+55 break; - case 1000: //Star Crumb + case ITEMID_STAR_CRUMB: make_per = 100000; // Star Crumbs are 100% success crafting rate? (made 1000% so it succeeds even after penalties) [Skotlex] break; default: // Enchanted Stones @@ -17074,32 +17094,32 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid, make_per += skill*100; //+1% bonus per level } switch(nameid){ - case 501: // Red Potion - case 503: // Yellow Potion - case 504: // White Potion + case ITEMID_RED_POTION: + case ITEMID_YELLOW_POTION: + case ITEMID_WHITE_POTION: make_per += (1+rnd()%100)*10 + 2000; break; - case 970: // Alcohol + case ITEMID_ALCOHOL: make_per += (1+rnd()%100)*10 + 1000; break; - case 7135: // Bottle Grenade - case 7136: // Acid Bottle - case 7137: // Plant Bottle - case 7138: // Marine Sphere Bottle + case ITEMID_FIRE_BOTTLE: + case ITEMID_ACID_BOTTLE: + case ITEMID_MAN_EATER_BOTTLE: + case ITEMID_MINI_BOTTLE: make_per += (1+rnd()%100)*10; break; - case 546: // Condensed Yellow Potion + case ITEMID_YELLOW_SLIM_POTION: make_per -= (1+rnd()%50)*10; break; - case 547: // Condensed White Potion - case 7139: // Glistening Coat + case ITEMID_WHITE_SLIM_POTION: + case ITEMID_COATING_BOTTLE: make_per -= (1+rnd()%100)*10; break; //Common items, recieve no bonus or penalty, listed just because they are commonly produced - case 505: // Blue Potion - case 545: // Condensed Red Potion - case 605: // Anodyne - case 606: // Aloevera + case ITEMID_BLUE_POTION: + case ITEMID_RED_SLIM_POTION: + case ITEMID_ANODYNE: + case ITEMID_ALOEBERA: default: break; } @@ -17166,22 +17186,22 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid, (sd->status.base_level-100) + pc_checkskill(sd, AM_LEARNINGPOTION) + pc_checkskill(sd, CR_FULLPROTECTION)*(4+rnd()%6); // (Caster?s Base Level - 100) + (Potion Research x 5) + (Full Chemical Protection Skill Level) x (Random number between 4 ~ 10) switch(nameid){// difficulty factor - case 12422: case 12425: - case 12428: + case ITEMID_HP_INCREASE_POTION_SMALL: case ITEMID_SP_INCREASE_POTION_SMALL: + case ITEMID_CONCENTRATED_WHITE_POTION_Z: difficulty += 10; break; - case 6212: case 12426: + case ITEMID_BOMB_MUSHROOM_SPORE: case ITEMID_SP_INCREASE_POTION_MEDIUM: difficulty += 15; break; - case 13264: case 12423: - case 12427: case 12436: + case ITEMID_BANANA_BOMB: case ITEMID_HP_INCREASE_POTION_MEDIUM: + case ITEMID_SP_INCREASE_POTION_LARGE: case ITEMID_VITATA500: difficulty += 20; break; - case 6210: case 6211: - case 12437: + case ITEMID_SEED_OF_HORNY_PLANT: case ITEMID_BLOODSUCK_PLANT_SEED: + case ITEMID_CONCENTRATED_CEROMAIN_SOUP: difficulty += 30; break; - case 12424: case 12475: + case ITEMID_HP_INCREASE_POTION_LARGE: case ITEMID_CURE_FREE: difficulty += 40; break; } @@ -17208,18 +17228,18 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid, qty = ~(5 + rnd()%5) + 1; switch(nameid){// difficulty factor - case 13260: + case ITEMID_APPLE_BOMB: difficulty += 5; break; - case 13261: case 13262: + case ITEMID_COCONUT_BOMB: case ITEMID_MELON_BOMB: difficulty += 10; break; - case 12429: case 12430: case 12431: - case 12432: case 12433: case 12434: - case 13263: + case ITEMID_SAVAGE_FULL_ROAST: case ITEMID_COCKTAIL_WARG_BLOOD: case ITEMID_MINOR_STEW: + case ITEMID_SIROMA_ICED_TEA: case ITEMID_DROSERA_HERB_SALAD: case ITEMID_PETITE_TAIL_NOODLES: + case ITEMID_PINEAPPLE_BOMB: difficulty += 15; break; - case 13264: + case ITEMID_BANANA_BOMB: difficulty += 20; break; } @@ -17268,10 +17288,10 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid, make_per += pc_checkskill(sd,skill_id)*500; // Smithing skills bonus: +5/+10/+15 make_per += pc_checkskill(sd,BS_WEAPONRESEARCH)*100 +((wlv >= 3)? pc_checkskill(sd,BS_ORIDEOCON)*100:0); // Weaponry Research bonus: +1/+2/+3/+4/+5/+6/+7/+8/+9/+10, Oridecon Research bonus (custom): +1/+2/+3/+4/+5 make_per -= (ele?2000:0) + sc*1500 + (wlv>1?wlv*1000:0); // Element Stone: -20%, Star Crumb: -15% each, Weapon level malus: -0/-20/-30 - if(pc_search_inventory(sd,989) > 0) make_per+= 1000; // Emperium Anvil: +10 - else if(pc_search_inventory(sd,988) > 0) make_per+= 500; // Golden Anvil: +5 - else if(pc_search_inventory(sd,987) > 0) make_per+= 300; // Oridecon Anvil: +3 - else if(pc_search_inventory(sd,986) > 0) make_per+= 0; // Anvil: +0? + if(pc_search_inventory(sd,ITEMID_EMPERIUM_ANVIL) > 0) make_per+= 1000; // Emperium Anvil: +10 + else if(pc_search_inventory(sd,ITEMID_GOLDEN_AVNIL) > 0) make_per+= 500; // Golden Anvil: +5 + else if(pc_search_inventory(sd,ITEMID_ORIDECON_ANVIL) > 0) make_per+= 300; // Oridecon Anvil: +3 + else if(pc_search_inventory(sd,ITEMID_ANVIL) > 0) make_per+= 0; // Anvil: +0? if(battle_config.wp_rate != 100) make_per = make_per * battle_config.wp_rate / 100; } @@ -17353,7 +17373,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid, } if (rnd()%10000 < make_per || qty == 1) { //Success tmp_item.amount++; - if(nameid < 545 || nameid > 547) + if(nameid < ITEMID_RED_SLIM_POTION || nameid > ITEMID_WHITE_SLIM_POTION) continue; if( skill_id != AM_PHARMACY && skill_id != AM_TWILIGHT1 && @@ -17476,7 +17496,7 @@ int skill_produce_mix (struct map_session_data *sd, uint16 skill_id, int nameid, break; case GN_MIX_COOKING: { struct item tmp_item; - const int compensation[5] = {13265, 13266, 13267, 12435, 13268}; + const int compensation[5] = {ITEMID_BLACK_LUMP, ITEMID_BLACK_HARD_LUMP, ITEMID_VERY_HARD_LUMP, ITEMID_BLACK_MASS, ITEMID_MYSTERIOUS_POWDER}; int rate = rnd()%500; memset(&tmp_item,0,sizeof(tmp_item)); if( rate < 50) i = 4; @@ -17561,14 +17581,14 @@ int skill_poisoningweapon( struct map_session_data *sd, int nameid) { } switch( nameid ) { // t_lv used to take duration from skill_get_time2 - case PO_PARALYSE: type = SC_PARALYSE; break; - case PO_PYREXIA: type = SC_PYREXIA; break; - case PO_DEATHHURT: type = SC_DEATHHURT; break; - case PO_LEECHESEND: type = SC_LEECHESEND; break; - case PO_VENOMBLEED: type = SC_VENOMBLEED; break; - case PO_TOXIN: type = SC_TOXIN; break; - case PO_MAGICMUSHROOM: type = SC_MAGICMUSHROOM; break; - case PO_OBLIVIONCURSE: type = SC_OBLIVIONCURSE; break; + case ITEMID_PARALYSE: type = SC_PARALYSE; break; + case ITEMID_PYREXIA: type = SC_PYREXIA; break; + case ITEMID_DEATHHURT: type = SC_DEATHHURT; break; + case ITEMID_LEECHESEND: type = SC_LEECHESEND; break; + case ITEMID_VENOMBLEED: type = SC_VENOMBLEED; break; + case ITEMID_TOXIN: type = SC_TOXIN; break; + case ITEMID_MAGICMUSHROOM: type = SC_MAGICMUSHROOM; break; + case ITEMID_OBLIVIONCURSE: type = SC_OBLIVIONCURSE; break; default: clif_skill_fail(sd,GC_POISONINGWEAPON,USESKILL_FAIL_LEVEL,0); return 0; @@ -17626,9 +17646,9 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid) { // Item picked decides the mob class switch(nameid) { - case 990: class_ = 2043; break; - case 991: class_ = 2044; break; - case 992: class_ = 2046; break; + case ITEMID_BLOODY_RED: class_ = 2043; break; + case ITEMID_CRYSTAL_BLUE: class_ = 2044; break; + case ITEMID_WIND_OF_VERDURE: class_ = 2046; break; default: class_ = 2045; break; } @@ -17748,15 +17768,15 @@ int skill_elementalanalysis(struct map_session_data* sd, int n, uint16 skill_lv, switch( nameid ) { // Level 1 - case 994: product = 990; break; // Flame Heart -> Red Blood. - case 995: product = 991; break; // Mystic Frozen -> Crystal Blue. - case 996: product = 992; break; // Rough Wind -> Wind of Verdure. - case 997: product = 993; break; // Great Nature -> Green Live. + case ITEMID_FLAME_HEART: product = ITEMID_BLOODY_RED; break; + case ITEMID_MISTIC_FROZEN: product = ITEMID_CRYSTAL_BLUE; break; + case ITEMID_ROUGH_WIND: product = ITEMID_WIND_OF_VERDURE; break; + case ITEMID_GREAT_NATURE: product = ITEMID_YELLOW_LIVE; break; // Level 2 - case 990: product = 994; break; // Red Blood -> Flame Heart. - case 991: product = 995; break; // Crystal Blue -> Mystic Frozen. - case 992: product = 996; break; // Wind of Verdure -> Rough Wind. - case 993: product = 997; break; // Green Live -> Great Nature. + case ITEMID_BLOODY_RED: product = ITEMID_FLAME_HEART; break; + case ITEMID_CRYSTAL_BLUE: product = ITEMID_MISTIC_FROZEN; break; + case ITEMID_WIND_OF_VERDURE: product = ITEMID_ROUGH_WIND; break; + case ITEMID_YELLOW_LIVE: product = ITEMID_GREAT_NATURE; break; default: clif_skill_fail(sd,SO_EL_ANALYSIS,USESKILL_FAIL_LEVEL,0); return 1; @@ -18453,10 +18473,10 @@ int skill_get_elemental_type( uint16 skill_id , uint16 skill_lv ) { int type = 0; switch( skill_id ) { - case SO_SUMMON_AGNI: type = 2114; break; - case SO_SUMMON_AQUA: type = 2117; break; - case SO_SUMMON_VENTUS: type = 2120; break; - case SO_SUMMON_TERA: type = 2123; break; + case SO_SUMMON_AGNI: type = ELEMENTALID_AGNI_S; break; + case SO_SUMMON_AQUA: type = ELEMENTALID_AQUA_S; break; + case SO_SUMMON_VENTUS: type = ELEMENTALID_VENTUS_S; break; + case SO_SUMMON_TERA: type = ELEMENTALID_TERA_S; break; } type += skill_lv - 1; diff --git a/src/map/skill.h b/src/map/skill.h index ae880a1473..52c67dcbc5 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -1979,16 +1979,6 @@ int skill_magicdecoy(struct map_session_data *sd, int nameid); * Guiltoine Cross **/ int skill_poisoningweapon( struct map_session_data *sd, int nameid); -enum gx_poison { - PO_PARALYSE = 12717, - PO_LEECHESEND, - PO_OBLIVIONCURSE, - PO_DEATHHURT, - PO_TOXIN, - PO_PYREXIA, - PO_MAGICMUSHROOM, - PO_VENOMBLEED -}; /** * Auto Shadow Spell (Shadow Chaser) **/ diff --git a/src/map/status.c b/src/map/status.c index d27c6ce79a..367af93440 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -9932,6 +9932,7 @@ int status_change_clear(struct block_list* bl, int type) case SC_WEIGHT90: case SC_EDP: case SC_MELTDOWN: + case SC_WEDDING: case SC_XMAS: case SC_SUMMER: case SC_HANBOK: