Jump to content
  • 0

EarthQuake After Some Announce (player Variable)


Urbanhack

Question

hello again guys.. i need 1more thing..

 

i Need a Earthquake after an Announce

for example

welcome to the server + earthquake

 

here is the code:

Announcements.getInstance().announceToAll("Welcome To The Server!!");

Earthquake eq = new Earthquake(player.getX(), player.getY(), player.getZ(), 14, 3);
Broadcast.toAllOnlinePlayers(eq);

 

The Problem Is The "player" variable

player.getX(), player.getY(), player.getZ()

because doesn't exist into the code

i Try With

private L2Object player;

but i get error.

can someone helpme?

ty again

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Index: java/com/l2jserver/gameserver/util/Broadcast.java
===================================================================
--- java/com/l2jserver/gameserver/util/Broadcast.java	(revision 4493)
+++ java/com/l2jserver/gameserver/util/Broadcast.java	(working copy)
@@ -35,6 +35,7 @@
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.CharInfo;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
+import com.l2jserver.gameserver.network.serverpackets.Earthquake;
import com.l2jserver.gameserver.network.serverpackets.L2GameServerPacket;
import com.l2jserver.gameserver.network.serverpackets.RelationChanged;

@@ -233,6 +234,19 @@
		toAllOnlinePlayers(cs);
	}

+	public static void broadCastEarthQuake()
+	{
+		Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
+		for(L2PcInstance p : pls)
+		{
+			if(p != null && p.isOnline())
+			{
+				final Earthquake eq = new Earthquake(p.getX(), p.getY(), p.getZ(), 14, 3);
+				p.sendPacket(eq);
+			}
+		}
+	}
+	
	public static void toPlayersInInstance(L2GameServerPacket mov, int instanceId)
	{
		Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();
Index: java/com/l2jserver/gameserver/Announcements.java
===================================================================
--- java/com/l2jserver/gameserver/Announcements.java	(revision 4493)
+++ java/com/l2jserver/gameserver/Announcements.java	(working copy)
@@ -217,11 +217,13 @@
	public void announceToAll(SystemMessage sm)
	{
		Broadcast.toAllOnlinePlayers(sm);
+		Broadcast.broadCastEarthQuake();
	}

	public void announceToInstance(SystemMessage sm, int instanceId)
	{
		Broadcast.toPlayersInInstance(sm, instanceId);
+		Broadcast.broadCastEarthQuake();
	}

	// Method for handling announcements from admin

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • CLExt PTS Classic Interlude - Extender       If you like to run a PTS Classic Interlude stable live server without any issues with all known bug issues already fixed, your choice is here!   Sometimes ppl question is why i dont choose any leak classic 3.0 example and i loose my time on this shit, its because i dont like any other chronicle of the game and im a lover of c3-c4, and the classic gameplay on Vanganth C4 Mother core as L2Server.exe is the best Rare base on PTS platform to play the classic client.   You will never see this gameplay at any java emulator.   Free ver, is 2.61 for thoses like to test datapack and if you like you can be subscriber.   Latest premium version is: 4.28.   Client link: https://www.mediafire.com/file/1d8xe18rvgi04lx/L2_Classic_Interlude_Client_V2.rar/file   Free 2.61 Server files: https://www.mediafire.com/file/mtqltep66asdguu/PTS_Vanganth_-_Classic_Interlude_P110.rar/file   Discord: https://discord.com/invite/aFKzdaDDvz   Enjoy! Have a good exploration!  
    • يمكنك الحصول على هراب مجلى كوري من خلال زيارة موقع السقاف اونلاين للحصول على كل ما يلزمك في منزلك من الأدوات الصحية المصنوعة بجودة و دقة متناهية و بأسعار لا مثيل لها في أي مكان آخر  https://alsaggaf.com.sa/product/%D9%87%D8%B1%D8%A7%D8%A8-%D9%85%D8%AC%D9%84%D9%89-%D9%83%D9%88%D8%B1%D9%8A-%D9%85%D9%86-%D8%B3%D9%8A%D9%88%D9%86-sm-33/
    • In l2j? There is probably something in the config files to allow all subclasses, i'm pretty sure. If not, one way is to go in the VillageMaster.java and check the function getSubclasses(). Then comment out the part where it removes all the kamael subclasses from the list.    
    • New review on an English-language resource: [IMG]https://i.imgur.com/4u8acWw.jpeg[/IMG]
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock