Jump to content

Question

Posted (edited)

In l2j-mobius i find a skill which give drop rate up. I give skill, but no effect.

Someone give me this code.

Index: dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java
===================================================================
--- dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java	(revision 7034)
+++ dist/game/data/scripts/handlers/bypasshandlers/NpcViewMod.java	(working copy)
@@ -265,6 +265,7 @@
 		final DecimalFormat chanceFormat = new DecimalFormat("0.00##");
 		int leftHeight = 0;
 		int rightHeight = 0;
+		final double dropRateEffectBonus = player.getStat().getBonusDropRateMultiplier();
 		final StringBuilder leftSb = new StringBuilder();
 		final StringBuilder rightSb = new StringBuilder();
 		String limitReachedMsg = "";
@@ -363,6 +364,8 @@
 						rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT;
 					}
 				}
+				// bonus drop rate effect
+				rateChance *= dropRateEffectBonus;
 			}
 			
 			sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");
Index: dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java
===================================================================
--- dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java	(revision 7034)
+++ dist/game/data/scripts/handlers/communityboard/DropSearchBoard.java	(working copy)
@@ -167,6 +167,7 @@
 				final int start = (page - 1) * 14;
 				final int end = Math.min(list.size() - 1, start + 14);
 				final StringBuilder builder = new StringBuilder();
+				final double dropRateEffectBonus = player.getStat().getBonusDropRateMultiplier();
 				for (int index = start; index <= end; index++)
 				{
 					final CBDropHolder cbDropHolder = list.get(index);
@@ -260,6 +261,8 @@
 								rateAmount *= Config.PREMIUM_RATE_DROP_AMOUNT;
 							}
 						}
+						// bonus drop rate effect
+						rateChance *= dropRateEffectBonus;
 					}
 					
 					builder.append("<tr>");
Index: dist/game/data/stats/skills/08400-08499.xml
===================================================================
--- dist/game/data/stats/skills/08400-08499.xml	(revision 7034)
+++ dist/game/data/stats/skills/08400-08499.xml	(working copy)
@@ -427,10 +427,16 @@
 	</skill>
 	<skill id="8415" levels="5" name="Ring Ability - Drop Rate Up">
 		<!-- Increases item drop rate. -->
+		<table name="#bonusDropRate">10 20 30 40 50</table>
 		<set name="icon" val="icon.skill3080" />
 		<set name="magicLvl" val="85" />
 		<set name="operateType" val="P" />
-		<set name="targetType" val="NONE" />
+		<set name="targetType" val="SELF" />
+		<for>
+			<effect name="Buff">
+				<add stat="bonusDropRate" val="#bonusDropRate" />
+			</effect>
+		</for>
 	</skill>
 	<skill id="8416" levels="5" name="Earring Ability - Drop Rate Up">
 		<!-- Increases item drop rate. -->
Index: dist/game/data/xsd/skills.xsd
===================================================================
--- dist/game/data/xsd/skills.xsd	(revision 7034)
+++ dist/game/data/xsd/skills.xsd	(working copy)
@@ -414,9 +414,10 @@
 			<xs:enumeration value="waterPower" />
 			<xs:enumeration value="windPower" />
 			<xs:enumeration value="firePower" />
-			<xs:enumeration value="bonusSp" />
 			<xs:enumeration value="defCritRateAdd" />
 			<xs:enumeration value="bonusExp" />
+			<xs:enumeration value="bonusSp" />
+			<xs:enumeration value="bonusDropRate" />
 			<xs:enumeration value="pvePhysDmg" />
 			<xs:enumeration value="pvePhysSkillsDmg" />
 			<xs:enumeration value="pveBowDmg" />
Index: java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java	(revision 7034)
+++ java/org/l2jmobius/gameserver/model/actor/stat/PlayerStat.java	(working copy)
@@ -937,4 +937,9 @@
 		
 		return bonus;
 	}
+	
+	public double getBonusDropRateMultiplier()
+	{
+		return 1 + (calcStat(Stat.BONUS_DROP_RATE, 0, null, null) / 100);
+	}
 }
Index: java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java	(revision 7034)
+++ java/org/l2jmobius/gameserver/model/actor/templates/NpcTemplate.java	(working copy)
@@ -776,6 +776,12 @@
 					}
 				}
 				
+				// bonus drop rate effect
+				if (killer.getActingPlayer() != null)
+				{
+					rateChance *= killer.getActingPlayer().getStat().getBonusDropRateMultiplier();
+				}
+				
 				// calculate if item will drop
 				if ((Rnd.nextDouble() * 100) < (dropItem.getChance() * rateChance))
 				{
Index: java/org/l2jmobius/gameserver/model/stats/Stat.java
===================================================================
--- java/org/l2jmobius/gameserver/model/stats/Stat.java	(revision 7034)
+++ java/org/l2jmobius/gameserver/model/stats/Stat.java	(working copy)
@@ -88,6 +88,7 @@
 	EXPSP_RATE("rExp"),
 	BONUS_EXP("bonusExp"),
 	BONUS_SP("bonusSp"),
+	BONUS_DROP_RATE("bonusDropRate"),
 	ATTACK_CANCEL("cancel"),
 	
 	// ACCURACY & RANGE

set like here, still no effect from skill. What it is wrong?

Edited by 0flee

1 answer to this question

Recommended Posts

  • 0
Posted

Code looks legit. You should debug it. Run game server on your own pc, attach debugger, make breakpoints in parts of the code that you have added and figure out which part is incorrect.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Faltan demasiados archivos,  y lógicas en clases claves como L2pcInstance, entre otras. si bien muchas cosas están y el flujo es valorable.  Gracias por tu esfuerzo es bastante... pero realmente no esta completo el código, falta que subas todas las modificaciones en clases colaterales... podrías intentar subir un diff de todo el mod  completo de tu pack y bueno ahí si que cada uno adapte... pero faltan muchas cosas, dudo que haya gente que lo haya echo funcionar con esto... 
    • I know people who have fully bypassed and reversed AAC. One day, they might even release the full source code, but for now, they’re still making money off it. I won’t name anyone, but it’s clear that there aren’t any truly solid anticheats for Lineage2. As I’ve said before, kernel level anticheats are the only real solution. Anything that runs as Internal and injects gets flagged, and your account ends up getting kicked or banned. That’s just how most games handle it nowadays. To TL;DR the whole thing cheating will always exist because there are people out there smart enough to bypass any protection and run private cheats. Public cheats are always detected eventually, so I don’t see any point in buying AAC, especially when they claim it blocks adr, which simply isn’t true.
    • 🌐 Website: https://l2adonis.com 📅 GRAND OPENING: July 18, 2025 – 20:00 (UTC+2) 💬 Discord: https://discord.com/invite/tZBj8JxAwx 🚫 No auto-farm • No auto-macro • No pay-to-win • No custom   Some Basic Info's (More detalied info's on website)  EXP/SP: x25  Adena: x15  Drop: x15  Spoil: x15  Seal Stones: x15  Raid Boss Drop: x10  Epic Boss Drop: x1  Manor: x10  Safe Enchant: +4  Max Enchant: +16  Normal Scroll Chance: 50%  Blessed Scroll Chance: 66% (If enchant fail item remain +4)  Buff Slots (30+4 extra with Divine Inspiration)  Dances/Songs Slots 14  Auto-learn skills  ⚔️ Real PvP • Real Progression • Retail-like experience JOIN NOW and relive the real L2 experience!
    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market Auto Buy Store  : https://utchihamkt.mysellauth.com/ Not sure if we’re legit? Check Our server — real reviews, real buyers https://discord.gg/uthciha-servicess  | https://campsite.bio/utchihaamkt
    • Looking for a Developer – Lineage II Interlude (Vanganth Files)   I’m seeking a developer to collaborate on a project based on Vanganth Interlude files.   Important: Applicants with a bad attitude, lack of respect, or unwillingness to work will be immediately rejected. Payment: Hourly rate, not per task. Contact: Please reach out to me via PM.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock