Skip to content

skill sleep for offline trader

Featured Replies

can someone send me code skill sleep for offline traders i think i have asked for it before but i search in my topics and someone has deleted it

 

 

Which project?

Sunrise/Jserver/Jserver Based

-add this in L2PcInstance.java inside the setPrivateStoreType method

if (privateStoreType == PrivateStoreType.NONE) {
    stopAbnormalEffect(AbnormalEffect.SLEEP);
}else{
    startAbnormalEffect(AbnormalEffect.SLEEP);
}

 

Acis 398 (Probably works for previous and recenter ones too)
Look for the setOperateType method in the Player.java class
and change for this one:
 

public void setOperateType(OperateType type)
{
       if(type == OperateType.NONE){
           stopAbnormalEffect(AbnormalEffect.SLEEP);
       } else {
           startAbnormalEffect(AbnormalEffect.SLEEP);           
       }
       _operateType = type;
}


For L2Scripts/FanDC based packs
look for setPrivateStoreType method in Player.java
and put this inside:
 

      if(type == 0) { // none
          stopAbnormalEffect(AbnormalEffect.SLEEP);
      }else{
          startAbnormalEffect(AbnormalEffect.SLEEP);
      }

 

 

I have not tested them, but this sound as simple as it is. U want to visualize the sleep effect when entering the private store mode and u want to remove it when not in the store mode anymore.

  • Author

i have found this 

if (Config.OFFLINE_DISCONNECT_FINISHED && (type == PrivateStoreType.NONE) && ((getClient() == null) || getClient().isDetached()))
			deleteMe();

 

and i have make it like this 

public void setPrivateStoreType(PrivateStoreType type)
	{
		_privateStoreType = type;
		if (type == PrivateStoreType.NONE) {
		    stopAbnormalEffect(AbnormalEffect.SLEEP);
		}else{
		    startAbnormalEffect(AbnormalEffect.SLEEP);
		}
		if (Config.OFFLINE_DISCONNECT_FINISHED && (type == PrivateStoreType.NONE) && ((getClient() == null) || getClient().isDetached()))
			deleteMe();
	}

 

but im getting this error https://prnt.sc/17eynfh

 

5 hours ago, haskovo said:

i have found this 

if (Config.OFFLINE_DISCONNECT_FINISHED && (type == PrivateStoreType.NONE) && ((getClient() == null) || getClient().isDetached()))
			deleteMe();

 

and i have make it like this 

public void setPrivateStoreType(PrivateStoreType type)
	{
		_privateStoreType = type;
		if (type == PrivateStoreType.NONE) {
		    stopAbnormalEffect(AbnormalEffect.SLEEP);
		}else{
		    startAbnormalEffect(AbnormalEffect.SLEEP);
		}
		if (Config.OFFLINE_DISCONNECT_FINISHED && (type == PrivateStoreType.NONE) && ((getClient() == null) || getClient().isDetached()))
			deleteMe();
	}

 

but im getting this error https://prnt.sc/17eynfh

Since u are on eclipse, press F3 on startAbnormalEffect or stopAbnormalEffect and see what class it requires as parameter and puit it there or import the needed class.

  • Author

i made it but when the player opens the menu for selling or buying it gets directly the effect i want when they exit the game then

 

public void setPrivateStoreType(PrivateStoreType type)
	{
		if (type == PrivateStoreType.NONE) {
		    stopAbnormalEffect(AbnormalEffect.SLEEP);
		}
		else {
			startAbnormalEffect(AbnormalEffect.SLEEP);
		}
		_privateStoreType = type;
		if (Config.OFFLINE_DISCONNECT_FINISHED && (type == PrivateStoreType.NONE) && ((getClient() == null) || getClient().isDetached()))
			deleteMe();
	}

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.