From 201d850ec63f84808533d44b37caa5f582c4c25e Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 9 May 2006 17:08:09 +0000 Subject: - Script commands sc_start, sc_start2 and sc_start4 will now start regardless of sc defense of the target player (that is, they cannot be avoided) - Fixed a possible counter overflow in attacked_count, changed the var size to unsigned char since the code can handle the overflow now. - Multiple targets again reduces armor defense, as reported by Tharis. - Increased dex increase of NPC_POWERUP to +20 per level. - Fog of Wall's -50 hit reduction is now only for ranged attacks. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6528 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 10 ++++++++++ src/map/battle.c | 9 +++++---- src/map/map.h | 2 +- src/map/mob.c | 10 +++++++--- src/map/script.c | 6 +++--- src/map/skill.c | 2 +- 6 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 0d68285e0..0e454a0e8 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,16 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +2006/05/09 + * Script commands sc_start, sc_start2 and sc_start4 will now start + regardless of sc defense of the target player (that is, they cannot be + avoided/blocked) [Skotlex] + * Fixed a possible counter overflow in attacked_count, changed the var size + to unsigned char since the code can handle the overflow now. [Skotlex] + * Multiple targets again reduces armor defense, as reported by Tharis. + [Skotlex] + * Increased dex bonus of NPC_POWERUP to +20 per level. [Skotlex] + * Fog of Wall's -50 hit reduction is now only for ranged attacks. [Skotlex] 2006/05/08 * Reverted the change that was making ES skills stun the caster always. [Skotlex] diff --git a/src/map/battle.c b/src/map/battle.c index af477cb2c..045e7ed90 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1305,7 +1305,9 @@ static struct Damage battle_calc_weapon_attack( hitrate+= status_get_hit(src) - flee; - if((sc && sc->data[SC_FOGWALL].timer!=-1) || (tsc && tsc->data[SC_FOGWALL].timer!=-1)) + if(wd.flag&BF_LONG && ( + (sc && sc->data[SC_FOGWALL].timer!=-1) || + (tsc && tsc->data[SC_FOGWALL].timer!=-1))) hitrate-=50; if(sd && flag.arrow) @@ -1871,11 +1873,10 @@ static struct Damage battle_calc_weapon_attack( target_count = unit_counttargeted(target,battle_config.vit_penalty_count_lv); if(target_count >= battle_config.vit_penalty_count) { if(battle_config.vit_penalty_type == 1) { -// armor defense shouldn't be reduced from what people are saying. [Skotlex] -// def1 = (def1 * (100 - (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num))/100; + def1 = (def1 * (100 - (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num))/100; def2 = (def2 * (100 - (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num))/100; } else { //Assume type 2 -// def1 -= (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num; + def1 -= (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num; def2 -= (target_count - (battle_config.vit_penalty_count - 1))*battle_config.vit_penalty_num; } } diff --git a/src/map/map.h b/src/map/map.h index 839dccd31..44b29af42 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -901,7 +901,7 @@ struct mob_data { short speed; short attacked_count; unsigned short level; - unsigned short attacked_players; + unsigned char attacked_players; unsigned int tdmg; //Stores total damage given to the mob, for exp calculations. [Skotlex] int hp, max_hp; int target_id,attacked_id; diff --git a/src/map/mob.c b/src/map/mob.c index bd312a772..47dcd85fd 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1597,10 +1597,14 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) if(!(type&2)) { int id = 0; if (src) { + md->attacked_players++; + if (!md->attacked_players) //Counter overflow o.O + md->attacked_players++; + switch (src->type) { case BL_PC: id = sd->status.char_id; - if(rand()%1000 < 1000/++(md->attacked_players)) + if(rand()%1000 < 1000/md->attacked_players) md->attacked_id = sd->bl.id; break; case BL_PET: @@ -1611,7 +1615,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) damage=(damage*battle_config.pet_attack_exp_rate)/100; //Modify logged damage accordingly. } //Let mobs retaliate against the pet's master [Skotlex] - if(rand()%1000 < 1000/++(md->attacked_players)) + if(rand()%1000 < 1000/md->attacked_players) md->attacked_id = pd->msd->bl.id; break; } @@ -1622,7 +1626,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type) struct map_session_data* msd = map_id2sd(md2->master_id); if (msd) id = msd->status.char_id; } - if(rand()%1000 < 1000/++(md->attacked_players)) + if(rand()%1000 < 1000/md->attacked_players) { //Let players decide whether to retaliate versus the master or the mob. [Skotlex] if (md2->master_id && battle_config.retaliate_to_master) md->attacked_id = md2->master_id; diff --git a/src/map/script.c b/src/map/script.c index a7a315869..40b6f10a2 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -6133,7 +6133,7 @@ int buildin_sc_start(struct script_state *st) val4 = 1; //Mark that this was a thrown sc_effect } if (bl) - sc_start4(bl,type,100,val1,0,0,val4,tick); + status_change_start(bl,type,10000,val1,0,0,val4,tick,11); return 0; } @@ -6161,7 +6161,7 @@ int buildin_sc_start2(struct script_state *st) } if(bl) - status_change_start(bl,type,per,val1,0,0,val4,tick,0); + status_change_start(bl,type,per,val1,0,0,val4,tick,11); return 0; } @@ -6191,7 +6191,7 @@ int buildin_sc_start4(struct script_state *st) tick/=2; } if (bl) - sc_start4(bl,type,100,val1,val2,val3,val4,tick); + status_change_start(bl,type,10000,val1,val2,val3,val4,tick,11); return 0; } diff --git a/src/map/skill.c b/src/map/skill.c index 66c3031bb..ec421d1c5 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4982,7 +4982,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case NPC_POWERUP: sc_start(bl,SC_INCATKRATE,100,40*skilllv,skill_get_time(skillid, skilllv)); //From experience it appears powerup is more hit, not +all stats. - sc_start(bl,SC_INCDEX,100,10*skilllv,skill_get_time(skillid, skilllv)); + sc_start(bl,SC_INCDEX,100,20*skilllv,skill_get_time(skillid, skilllv)); // sc_start(bl,SC_INCALLSTATUS,100,skilllv*5,skill_get_time(skillid, skilllv)); clif_skill_nodamage(src,bl,skillid,skilllv,1); break; -- cgit v1.2.3-70-g09d2