Browse Source

Adds SC_WEAPONBREAKER status (#7265)

* Fixes #6915.
* Adds the SC_WEAPONBREAKER status which is applied via NPC_WEAPONBRAKER's self cast ability.
* Adds a chance to break a target's weapon at 2 * skill_lv% for 30 seconds.
Thanks to @Playtester!
Aleos 2 năm trước cách đây
mục cha
commit
7f82194eca

+ 3 - 5
db/pre-re/skill_db.yml

@@ -9325,15 +9325,13 @@ Body:
     Name: NPC_WEAPONBRAKER
     Name: NPC_WEAPONBRAKER
     Description: Break weapon
     Description: Break weapon
     MaxLevel: 10
     MaxLevel: 10
-    Type: Weapon
-    TargetType: Attack
+    TargetType: Self
     Flags:
     Flags:
       IsNpc: true
       IsNpc: true
-    Range: 9
     Hit: Single
     Hit: Single
     HitCount: 1
     HitCount: 1
-    Element: Weapon
-    Status: BrokenWeapon
+    Duration: 30000
+    Status: WeaponBreaker
   - Id: 344
   - Id: 344
     Name: NPC_ARMORBRAKE
     Name: NPC_ARMORBRAKE
     Description: Break armor
     Description: Break armor

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

@@ -6933,3 +6933,5 @@ Body:
       NoDispell: true
       NoDispell: true
       NoClearance: true
       NoClearance: true
       NoClearbuff: true
       NoClearbuff: true
+  - Status: WeaponBreaker
+    DurationLookup: NPC_WEAPONBRAKER

+ 3 - 5
db/re/skill_db.yml

@@ -9635,15 +9635,13 @@ Body:
     Name: NPC_WEAPONBRAKER
     Name: NPC_WEAPONBRAKER
     Description: Break weapon
     Description: Break weapon
     MaxLevel: 10
     MaxLevel: 10
-    Type: Weapon
-    TargetType: Attack
+    TargetType: Self
     Flags:
     Flags:
       IsNpc: true
       IsNpc: true
-    Range: 9
     Hit: Single
     Hit: Single
     HitCount: 1
     HitCount: 1
-    Element: Weapon
-    Status: BrokenWeapon
+    Duration: 30000
+    Status: WeaponBreaker
   - Id: 344
   - Id: 344
     Name: NPC_ARMORBRAKE
     Name: NPC_ARMORBRAKE
     Description: Break armor
     Description: Break armor

+ 2 - 0
db/re/status.yml

@@ -8400,3 +8400,5 @@ Body:
       NoDispell: true
       NoDispell: true
       NoBanishingBuster: true
       NoBanishingBuster: true
       NoClearance: true
       NoClearance: true
+  - Status: WeaponBreaker
+    DurationLookup: NPC_WEAPONBRAKER

+ 5 - 0
doc/status_change.txt

@@ -2827,3 +2827,8 @@ SC_PACKING_ENVELOPE9	(EFST_PACKING_ENVELOPE9)
 SC_PACKING_ENVELOPE10	(EFST_PACKING_ENVELOPE10)
 SC_PACKING_ENVELOPE10	(EFST_PACKING_ENVELOPE10)
 	desc: Increases HIT
 	desc: Increases HIT
 	val1: + HIT
 	val1: + HIT
+
+SC_WEAPONBREAKER
+	desc: Bonus given when using NPC_WEAPONBRAKER skill
+	val1: Skill level
+	val2: val1 * 2 weapon break chance

+ 1 - 0
src/map/script_constants.hpp

@@ -1865,6 +1865,7 @@
 	export_constant(SC_SKF_CAST);
 	export_constant(SC_SKF_CAST);
 	export_constant(SC_BEEF_RIB_STEW);
 	export_constant(SC_BEEF_RIB_STEW);
 	export_constant(SC_PORK_RIB_STEW);
 	export_constant(SC_PORK_RIB_STEW);
+	export_constant(SC_WEAPONBREAKER);
 
 
 #ifdef RENEWAL
 #ifdef RENEWAL
 	export_constant(SC_EXTREMITYFIST2);
 	export_constant(SC_EXTREMITYFIST2);

+ 7 - 6
src/map/skill.cpp

@@ -1657,9 +1657,6 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
 			break;
 			break;
 		}
 		}
 	// Equipment breaking monster skills [Celest]
 	// Equipment breaking monster skills [Celest]
-	case NPC_WEAPONBRAKER:
-		skill_break_equip(src,bl, EQP_WEAPON, 150*skill_lv, BCT_ENEMY);
-		break;
 	case NPC_ARMORBRAKE:
 	case NPC_ARMORBRAKE:
 		skill_break_equip(src,bl, EQP_ARMOR, 150*skill_lv, BCT_ENEMY);
 		skill_break_equip(src,bl, EQP_ARMOR, 150*skill_lv, BCT_ENEMY);
 		break;
 		break;
@@ -2226,8 +2223,12 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
 			rate = 0;
 			rate = 0;
 			if( sd )
 			if( sd )
 				rate += sd->bonus.break_weapon_rate;
 				rate += sd->bonus.break_weapon_rate;
-			if( sc && sc->data[SC_MELTDOWN] )
-				rate += sc->data[SC_MELTDOWN]->val2;
+			if (sc) {
+				if (sc->data[SC_MELTDOWN])
+					rate += sc->data[SC_MELTDOWN]->val2;
+				if (sc->data[SC_WEAPONBREAKER])
+					rate += sc->data[SC_WEAPONBREAKER]->val2;
+			}
 			if( rate )
 			if( rate )
 				skill_break_equip(src,bl, EQP_WEAPON, rate, BCT_ENEMY);
 				skill_break_equip(src,bl, EQP_WEAPON, rate, BCT_ENEMY);
 
 
@@ -5078,7 +5079,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
 	case NPC_UNDEADATTACK:
 	case NPC_UNDEADATTACK:
 	case NPC_CHANGEUNDEAD:
 	case NPC_CHANGEUNDEAD:
 	case NPC_ARMORBRAKE:
 	case NPC_ARMORBRAKE:
-	case NPC_WEAPONBRAKER:
 	case NPC_HELMBRAKE:
 	case NPC_HELMBRAKE:
 	case NPC_SHIELDBRAKE:
 	case NPC_SHIELDBRAKE:
 	case NPC_BLINDATTACK:
 	case NPC_BLINDATTACK:
@@ -7674,6 +7674,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 	case NPC_MAGICMIRROR:
 	case NPC_MAGICMIRROR:
 	case ST_PRESERVE:
 	case ST_PRESERVE:
 	case NPC_KEEPING:
 	case NPC_KEEPING:
+	case NPC_WEAPONBRAKER:
 	case NPC_BARRIER:
 	case NPC_BARRIER:
 	case NPC_INVINCIBLE:
 	case NPC_INVINCIBLE:
 	case NPC_INVINCIBLEOFF:
 	case NPC_INVINCIBLEOFF:

+ 3 - 0
src/map/status.cpp

@@ -12509,6 +12509,9 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 				}
 				}
 			}
 			}
 			break;
 			break;
+		case SC_WEAPONBREAKER:
+			val2 = val1 * 2 * 100; // Chance to break weapon
+			break;
 
 
 		default:
 		default:
 			if (calc_flag.none() && scdb->skill_id == 0 && scdb->icon == EFST_BLANK && scdb->opt1 == OPT1_NONE && scdb->opt2 == OPT2_NONE && scdb->state.none() && scdb->flag.none() && scdb->end.empty() && scdb->endreturn.empty() && scdb->fail.empty()) {
 			if (calc_flag.none() && scdb->skill_id == 0 && scdb->icon == EFST_BLANK && scdb->opt1 == OPT1_NONE && scdb->opt2 == OPT2_NONE && scdb->state.none() && scdb->flag.none() && scdb->end.empty() && scdb->endreturn.empty() && scdb->fail.empty()) {

+ 2 - 0
src/map/status.hpp

@@ -1255,6 +1255,8 @@ enum sc_type : int16 {
 	SC_BEEF_RIB_STEW,
 	SC_BEEF_RIB_STEW,
 	SC_PORK_RIB_STEW,
 	SC_PORK_RIB_STEW,
 
 
+	SC_WEAPONBREAKER,
+
 #ifdef RENEWAL
 #ifdef RENEWAL
 	SC_EXTREMITYFIST2, //! NOTE: This SC should be right before SC_MAX, so it doesn't disturb if RENEWAL is disabled
 	SC_EXTREMITYFIST2, //! NOTE: This SC should be right before SC_MAX, so it doesn't disturb if RENEWAL is disabled
 #endif
 #endif