Jump to content
  • 0

Question about pvp reward aka sounds


Question

Posted

Hi guys i need some java help so here we go:

reward players for a pvp kill in a related zone here is the code:

// pvp reward
	if (isInsideZone(ZONE_PVP))
	{
		addItem("Loot", 8732, 1, this, true);
		sendMessage("You won 1 lifestone for a pvp kill!");
	}

How can i add 1 more zone?

 

Also About pvp counterstike sounds

code:

+             case 1:
+                PlaySound _snd1 = new PlaySound(1, "firstblood", 0, 0, 0, 0, 0);
+                sendPacket(_snd1);
+             break;
+             
+             case 2:
+                PlaySound _snd2 = new PlaySound(1, "doublekill", 0, 0, 0, 0, 0);
+                sendPacket(_snd2);
+             break;
+             
+             case 3:
+                PlaySound _snd3 = new PlaySound(1, "triplekill", 0, 0, 0, 0, 0);
+                sendPacket(_snd3);
+             break;
+             
+             case 4:
+                PlaySound _snd4 = new PlaySound(1, "megakill", 0, 0, 0, 0, 0);
+                sendPacket(_snd4);
+             break;
+             
+             case 5:
+                PlaySound _snd5 = new PlaySound(1, "ultrakill", 0, 0, 0, 0, 0);
+                sendPacket(_snd5);
+             break;
+             
+             case 10:
+                PlaySound _snd10 = new PlaySound(1, "monsterkill", 0, 0, 0, 0, 0);
+                sendPacket(_snd10);
+             break;
+             
+             case 15:
+                PlaySound _snd15 = new PlaySound(1, "killingspree", 0, 0, 0, 0, 0);
+                sendPacket(_snd15);
+             break;
+               default:
+                ;
+             }   
+      

how can i make it to play sound to all players in l2 world and not only to the killing spree person?

 

5 answers to this question

Recommended Posts

  • 0
Posted

 

 

// pvp reward
	if (isInsideZone(ZONE_PVP) || isInsideZone(ZONE_PEACE))
	{
		addItem("Loot", 8732, 1, this, true);
		sendMessage("You won 1 lifestone for a pvp kill!");
	}

 

or

 

// pvp reward
	if (!isInsideZone(ZONE_PEACE))
	{
		addItem("Loot", 8732, 1, this, true);
		sendMessage("You won 1 lifestone for a pvp kill!");
	}

 

and

 

+L2PcInstance[] players = L2World.getInstance().getAllPlayers().values(new L2PcInstance[0]);		
+switch(your variable...){
+             case 1:
+                PlaySound _snd1 = new PlaySound(1, "firstblood", 0, 0, 0, 0, 0);
+for(L2PcInstance pl : players){
+                pl.sendPacket(_snd1);}
+             break;
+             
+             case 2:
+                PlaySound _snd2 = new PlaySound(1, "doublekill", 0, 0, 0, 0, 0);
+for(L2PcInstance pl : players){
+                pl.sendPacket(_snd2);}
+             break;
+             
+             case 3:
+                PlaySound _snd3 = new PlaySound(1, "triplekill", 0, 0, 0, 0, 0);
+for(L2PcInstance pl : players){
+                pl.sendPacket(_snd3);}
+             break;
+             
+             case 4:
+                PlaySound _snd4 = new PlaySound(1, "megakill", 0, 0, 0, 0, 0);
+for(L2PcInstance pl : players){
+                pl.sendPacket(_snd4);}
+             break;
+             
+             case 5:
+                PlaySound _snd5 = new PlaySound(1, "ultrakill", 0, 0, 0, 0, 0);
+for(L2PcInstance pl : players){
+                pl.sendPacket(_snd5);}
+             break;
+             
+             case 10:
+                PlaySound _snd10 = new PlaySound(1, "monsterkill", 0, 0, 0, 0, 0);
+for(L2PcInstance pl : players){
+                pl.sendPacket(_snd10);}
+             break;
+             
+             case 15:
+                PlaySound _snd15 = new PlaySound(1, "killingspree", 0, 0, 0, 0, 0);
+for(L2PcInstance pl : players){
+                pl.sendPacket(_snd15);}
+             break;
+               default:
+                ;
+             }   
+      

 

  • 0
Posted

Well i tried to insert sound code into quake system here it is:

{
		case 5:
			if(Config.ENABLE_ANTI_PVP_FARM_MSG){
				CreatureSay cs12 = new CreatureSay(0, 15, "",  getName() + " is on a Killing Spree!"); // 8D
				PlaySound _snd1 = new PlaySound(1, "killingspree", 0, 0, 0, 0, 0);
				sendPacket(_snd1);
				for(L2PcInstance player: L2World.getInstance().getAllPlayers())
				{
					if(player != null)
						if(player.isOnline()!=0)
							if(player.isGM())					
								player.sendPacket(cs12);                  						
				}
				for(L2PcInstance player: L2World.getInstance().getAllPlayers())
								{
									if(player != null)
										if(player.isOnline()!=0)
											player.sendPacket(_snd1);
								}			
			}

 

but only sound works, message doesnt go to all players :/

  • 0
Posted

I dunno if you simply thought about your system, but it will be a terrible mess if everyone can listen sounds of others.

 

About your question itself => Broadcast.java got a lot of useful methods.

 

Finally, cs12 must be broadcasted aswell (not to GMs only...). You only broadcast _snd1 to everyone. And fusion both checks...

  • 0
Posted

I dunno if you simply thought about your system, but it will be a terrible mess if everyone can listen sounds of others.

 

About your question itself => Broadcast.java got a lot of useful methods.

 

Finally, cs12 must be broadcasted aswell (not to GMs only...). You only broadcast _snd1 to everyone. And fusion both checks...

aight thanls for your times guys topic can be locked

 

Guest
This topic is now closed to further replies.


  • Posts

    • The community keeps growing every day, more than 350 master accounts created with new players joining to experience Lineage II Classic 2.5 Remastered. Gameplay moved to Stage 2: 1.3 version Rising Tide, where you can do quest for Moon Armor set, farm faster in Alligator Island, Enchanted Valley as newcomer, Outlaw Forest also added where you can do the Daily Quest after Lv.51.    Think of it as a blend of C1, C2, and C3, but more challenging, with improved gameplay, better balance, and enhanced graphics thanks to the Classic client introduced around 2014–2015.   On top of that, all the new features we've added make the experience even more enjoyable while preserving the true Classic feeling.   If you're an Interlude player, it may feel unfamiliar at first but not completely different. It's a more hardcore experience that focuses primarily on developing your main character, rather than rushing to subclasses, Noblesse, and similar endgame goals.
    • I would like to share with you my pack from old L2Pride, based on aCis with latest updates and everything tha needs to run correct and smoothly on every needs. No error consoles ready to use live, ready economy, reworked mobs, skills balance, class balanced, ready events such as TVT/DM/CTF. The pack comes also with essence interface full workable. (Data Pack + Source Included)  The price is negotiable, so let me know in pm. Dont waste my time if you dont really want and only ask for price. https://prnt.sc/LRCRQyUxaxB5 https://prnt.sc/6I95YMy-WR6q https://prnt.sc/jjTm69gUGN7e https://prnt.sc/C7GLQKJXqDdw https://prnt.sc/Pnp7f_USCLar https://prnt.sc/8snRTbznlYEW
    • Longest 24 hours in my life. Also you find nothing on google about his "JewStor Service", neither on telegram besides on maxcheaters. Typical case of scamming.
    • You nid to use the alpha channel in Photoshop
    • "I am creating some buttons for the community, but I want to make their background transparent. Since my general background is a non-flat texture like clouds, if I don't have a transparent background, it doesn't look good. Could you please help me and tell me how I should go about generating the texture in UE2? Currently, I have the TGA texture with a transparent background in Photoshop."
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..