summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-09 17:08:09 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-05-09 17:08:09 +0000
commit201d850ec63f84808533d44b37caa5f582c4c25e (patch)
tree97069a114e46d4fa379a3348f5e6a3be0e6abb90 /src
parent78c3ef3eee96f59282e699b3c7da7dad592ab5ea (diff)
downloadhercules-201d850ec63f84808533d44b37caa5f582c4c25e.tar.gz
hercules-201d850ec63f84808533d44b37caa5f582c4c25e.tar.bz2
hercules-201d850ec63f84808533d44b37caa5f582c4c25e.tar.xz
hercules-201d850ec63f84808533d44b37caa5f582c4c25e.zip
- 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
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c9
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/mob.c10
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/skill.c2
5 files changed, 17 insertions, 12 deletions
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;