L2JMobius

High Five Drop rate effect

criss31 · 15 · 4949

Offline criss31

  • Heir
  • **
    • Posts: 16
Hello everyone, i want to make possible a skill for player to rise in drops. And i find something in skills. With effects. But, unfortunatelly, this effect isn;t implemented in core-side. XML of skill looks like that:
Code: [Select]
<skill id="8415" toLevel="5" name="Ring Ability: Drop Rate Up">
        <!-- Increases item drop rate. -->
        <icon>icon.skill3080</icon>
        <magicLvl>85</magicLvl>
        <operateType>P</operateType>
        <magicCriticalRate>5</magicCriticalRate>
        <effects>
            <effect name="BonusDropRate">
                <amount>
                    <value level="1">10</value>
                    <value level="2">20</value>
                    <value level="3">30</value>
                    <value level="4">40</value>
                    <value level="5">50</value>
                </amount>
                <mode>PER</mode>
            </effect>
        </effects>
    </skill>
if someone can help, i appreciate.
Greetings


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16047
Try this.
Code: [Select]
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


Offline criss31

  • Heir
  • **
    • Posts: 16
I do all settings, unfortunatelly, do not want to work.


Effect isn't applied.

Settings of skill is:
Code: [Select]
<skill id="8415" levels="10" name="Ring Ability - Drop Rate Up">
<!-- Increases item drop rate. -->
<table name="#bonusDropRate">10 20 30 40 50 60 70 80 90 100</table>
<set name="icon" val="icon.skill3080" />
<set name="magicLvl" val="85" />
<set name="operateType" val="P" />
<set name="targetType" val="SELF" />
<for>
<effect name="Buff">
<add stat="bonusDropRate" val="#bonusDropRate" /> <!-- 100% -->
</effect>
</for>
</skill>


Offline Horus

  • Black Sheep
  • Count
  • *****
    • Posts: 483
If you have a drop of 1 adena per mob when you equip the ring that has 50%, don't expect it to increase. because 50% of 1 is 0.5 and the mobs are not going to drop you 1.5 adena. always whole number not fractions .... try increasing the drop to overcome 2 adena per mob and try the ring there ... instead of drop 2 adena when you equip it you drop 3 adena


Offline criss31

  • Heir
  • **
    • Posts: 16
I make skill for 100%, same drop. x1 And i delete skill and i make myself premium char. I get x2 adena with premium. skill 100% x1. And tell me why when i put drop 100% drop, drop isn't 100% chance? I must kill 4-5 mobs to get drop.


Offline criss31

  • Heir
  • **
    • Posts: 16
I set mob count to x10 adena as u see. And effect 50% from skill


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16047
Send your item XML.

Also add before
// calculate if item will drop
Add this
System.out.println("Chance " + dropItem.getChance() + " Bonus " + rateChance + " Combined " + (dropItem.getChance() * rateChance));


Offline criss31

  • Heir
  • **
    • Posts: 16
Xml i have just in skill, there is not any item with that skill effect. Clean package. I don;t create an item. And where i should add tat lines? in PlayerStat.java?


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16047

Offline criss31

  • Heir
  • **
    • Posts: 16
Chance 100.0 Bonus 1.5 Combined 150.0
 but in game still 10 i get not 15

with rate 100% i get this print.
Chance 100.0 Bonus 2.0 Combined 200.0
 but drop it is still 10


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16047

Offline criss31

  • Heir
  • **
    • Posts: 16
I want for amount. Like it is for premium


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16047
I want for amount. Like it is for premium

Then make it as I made the one for rate. :)


Offline criss31

  • Heir
  • **
    • Posts: 16
Well, i don know how to change it. I do like this:



But i get this error