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

    • ⭐MidnightSell team WTB/WTS GOLD ⭐TWW EU/US all servers ⭐Cataclysm all servers ⭐Payment Visa/Master/Btc/Eth/Trc-20/Erc-20 (all payments within 10 min) ⭐For all question pls dm ⭐Discord https://discord.gg/h8AN57qJjK ⭐Or Telegram @MidnightSell
    • Hey guys, I came up with this idea while needing to write down multiple locations. When you use the /loc command, a text file is created (only the first time) and stores all the locations you debug.   Output:   --- a/aCis_gameserver/java/net/sf/l2j/gameserver/handler/usercommandhandlers/Loc.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/handler/usercommandhandlers/Loc.java @@ -1,5 +1,10 @@ package net.sf.l2j.gameserver.handler.usercommandhandlers; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + import net.sf.l2j.gameserver.data.xml.MapRegionData; import net.sf.l2j.gameserver.handler.IUserCommandHandler; import net.sf.l2j.gameserver.model.actor.Player; @@ -13,6 +18,7 @@ 0 }; + @SuppressWarnings("resource") @Override public void useUserCommand(int id, Player player) { @@ -100,6 +106,26 @@ } player.sendPacket(SystemMessage.getSystemMessage(msg).addNumber(player.getX()).addNumber(player.getY()).addNumber(player.getZ())); + + if (player.isGM()) + { + try + { + String fileLoc = "./data/locations.txt"; + final File file = new File(fileLoc); + file.createNewFile(); + + FileWriter fw = new FileWriter(fileLoc, true); + BufferedWriter bw = new BufferedWriter(fw); + bw.write(player.getX() + ", " + player.getY() + ", " + player.getZ()); + bw.newLine(); + bw.close(); + } + catch (IOException e) + { + e.printStackTrace(); + } + } } @Override  
    • Not any training model, i should fix that, just a very well done bot engine. As we use it on a local Internet Cafe spot and people join to test server, they don't seem to understand they are bots. Their behaviour is really well done. Many actions that other bots can't do are possible and the are complicated patterns that can be done due to structure of the engine such as Pick items of dead party pk member and later on trade them back to owner. So i'll fix later the title to Bot Engine rather than A.I. 
    • its old ver ))   this is new https://gamerip.ru/index.php?/topic/3308-lineage2-chronicle3-rise-of-darkness-new-version-172-030225/
  • Topics

×
×
  • Create New...