L2JMobius

C6 Death penalty

G-hamsteR · 6 · 6773

Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
Hello,

I edited my configs and I put DeathPenaltyChance = 0, however players were getting death penalty. I haven't tested it yet, but I'm almost certain that this will fix it.

Code: [Select]
diff --git java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
index 28a118e..d61097d 100644
--- java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
+++ java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
@@ -14997,7 +14997,7 @@
  */
  public void calculateDeathPenaltyBuffLevel(Creature killer)
  {
- if ((Rnd.get(100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof PlayerInstance) && !isGM() && (!getCharmOfLuck() || (!(killer instanceof GrandBossInstance) && !(killer instanceof RaidBossInstance))) && (!isInsideZone(ZoneId.PVP) && !isInsideZone(ZoneId.SIEGE)))
+ if ((Rnd.get(100) >= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof PlayerInstance) && !isGM() && (!getCharmOfLuck() || (!(killer instanceof GrandBossInstance) && !(killer instanceof RaidBossInstance))) && (!isInsideZone(ZoneId.PVP) && !isInsideZone(ZoneId.SIEGE)))
  {
  increaseDeathPenaltyBuffLevel();
  }


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16035
Try
Code: [Select]
Index: java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java (revision 7474)
+++ java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java (working copy)
@@ -14814,7 +14814,7 @@
  */
  public void calculateDeathPenaltyBuffLevel(Creature killer)
  {
- if ((Rnd.get(100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof PlayerInstance) && !isGM() && (!getCharmOfLuck() || (!(killer instanceof GrandBossInstance) && !(killer instanceof RaidBossInstance))) && (!isInsideZone(ZoneId.PVP) && !isInsideZone(ZoneId.SIEGE)))
+ if ((Config.DEATH_PENALTY_CHANCE > 0) && (Rnd.get(100) < Config.DEATH_PENALTY_CHANCE) && !killer.isPlayer() && !isGM() && !getCharmOfLuck() && !(killer instanceof GrandBossInstance) && !(killer instanceof RaidBossInstance) && !isInsideZone(ZoneId.PVP) && !isInsideZone(ZoneId.SIEGE))
  {
  increaseDeathPenaltyBuffLevel();
  }


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
Seems 100% right. I will test it tomorrow and post my result. I understand the logic of Rnd.get(100) < Config.DEATH_PENALTY_CHANCE. It's like (100 - Rnd.get(100)) > Config.DEATH_PENALTY_CHANCE)


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16035
Try
Code: [Select]
Index: java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java
===================================================================
--- java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java (revision 7474)
+++ java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java (working copy)
@@ -14814,7 +14814,7 @@
  */
  public void calculateDeathPenaltyBuffLevel(Creature killer)
  {
- if ((Rnd.get(100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof PlayerInstance) && !isGM() && (!getCharmOfLuck() || (!(killer instanceof GrandBossInstance) && !(killer instanceof RaidBossInstance))) && (!isInsideZone(ZoneId.PVP) && !isInsideZone(ZoneId.SIEGE)))
+ if ((Config.DEATH_PENALTY_CHANCE > 0) && (Rnd.get(100) < Config.DEATH_PENALTY_CHANCE) && !killer.isPlayer() && !isGM() && !getCharmOfLuck() && !(killer instanceof GrandBossInstance) && !(killer instanceof RaidBossInstance) && !isInsideZone(ZoneId.PVP) && !isInsideZone(ZoneId.SIEGE))
  {
  increaseDeathPenaltyBuffLevel();
  }

Any news on this?


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
I haven't received any reports for death penalty. It's fixed :)