L2JMobius

The Source of Flame helios

exce · 20 · 1371

Offline exce

  • Knight
  • ***
    • Posts: 54
helios1 and helios 2 deleteMe() aren't working.


https://imgur.com/a/BSZpnWW


seems all deleteMe aren't working.


instances.fortressofthedead
Code: [Select]
else if (npc.getId() == VON_HELLMAN)
{
npc.deleteMe();
playMovie(player, Movie.ERT_QUEST_A);
startQuestTimer("hellman_dead", 180, npc, player);
}

von hellman isn't deleted either.


Offline Black Judge

  • Heir
  • **
    • Posts: 36
I noticed this problem not only with Helios


Online gigilo1968

  • Black Sheep
  • Elder
  • ****
    • Posts: 188
    • Hi5
Try this
Code: [Select]
--- a/L2J_Mobius_11.1_TheSourceOfFlame/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_11.1_TheSourceOfFlame/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -1202,6 +1202,11 @@
  getSkillChannelized().abortChannelization();
  }
 
+ if (isInInstance())
+ {
+ setInstanceById(0);
+ }
+
  ZoneManager.getInstance().getRegion(this).removeFromZones(this);
 
  return super.deleteMe();



Offline exce

  • Knight
  • ***
    • Posts: 54
Try this
Code: [Select]
--- a/L2J_Mobius_11.1_TheSourceOfFlame/java/org/l2jmobius/gameserver/model/actor/Npc.java
+++ b/L2J_Mobius_11.1_TheSourceOfFlame/java/org/l2jmobius/gameserver/model/actor/Npc.java
@@ -1202,6 +1202,11 @@
  getSkillChannelized().abortChannelization();
  }
 
+ if (isInInstance())
+ {
+ setInstanceById(0);
+ }
+
  ZoneManager.getInstance().getRegion(this).removeFromZones(this);
 
  return super.deleteMe();


worked fine. ty


Offline exce

  • Knight
  • ***
    • Posts: 54
is happening too when is not a instance. the boss aren't vanish.


Online gigilo1968

  • Black Sheep
  • Elder
  • ****
    • Posts: 188
    • Hi5
Where is method npc.deleteMe() without instance?  :-\
if you spawn RB or NPC custom, default respawn time is 60 sec


Offline exce

  • Knight
  • ***
    • Posts: 54
Where is method npc.deleteMe() without instance?  :-\
if you spawn RB or NPC custom, default respawn time is 60 sec

"challenge fallen emperor's throne" is a instance
"open the path to helio's throne" aren't

so, im not spawning any npc is de code but it seems right

ai.bosses.Helios:
Code: [Select]
case HELIOS1:
{
_bossInstance.deleteMe();
_bossZone.getPlayersInside().forEach(player -> playMovie(player, Movie.SC_HELIOS_TRANS_A));
startQuestTimer("stage2", 15000, null, null);
break;
}
case HELIOS2:
{
_bossInstance.deleteMe();
if (_leopold != null)
{
_leopold.deleteMe();
}
_bossZone.getPlayersInside().forEach(player -> playMovie(player, Movie.SC_HELIOS_TRANS_B));
startQuestTimer("stage3", 15000, null, null);
break;
}




Online gigilo1968

  • Black Sheep
  • Elder
  • ****
    • Posts: 188
    • Hi5
I don't understand "open the path to helio's throne" is instance  :-\
But try this code

Code: [Select]
               if (isInInstance() || getSpawn().getRespawnDelay() > 0)
{
setInstanceById(0);
getSpawn().setRespawnDelay(0);
}


Offline exce

  • Knight
  • ***
    • Posts: 54
I don't understand "open the path to helio's throne" is instance  :-\
But try this code

Code: [Select]
               if (isInInstance() || getSpawn().getRespawnDelay() > 0)
{
setInstanceById(0);
getSpawn().setRespawnDelay(0);
}

where?

just discovered have two deleteMe()
one on npc.java and another on creature.java this in particular are using creature.java code.


creature.java
Code: [Select]
@Override
public boolean deleteMe()
{
if (hasAI())
{
getAI().stopAITask();
}

// Removes itself from the summoned list.
if ((_summoner != null))
{
_summoner.removeSummonedNpc(getObjectId());
}

// Remove all active, passive and option effects, do not broadcast changes.
_effectList.stopAllEffectsWithoutExclusions(false, false);

// Forget all seen creatures.
if (_seenCreatures != null)
{
CreatureSeeTaskManager.getInstance().remove(this);
_seenCreatures.clear();
}

// Cancel the BuffFinishTask related to this creature.
cancelBuffFinishTask();

// Set world region to null.
setWorldRegion(null);

return true;
}


npc.java
Code: [Select]
@Override
public boolean deleteMe()
{
try
{
onDecay();
}
catch (Exception e)
{
LOGGER.log(Level.SEVERE, "Failed decayMe().", e);
}

if (isChannelized())
{
getSkillChannelized().abortChannelization();
}
if (isInInstance())
{
setInstanceById(0);
}

ZoneManager.getInstance().getRegion(this).removeFromZones(this);

return super.deleteMe();
}


Online gigilo1968

  • Black Sheep
  • Elder
  • ****
    • Posts: 188
    • Hi5

Offline exce

  • Knight
  • ***
    • Posts: 54
what about creature.java?



added on npc.java:
Code: [Select]
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.l2jmobius.gameserver.model.Spawn.getRespawnDelay()" because the return value of "org.l2jmobius.gameserver.model.actor.Npc.getSpawn()" is null
at org.l2jmobius.gameserver.model.actor.Npc.deleteMe(Npc.java:1208)
at org.l2jmobius.gameserver.model.actor.instance.Monster.deleteMe(Monster.java:140)
at org.l2jmobius.gameserver.util.MinionList.onMasterDie(MinionList.java:117)
at org.l2jmobius.gameserver.model.actor.instance.Monster.deleteMe(Monster.java:132)
at org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate.lambda$despawn$0(NpcSpawnTemplate.java:476)
at java.base/java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4706)
at org.l2jmobius.gameserver.model.spawns.NpcSpawnTemplate.despawn(NpcSpawnTemplate.java:472)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at org.l2jmobius.gameserver.model.spawns.SpawnGroup.despawnAll(SpawnGroup.java:142)
at ai.others.Spawns.DayNightSpawns.lambda$manageSpawns$1(DayNightSpawns.java:75)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at ai.others.Spawns.DayNightSpawns.manageSpawns(DayNightSpawns.java:69)
at ai.others.Spawns.DayNightSpawns.onSpawnActivate(DayNightSpawns.java:50)
at org.l2jmobius.gameserver.model.spawns.SpawnTemplate.lambda$notifyActivate$0(SpawnTemplate.java:184)
at org.l2jmobius.gameserver.model.spawns.SpawnTemplate.notifyEvent(SpawnTemplate.java:156)
at org.l2jmobius.gameserver.model.spawns.SpawnTemplate.notifyActivate(SpawnTemplate.java:184)
at org.l2jmobius.gameserver.data.xml.SpawnData.init(SpawnData.java:133)
at org.l2jmobius.gameserver.GameServer.<init>(GameServer.java:408)
at org.l2jmobius.gameserver.GameServer.main(GameServer.java:536)


Online gigilo1968

  • Black Sheep
  • Elder
  • ****
    • Posts: 188
    • Hi5
My finish idea ;D

Code: [Select]
                if (isInInstance() || ((getSpawn().getRespawnPattern() != null) && getSpawn().getRespawnDelay() > 0))
{
setInstanceById(0);
getSpawn().setRespawnDelay(0);
}



Offline exce

  • Knight
  • ***
    • Posts: 54
My finish idea ;D

Code: [Select]
                if (isInInstance() || ((getSpawn().getRespawnPattern() != null) && getSpawn().getRespawnDelay() > 0))
{
setInstanceById(0);
getSpawn().setRespawnDelay(0);
}

Code: [Select]
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "org.l2jmobius.gameserver.model.Spawn.getRespawnPattern()" because the return value of "org.l2jmobius.gameserver.model.actor.Npc.getSpawn()" is null


this one works well for instances:
Code: [Select]
if (isInInstance())
{
setInstanceById(0);
}

but not for open world boss like helios.


Online gigilo1968

  • Black Sheep
  • Elder
  • ****
    • Posts: 188
    • Hi5
My Helios boss script is absolutely different. I can't check

case "beginning":
_bossInstance = addSpawn(HELIOS1, HELIOS_SPAWN_LOC.getX(), HELIOS_SPAWN_LOC.getY(), HELIOS_SPAWN_LOC.getZ(), HELIOS_SPAWN_LOC.getHeading(), false, 0, false);

and when kill HELIOS1
_bossInstance.deleteMe(); <--- not work
_bossZone.getPlayersInside().forEach(player -> playMovie(player, Movie.SC_HELIOS_TRANS_A));