L2JMobius

C6 Lag caused by soulshots

G-hamsteR · 8 · 6888

Online G-hamsteR

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

Soulshots cause great lag, especially if many players are hitting something for minutes. Here is a fix.

Code: [Select]
diff --git a/java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java b/java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
index a5bddf1..e3c58d1 100644
--- a/java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
+++ b/java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
@@ -119,7 +119,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_THE_SPIRITS_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
  }
 
  @Override


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16041
No change for other shots?
Maybe 3000...
Code: [Select]
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (working copy)
@@ -148,7 +148,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 3000);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (working copy)
@@ -163,7 +163,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 3000);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (working copy)
@@ -126,7 +126,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 3000);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (working copy)
@@ -119,7 +119,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_THE_SPIRITS_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 3000);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (working copy)
@@ -116,7 +116,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 3000);
  }
 
  @Override


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16041
New patch.
Code: [Select]
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (working copy)
@@ -148,7 +148,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (working copy)
@@ -163,7 +163,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (working copy)
@@ -122,11 +122,14 @@
  }
 
  // Charge Blessed Spiritshot
+ if (weaponInst.getChargedSpiritshot() != itemId)
+ {
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
+ }
  weaponInst.setChargedSpiritshot(ItemInstance.CHARGED_BLESSED_SPIRITSHOT);
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (working copy)
@@ -115,11 +115,14 @@
  }
 
  // Charge soulshot
+ if (weaponInst.getChargedSoulshot() != itemId)
+ {
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
+ }
  weaponInst.setChargedSoulshot(ItemInstance.CHARGED_SOULSHOT);
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_THE_SPIRITS_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (working copy)
@@ -112,11 +112,14 @@
  }
 
  // Charge Spiritshot
+ if (weaponInst.getChargedSpiritshot() != itemId)
+ {
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
+ }
  weaponInst.setChargedSpiritshot(ItemInstance.CHARGED_SPIRITSHOT);
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
  }
 
  @Override


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332

Online Mobius

  • Distinguished King
  • *****
    • Posts: 16041
Then use first patch, distance 600 and we done with this?
Code: [Select]
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSoulShot.java (working copy)
@@ -148,7 +148,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, 2033, 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BeastSpiritShot.java (working copy)
@@ -163,7 +163,7 @@
 
  // Pet uses the power of spirit.
  activeOwner.sendPacket(SystemMessageId.PET_USES_THE_POWER_OF_SPIRIT);
- Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(activeOwner, new MagicSkillUse(activePet, activePet, isBlessed ? 2009 : 2008, 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/BlessedSpiritShot.java (working copy)
@@ -126,7 +126,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SoulShots.java (working copy)
@@ -119,7 +119,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_THE_SPIRITS_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
  }
 
  @Override
Index: java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java
===================================================================
--- java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (revision 7463)
+++ java/org/l2jmobius/gameserver/handler/itemhandlers/SpiritShot.java (working copy)
@@ -116,7 +116,7 @@
 
  // Send message to client
  player.sendPacket(SystemMessageId.POWER_OF_MANA_ENABLED);
- Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 360000/* 600 */);
+ Broadcast.toSelfAndKnownPlayersInRadius(player, new MagicSkillUse(player, player, SKILL_IDS[weaponGrade], 1, 0, 0), 600);
  }
 
  @Override


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
Something went wrong. Even with the first patch, I can't see the soulshots. Let me find out what happened and send you feedback. Maybe the previous patch was fine and the problem in my case is somewhere else.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16041