Browse Source

Implement SC_CONTENTS_1~10 (#8755)

* Implemented SC_CONTENTS_1~10
* Apply code review
crazyarashi 6 months ago
parent
commit
ec04ceba27
6 changed files with 241 additions and 2 deletions
  1. 12 0
      db/re/item_db_usable.yml
  2. 90 0
      db/re/status.yml
  3. 41 1
      doc/status_change.txt
  4. 11 1
      src/map/script_constants.hpp
  5. 77 0
      src/map/status.cpp
  6. 10 0
      src/map/status.hpp

+ 12 - 0
db/re/item_db_usable.yml

@@ -78155,6 +78155,10 @@ Body:
       NoGuildStorage: true
       NoMail: true
       NoAuction: true
+    Script: |
+      sc_start SC_CONTENTS_1,900000,10;
+      specialeffect2 EF_POTION_BERSERK;
+      specialeffect2 EF_PROVIDENCE;
   - Id: 102781
     AegisName: 2401_ev_Galbi
     Name: New Year Galbi-jjim
@@ -78168,6 +78172,10 @@ Body:
       NoGuildStorage: true
       NoMail: true
       NoAuction: true
+    Script: |
+      sc_start SC_CONTENTS_2,900000,10;
+      specialeffect2 EF_POTION_BERSERK;
+      specialeffect2 EF_SPELLBREAKER;
   - Id: 102782
     AegisName: 2401_ev_Rice_Soup
     Name: New Year Rice Cake Soup
@@ -78181,6 +78189,10 @@ Body:
       NoGuildStorage: true
       NoMail: true
       NoAuction: true
+    Script: |
+      sc_start SC_CONTENTS_3,900000,15;
+      specialeffect2 EF_POTION_BERSERK;
+      specialeffect2 EF_HASTEUP;
   - Id: 102783
     AegisName: 2401_ev_Lunch_Box
     Name: Sulki's Lunch Box

+ 90 - 0
db/re/status.yml

@@ -9045,3 +9045,93 @@ Body:
       NoClearance: true
       NoDispell: true
       NoRemoveOnDead: true
+  - Status: Contents_1
+    Icon: EFST_CONTENTS_1
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_2
+    Icon: EFST_CONTENTS_2
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_3
+    Icon: EFST_CONTENTS_3
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_4
+    Icon: EFST_CONTENTS_4
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_5
+    Icon: EFST_CONTENTS_5
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_6
+    Icon: EFST_CONTENTS_6
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_7
+    Icon: EFST_CONTENTS_7
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_8
+    Icon: EFST_CONTENTS_8
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_9
+    Icon: EFST_CONTENTS_9
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true
+  - Status: Contents_10
+    Icon: EFST_CONTENTS_10
+    CalcFlags:
+      All: true
+    Flags:
+      NoClearbuff: true
+      NoDispell: true
+      NoBanishingBuster: true
+      NoClearance: true

+ 41 - 1
doc/status_change.txt

@@ -3,7 +3,7 @@
 //===== By: ==================================================
 //= rAthena Dev Team
 //===== Last Updated: ========================================
-//= 20171207
+//= 20241024
 //===== Description: =========================================
 //= List of all Status Changes and theirs val1, val2, val3, and
 //= val4 usage in source. Providing easier guide to use
@@ -2875,3 +2875,43 @@ SC_STR_SCROLL	(EFST_STR_SCROLL)
 SC_INT_SCROLL	(EFST_INT_SCROLL)
 	desc: Increases INT.
 	val1: + INT
+
+SC_CONTENTS_1	(EFST_CONTENTS_1)
+	desc: Increase physical and magical damage to all element enemies
+	val1: +% damage
+	
+SC_CONTENTS_2	(EFST_CONTENTS_2)
+	desc: Increase melee physical damage, range physical damage, and all elemental magic damage.
+	val1: +% damage
+	
+SC_CONTENTS_3	(EFST_CONTENTS_3)
+	desc: Increase ATK and MATK
+	val1: +% damage
+	
+SC_CONTENTS_4	(EFST_CONTENTS_4)
+	desc: Increase ATK and MATK
+	val1: +% damage
+	
+SC_CONTENTS_5	(EFST_CONTENTS_5)
+	desc: Increase ASPD and reduce variable casttime
+	val1: +% increase ASPD, -% reduce variable casttime
+	
+SC_CONTENTS_6	(EFST_CONTENTS_6)
+	desc: Increase physical and magical damage to Dragon and Plant race.
+	val1: +% damage
+	
+SC_CONTENTS_7	(EFST_CONTENTS_7)
+	desc: Increase physical and magical damage to Demon and Undead race.
+	val1: +% damage
+	
+SC_CONTENTS_8	(EFST_CONTENTS_8)
+	desc: Increase physical and magical damage to Formless and Fish race.
+	val1: +% damage
+	
+SC_CONTENTS_9	(EFST_CONTENTS_9)
+	desc: Increase physical and magical damage to Angel and Brute race.
+	val1: +% damage
+	
+SC_CONTENTS_10	(EFST_CONTENTS10)
+	desc: Increase physical and magical damage to Insect and Demihuman race.
+	val1: +% damage

+ 11 - 1
src/map/script_constants.hpp

@@ -1923,7 +1923,17 @@
 	export_constant(SC_EP16_DEF);
 	export_constant(SC_STR_SCROLL);
 	export_constant(SC_INT_SCROLL);
-
+	export_constant(SC_CONTENTS_1);
+	export_constant(SC_CONTENTS_2);
+	export_constant(SC_CONTENTS_3);
+	export_constant(SC_CONTENTS_4);
+	export_constant(SC_CONTENTS_5);
+	export_constant(SC_CONTENTS_6);
+	export_constant(SC_CONTENTS_7);
+	export_constant(SC_CONTENTS_8);
+	export_constant(SC_CONTENTS_9);
+	export_constant(SC_CONTENTS_10);
+	
 	/* status icons */
 	export_deprecated_constant2("SI_BLANK",-1);
 	export_deprecated_constant2("SI_PROVOKE",0);

+ 77 - 0
src/map/status.cpp

@@ -4945,6 +4945,79 @@ int status_calc_pc_sub(map_session_data* sd, uint8 opt)
 		if (sc->getSCE(SC_EP16_DEF)) {
 			sd->indexed_bonus.subrace2[RC2_EP16_DEF] += sc->getSCE(SC_EP16_DEF)->val1;
 		}
+		if (sc->getSCE(SC_CONTENTS_1)) {
+			sd->right_weapon.addele[ELE_ALL] += sc->getSCE(SC_CONTENTS_1)->val1;
+			if( !battle_config.left_cardfix_to_right ){
+				sd->left_weapon.addele[ELE_ALL] += sc->getSCE(SC_CONTENTS_1)->val1;
+			}
+			sd->indexed_bonus.magic_addele_script[ELE_ALL] += sc->getSCE(SC_CONTENTS_1)->val1;
+		}
+		if (sc->getSCE(SC_CONTENTS_2)) {
+			sd->bonus.short_attack_atk_rate += sc->getSCE(SC_CONTENTS_2)->val1;
+			sd->bonus.long_attack_atk_rate += sc->getSCE(SC_CONTENTS_2)->val1;
+			sd->indexed_bonus.magic_atk_ele[ELE_ALL] += sc->getSCE(SC_CONTENTS_2)->val1;
+		}
+		if (sc->getSCE(SC_CONTENTS_3)) {
+			pc_bonus(sd, SP_ATK_RATE, sc->getSCE(SC_CONTENTS_3)->val1);
+			pc_bonus(sd, SP_MATK_RATE, sc->getSCE(SC_CONTENTS_3)->val1);
+		}
+		if (sc->getSCE(SC_CONTENTS_4)) {
+			pc_bonus(sd, SP_ATK_RATE, sc->getSCE(SC_CONTENTS_4)->val1);
+			pc_bonus(sd, SP_MATK_RATE, sc->getSCE(SC_CONTENTS_4)->val1);
+		}
+		if (sc->getSCE(SC_CONTENTS_5)) {
+			sd->bonus.varcastrate -= sc->getSCE(SC_CONTENTS_5)->val1;
+		}
+		if (sc->getSCE(SC_CONTENTS_6)) {
+			sd->right_weapon.addrace[RC_DRAGON] += sc->getSCE(SC_CONTENTS_6)->val1;
+			sd->right_weapon.addrace[RC_PLANT] += sc->getSCE(SC_CONTENTS_6)->val1;
+			if( !battle_config.left_cardfix_to_right ){
+				sd->left_weapon.addrace[RC_DRAGON] += sc->getSCE(SC_CONTENTS_6)->val1;
+				sd->left_weapon.addrace[RC_PLANT] += sc->getSCE(SC_CONTENTS_6)->val1;
+			}
+			sd->indexed_bonus.magic_addrace[RC_DRAGON] += sc->getSCE(SC_CONTENTS_6)->val1;
+			sd->indexed_bonus.magic_addrace[RC_PLANT] += sc->getSCE(SC_CONTENTS_6)->val1;
+		}
+		if (sc->getSCE(SC_CONTENTS_7)) {
+			sd->right_weapon.addrace[RC_DEMON] += sc->getSCE(SC_CONTENTS_7)->val1;
+			sd->right_weapon.addrace[RC_UNDEAD] += sc->getSCE(SC_CONTENTS_7)->val1;
+			if( !battle_config.left_cardfix_to_right ){
+				sd->left_weapon.addrace[RC_DEMON] += sc->getSCE(SC_CONTENTS_7)->val1;
+				sd->left_weapon.addrace[RC_UNDEAD] += sc->getSCE(SC_CONTENTS_7)->val1;
+			}
+			sd->indexed_bonus.magic_addrace[RC_DEMON] += sc->getSCE(SC_CONTENTS_7)->val1;
+			sd->indexed_bonus.magic_addrace[RC_UNDEAD] += sc->getSCE(SC_CONTENTS_7)->val1;
+		}
+		if (sc->getSCE(SC_CONTENTS_8)) {
+			sd->right_weapon.addrace[RC_FORMLESS] += sc->getSCE(SC_CONTENTS_8)->val1;
+			sd->right_weapon.addrace[RC_FISH] += sc->getSCE(SC_CONTENTS_8)->val1;
+			if( !battle_config.left_cardfix_to_right ){
+				sd->left_weapon.addrace[RC_FORMLESS] += sc->getSCE(SC_CONTENTS_8)->val1;
+				sd->left_weapon.addrace[RC_FISH] += sc->getSCE(SC_CONTENTS_8)->val1;
+			}
+			sd->indexed_bonus.magic_addrace[RC_FORMLESS] += sc->getSCE(SC_CONTENTS_8)->val1;
+			sd->indexed_bonus.magic_addrace[RC_FISH] += sc->getSCE(SC_CONTENTS_8)->val1;
+		}
+		if (sc->getSCE(SC_CONTENTS_9)) {
+			sd->right_weapon.addrace[RC_ANGEL] += sc->getSCE(SC_CONTENTS_9)->val1;
+			sd->right_weapon.addrace[RC_BRUTE] += sc->getSCE(SC_CONTENTS_9)->val1;
+			if( !battle_config.left_cardfix_to_right ){
+				sd->left_weapon.addrace[RC_ANGEL] += sc->getSCE(SC_CONTENTS_9)->val1;
+				sd->left_weapon.addrace[RC_BRUTE] += sc->getSCE(SC_CONTENTS_9)->val1;
+			}
+			sd->indexed_bonus.magic_addrace[RC_ANGEL] += sc->getSCE(SC_CONTENTS_9)->val1;
+			sd->indexed_bonus.magic_addrace[RC_BRUTE] += sc->getSCE(SC_CONTENTS_9)->val1;
+		}
+		if (sc->getSCE(SC_CONTENTS_10)) {
+			sd->right_weapon.addrace[RC_DEMIHUMAN] += sc->getSCE(SC_CONTENTS_10)->val1;
+			sd->right_weapon.addrace[RC_INSECT] += sc->getSCE(SC_CONTENTS_10)->val1;
+			if( !battle_config.left_cardfix_to_right ){
+				sd->left_weapon.addrace[RC_DEMIHUMAN] += sc->getSCE(SC_CONTENTS_10)->val1;
+				sd->left_weapon.addrace[RC_INSECT] += sc->getSCE(SC_CONTENTS_10)->val1;
+			}
+			sd->indexed_bonus.magic_addrace[RC_DEMIHUMAN] += sc->getSCE(SC_CONTENTS_10)->val1;
+			sd->indexed_bonus.magic_addrace[RC_INSECT] += sc->getSCE(SC_CONTENTS_10)->val1;
+		}
 	}
 	status_cpy(&sd->battle_status, base_status);
 
@@ -8378,6 +8451,8 @@ static short status_calc_aspd(struct block_list *bl, status_change *sc, bool fix
 			bonus += sc->getSCE(SC_SKF_ASPD)->val1;
 		if( sc->getSCE(SC_PORK_RIB_STEW) )
 			bonus += 5;
+		if( sc->getSCE(SC_CONTENTS_5) )
+			bonus += sc->getSCE(SC_CONTENTS_5)->val1;
 
 		map_session_data* sd = BL_CAST(BL_PC, bl);
 		uint8 skill_lv;
@@ -8593,6 +8668,8 @@ static short status_calc_aspd_rate(struct block_list *bl, status_change *sc, int
 		aspd_rate -= sc->getSCE(SC_SKF_ASPD)->val1 * 10;
 	if( sc->getSCE(SC_PORK_RIB_STEW) )
 		aspd_rate -= 50;
+	if ( sc->getSCE(SC_CONTENTS_5) )
+		aspd_rate -= sc->getSCE(SC_CONTENTS_5)->val1 * 10;
 
 	return (short)cap_value(aspd_rate,0,SHRT_MAX);
 }

+ 10 - 0
src/map/status.hpp

@@ -1318,6 +1318,16 @@ enum sc_type : int16 {
 	SC_EP16_DEF,
 	SC_STR_SCROLL,
 	SC_INT_SCROLL,
+	SC_CONTENTS_1,
+	SC_CONTENTS_2,
+	SC_CONTENTS_3,
+	SC_CONTENTS_4,
+	SC_CONTENTS_5,
+	SC_CONTENTS_6,
+	SC_CONTENTS_7,
+	SC_CONTENTS_8,
+	SC_CONTENTS_9,
+	SC_CONTENTS_10,
 
 	SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
 };