L2JMobius

Free Users => Solved/Invalid Bug Reports => Topic started by: slayerofdark on May 24, 2022, 05:04:03 PM

Title: Not instant to village when died on instances
Post 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.
Title: Re: Not instant to village when died on instances
Post by: slayerofdark on May 30, 2022, 02:36:29 AM
I found the solution to not insta tp out.
Instance.java
Code: [Select]
/**
* 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
Code: [Select]
/**
* 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.
Code: [Select]
// 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.
Title: Re: Not instant to village when died on instances
Post by: Mobius on May 30, 2022, 06:08:26 PM
What value is _ejectTime?
Maybe neeeds milliseconds? seconds? minutes?
Title: Re: Not instant to village when died on instances
Post by: slayerofdark on May 30, 2022, 06:25:16 PM
config.java
Code: [Select]
EJECT_DEAD_PLAYER_TIME = generalConfig.getInt("EjectDeadPlayerTime", 1);maybe that "1" is the problem idk. I haven't changed anything.
Title: Re: Not instant to village when died on instances
Post by: Mobius on May 30, 2022, 06:36:30 PM
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.
Code: [Select]
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);
Title: Re: Not instant to village when died on instances
Post by: slayerofdark on May 31, 2022, 09:34:39 AM
Tested and works.
Title: Re: Not instant to village when died on instances
Post by: Mobius on May 31, 2022, 02:21:09 PM
Fixed with https://bitbucket.org/MobiusDev/l2j_mobius/commits/b3aa518b2eb5a3974a1965ee8d439de74ce903e7