diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/config/renewal.h | 1 | ||||
-rw-r--r-- | src/map/battle.c | 95 | ||||
-rw-r--r-- | src/map/itemdb.c | 12 | ||||
-rw-r--r-- | src/map/mob.c | 6 | ||||
-rw-r--r-- | src/map/pc.c | 3 | ||||
-rw-r--r-- | src/map/script.c | 18 | ||||
-rw-r--r-- | src/map/script.h | 5 | ||||
-rw-r--r-- | src/map/skill.c | 8 | ||||
-rw-r--r-- | src/map/status.c | 12 |
9 files changed, 134 insertions, 26 deletions
diff --git a/src/config/renewal.h b/src/config/renewal.h index 3b11aff74..36615d63b 100644 --- a/src/config/renewal.h +++ b/src/config/renewal.h @@ -60,6 +60,7 @@ /// - damage is NOT increased by 400% /// - it does NOT affect grimtooth /// - weapon and status ATK are increased +/// - some skill's damage ratio has modified #define RENEWAL_EDP /// renewal ASPD [malufett] diff --git a/src/map/battle.c b/src/map/battle.c index 8ad54f413..687db1b95 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2498,12 +2498,14 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block } //Skill damage modifiers that stack linearly if(sc && skill_id != PA_SACRIFICE){ +#ifdef RENEWAL_EDP if( sc->data[SC_EDP] ){ if( skill_id == AS_SONICBLOW || skill_id == GC_COUNTERSLASH || skill_id == GC_CROSSIMPACT ) skillratio >>= 1; } +#endif if(sc->data[SC_OVERTHRUST]) skillratio += sc->data[SC_OVERTHRUST]->val3; if(sc->data[SC_OVERTHRUSTMAX]) @@ -3409,11 +3411,36 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list ad.damage = battle->calc_cardfix(BF_MAGIC, src, target, nk, s_ele, 0, ad.damage, 0, ad.flag); #endif if(sd) { + uint16 skill; //Damage bonuses if ((i = pc->skillatk_bonus(sd, skill_id))) ad.damage += ad.damage*i/100; - - if( (i = battle->adjust_skill_damage(src->m,skill_id)) ) + switch(skill_id){ + case WL_CHAINLIGHTNING_ATK: + skill = WL_CHAINLIGHTNING; + break; + case AB_DUPLELIGHT_MAGIC: + skill = AB_DUPLELIGHT; + break; + case WL_TETRAVORTEX_FIRE: + case WL_TETRAVORTEX_WATER: + case WL_TETRAVORTEX_WIND: + case WL_TETRAVORTEX_GROUND: + skill = WL_TETRAVORTEX; + break; + case WL_SUMMON_ATK_FIRE: + case WL_SUMMON_ATK_WIND: + case WL_SUMMON_ATK_WATER: + case WL_SUMMON_ATK_GROUND: + skill = WL_RELEASE; + break; + case WM_REVERBERATION_MAGIC: + skill = WM_REVERBERATION; + break; + default: + skill = skill_id; + } + if( (i = battle->adjust_skill_damage(src->m,skill)) ) MATK_RATE(i); //Ignore Defense? @@ -3849,10 +3876,18 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * } #endif md.damage = battle->calc_cardfix(BF_MISC, src, target, nk, s_ele, 0, md.damage, 0, md.flag); - - if (sd && (i = pc->skillatk_bonus(sd, skill_id))) - md.damage += md.damage*i/100; - + if(skill_id){ + uint16 skill; + switch(skill_id){ + case GN_HELLS_PLANT_ATK: + skill = GN_HELLS_PLANT; + break; + default: + skill = skill_id; + } + if (sd && (i = pc->skillatk_bonus(sd, skill))) + md.damage += md.damage*i/100; + } if( (i = battle->adjust_skill_damage(src->m,skill_id)) ) md.damage = md.damage * i / 100; @@ -4543,6 +4578,10 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list ATK_ADD( 30 * tsc->data[SC_DARKCROW]->val1 ); } + if ( sc && !skill_id && sc->data[SC_EXEEDBREAK] ) { + ATK_ADDRATE(sc->data[SC_EXEEDBREAK]->val1); + status_change_end(src, SC_EXEEDBREAK, INVALID_TIMER); + } #ifdef RENEWAL if( sd && skill_id == NJ_KUNAI ){ flag.tdef = 1; @@ -4694,9 +4733,43 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list ATK_ADDRATE(50); break; } - - if( (i = battle->adjust_skill_damage(src->m,skill_id)) ) - ATK_RATE(i); + if( skill_id ){ + uint16 skill; + switch(skill_id){ + case AB_DUPLELIGHT_MELEE: + skill = AB_DUPLELIGHT; + break; + case LG_OVERBRAND_BRANDISH: + case LG_OVERBRAND_PLUSATK: + skill = LG_OVERBRAND; + break; + case WM_SEVERE_RAINSTORM_MELEE: + skill = WM_SEVERE_RAINSTORM; + break; + case WM_REVERBERATION_MELEE: + skill = WM_REVERBERATION; + break; + case GN_CRAZYWEED_ATK: + skill = GN_CRAZYWEED; + break; + case GN_SLINGITEM_RANGEMELEEATK: + skill = GN_SLINGITEM; + break; + case RL_R_TRIP_PLUSATK: + skill = RL_R_TRIP; + break; + case RL_B_FLICKER_ATK: + skill = RL_FLICKER; + break; + case RL_GLITTERING_GREED_ATK: + skill = RL_GLITTERING_GREED; + break; + default: + skill = skill_id; + } + if( (i = battle->adjust_skill_damage(src->m,skill)) ) + ATK_RATE(i); + } if( sd ) { if (skill_id && (i = pc->skillatk_bonus(sd, skill_id))) @@ -5532,10 +5605,6 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t wd = battle->calc_attack(BF_WEAPON, src, target, 0, 0, flag); if( sc && sc->count ) { - if (sc->data[SC_EXEEDBREAK]) { - ATK_RATER(sc->data[SC_EXEEDBREAK]->val1); - status_change_end(src, SC_EXEEDBREAK, INVALID_TIMER); - } if( sc->data[SC_SPELLFIST] ) { if( --(sc->data[SC_SPELLFIST]->val1) >= 0 ){ struct Damage ad = battle->calc_attack(BF_MAGIC,src,target,sc->data[SC_SPELLFIST]->val3,sc->data[SC_SPELLFIST]->val4,flag|BF_SHORT); diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 527972516..bfcc6f795 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1164,6 +1164,9 @@ void itemdb_read_chains(void) { CREATE(itemdb->chains, struct item_chain, libconfig->setting_length(item_chain_conf.root)); itemdb->chain_count = (unsigned short)libconfig->setting_length(item_chain_conf.root); +#ifdef ENABLE_CASE_CHECK + script->parser_current_file = config_filename; +#endif // ENABLE_CASE_CHECK while( (itc = libconfig->setting_get_elem(item_chain_conf.root,i++)) ) { struct item_data *data = NULL; struct item_chain_entry *prev = NULL; @@ -1197,6 +1200,9 @@ void itemdb_read_chains(void) { count++; } +#ifdef ENABLE_CASE_CHECK + script->parser_current_file = NULL; +#endif // ENABLE_CASE_CHECK libconfig->destroy(&item_chain_conf); @@ -2230,8 +2236,14 @@ void itemdb_name_constants(void) { DBIterator *iter = db_iterator(itemdb->names); struct item_data *data; +#ifdef ENABLE_CASE_CHECK + script->parser_current_file = "Item Database (Likely an invalid or conflicting AegisName)"; +#endif // ENABLE_CASE_CHECK for( data = dbi_first(iter); dbi_exists(iter); data = dbi_next(iter) ) script->set_constant2(data->name,data->nameid,0); +#ifdef ENABLE_CASE_CHECK + script->parser_current_file = NULL; +#endif // ENABLE_CASE_CHECK dbi_destroy(iter); } diff --git a/src/map/mob.c b/src/map/mob.c index dab7b99ac..dc83be93e 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3962,10 +3962,16 @@ int mob_read_sqldb(void) { void mob_name_constants(void) { int i; +#ifdef ENABLE_CASE_CHECK + script->parser_current_file = "Mob Database (Likely an invalid or conflicting SpriteName)"; +#endif // ENABLE_CASE_CHECK for (i = 0; i < MAX_MOB_DB; i++) { if (mob->db_data[i] && !mob->is_clone(i)) script->set_constant2(mob->db_data[i]->sprite, i, 0); } +#ifdef ENABLE_CASE_CHECK + script->parser_current_file = NULL; +#endif // ENABLE_CASE_CHECK } /*========================================== diff --git a/src/map/pc.c b/src/map/pc.c index 14e7d4661..e29ef343f 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5206,7 +5206,8 @@ int pc_checkallowskill(struct map_session_data *sd) SC_LKCONCENTRATION, SC_EDP, #endif - SC_FEARBREEZE + SC_FEARBREEZE, + SC_EXEEDBREAK, }; const enum sc_type scs_list[] = { SC_AUTOGUARD, diff --git a/src/map/script.c b/src/map/script.c index aa3713427..4fb4e7224 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2275,7 +2275,10 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o for(i=0; i<size; i++) linkdb_final(&script->syntax.curly[i].case_label); #ifdef ENABLE_CASE_CHECK - script->local_casecheck.clear(); + script->local_casecheck.clear(); + script->parser_current_src = NULL; + script->parser_current_file = NULL; + script->parser_current_line = 0; #endif // ENABLE_CASE_CHECK return NULL; } @@ -2292,7 +2295,10 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o script->size = 0; script->buf = NULL; #ifdef ENABLE_CASE_CHECK - script->local_casecheck.clear(); + script->local_casecheck.clear(); + script->parser_current_src = NULL; + script->parser_current_file = NULL; + script->parser_current_line = 0; #endif // ENABLE_CASE_CHECK return NULL; } @@ -2310,7 +2316,10 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o script->size = 0; script->buf = NULL; #ifdef ENABLE_CASE_CHECK - script->local_casecheck.clear(); + script->local_casecheck.clear(); + script->parser_current_src = NULL; + script->parser_current_file = NULL; + script->parser_current_line = 0; #endif // ENABLE_CASE_CHECK return NULL; } @@ -2428,6 +2437,9 @@ struct script_code* parse_script(const char *src,const char *file,int line,int o code->script_vars = NULL; #ifdef ENABLE_CASE_CHECK script->local_casecheck.clear(); + script->parser_current_src = NULL; + script->parser_current_file = NULL; + script->parser_current_line = 0; #endif // ENABLE_CASE_CHECK return code; } diff --git a/src/map/script.h b/src/map/script.h index 4906d4fa8..872c5bc31 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -23,8 +23,9 @@ struct eri; **/ // TODO: Remove temporary code #define ENABLE_CASE_CHECK -#define DeprecationWarning(func, bad, good, file, line) ShowError("%s: use of deprecated keyword '%s' (use '%s' instead) in file '%s', line '%d'.\n", (func), (bad), (good), (file), (line)); -#define DeprecationWarning2(func, bad, good, where) ShowError("%s: detected possible use of wrong case in a script. Found '%s', probably meant to be '%s' (in '%s').\n", (func), (bad), (good), (where)); +#define get_script_source(source) ((source) ? (source) : "Unknown (Possibly source or variables stored in database") +#define DeprecationWarning(func, bad, good, file, line) ShowError("%s: use of deprecated keyword '%s' (use '%s' instead) in file '%s', line '%d'.\n", (func), (bad), (good), get_script_source(file), (line)); +#define DeprecationWarning2(func, bad, good, where) ShowError("%s: detected possible use of wrong case in a script. Found '%s', probably meant to be '%s' (in '%s').\n", (func), (bad), (good), get_script_source(where)); #define disp_deprecation_message(func, good, p) disp_warning_message(func": use of deprecated keyword (use '"good"' instead).", (p)); #define NUM_WHISPER_VAR 10 diff --git a/src/map/skill.c b/src/map/skill.c index 2e520454f..a66ead4ae 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -15067,7 +15067,7 @@ int skill_maelstrom_suction(struct block_list *bl, va_list ap) { *------------------------------------------*/ int skill_enchant_elemental_end (struct block_list *bl, int type) { struct status_change *sc; - const enum sc_type scs[] = { SC_ENCHANTPOISON, SC_ASPERSIO, SC_PROPERTYFIRE, SC_PROPERTYWATER, SC_PROPERTYWIND, SC_PROPERTYGROUND, SC_PROPERTYDARK, SC_PROPERTYTELEKINESIS, SC_ENCHANTARMS, SC_EXEEDBREAK }; + const enum sc_type scs[] = { SC_ENCHANTPOISON, SC_ASPERSIO, SC_PROPERTYFIRE, SC_PROPERTYWATER, SC_PROPERTYWIND, SC_PROPERTYGROUND, SC_PROPERTYDARK, SC_PROPERTYTELEKINESIS, SC_ENCHANTARMS }; int i; nullpo_ret(bl); nullpo_ret(sc = status->get_sc(bl)); @@ -18130,7 +18130,13 @@ void skill_readdb(bool minimal) { safestrncpy(skill->db[0].name, "UNKNOWN_SKILL", sizeof(skill->db[0].name)); safestrncpy(skill->db[0].desc, "Unknown Skill", sizeof(skill->db[0].desc)); +#ifdef ENABLE_CASE_CHECK + script->parser_current_file = DBPATH"skill_db.txt"; +#endif // ENABLE_CASE_CHECK sv->readdb(map->db_path, DBPATH"skill_db.txt", ',', 17, 17, MAX_SKILL_DB, skill->parse_row_skilldb); +#ifdef ENABLE_CASE_CHECK + script->parser_current_file = NULL; +#endif // ENABLE_CASE_CHECK if (minimal) return; diff --git a/src/map/status.c b/src/map/status.c index e204e9d92..df79cee74 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -8435,12 +8435,12 @@ int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val tick = -1; //endless duration in the client break; case SC_EXEEDBREAK: - val1 *= 150; // 150 * skill_lv - if( sd && sd->inventory_data[sd->equip_index[EQI_HAND_R]] ) { // Chars. - val1 += (sd->inventory_data[sd->equip_index[EQI_HAND_R]]->weight/10 * sd->inventory_data[sd->equip_index[EQI_HAND_R]]->wlv * status->get_lv(bl) / 100); - val1 += 15 * (sd ? sd->status.job_level:50) + 100; - } else // Mobs - val1 += (400 * status->get_lv(bl) / 100) + (15 * (status->get_lv(bl) / 2)); // About 1138% at mob_lvl 99. Is an aproximation to a standard weapon. [pakpil] + if( sd ){ + short index = sd->equip_index[EQI_HAND_R]; + val1 = 15 * (sd->status.job_level + val1 * 10); + if( index >= 0 && sd->inventory_data[index] && sd->inventory_data[index]->type == IT_WEAPON ) + val1 += (sd->inventory_data[index]->weight / 10 * sd->inventory_data[index]->wlv) * status->get_lv(bl) / 100; + } break; case SC_PRESTIGE: // Based on suggested formula in iRO Wiki and some test, still need more test. [pakpil] val2 = ((st->int_ + st->luk) / 6) + 5; // Chance to evade magic damage. |