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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Just another ChatGPT programmer. It had to be a Brazilian, hahaha.
    • Dear MaxCheaters Community,   It is disappointing to see the project being dismissed before there is a clear understanding of the work, planning, and vision behind it.   Other communities, such as the Russian and Brazilian Lineage II communities, often support their projects and help them grow. I believe the European community would benefit from adopting the same constructive and supportive approach.   We are not asking anyone to believe in promises alone. We will let our work, progress, and results speak for themselves. Actions speak louder than words. Thanks in advance. -MightyProject Founder
    • 🎙️ Mod de Voz Dev — A.L.N ModVozALN • Sistema de Voz por Proximidade para Lineage II Instalador Gráfico para Launchers L2J • v1.9.44 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🚀 O que é O ModVozALN.exe instala automaticamente o sistema completo de voz por proximidade em sua pack L2J, sem necessidade de alterar o código-fonte da revisão. ✅ Recursos ✔️ Não altera arquivos .java (Bridge via Java Agent) ✔️ Não modifica a Engine.dll (cliente utiliza L2VoiceInject.exe) ✔️ Funciona mesmo sem acesso ao source da revisão ✔️ Instalação automatizada em poucos cliques 🎮 Atalhos INSERT → Abre o painel de voz Segure H → Conversa por proximidade ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🖥️ Launchers 🎤 L2VoiceServer.exe Servidor de voz com interface gráfica e monitor de logs. ⚙️ L2GameServer.exe Inicializa o GameServer com o Java Agent automaticamente. ⏳ O GameServer aguarda automaticamente o Voice Server na porta TCP 17667 antes da inicialização. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ✨ Principais Recursos 📁 Estrutura organizada 📂 Game 📂 Libs 📂 Voice 📂 System 🔍 Detecção automática de revisões aCis L2jMega L2jMobius L2jFrozen L2Off BrProject Custom ⚙️ Geração automática 📄 gs-voz-launch.cfg 📄 Arquivo .bat ☕ Main Class correta 📦 Bibliotecas adicionadas l2voice-bridge.jar Jedis 🔎 Localização automática do Java Busca o JDK em todos os discos e instalações conhecidas. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ☕ Compatibilidade Java (JDK) Utilize sempre o mesmo JDK exigido pela sua revisão. Revisão JDK BrProject / ext.mods 25 L2jMega / L2JALN 17–21 aCis / RusaCis 11–17 L2jMobius 17–21 L2jFrozen 8–11 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔎 Busca Automática do Java (v1.9.44+) O instalador procura automaticamente o java.exe em: 💿 Todos os discos (C:, D:, E:...) 📁 Program Files / Java Eclipse Adoptium Microsoft JDK Amazon Corretto JAVA_HOME Pastas da própria pack (Game, Libs e raiz) O caminho encontrado é salvo em: Game\gs-voz-launch.cfg ✅ Não é necessário editar o set-java.bat. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚠️ UnsupportedClassVersionError Exemplo 69.0 vs 55.0 ✔️ Solução Instale o JDK compatível com sua revisão. Reinstale utilizando o ModVozALN v1.9.44 ou superior. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🎥 Vídeo de Demonstração 📺 https://www.youtube.com/watch?v=8aJMy08o8so&t=7s ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📥 Download 💻 Projeto https://github.com/ALN2025/ModVozALN 📦 Executável https://github.com/ALN2025/ModVozALN.exe 📄 Consulte também o arquivo VERSION.txt Versão Atual: v1.9.44 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 Instalação 1️⃣ Extraia o ModVozALN.zip 2️⃣ Execute ModVozALN.exe 3️⃣ Informe as pastas: 📂 Game 📂 Libs 📂 Voice 📂 System 4️⃣ Clique em Instalar ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ▶️ Ordem de Inicialização Redis ↓ Login Server ↓ L2VoiceServer.exe ↓ L2GameServer.exe ↓ L2VoiceInject.exe ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔥 Firewall (VPS) 🌐 UDP: 17666 🌐 TCP: 17667 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 👨‍💻 Desenvolvido por Dev ⩿ A.L.N/⪀ 🌍 scriptclean.com.br
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..