Quellcode durchsuchen

Fixed Barrier Damage Reduction (#9148)

- Barrier now sets damage to 1 per Hit instead of giving 100 DEF/MDEF
- Barrier works against all skills except those that ignore damage modifiers completely
  * In pre-re Gravitational Field and Pressure still deal full damage against Barrier
  * Other skills that ignore damage modifiers are not relevant as they cannot be used against monsters
- Fixes #9141
Playtester vor 2 Monaten
Ursprung
Commit
73b9c86be7
4 geänderte Dateien mit 5 neuen und 10 gelöschten Zeilen
  1. 0 3
      db/pre-re/status.yml
  2. 0 3
      db/re/status.yml
  3. 5 0
      src/map/battle.cpp
  4. 0 4
      src/map/status.cpp

+ 0 - 3
db/pre-re/status.yml

@@ -777,9 +777,6 @@ Body:
   - Status: Barrier
     Icon: EFST_BARRIER
     DurationLookup: NPC_BARRIER
-    CalcFlags:
-      Mdef: true
-      Def: true
     Flags:
       RemoveOnHermode: true
   - Status: Stripweapon

+ 0 - 3
db/re/status.yml

@@ -804,9 +804,6 @@ Body:
   - Status: Barrier
     Icon: EFST_BARRIER
     DurationLookup: NPC_BARRIER
-    CalcFlags:
-      Mdef: true
-      Def: true
     Flags:
       RemoveOnHermode: true
   - Status: Stripweapon

+ 5 - 0
src/map/battle.cpp

@@ -1667,6 +1667,11 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
 	}
 
 	if( tsc != nullptr && !tsc->empty() ) {
+		// Barrier just sets damage to 1 per hit and prevents the rest of the code from being processed
+		// But only if the damage at this point is greater than 0
+		if (damage > 0 && tsc->getSCE(SC_BARRIER) != nullptr)
+			return div_;
+
 		// Damage increasing effects
 #ifdef RENEWAL // Flat +400% damage from melee
 		if (tsc->getSCE(SC_KAITE) && (flag&(BF_SHORT|BF_MAGIC)) == BF_SHORT)

+ 0 - 4
src/map/status.cpp

@@ -7533,8 +7533,6 @@ static defType status_calc_def(struct block_list *bl, status_change *sc, int32 d
 	if(sc->getSCE(SC_ETERNALCHAOS))
 		return 0;
 #endif
-	if(sc->getSCE(SC_BARRIER))
-		return 100;
 	if(sc->getSCE(SC_KEEPING))
 		return 90;
 #ifndef RENEWAL /// Steel Body does not provide 90 DEF in [RENEWAL]
@@ -7706,8 +7704,6 @@ static defType status_calc_mdef(struct block_list *bl, status_change *sc, int32
 
 	if(sc->getSCE(SC_BERSERK))
 		return 0;
-	if(sc->getSCE(SC_BARRIER))
-		return 100;
 
 #ifndef RENEWAL /// Steel Body does not provide 90 MDEF in [RENEWAL]
 	if(sc->getSCE(SC_STEELBODY))