Bläddra i källkod

- 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://svn.code.sf.net/p/rathena/svn/trunk@6528 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex 19 år sedan
förälder
incheckning
05667b0fa9
6 ändrade filer med 27 tillägg och 12 borttagningar
  1. 10 0
      Changelog-Trunk.txt
  2. 5 4
      src/map/battle.c
  3. 1 1
      src/map/map.h
  4. 7 3
      src/map/mob.c
  5. 3 3
      src/map/script.c
  6. 1 1
      src/map/skill.c

+ 10 - 0
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]

+ 5 - 4
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;
 					}
 				}

+ 1 - 1
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;

+ 7 - 3
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;

+ 3 - 3
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;
 }
 

+ 1 - 1
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;