L2JMobius
Free Users => Solved/Invalid Bug Reports => Topic started by: slayerofdark on May 24, 2022, 05:04:03 PM
-
Hello everyone, i want to make players died in instances to have some time or have to press to village and not insta tp them outside of instance. Anyone know where to look?
Also when reenter to instance and kill boss it saw notice 0 sec and tp out and they dont get drops. please anyone.
-
I found the solution to not insta tp out.
Instance.java
/**
* This method is called when player dies inside instance.
* @param player
*/
public void notifyDeath(Player player)
{
if (!player.isOnEvent() && (_ejectTime > 0))
{
// Send message
final SystemMessage sm = new SystemMessage(SystemMessageId.IF_YOU_ARE_NOT_RESURRECTED_WITHIN_S1_MINUTES_YOU_WILL_BE_EXPELLED_FROM_THE_INSTANT_ZONE);
sm.addInt(_ejectTime / 60 / 1000);
player.sendPacket(sm);
// Start eject task
_ejectDeadTasks.put(player.getObjectId(), ThreadPool.schedule(() ->
{
if (player.isDead() && (player.getInstanceId() == _id))
{
player.setInstanceId(0);
if (_exitLocation != null)
{
player.teleToLocation(_exitLocation, true);
}
else
{
player.teleToLocation(TeleportWhereType.TOWN);
}
}
}, _ejectTime));
}
}
changed to
/**
* This method is called when player dies inside instance.
* @param player
*/
public void notifyDeath(Player player)
{
}
After delete only this player get message you have 0 minutes to get resurected xD something wrong on timer.
// Start eject task
_ejectDeadTasks.put(player.getObjectId(), ThreadPool.schedule(() ->
{
if (player.isDead() && (player.getInstanceId() == _id))
{
player.setInstanceId(0);
if (_exitLocation != null)
{
player.teleToLocation(_exitLocation, true);
}
else
{
player.teleToLocation(TeleportWhereType.TOWN);
}
}
}, _ejectTime));
}
The problem i have now is when kill zaken or freya hall of suffering (kamaloka works fine give 5 minutes after boss death)test with normal chars message come notice: 0 seconds remaing and no drops recieved ( i know i can make autoloot on bosses and prob solved, but i dont want to i want to find out why it is happening) no error on code.
-
What value is _ejectTime?
Maybe neeeds milliseconds? seconds? minutes?
-
config.java
EJECT_DEAD_PLAYER_TIME = generalConfig.getInt("EjectDeadPlayerTime", 1);
maybe that "1" is the problem idk. I haven't changed anything.
-
In General.ini
# When a player dies, is removed from instance after a fixed period of time.
# Time in seconds.
# Default: 60
EjectDeadPlayerTime = 60
Try this.
Index: java/org/l2jmobius/Config.java
===================================================================
--- java/org/l2jmobius/Config.java (revision 10272)
+++ java/org/l2jmobius/Config.java (working copy)
@@ -2080,7 +2080,7 @@
INSTANCE_FINISH_TIME = generalConfig.getInt("DefaultFinishTime", 5);
RESTORE_PLAYER_INSTANCE = generalConfig.getBoolean("RestorePlayerInstance", false);
ALLOW_SUMMON_IN_INSTANCE = generalConfig.getBoolean("AllowSummonInInstance", false);
- EJECT_DEAD_PLAYER_TIME = generalConfig.getInt("EjectDeadPlayerTime", 1);
+ EJECT_DEAD_PLAYER_TIME = generalConfig.getInt("EjectDeadPlayerTime", 60) * 1000;
ALLOW_LOTTERY = generalConfig.getBoolean("AllowLottery", true);
ALLOW_RACE = generalConfig.getBoolean("AllowRace", true);
ALLOW_WATER = generalConfig.getBoolean("AllowWater", true);
-
Tested and works.
-
Fixed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/b3aa518b2eb5a3974a1965ee8d439de74ce903e7