sound per kill

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
tresorek
Posts: 10
Joined: Wed Nov 12, 2008 12:32 pm
Location: Poland

sound per kill

Post by tresorek »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 3696:
L2JDP Revision 3696:

Hello.
I have code that play sounds per 2-4-6... kills but i have some problem with l2pcinstance

can someone look at this?

Code: Select all

Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(revision 3858)+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java	(working copy)@@ -182,6 +182,7 @@ import com.l2jserver.gameserver.network.serverpackets.ObservationReturn; import com.l2jserver.gameserver.network.serverpackets.PartySmallWindowUpdate; import com.l2jserver.gameserver.network.serverpackets.PetInventoryUpdate;+import com.l2jserver.gameserver.network.serverpackets.PlaySound; import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListDelete; import com.l2jserver.gameserver.network.serverpackets.PledgeShowMemberListUpdate; import com.l2jserver.gameserver.network.serverpackets.PrivateStoreListBuy;@@ -5289,6 +5305,8 @@       if (!super.doDie(killer))          return false; +      spreeKills = 0;+             if (isMounted())          stopFeed();       synchronized (this)@@ -5333,9 +5351,25 @@                      if ((_clan.isAtWarWith(pk.getClanId()) && pk.getClan().isAtWarWith(_clan.getClanId()))                            || (isInSiege() && pk.isInSiege()))                      {+                        PlaySound _snd = new PlaySound(1, "firstblood", 0, 0, 0, 0, 0);+                        +                        Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers().values();+                        for (L2PcInstance onlinePlayer : pls)+                           if (onlinePlayer.isOnline() == 1)+                           {+                              if (onlinePlayer.getClan() != null)+                              {+                                 if (onlinePlayer.getClan() == pk.getClan() && onlinePlayer != pk)+                                 {+                                    onlinePlayer.sendPacket(_snd);+                                 }+                              }+                           }+                                                 //    when your reputation score is 0 or below, the other clan cannot acquire any reputation points-                        if (getClan().getReputationScore() > 0)+                        if (getClan().getReputationScore() > 0){                            pk.getClan().setReputationScore(pk.getClan().getReputationScore() + Config.REPUTATION_SCORE_PER_KILL, true);+                        }                         //    when the opposing sides reputation score is 0 or below, your clans reputation score does not decrease                         if (pk.getClan().getReputationScore() > 0)                            _clan.setReputationScore(_clan.getReputationScore() - Config.REPUTATION_SCORE_PER_KILL, true);@@ -5616,8 +5650,47 @@      * Increase the pvp kills count and send the info to the player      *      */+   private int spreeKills = 0;     public void increasePvpKills()     {+       spreeKills++;+       +      switch(spreeKills){+       +       case 2:+          PlaySound _snd2 = new PlaySound(1, "firstblood", 0, 0, 0, 0, 0);+          sendPacket(_snd2);+       break;+       +       case 4:+          PlaySound _snd4 = new PlaySound(1, "headshot", 0, 0, 0, 0, 0);+          sendPacket(_snd4);+       break;+       +       case 6:+          PlaySound _snd6 = new PlaySound(1, "killingspree", 0, 0, 0, 0, 0);+          sendPacket(_snd6);+       break;+       +       case 8:+          PlaySound _snd8 = new PlaySound(1, "multikill", 0, 0, 0, 0, 0);+          sendPacket(_snd8);+       break;+       +       case 10:+          PlaySound _snd10 = new PlaySound(1, "ultrakill", 0, 0, 0, 0, 0);+          sendPacket(_snd10);+       break;+       +       case 12:+          PlaySound _snd12 = new PlaySound(1, "monsterkill", 0, 0, 0, 0, 0);+          sendPacket(_snd12);+       break;+       +       case 14:+          PlaySound _snd14 = new PlaySound(1, "rampage", 0, 0, 0, 0, 0);+          sendPacket(_snd14);+       break;+       case 16:+          PlaySound _snd16 = new PlaySound(1, "unstoppable", 0, 0, 0, 0, 0);+          sendPacket(_snd16);+       break;+       case 20:+          PlaySound _snd18 = new PlaySound(1, "holyshit", 0, 0, 0, 0, 0);+          sendPacket(_snd18);+       break;+       case 22:+          PlaySound _snd20 = new PlaySound(1, "wickedsick", 0, 0, 0, 0, 0);+          sendPacket(_snd20);+       break;+       case 24:+          PlaySound _snd22 = new PlaySound(1, "godlike", 0, 0, 0, 0, 0);+          sendPacket(_snd22);+       break;+         default:+          ;+       }+         // Add karma to attacker and increase its PK counter         setPvpKills(getPvpKills() + 1); @@ -5669,6 +5742,10 @@         if (getKarma() > (Integer.MAX_VALUE - newKarma))             newKarma = Integer.MAX_VALUE - getKarma(); +        PlaySound _snd = new PlaySound(1, "bottomfeeder", 0, 0, 0, 0, 0);+      sendPacket(_snd);+      broadcastPacket(_snd);+               // Add karma to attacker and increase its PK counter         setPkKills(getPkKills() + 1);         setKarma(getKarma() + newKarma);
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: sound per kill

Post by jurchiks »

that sounds and looks more like a counter-strike mod than l2 mod...
besides, client doesn't have such sounds as monsterkill and unstoppable, so there's no point
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.
tresorek
Posts: 10
Joined: Wed Nov 12, 2008 12:32 pm
Location: Poland

Re: sound per kill

Post by tresorek »

client have that sounds, i have only problems with l2pcinstance
macdonald12
Posts: 89
Joined: Mon Sep 15, 2008 8:51 am

Re: sound per kill

Post by macdonald12 »

tresorek wrote:client have that sounds, i have only problems with l2pcinstance
Client has a sound called "holyshit"? Somehow i find that hard to believe.... :roll:
User avatar
Stake
Posts: 383
Joined: Sun Mar 23, 2008 9:33 pm
Location: Hungary
Contact:

Re: sound per kill

Post by Stake »

Client may have Unreal Tournament sounds, since it has Unreal2.5 engine. :)
Image
Image
tresorek
Posts: 10
Joined: Wed Nov 12, 2008 12:32 pm
Location: Poland

Re: sound per kill

Post by tresorek »

omg i manually added sounds to client
antons007
Posts: 149
Joined: Sat Sep 12, 2009 4:18 pm

Re: sound per kill

Post by antons007 »

why you have headshot sound??? in l2 you can't make headshots !!! :D
tresorek
Posts: 10
Joined: Wed Nov 12, 2008 12:32 pm
Location: Poland

Re: sound per kill

Post by tresorek »

antons007 wrote:why you have headshot sound??? in l2 you can't make headshots !!! :D
Why u asking stupid (off top) questions? To get more posts? I add this sound because i want it, and in base post i asked about code, if u dont know how to answer this question shut up, your posts like this sound like own headshots:)

So at end i trying to apply patch automatically, today i try to put it manually and try it.
MrWashington
Posts: 12
Joined: Thu Jan 21, 2010 5:42 pm

Re: sound per kill

Post by MrWashington »

tresorek wrote:

Code: Select all

PlaySound _snd = new PlaySound(1, "firstblood", 0, 0, 0, 0, 0);
Don't you need to specify the package file the sound belongs to?

Eg,

Code: Select all

sendPacket( new PlaySound("Itemsound.quest_itemget") );
is in the Itemsound.uax package.
Post Reply