L2JMobius

High Five Quest Four Goblets

Susuy · 14 · 4805

Offline Susuy

  • Heir
  • **
    • Posts: 32
After entering the room the box never appears to start the event. Still shows a message saying the quantity of items is incorrect and I don't understand why.

https://ibb.co/jVZqx13


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16010

Offline Susuy

  • Heir
  • **
    • Posts: 32
No errors or warnings appear on the gameserver during this event.
I thought that, like the messages, it was returning some null value but I didn't find any errors in the files:
org.l2jmobius.gameserver.instancemanager.FourSepulcherManager
org.l2jmobius.gameserver.model.actor.instance.SepulcherMonsterInstance
org.l2jmobius.gameserver.model.actor.instance.SepulcherNpcInstance

however, even though they are correct, there are still some problems with the amount of time spent inside the room. It should announce the running time every 10 minutes but the message just says: "minute(s) have passed"
And as soon as you talk to the NPC and enter the room there should already be a mystirous box in the center of the room but it is not there and does not appear after the players enter


Offline kinghanker

  • Knight
  • ***
    • Posts: 64
The message that informs you of the time that has passed shows only the message and not the time, to correct it, you can try this solution:

Code: [Select]
diff --git a/java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java b/java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
index f608107..4fc6f49 100644
--- a/java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
+++ b/java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
@@ -1459,29 +1459,29 @@
  case 56:
  case 57:
  {
CurrentTime = 55;
  break;
  }
  }
  }
return CurrentTime;
  }
 
- public void managerSay(byte value)
+ public void managerSay(byte min)
  {
  // for attack phase, sending message every 5 minutes
  if (_inAttackTime)
  {
- if (value < 5)
+ if (min < 5)
  {
  return; // do not shout when < 5 minutes
  }
 
- final byte min = minuteSelect(value);
- NpcStringId msg = NpcStringId.MINUTE_S_HAVE_PASSED;
- if (min == 90)
+ final byte PassTime = minuteSelect(min);
+ String msg = min + " minute(s) have passed."; // now this is a
+ if (PassTime == 90)
  {
- msg = NpcStringId.GAME_OVER_THE_TELEPORT_WILL_APPEAR_MOMENTARILY;
+ msg = "Game over. The teleport will appear momentarily.";
  }
 
  for (Spawn temp : _managers)

diff --git a/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherNpcInstance.java b/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherNpcInstance.java
index 86426ff..9b10eb7 100644
--- a/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherNpcInstance.java
+++ b/java/org/l2jmobius/gameserver/model/actor/instance/SepulcherNpcInstance.java
@@ -438,6 +438,23 @@
  }
  }
 
+ public void sayInShout(String msg)
+ {
+ if (msg == null)
+ {
+ return;// wrong usage
+ }
+
+ final CreatureSay creatureSay = new CreatureSay(this, ChatType.NPC_SHOUT, getName(), msg);
+ for (PlayerInstance player : World.getInstance().getPlayers())
+ {
+ if (Util.checkIfInRange(15000, player, this, true))
+ {
+ player.sendPacket(creatureSay);
+ }
+ }
+ }
+
  public void showHtmlFile(PlayerInstance player, String file)
  {
  final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());

Note: When you enter any of the rooms with a party the boxes will not appear, but if the server is restarted, players will be kicked out of the rooms and the boxes will appear in ALL rooms and not just the room that was started.

The rest of the problem is still intermittent when I fix it I bring the solution


Online CostyKiller

  • Distinguished King
  • *****
    • Posts: 953
I tested this too, the first boxes don’t spawn, if you spawn the box manually everything is fine after that.
I will try to fix it if I have some time.


Offline Susuy

  • Heir
  • **
    • Posts: 32
Quote
kinghanker
thanks, really after restart the boxes appear. I saw that when the event starts all the rooms receive the boxes, the right thing would be just to show the box in the sepulcher that the players entered?


Offline kinghanker

  • Knight
  • ***
    • Posts: 64
Merry Christmas to everyone!
As a gift I brought the solution to this damn problem (I didn't wait until today, I only managed to solve it last night XD)

Code: [Select]
--- a/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -299,7 +302,8 @@ public class Spawn extends Location implements IIdentifiable, INamable
 
  public Npc doSpawn()
  {
- return _doRespawn ? doSpawn(false) : null;
+ return doSpawn(false);
  }
 
  /**

I did the tests and fixed the Four Sepulcher problem and the mobs keep respawning normally but I didn't investigate further if it affected something else.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16010
You break all spawns instead of testing where the actual problem is?
Try something from the ones bellow.
Code: [Select]
Index: java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
===================================================================
--- java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java (revision 9647)
+++ java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java (working copy)
@@ -1040,7 +1040,7 @@
  final Spawn spawnDat = _mysteriousBoxSpawns.get(npcId);
  if (spawnDat != null)
  {
- _allMobs.add(spawnDat.doSpawn());
+ _allMobs.add(spawnDat.doSpawn(false));
  spawnDat.stopRespawn();
  }
  }
@@ -1099,7 +1099,7 @@
  keyBoxMobSpawn.setLocation(spawnDat);
  keyBoxMobSpawn.setRespawnDelay(3600);
  SpawnTable.getInstance().addNewSpawn(keyBoxMobSpawn, false);
- mob = (SepulcherMonster) keyBoxMobSpawn.doSpawn();
+ mob = (SepulcherMonster) keyBoxMobSpawn.doSpawn(false);
  keyBoxMobSpawn.stopRespawn();
  }
  catch (Exception e)
@@ -1209,7 +1209,7 @@
  spawnDat.setXYZ(activeChar);
  spawnDat.setHeading(activeChar.getHeading());
  spawnDat.setRespawnDelay(3600);
- _allMobs.add(spawnDat.doSpawn());
+ _allMobs.add(spawnDat.doSpawn(false));
  spawnDat.stopRespawn();
  }
  }
@@ -1248,7 +1248,7 @@
 
  for (Spawn spawnDat : monsterList)
  {
- final SepulcherMonster mob = (SepulcherMonster) spawnDat.doSpawn();
+ final SepulcherMonster mob = (SepulcherMonster) spawnDat.doSpawn(false);
  spawnDat.stopRespawn();
 
  if (mob != null)


Offline Susuy

  • Heir
  • **
    • Posts: 32
Code: [Select]
--- a/java/org/l2jmobius/gameserver/model/Spawn.java
+++ b/java/org/l2jmobius/gameserver/model/Spawn.java
@@ -299,7 +302,8 @@ public class Spawn extends Location implements IIdentifiable, INamable
 
  public Npc doSpawn()
  {
- return _doRespawn ? doSpawn(false) : null;
+ return doSpawn(false);
  }
 
  /**

What fields can this change affect? As there was no other solution until today, I changed this part of the code earlier today and the server is online working normally, no player reported problems with respawn so far but if this change impacts any system I will have to change again.


Offline kinghanker

  • Knight
  • ***
    • Posts: 64
You break all spawns instead of testing where the actual problem is?
Try something from the ones bellow.

The problems that occurred were:
- As soon as the server started the boxes were in the first room normally but the Mysteious's Box didn't appear in the first room after turning the time of the instance.
- When it was possible to enter the room and talk to the box the instance started normally, the mobs spawned, were killed and the box with the key appeared, after opening the second room 7/10 times the box did not spawn in the second room and interrupted the instance there.
- The messages from the managers were blank
- The managers didn't show the right elapsed time after the player entered the room.

I reviewed the FourSepulcherManagers.java file and didn't see any inconsistencies, everything was correct. In my insanity I even used older versions of this file, compared it with other codes I have and for some it was exactly the same. It wasn't supposed to have problems. that's why I looked for a solution outside of it. PALLATIVEly "breaking all spawns" solved the problem in FourSepulcher, the instance is working perfectly.
But it is not the solution to the problem itself.
At least it helped you to see the problem and come up with a more polished solution.
But I can't stop thinking: If FourSepulcher had this problem with the spawn other instances like delusion, dimensional among others can't also have this problem?
It's just a point to note.

What fields can this change affect? As there was no other solution until today, I changed this part of the code earlier today and the server is online working normally, no player reported problems with respawn so far but if this change impacts any system I will have to change again.
If it didn't influence the functioning of anything excellent but as Mobius said: my change "break all spawns" then it must have impacted on something.
I would also like to know where the change I made is having an impact, in the future maybe it can serve as a knowledge base.


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16010
You will have to read how spawn, despawn and respawn methods work, in order to know what breaks and what works as it should.
Delete the doSpawn method and you will see what could break.


Offline Susuy

  • Heir
  • **
    • Posts: 32
You break all spawns instead of testing where the actual problem is?
Try something from the ones bellow.
Code: [Select]
Index: java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java
===================================================================
--- java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java (revision 9647)
+++ java/org/l2jmobius/gameserver/instancemanager/FourSepulchersManager.java (working copy)
@@ -1040,7 +1040,7 @@
  final Spawn spawnDat = _mysteriousBoxSpawns.get(npcId);
  if (spawnDat != null)
  {
- _allMobs.add(spawnDat.doSpawn());
+ _allMobs.add(spawnDat.doSpawn(false));
  spawnDat.stopRespawn();
  }
  }
@@ -1099,7 +1099,7 @@
  keyBoxMobSpawn.setLocation(spawnDat);
  keyBoxMobSpawn.setRespawnDelay(3600);
  SpawnTable.getInstance().addNewSpawn(keyBoxMobSpawn, false);
- mob = (SepulcherMonster) keyBoxMobSpawn.doSpawn();
+ mob = (SepulcherMonster) keyBoxMobSpawn.doSpawn(false);
  keyBoxMobSpawn.stopRespawn();
  }
  catch (Exception e)
@@ -1209,7 +1209,7 @@
  spawnDat.setXYZ(activeChar);
  spawnDat.setHeading(activeChar.getHeading());
  spawnDat.setRespawnDelay(3600);
- _allMobs.add(spawnDat.doSpawn());
+ _allMobs.add(spawnDat.doSpawn(false));
  spawnDat.stopRespawn();
  }
  }
@@ -1248,7 +1248,7 @@
 
  for (Spawn spawnDat : monsterList)
  {
- final SepulcherMonster mob = (SepulcherMonster) spawnDat.doSpawn();
+ final SepulcherMonster mob = (SepulcherMonster) spawnDat.doSpawn(false);
  spawnDat.stopRespawn();
 
  if (mob != null)

It  works!

question, it's a genuine doubt: the _doRespawn variable is already started with the value true and it changes its value only when _respawnMinDelay > 0 or when the stopRespawn class is called.
if _respawnMinDelay has its value assigned in the spawns xml then what is the use of that check in doSpawn? if there is a need for that verification, returning null would not generate an NPE?
I've already applied the fix you proposed but I still feel I don't understand the reason for that check in doSpawn


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16010
It is meant to prevent respawn from spawns that need it.
Returning null never causes an NPE when code using it expects null to be returned.