L2JMobius

C6 Festive Sweeper

caioconc · 11 · 7061

Offline caioconc

  • Heir
  • **
    • Posts: 33
Skill 444, disappeared mob alive, and does not catch the drops spoill.



Online Mobius

  • Distinguished King
  • *****
    • Posts: 16041
Mobs turn blue, you get spoils? and they disapear.
I do not understand well and not have time to debug this.


Offline caioconc

  • Heir
  • **
    • Posts: 33
do not sweep the mobs in blue, and disappear with all the living mob around.!!



I already have the solution, can I share?


Online G-hamsteR

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

Offline caioconc

  • Heir
  • **
    • Posts: 33
my english is terrible and my programming logic is different i'm sorry, i accept constructive criticism.

Code: [Select]
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/Skill.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/Skill.java
index 56f201a..2f3aa82 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/Skill.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/Skill.java
@@ -2423,22 +2423,9 @@
  }
  case TARGET_AREA_CORPSE_MOB:
  {
- if (!(target instanceof Attackable) || !target.isDead())
- {
- creature.sendPacket(new SystemMessage(SystemMessageId.THAT_IS_THE_INCORRECT_TARGET));
- return null;
- }
- if (!onlyFirst)
- {
- targetList.add(target);
- }
- else
- {
- return new Creature[]
- {
- target
- };
- }

  final boolean srcInArena = creature.isInsideZone(ZoneId.PVP) && !creature.isInsideZone(ZoneId.SIEGE);
  PlayerInstance src = null;
  if (creature instanceof PlayerInstance)
@@ -2449,16 +2436,10 @@
  final int radius = _skillRadius;
  if (creature.getKnownList() != null)
  {
- for (WorldObject obj : creature.getKnownList().getKnownObjects().values())
+ for (Creature obj : creature.getKnownList().getKnownCharactersInRadius(radius))
  {
- if (obj == null)
- {
- continue;
- }
- if ((!(obj instanceof Attackable) && !(obj instanceof Playable)) || ((Creature) obj).isDead() || ((Creature) obj == creature))
- {
- continue;
- }
+
  if (!Util.checkIfInRange(radius, target, obj, true))
  {
  continue;
@@ -2532,14 +2513,13 @@
  {
  continue;
  }
- targetList.add((Creature) obj);
+ targetList.add(obj);
  }
+
  }
- if (targetList.isEmpty())
- {
- return null;
- }
- return targetList.toArray(new Creature[targetList.size()]);
+
+ return targetList.toArray(new WorldObject[targetList.size()]);
+
  }
  case TARGET_UNLOCKABLE:
  {



Code: [Select]
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/skillhandlers/Sweep.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/skillhandlers/Sweep.java
index 2ced212..b48c8af 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/skillhandlers/Sweep.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/skillhandlers/Sweep.java
@@ -70,7 +70,7 @@
  }
  }
 
- if (isSweeping)
+ if (isSweeping == true)
  {
  if ((items == null) || (items.length == 0))
  {
@@ -105,9 +105,13 @@
  player.sendPacket(smsg);
  }
  }
+ target.endDecayTask();
+
  }
- target.endDecayTask();
-
+ else if ((target.isDead() == true) && (isSweeping == false))
+ {
+ target.endDecayTask();
+ }
  if (send)
  {
  if (iu != null)




Online Mobius

  • Distinguished King
  • *****
    • Posts: 16041
Nice work.
If this works I see no reason not to commit it. ;)


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
I didn't understand what the problem was, but I think that this needs testing before committing. Seeing a few lines like the following makes me wonder what's their purpose. For example, removing this kind of checks:

if (obj == null)
{
   continue;
}

Can someone explain the problem so that I can test it?


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16041
That is a standard null check.
If object is null, for whatever reason, continue with next iteration.


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
That is a standard null check.
If object is null, for whatever reason, continue with next iteration.

Hello,

I know what this does. I don't know why it should be removed  :P. A lot of checks are removed with this patch.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16041
I assumed you removed stuff that conflicted with the Festive Sweeper functionality.
You better test one by one the removals.