Browse Source

NPC_POWERUP, NPC_AGIUP (vs. Quagmire) and Dispel (#8243)

- NPC_POWERUP and NPC_AGIUP now grant their own unique status changes
- Duration of NPC_POWERUP is now 5s*level
- Duration of NPC_AGIUP is now 10s*level and max level is back to 10
- Quagmire, Slow Grace and Adoramus now work even when the target used NPC_AGIUP
- NPC_AGIUP will remove Decrease Agi on start but will not prevent it
- NPC_AGIUP can be dispelled, but NPC_POWERUP cannot
- Dispel will now make a monster unlock its target
- Removed custom code to display the NPC_POWERUP effect, it's now correctly linked to EFST_POWERUP
- Removed the ifdef around EXTREMITYFIST2, so we no longer constantly change its ID
- Fixes #8242 
- Fixes #904 
- Fixes #7346
Playtester 1 year ago
parent
commit
82c37ce32d

+ 23 - 13
db/pre-re/skill_db.yml

@@ -9345,20 +9345,20 @@ Body:
     Hit: Single
     Duration1:
       - Level: 1
-        Time: 10000
+        Time: 5000
       - Level: 2
-        Time: 15000
+        Time: 10000
       - Level: 3
-        Time: 20000
+        Time: 15000
       - Level: 4
-        Time: 25000
+        Time: 20000
       - Level: 5
-        Time: 30000
-    Status: IncHitRate
+        Time: 25000
+    Status: Powerup
   - Id: 350
     Name: NPC_AGIUP
-    Description: Agility UP
-    MaxLevel: 5
+    Description: Agility Up
+    MaxLevel: 10
     TargetType: Self
     DamageFlags:
       NoDamage: true
@@ -9369,14 +9369,24 @@ Body:
       - Level: 1
         Time: 10000
       - Level: 2
-        Time: 15000
-      - Level: 3
         Time: 20000
+      - Level: 3
+        Time: 30000
       - Level: 4
-        Time: 25000
+        Time: 40000
       - Level: 5
-        Time: 30000
-    Status: IncFleeRate
+        Time: 50000
+      - Level: 6
+        Time: 60000
+      - Level: 7
+        Time: 70000
+      - Level: 8
+        Time: 80000
+      - Level: 9
+        Time: 90000
+      - Level: 10
+        Time: 100000
+    Status: Agiup
   - Id: 351
     Name: NPC_SIEGEMODE
     Description: Siege Mode

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

@@ -2059,7 +2059,6 @@ Body:
       NoBanishingBuster: true
       NoClearance: true
   - Status: Inchitrate
-    DurationLookup: NPC_POWERUP
     CalcFlags:
       Hit: true
     Flags:
@@ -2078,7 +2077,6 @@ Body:
       NoBanishingBuster: true
       NoClearance: true
   - Status: Incfleerate
-    DurationLookup: NPC_AGIUP
     CalcFlags:
       Flee: true
     Flags:
@@ -7062,3 +7060,25 @@ Body:
       NoClearbuff: true
   - Status: WeaponBreaker
     DurationLookup: NPC_WEAPONBRAKER
+  - Status: Powerup
+    Icon: EFST_POWERUP
+    DurationLookup: NPC_POWERUP
+    CalcFlags:
+      Hit: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Agiup
+    Icon: EFST_AGIUP
+    DurationLookup: NPC_AGIUP
+    CalcFlags:
+      Speed: true
+      Flee: true
+    Flags:
+      NoClearbuff: true
+      NoBanishingBuster: true
+      NoClearance: true
+    EndOnStart:
+      Decreaseagi: true

+ 23 - 13
db/re/skill_db.yml

@@ -9655,20 +9655,20 @@ Body:
     Hit: Single
     Duration1:
       - Level: 1
-        Time: 10000
+        Time: 5000
       - Level: 2
-        Time: 15000
+        Time: 10000
       - Level: 3
-        Time: 20000
+        Time: 15000
       - Level: 4
-        Time: 25000
+        Time: 20000
       - Level: 5
-        Time: 30000
-    Status: IncHitRate
+        Time: 25000
+    Status: Powerup
   - Id: 350
     Name: NPC_AGIUP
-    Description: Agility UP
-    MaxLevel: 5
+    Description: Agility Up
+    MaxLevel: 10
     TargetType: Self
     DamageFlags:
       NoDamage: true
@@ -9679,14 +9679,24 @@ Body:
       - Level: 1
         Time: 10000
       - Level: 2
-        Time: 15000
-      - Level: 3
         Time: 20000
+      - Level: 3
+        Time: 30000
       - Level: 4
-        Time: 25000
+        Time: 40000
       - Level: 5
-        Time: 30000
-    Status: IncFleeRate
+        Time: 50000
+      - Level: 6
+        Time: 60000
+      - Level: 7
+        Time: 70000
+      - Level: 8
+        Time: 80000
+      - Level: 9
+        Time: 90000
+      - Level: 10
+        Time: 100000
+    Status: Agiup
   - Id: 351
     Name: NPC_SIEGEMODE
     Description: Siege Mode

+ 22 - 2
db/re/status.yml

@@ -2172,7 +2172,6 @@ Body:
       NoBanishingBuster: true
       NoClearance: true
   - Status: Inchitrate
-    DurationLookup: NPC_POWERUP
     CalcFlags:
       Hit: true
     Flags:
@@ -2191,7 +2190,6 @@ Body:
       NoBanishingBuster: true
       NoClearance: true
   - Status: Incfleerate
-    DurationLookup: NPC_AGIUP
     CalcFlags:
       Flee: true
     Flags:
@@ -8915,3 +8913,25 @@ Body:
       NoBanishingBuster: true
       NoClearance: true
       SendVal1: true
+  - Status: Powerup
+    Icon: EFST_POWERUP
+    DurationLookup: NPC_POWERUP
+    CalcFlags:
+      Hit: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Agiup
+    Icon: EFST_AGIUP
+    DurationLookup: NPC_AGIUP
+    CalcFlags:
+      Speed: true
+      Flee: true
+    Flags:
+      NoClearbuff: true
+      NoBanishingBuster: true
+      NoClearance: true
+    EndOnStart:
+      Decreaseagi: true

+ 10 - 0
doc/status_change.txt

@@ -2832,3 +2832,13 @@ SC_WEAPONBREAKER
 	desc: Bonus given when using NPC_WEAPONBRAKER skill
 	val1: Skill level
 	val2: val1 * 2 weapon break chance
+
+SC_POWERUP
+	desc: Increases ATKpercent and Hit.
+	val1: + ATKpercent
+	val2: +% Hit
+
+SC_AGIUP
+	desc: Increase Speed and Flee.
+	val1: +% Walkspeed
+	val2: +% Flee

+ 2 - 0
src/map/battle.cpp

@@ -4465,6 +4465,8 @@ static unsigned short battle_get_atkpercent(struct block_list& bl, uint16 skill_
 		atkpercent -= 25;
 	if (sc.getSCE(SC_INCATKRATE))
 		atkpercent += sc.getSCE(SC_INCATKRATE)->val1;
+	if (sc.getSCE(SC_POWERUP))
+		atkpercent += sc.getSCE(SC_POWERUP)->val1;
 	if (sc.getSCE(SC_SKE))
 		atkpercent += 300;
 	if (sc.getSCE(SC_BLOODLUST))

+ 2 - 3
src/map/script_constants.hpp

@@ -1912,10 +1912,9 @@
 	export_constant(SC_HIDDEN_CARD);
 	export_constant(SC_PERIOD_RECEIVEITEM_2ND);
 	export_constant(SC_PERIOD_PLUSEXP_2ND);
-
-#ifdef RENEWAL
 	export_constant(SC_EXTREMITYFIST2);
-#endif
+	export_constant(SC_POWERUP);
+	export_constant(SC_AGIUP);
 
 	/* status icons */
 	export_deprecated_constant2("SI_BLANK",-1);

+ 5 - 4
src/map/skill.cpp

@@ -9651,6 +9651,9 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 			//Remove bonus_script by Dispell
 			if (dstsd)
 				pc_bonus_script_clear(dstsd,BSF_REM_ON_DISPELL);
+			// Monsters will unlock their target instead
+			else if (dstmd)
+				mob_unlocktarget(dstmd, tick);
 
 			if(!tsc || !tsc->count)
 				break;
@@ -9997,15 +10000,13 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 		break;
 
 	case NPC_POWERUP:
-		sc_start(src,bl,SC_INCATKRATE,100,200,skill_get_time(skill_id, skill_lv));
 		clif_skill_nodamage(src,bl,skill_id,skill_lv,
-			sc_start(src,bl,type,100,100,skill_get_time(skill_id, skill_lv)));
+			sc_start2(src,bl,type,100,200,100,skill_get_time(skill_id, skill_lv)));
 		break;
 
 	case NPC_AGIUP:
-		sc_start(src,bl,SC_SPEEDUP1,100,50,skill_get_time(skill_id, skill_lv));
 		clif_skill_nodamage(src,bl,skill_id,skill_lv,
-			sc_start(src,bl,type,100,100,skill_get_time(skill_id, skill_lv)));
+			sc_start2(src,bl,type,100,50,100,skill_get_time(skill_id, skill_lv)));
 		break;
 
 	case NPC_INVISIBLE:

+ 7 - 8
src/map/status.cpp

@@ -7403,6 +7403,8 @@ static signed short status_calc_hit(struct block_list *bl, status_change *sc, in
 		hit += sc->getSCE(SC_MTF_HITFLEE)->val1;
 	if(sc->getSCE(SC_INCHITRATE))
 		hit += hit * sc->getSCE(SC_INCHITRATE)->val1/100;
+	if (sc->getSCE(SC_POWERUP))
+		hit += hit * sc->getSCE(SC_POWERUP)->val2 / 100;
 	if(sc->getSCE(SC_BLIND))
 		hit -= hit * 25/100;
 	if(sc->getSCE(SC_HEAT_BARREL))
@@ -7519,6 +7521,8 @@ static signed short status_calc_flee(struct block_list *bl, status_change *sc, i
 	// Rate value
 	if(sc->getSCE(SC_INCFLEERATE))
 		flee += flee * sc->getSCE(SC_INCFLEERATE)->val1/100;
+	if (sc->getSCE(SC_AGIUP))
+		flee += flee * sc->getSCE(SC_AGIUP)->val2 / 100;
 	if(sc->getSCE(SC_SPIDERWEB) || sc->getSCE(SC_WIDEWEB))
 		flee -= flee * 50/100;
 	if(sc->getSCE(SC_BERSERK))
@@ -8012,8 +8016,10 @@ static unsigned short status_calc_speed(struct block_list *bl, status_change *sc
 			speed_rate = 150;
 
 		// GetMoveHasteValue1()
-		if( sc->getSCE(SC_SPEEDUP1) ) // !FIXME: used both by NPC_AGIUP and Speed Potion script
+		if( sc->getSCE(SC_SPEEDUP1) )
 			val = max( val, sc->getSCE(SC_SPEEDUP1)->val1 );
+		if (sc->getSCE(SC_AGIUP))
+			val = max(val, sc->getSCE(SC_AGIUP)->val1);
 		if( sc->getSCE(SC_INCREASEAGI) )
 			val = max( val, 25 );
 		if( sc->getSCE(SC_WINDWALK) )
@@ -12888,13 +12894,6 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 			if ((val1&0xFFFF) == CG_MOONLIT)
 				sc->opt3 |= OPT3_MOONLIT;
 			break;
-		case SC_INCATKRATE:
-			// Simulate Explosion Spirits effect for NPC_POWERUP [Skotlex]
-			if (bl->type != BL_MOB) {
-				disable_opt_flag = true;
-				break;
-			}
-			break;
 	}
 
 	// On Aegis, when turning on a status change, first goes the option packet, then the sc packet.

+ 4 - 3
src/map/status.hpp

@@ -1307,9 +1307,10 @@ enum sc_type : int16 {
 	SC_PERIOD_RECEIVEITEM_2ND,
 	SC_PERIOD_PLUSEXP_2ND,
 
-#ifdef RENEWAL
-	SC_EXTREMITYFIST2, //! NOTE: This SC should be right before SC_MAX, so it doesn't disturb if RENEWAL is disabled
-#endif
+	SC_EXTREMITYFIST2,
+	SC_POWERUP,
+	SC_AGIUP,
+
 	SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
 };