Bläddra i källkod

Adds drop effect to dropped random option items (#6278)

* Adds the official pillar effect on dropped items depending on how many random options were applied to them.
Thanks to @limitro, @Atemo, and @Lemongrass3110!
Co-authored-by: Atemo <Atemo@users.noreply.github.com>
Aleos 3 år sedan
förälder
incheckning
9114083d7e
4 ändrade filer med 29 tillägg och 3 borttagningar
  1. 3 0
      conf/battle/drops.conf
  2. 1 0
      src/map/battle.cpp
  3. 1 0
      src/map/battle.hpp
  4. 24 3
      src/map/clif.cpp

+ 3 - 0
conf/battle/drops.conf

@@ -189,3 +189,6 @@ idletime_mer_option: 0x1F
 // If drop rate was below this amount and bonus is applied to it, the bonus can't make it exceed this amount.
 drop_rate_cap: 9000
 drop_rate_cap_vip: 9000
+
+// Displays a colored pillar effect for items dropped by monsters that contain random options.
+rndopt_drop_pillar: on

+ 1 - 0
src/map/battle.cpp

@@ -9128,6 +9128,7 @@ static const struct _battle_data {
 	{ "mer_idle_no_share" ,                 &battle_config.mer_idle_no_share,               0,      0,      INT_MAX,        },
 	{ "idletime_mer_option",                &battle_config.idletime_mer_option,             0x1F,   0x1,    0xFFF,          },
 	{ "feature.refineui",                   &battle_config.feature_refineui,                1,      0,      1,              },
+	{ "rndopt_drop_pillar",                 &battle_config.rndopt_drop_pillar,              1,      0,      1,              },
 
 #include "../custom/battle_config_init.inc"
 };

+ 1 - 0
src/map/battle.hpp

@@ -689,6 +689,7 @@ struct Battle_Config
 	int mer_idle_no_share;
 	int idletime_mer_option;
 	int feature_refineui;
+	int rndopt_drop_pillar;
 
 #include "../custom/battle_config_struct.inc"
 };

+ 24 - 3
src/map/clif.cpp

@@ -878,13 +878,34 @@ void clif_dropflooritem( struct flooritem_data* fitem, bool canShowEffect ){
 		if( dropEffect > 0 ){
 			p.showdropeffect = 1;
 			p.dropeffectmode = dropEffect - 1;
-		}else{
+		}else if (battle_config.rndopt_drop_pillar != 0){
+			uint8 optionCount = 0;
+
+			for (uint8 i = 0; i < MAX_ITEM_RDM_OPT; i++) {
+				if (fitem->item.option[i].id != 0) {
+					optionCount++;
+				}
+			}
+
+			if (optionCount > 0) {
+				p.showdropeffect = 1;
+				if (optionCount == 1)
+					p.dropeffectmode = DROPEFFECT_BLUE_PILLAR - 1;
+				else if (optionCount == 2)
+					p.dropeffectmode = DROPEFFECT_YELLOW_PILLAR - 1;
+				else
+					p.dropeffectmode = DROPEFFECT_PURPLE_PILLAR - 1;
+			} else {
+				p.showdropeffect = 0;
+				p.dropeffectmode = DROPEFFECT_NONE;
+			}
+		} else {
 			p.showdropeffect = 0;
-			p.dropeffectmode = 0;
+			p.dropeffectmode = DROPEFFECT_NONE;
 		}
 	}else{
 		p.showdropeffect = 0;
-		p.dropeffectmode = 0;
+		p.dropeffectmode = DROPEFFECT_NONE;
 	}
 #endif
 	clif_send( &p, sizeof(p), &fitem->bl, AREA );