Browse Source

Allow to define conditional SCS only (#9219)

Allow defining only SCS_NOMOVECOND
Allow defining only SCS_NOCASTCOND
Allow defining only SCS_NOCHATCOND
Allow defining only SCS_NOATTACKCOND
Allow defining only SCS_NOWARPCOND
Allow defining only SCS_NOPICKITEMCOND
Allow defining only SCS_NODROPITEMCOND
Allow defining only SCS_NOEQUIPITEMCOND
Allow defining only SCS_NOUNEQUIPITEMCOND
Allow defining only SCS_NOCONSUMEITEMCOND
Allow defining only SCS_NODEATHPENALTYCOND
Allow defining only SCS_NOINTERACTCOND
Lemongrass3110 1 month ago
parent
commit
3d179ca4d4
3 changed files with 14 additions and 44 deletions
  1. 1 19
      db/pre-re/status.yml
  2. 1 13
      db/re/status.yml
  3. 12 12
      src/map/status.cpp

+ 1 - 19
db/pre-re/status.yml

@@ -319,7 +319,6 @@ Body:
     Icon: EFST_HIDING
     Icon: EFST_HIDING
     DurationLookup: TF_HIDING
     DurationLookup: TF_HIDING
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
       NoPickItem: true
       NoPickItem: true
       NoConsumeItem: true
       NoConsumeItem: true
@@ -1145,13 +1144,9 @@ Body:
       bonus2 bSubEle,Ele_Wind, getstatus(SC_ARMOR_ELEMENT_WATER, 4);
       bonus2 bSubEle,Ele_Wind, getstatus(SC_ARMOR_ELEMENT_WATER, 4);
   - Status: Nochat
   - Status: Nochat
     States:
     States:
-      NoPickItem: true
       NoPickItemCond: true
       NoPickItemCond: true
-      NoDropItem: true
       NoDropItemCond: true
       NoDropItemCond: true
-      NoChat: true
       NoChatCond: true
       NoChatCond: true
-      NoConsumeItem: true
       NoConsumeItemCond: true
       NoConsumeItemCond: true
     Flags:
     Flags:
       NoRemoveOnDead: true
       NoRemoveOnDead: true
@@ -1232,7 +1227,6 @@ Body:
     Icon: EFST_GOSPEL
     Icon: EFST_GOSPEL
     DurationLookup: PA_GOSPEL
     DurationLookup: PA_GOSPEL
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
     CalcFlags:
     CalcFlags:
       Speed: true
       Speed: true
@@ -1253,7 +1247,6 @@ Body:
   - Status: Basilica
   - Status: Basilica
     DurationLookup: HP_BASILICA
     DurationLookup: HP_BASILICA
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
       NoAttack: true
       NoAttack: true
     Flags:
     Flags:
@@ -1678,9 +1671,7 @@ Body:
     Icon: EFST_GRAVITATION
     Icon: EFST_GRAVITATION
     DurationLookup: HW_GRAVITATION
     DurationLookup: HW_GRAVITATION
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
-      NoConsumeItem: true
       NoConsumeItemCond: true
       NoConsumeItemCond: true
     CalcFlags:
     CalcFlags:
       Aspd: true
       Aspd: true
@@ -1707,9 +1698,7 @@ Body:
       Speed: true
       Speed: true
       Aspd: true
       Aspd: true
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
-      NoAttack: true
       NoAttackCond: true
       NoAttackCond: true
   - Status: Hermode
   - Status: Hermode
     Icon: EFST_HERMODE
     Icon: EFST_HERMODE
@@ -1773,9 +1762,7 @@ Body:
     Icon: EFST_BDPLAYING
     Icon: EFST_BDPLAYING
     DurationLookup: BD_ENCORE
     DurationLookup: BD_ENCORE
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
-      NoAttack: true
       NoAttackCond: true
       NoAttackCond: true
     CalcFlags:
     CalcFlags:
       Speed: true
       Speed: true
@@ -3000,7 +2987,6 @@ Body:
   - Status: Fear
   - Status: Fear
     DurationLookup: RK_WINDCUTTER
     DurationLookup: RK_WINDCUTTER
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
     CalcFlags:
     CalcFlags:
       Flee: true
       Flee: true
@@ -3363,7 +3349,6 @@ Body:
     Icon: EFST_CAMOUFLAGE
     Icon: EFST_CAMOUFLAGE
     DurationLookup: RA_CAMOUFLAGE
     DurationLookup: RA_CAMOUFLAGE
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
     CalcFlags:
     CalcFlags:
       Speed: true
       Speed: true
@@ -3697,8 +3682,7 @@ Body:
   - Status: Oblivioncurse
   - Status: Oblivioncurse
     Icon: EFST_OBLIVIONCURSE
     Icon: EFST_OBLIVIONCURSE
     States:
     States:
-      NoCast: true
-      Nocastcond: true
+      NoCastCond: true
     CalcFlags:
     CalcFlags:
       Regen: true
       Regen: true
     Flags:
     Flags:
@@ -3843,9 +3827,7 @@ Body:
     Icon: EFST_COLD
     Icon: EFST_COLD
     DurationLookup: SO_DIAMONDDUST
     DurationLookup: SO_DIAMONDDUST
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
-      NoCast: true
       NoCastCond: true
       NoCastCond: true
       NoConsumeItem: true
       NoConsumeItem: true
       NoAttack: true
       NoAttack: true

+ 1 - 13
db/re/status.yml

@@ -340,7 +340,6 @@ Body:
     Icon: EFST_HIDING
     Icon: EFST_HIDING
     DurationLookup: TF_HIDING
     DurationLookup: TF_HIDING
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
       NoPickItem: true
       NoPickItem: true
       NoConsumeItem: true
       NoConsumeItem: true
@@ -1174,13 +1173,9 @@ Body:
       bonus2 bSubEle,Ele_Wind, getstatus(SC_ARMOR_ELEMENT_WATER, 4);
       bonus2 bSubEle,Ele_Wind, getstatus(SC_ARMOR_ELEMENT_WATER, 4);
   - Status: Nochat
   - Status: Nochat
     States:
     States:
-      NoPickItem: true
       NoPickItemCond: true
       NoPickItemCond: true
-      NoDropItem: true
       NoDropItemCond: true
       NoDropItemCond: true
-      NoChat: true
       NoChatCond: true
       NoChatCond: true
-      NoConsumeItem: true
       NoConsumeItemCond: true
       NoConsumeItemCond: true
     Flags:
     Flags:
       NoRemoveOnDead: true
       NoRemoveOnDead: true
@@ -1258,7 +1253,6 @@ Body:
     Icon: EFST_GOSPEL
     Icon: EFST_GOSPEL
     DurationLookup: PA_GOSPEL
     DurationLookup: PA_GOSPEL
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
     CalcFlags:
     CalcFlags:
       Speed: true
       Speed: true
@@ -1775,7 +1769,6 @@ Body:
     Icon: EFST_BDPLAYING
     Icon: EFST_BDPLAYING
     DurationLookup: BD_ENCORE
     DurationLookup: BD_ENCORE
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
     CalcFlags:
     CalcFlags:
       Speed: true
       Speed: true
@@ -3108,7 +3101,6 @@ Body:
   - Status: Fear
   - Status: Fear
     DurationLookup: RK_WINDCUTTER
     DurationLookup: RK_WINDCUTTER
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
     CalcFlags:
     CalcFlags:
       Flee: true
       Flee: true
@@ -3480,7 +3472,6 @@ Body:
     Icon: EFST_CAMOUFLAGE
     Icon: EFST_CAMOUFLAGE
     DurationLookup: RA_CAMOUFLAGE
     DurationLookup: RA_CAMOUFLAGE
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
     CalcFlags:
     CalcFlags:
       Speed: true
       Speed: true
@@ -3837,8 +3828,7 @@ Body:
   - Status: Oblivioncurse
   - Status: Oblivioncurse
     Icon: EFST_OBLIVIONCURSE
     Icon: EFST_OBLIVIONCURSE
     States:
     States:
-      NoCast: true
-      Nocastcond: true
+      NoCastCond: true
     CalcFlags:
     CalcFlags:
       Regen: true
       Regen: true
     Flags:
     Flags:
@@ -3991,9 +3981,7 @@ Body:
     Icon: EFST_COLD
     Icon: EFST_COLD
     DurationLookup: SO_DIAMONDDUST
     DurationLookup: SO_DIAMONDDUST
     States:
     States:
-      NoMove: true
       NoMoveCond: true
       NoMoveCond: true
-      NoCast: true
       NoCastCond: true
       NoCastCond: true
       NoConsumeItem: true
       NoConsumeItem: true
       NoAttack: true
       NoAttack: true

+ 12 - 12
src/map/status.cpp

@@ -5558,7 +5558,7 @@ void status_calc_state( block_list& bl, status_change& sc, std::shared_ptr<s_sta
 	};
 	};
 
 
 	// Can't move
 	// Can't move
-	if( scdb->state[SCS_NOMOVE] ){
+	if( scdb->state[SCS_NOMOVE] || scdb->state[SCS_NOMOVECOND] ){
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.move, SCS_NOMOVE, SCS_NOMOVECOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.move, SCS_NOMOVE, SCS_NOMOVECOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 			// Check the specific conditions
 			// Check the specific conditions
 			switch( type ){
 			switch( type ){
@@ -5647,7 +5647,7 @@ void status_calc_state( block_list& bl, status_change& sc, std::shared_ptr<s_sta
 	}
 	}
 
 
 	// Can't use skills
 	// Can't use skills
-	if( scdb->state[SCS_NOCAST] ){
+	if( scdb->state[SCS_NOCAST] || scdb->state[SCS_NOCASTCOND] ){
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.cast, SCS_NOCAST, SCS_NOCASTCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.cast, SCS_NOCAST, SCS_NOCASTCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 			// Check the specific conditions
 			// Check the specific conditions
 			switch( type ){
 			switch( type ){
@@ -5666,7 +5666,7 @@ void status_calc_state( block_list& bl, status_change& sc, std::shared_ptr<s_sta
 	}
 	}
 
 
 	// Can't chat
 	// Can't chat
-	if( scdb->state[SCS_NOCHAT] ) {
+	if( scdb->state[SCS_NOCHAT] || scdb->state[SCS_NOCHATCOND] ){
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.chat, SCS_NOCHAT, SCS_NOCHATCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.chat, SCS_NOCHAT, SCS_NOCHATCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 			// Check the specific conditions
 			// Check the specific conditions
 			switch( type ){
 			switch( type ){
@@ -5685,7 +5685,7 @@ void status_calc_state( block_list& bl, status_change& sc, std::shared_ptr<s_sta
 	}
 	}
 
 
 	// Can't attack
 	// Can't attack
-	if( scdb->state[SCS_NOATTACK] ){
+	if( scdb->state[SCS_NOATTACK] || scdb->state[SCS_NOATTACKCOND] ){
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.attack, SCS_NOATTACK, SCS_NOATTACKCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.attack, SCS_NOATTACK, SCS_NOATTACKCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 			// Check the specific conditions
 			// Check the specific conditions
 			switch( type ){
 			switch( type ){
@@ -5714,14 +5714,14 @@ void status_calc_state( block_list& bl, status_change& sc, std::shared_ptr<s_sta
 	}
 	}
 
 
 	// Can't warp
 	// Can't warp
-	if( scdb->state[SCS_NOWARP] ){
+	if( scdb->state[SCS_NOWARP] || scdb->state[SCS_NOWARPCOND] ){
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.warp, SCS_NOWARP, SCS_NOWARPCOND, func_not_impl );
 		status_calc_state_sub( bl, sc, start, scdb, sc.cant.warp, SCS_NOWARP, SCS_NOWARPCOND, func_not_impl );
 	}
 	}
 
 
 	// Player-only states
 	// Player-only states
 	if( bl.type == BL_PC ) {
 	if( bl.type == BL_PC ) {
 		// Can't pick-up items
 		// Can't pick-up items
-		if( scdb->state[SCS_NOPICKITEM] ){
+		if( scdb->state[SCS_NOPICKITEM] || scdb->state[SCS_NOPICKITEMCOND] ){
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.pickup, SCS_NOPICKITEM, SCS_NOPICKITEMCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.pickup, SCS_NOPICKITEM, SCS_NOPICKITEMCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 				// Check the specific conditions
 				// Check the specific conditions
 				switch( type ){
 				switch( type ){
@@ -5740,7 +5740,7 @@ void status_calc_state( block_list& bl, status_change& sc, std::shared_ptr<s_sta
 		}
 		}
 
 
 		// Can't drop items
 		// Can't drop items
-		if( scdb->state[SCS_NODROPITEM] ){
+		if( scdb->state[SCS_NODROPITEM] || scdb->state[SCS_NODROPITEMCOND] ){
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.drop, SCS_NODROPITEM, SCS_NODROPITEMCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.drop, SCS_NODROPITEM, SCS_NODROPITEMCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 				// Check the specific conditions
 				// Check the specific conditions
 				switch( type ){
 				switch( type ){
@@ -5759,17 +5759,17 @@ void status_calc_state( block_list& bl, status_change& sc, std::shared_ptr<s_sta
 		}
 		}
 
 
 		// Can't equip item
 		// Can't equip item
-		if( scdb->state[SCS_NOEQUIPITEM] ){
+		if( scdb->state[SCS_NOEQUIPITEM] || scdb->state[SCS_NOEQUIPITEMCOND] ){
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.equip, SCS_NOEQUIPITEM, SCS_NOEQUIPITEMCOND, func_not_impl );
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.equip, SCS_NOEQUIPITEM, SCS_NOEQUIPITEMCOND, func_not_impl );
 		}
 		}
 
 
 		// Can't unequip item
 		// Can't unequip item
-		if( scdb->state[SCS_NOUNEQUIPITEM] ){
+		if( scdb->state[SCS_NOUNEQUIPITEM] || scdb->state[SCS_NOUNEQUIPITEMCOND] ){
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.unequip, SCS_NOUNEQUIPITEM, SCS_NOUNEQUIPITEMCOND, func_not_impl );
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.unequip, SCS_NOUNEQUIPITEM, SCS_NOUNEQUIPITEMCOND, func_not_impl );
 		}
 		}
 
 
 		// Can't consume item
 		// Can't consume item
-		if( scdb->state[SCS_NOCONSUMEITEM] ){
+		if( scdb->state[SCS_NOCONSUMEITEM] || scdb->state[SCS_NOCONSUMEITEMCOND] ){
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.consume, SCS_NOCONSUMEITEM, SCS_NOCONSUMEITEMCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.consume, SCS_NOCONSUMEITEM, SCS_NOCONSUMEITEMCOND, []( block_list& bl, status_change& sc, bool& restriction, const sc_type type, const status_change_entry& sce ) -> bool {
 				// Check the specific conditions
 				// Check the specific conditions
 				switch( type ){
 				switch( type ){
@@ -5794,12 +5794,12 @@ void status_calc_state( block_list& bl, status_change& sc, std::shared_ptr<s_sta
 		}
 		}
 
 
 		// Can't lose exp
 		// Can't lose exp
-		if( scdb->state[SCS_NODEATHPENALTY] ){
+		if( scdb->state[SCS_NODEATHPENALTY] || scdb->state[SCS_NODEATHPENALTYCOND] ){
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.deathpenalty, SCS_NODEATHPENALTY, SCS_NODEATHPENALTYCOND, func_not_impl );
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.deathpenalty, SCS_NODEATHPENALTY, SCS_NODEATHPENALTYCOND, func_not_impl );
 		}
 		}
 
 
 		// Can't sit/stand/talk to NPC
 		// Can't sit/stand/talk to NPC
-		if( scdb->state[SCS_NOINTERACT] ){
+		if( scdb->state[SCS_NOINTERACT] || scdb->state[SCS_NOINTERACTCOND] ){
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.interact, SCS_NOINTERACT, SCS_NOINTERACTCOND, func_not_impl );
 			status_calc_state_sub( bl, sc, start, scdb, sc.cant.interact, SCS_NOINTERACT, SCS_NOINTERACTCOND, func_not_impl );
 		}
 		}
 	}
 	}