Переглянути джерело

Added new status flag RequireNoWeapon (#7201)

* Fixes #7200.
* Added new status flag RequireNoWeapon.
Singe Horizontal 2 роки тому
батько
коміт
4718d5e813
6 змінених файлів з 9 додано та 2 видалено
  1. 1 1
      db/pre-re/status.yml
  2. 1 1
      db/re/status.yml
  3. 1 0
      doc/status.txt
  4. 4 0
      src/map/pc.cpp
  5. 1 0
      src/map/script_constants.hpp
  6. 1 0
      src/map/status.hpp

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

@@ -1949,8 +1949,8 @@ Body:
     Flags:
       NoSave: true
       NoClearance: true
-      RequireWeapon: true
       RemoveOnHermode: true
+      RequireNoWeapon: true
   - Status: Spirit
     Icon: EFST_SOULLINK
     DurationLookup: SL_HIGH

+ 1 - 1
db/re/status.yml

@@ -2057,8 +2057,8 @@ Body:
     Flags:
       NoSave: true
       NoClearance: true
-      RequireWeapon: true
       RemoveOnHermode: true
+      RequireNoWeapon: true
   - Status: Spirit
     Icon: EFST_SOULLINK
     DurationLookup: SL_HIGH

+ 1 - 0
doc/status.txt

@@ -248,6 +248,7 @@ Flags: Various status flags for specific status change events.
 	NonPlayer             - Sends the NPC_SHOWEFST_UPDATE packet. Used to send effects to NPC/monsters.
 
 	RequireWeapon         - Status requires a weapon to be equipped.
+	RequireNoWeapon       - Status requires that no weapons be equipped.
 	RequireShield         - Status requires a shield to be equipped.
 
 	SuperNoviceAngel      - Status that is given from Super Novice Angel.

+ 4 - 0
src/map/pc.cpp

@@ -7296,6 +7296,10 @@ static void pc_checkallowskill(map_session_data *sd)
 			if (sd->sc.getSCE(status) && !pc_check_weapontype(sd, skill_get_weapontype(it.second->skill_id)))
 				status_change_end(&sd->bl, status);
 		}
+		if (flag[SCF_REQUIRENOWEAPON]) { 
+			if (sd->sc.getSCE(status) && sd->status.weapon)
+				status_change_end(&sd->bl, status, INVALID_TIMER);
+		}
 
 		if (flag[SCF_REQUIRESHIELD]) { // Skills requiring a shield
 			if (sd->sc.getSCE(status) && sd->status.shield <= 0)

+ 1 - 0
src/map/script_constants.hpp

@@ -10094,6 +10094,7 @@
 	export_constant(SCF_REMOVEONUNEQUIPWEAPON);
 	export_constant(SCF_REMOVEONUNEQUIPARMOR);
 	export_constant(SCF_REMOVEONHERMODE);
+	export_constant(SCF_REQUIRENOWEAPON);
 
 	/* enchantgrades */
 	export_constant(ENCHANTGRADE_NONE);

+ 1 - 0
src/map/status.hpp

@@ -3031,6 +3031,7 @@ enum e_status_change_flag : uint16 {
 	SCF_REMOVEONUNEQUIPWEAPON,
 	SCF_REMOVEONUNEQUIPARMOR,
 	SCF_REMOVEONHERMODE,
+	SCF_REQUIRENOWEAPON,
 	SCF_MAX
 };