Offline Shop

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
L2C4CyBeR
Posts: 14
Joined: Wed Apr 28, 2010 4:06 pm

Offline Shop

Post by L2C4CyBeR »

L2J Revision Newest
L2JDP Revision Newest

Hello, i expermenting with offline shop/craft. I thought that i can add L2Effect (sleep) to offline shop(player).
My code example:

Code: Select all

 Index: java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java===================================================================--- a/java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java+++ b/java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java@@ -32,4 +32,9 @@ import com.l2jserver.gameserver.network.L2GameClient; import com.l2jserver.gameserver.network.L2GameClient.GameClientState;+import com.l2jserver.gameserver.model.L2Effect;+import com.l2jserver.gameserver.skills.Env;+import com.l2jserver.gameserver.templates.effects.EffectTemplate;+import com.l2jserver.gameserver.templates.skills.L2EffectType;+import com.l2jserver.gameserver.skills.effects.EffectSleep;  public class OfflineTradersTable@@ -226,4 +231,5 @@                                         player.restoreEffects();                                         player.broadcastUserInfo();+                                        player.startSleeping();                                         nTraders++;                                 } 
I have compiled and added to my server, but players dont get sleep effect. But when i do server restart, it works.
Example:

After player makes offline shop and exits.
http://pico.lt/upload/files/2010-06/7423eacd.jpg

After server restart.
http://pico.lt/upload/files/2010-06/275a7251.jpg


Maybe somebody can fix this ? It should be like that: player do offline shop, exit, then gets this effect.

Credist: Me :)
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Offline Shop

Post by janiii »

it would just be enough to use abnormal effect.

you have unused imports in your patch..

for the other thing, check L2GameClient class, inner class DisconnectTask and the run() method.

Code: Select all

Index: java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java===================================================================--- java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java	(revision 4266)+++ java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java	(working copy)@@ -31,6 +31,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.L2GameClient; import com.l2jserver.gameserver.network.L2GameClient.GameClientState;+import com.l2jserver.gameserver.skills.AbnormalEffect;  public class OfflineTradersTable {@@ -219,6 +220,7 @@ 					stm_items.close();  					player.sitDown();+					player.startAbnormalEffect(AbnormalEffect.SLEEP); 					if (Config.OFFLINE_SET_NAME_COLOR) 						player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR); 					player.setPrivateStoreType(type);Index: java/com/l2jserver/gameserver/network/L2GameClient.java===================================================================--- java/com/l2jserver/gameserver/network/L2GameClient.java	(revision 4266)+++ java/com/l2jserver/gameserver/network/L2GameClient.java	(working copy)@@ -47,6 +47,7 @@ import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket; import com.l2jserver.gameserver.network.serverpackets.ServerClose;+import com.l2jserver.gameserver.skills.AbnormalEffect; import com.l2jserver.gameserver.util.Util; import com.l2jserver.util.EventData; @@ -628,6 +629,7 @@ 								|| (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE)) 						{ 							player.leaveParty();+							player.startAbnormalEffect(AbnormalEffect.SLEEP); 							if (Config.OFFLINE_SET_NAME_COLOR) 							{ 								player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
L2C4CyBeR
Posts: 14
Joined: Wed Apr 28, 2010 4:06 pm

Re: Offline Shop

Post by L2C4CyBeR »

Any suggestions ?
janiii wrote:it would just be enough to use abnormal effect.

you have unused imports in your patch..

for the other thing, check L2GameClient class, inner class DisconnectTask and the run() method.

Code: Select all

Index: java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java===================================================================--- java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java	(revision 4266)+++ java/com/l2jserver/gameserver/datatables/OfflineTradersTable.java	(working copy)@@ -31,6 +31,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.network.L2GameClient; import com.l2jserver.gameserver.network.L2GameClient.GameClientState;+import com.l2jserver.gameserver.skills.AbnormalEffect;  public class OfflineTradersTable {@@ -219,6 +220,7 @@ 					stm_items.close();  					player.sitDown();+					player.startAbnormalEffect(AbnormalEffect.SLEEP); 					if (Config.OFFLINE_SET_NAME_COLOR) 						player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR); 					player.setPrivateStoreType(type);Index: java/com/l2jserver/gameserver/network/L2GameClient.java===================================================================--- java/com/l2jserver/gameserver/network/L2GameClient.java	(revision 4266)+++ java/com/l2jserver/gameserver/network/L2GameClient.java	(working copy)@@ -47,6 +47,7 @@ import com.l2jserver.gameserver.model.entity.TvTEvent; import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket; import com.l2jserver.gameserver.network.serverpackets.ServerClose;+import com.l2jserver.gameserver.skills.AbnormalEffect; import com.l2jserver.gameserver.util.Util; import com.l2jserver.util.EventData; @@ -628,6 +629,7 @@ 								|| (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE)) 						{ 							player.leaveParty();+							player.startAbnormalEffect(AbnormalEffect.SLEEP); 							if (Config.OFFLINE_SET_NAME_COLOR) 							{ 								player.getAppearance().setNameColor(Config.OFFLINE_NAME_COLOR);
Thanks i will try ;)
Last edited by L2C4CyBeR on Mon Jun 14, 2010 1:58 pm, edited 1 time in total.
L2C4CyBeR
Posts: 14
Joined: Wed Apr 28, 2010 4:06 pm

Re: Offline Shop

Post by L2C4CyBeR »

Big thanks janiii. WORKING ! You are best ;)

I have one more question, but its not important.

Its possible to increase height between head and Effect ?

http://pico.lt/upload/files/2010-06/f93d1cd1.jpg
User avatar
janiii
L2j Veteran
L2j Veteran
Posts: 4269
Joined: Wed May 28, 2008 3:15 pm
Location: Slovakia

Re: Offline Shop

Post by janiii »

L2C4CyBeR wrote:Its possible to increase height between head and Effect ?

http://pico.lt/upload/files/2010-06/f93d1cd1.jpg
dont think it is possible. mostly client issue.
DO NOT EVEN TRY TO MESS WITH ME!
forum flOOder dancing dEVILoper
I don't give private support - PM will be ignored!
L2C4CyBeR
Posts: 14
Joined: Wed Apr 28, 2010 4:06 pm

Re: Offline Shop

Post by L2C4CyBeR »

Thanks for your help.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Offline Shop

Post by jurchiks »

It actually looks pretty good! :)
I have another question - is it possible NOT to freeze characters after they've offlined? I mean, currently when the character is in offline mode, it doesn't have it's movement (breathing), it's like a stone statue, and it looks weird, if, for example, i has it's agathion flying around it.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Post Reply