Explorar o código

- /doridori now won't double the HP/SP regen of TKs, it only activates their "happy" state.
- Added the -50 hit penalty when standing on Wall of Fog.
- Cleaned up status_calc_mdef2
- Uncommented the status_calc_mdef2 call in status_calc_pc.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6491 54d463be-8e91-2dee-dedb-b68131a5f0ec

skotlex %!s(int64=19) %!d(string=hai) anos
pai
achega
266148ef5f
Modificáronse 5 ficheiros con 27 adicións e 24 borrados
  1. 4 0
      Changelog-Trunk.txt
  2. 4 1
      src/map/battle.c
  3. 4 1
      src/map/clif.c
  4. 1 12
      src/map/pc.c
  5. 14 10
      src/map/status.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/05/05
+	* /doridori now won't double the HP/SP regen of TKs, it only activates
+	  their "happy" state. [Skotlex]
+	* Added the -50 hit penalty when standing on Wall of Fog. [Skotlex]
+	* Uncommented the status_calc_mdef2 call in status_calc_pc. [Skotlex]
 	* Being in Enjoyable Rest state will now also trigger the HP/SP Time skills
 	  (even if there's no other TK around). [Skotlex]
 	* Added battle config settings view_range_rate and chase_range_rate to

+ 4 - 1
src/map/battle.c

@@ -1304,7 +1304,10 @@ 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))
+			hitrate-=50;
+			
 		if(sd && flag.arrow)
 			hitrate += sd->arrow_hit;
 		if(skill_num)

+ 4 - 1
src/map/clif.c

@@ -10820,7 +10820,10 @@ void clif_parse_PMIgnoreList(int fd,struct map_session_data *sd)
  */
 void clif_parse_NoviceDoriDori(int fd, struct map_session_data *sd) {
 	int level;
-	sd->doridori_counter = 1;
+	
+	if ((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE)
+		sd->doridori_counter++;
+	
 	if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON
 		&& sd->state.rest && (level = pc_checkskill(sd,TK_SPTIME)))
 		sc_start(&sd->bl,SkillStatusChangeTable[TK_SPTIME],100,level,skill_get_time(TK_SPTIME, level));

+ 1 - 12
src/map/pc.c

@@ -6817,7 +6817,7 @@ static int pc_natural_heal_sp(struct map_session_data *sd)
 
 	if(sd->nshealsp > 0) {
 		if(sd->inchealsptick >= battle_config.natural_heal_skill_interval && sd->status.sp < sd->status.max_sp) {
-			if(sd->doridori_counter && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE) {
+			if(sd->doridori_counter) {
 				bonus = sd->nshealsp*2;
 				sd->doridori_counter = 0;
 			} else
@@ -6858,12 +6858,6 @@ static int pc_spirit_heal_hp(struct map_session_data *sd)
 
 	if(sd->inchealspirithptick >= interval) {
 		bonus_hp = sd->nsshealhp;
-		if(sd->doridori_counter && pc_checkskill(sd,TK_HPTIME) > 0) {
-		  	//TK_HPTIME doridori provided bonus [Dralnu]
-			bonus_hp += sd->nsshealhp;
-			if (!sd->nsshealsp) //If there's sp regen, this gets clear in the next function. [Skotlex]
-				sd->doridori_counter = 0;
-		}
 		while(sd->inchealspirithptick >= interval) {
 			if(pc_issit(sd)) {
 				sd->inchealspirithptick -= interval;
@@ -6904,11 +6898,6 @@ static int pc_spirit_heal_sp(struct map_session_data *sd)
 
 	if(sd->inchealspiritsptick >= interval) {
 		bonus_sp = sd->nsshealsp;
-		if(sd->doridori_counter && pc_checkskill(sd,TK_SPTIME) > 0) {
-			//TK_SPTIME doridori provided bonus [Dralnu]
-			bonus_sp += sd->nsshealsp;
-			sd->doridori_counter = 0;
-		}
 		while(sd->inchealspiritsptick >= interval) {
 			if(pc_issit(sd)) {
 				sd->inchealspiritsptick -= interval;

+ 14 - 10
src/map/status.c

@@ -1311,7 +1311,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
 		// Basic INT-MDEF value
 		sd->mdef2 += sd->paramc[3];
 
-		// sd->mdef2 = status_calc_mdef2(&sd->bl,sd->mdef2);
+		sd->mdef2 = status_calc_mdef2(&sd->bl,sd->mdef2);
 
 		// Apply relative modifiers from equipment
 		if(sd->mdef2_rate != 100)
@@ -2953,20 +2953,24 @@ int status_get_mdef2(struct block_list *bl)
 	int mdef2=0;
 	nullpo_retr(0, bl);
 
-	if(bl->type == BL_PC)
-		return ((struct map_session_data *)bl)->mdef2 + (((struct map_session_data *)bl)->paramc[2]>>1);
-	else if(bl->type == BL_MOB)
-		mdef2 = ((struct mob_data *)bl)->db->int_ + (((struct mob_data *)bl)->db->vit>>1);
-	else if(bl->type == BL_PET) {	//<Skotlex> Use pet's stats
-		if (battle_config.pet_lv_rate && ((struct pet_data *)bl)->status)
-			mdef2 = ((struct pet_data *)bl)->status->int_ +(((struct pet_data *)bl)->status->vit>>1);
+	switch(bl->type)
+	{
+	case BL_PC:
+		return ((TBL_PC*)bl)->mdef2 + (((TBL_PC*)bl)->paramc[2]>>1);
+	case BL_MOB:
+		mdef2 = ((TBL_MOB*)bl)->db->int_ + (((TBL_MOB*)bl)->db->vit>>1);
+		break;
+	case BL_PET:
+		//<Skotlex> Use pet's stats
+		if (battle_config.pet_lv_rate && ((TBL_PET*)bl)->status)
+			mdef2 = ((TBL_PET*)bl)->status->int_ +(((TBL_PET*)bl)->status->vit>>1);
 		else
-			mdef2 = ((struct pet_data *)bl)->db->int_ + (((struct pet_data *)bl)->db->vit>>1);
+			mdef2 = ((TBL_PET*)bl)->db->int_ + (((TBL_PET*)bl)->db->vit>>1);
+		break;
 	}
 
 	mdef2 = status_calc_mdef2(bl,mdef2);
 	if(mdef2 < 0) mdef2 = 0;
-	
 	return mdef2;
 }
 /*==========================================