xAddytzu Posted October 19, 2009 Posted October 19, 2009 ===================================================================== Index: net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java ===================================================================== public final void sendDamageMessage(L2Character target, int damage, boolean mcrit, boolean pcrit, boolean miss) { // Check if hit is missed if (miss) { sendPacket(new SystemMessage(SystemMessageId.MISSED_TARGET)); return; } // check if hit is critical if (pcrit) + { sendPacket(new SystemMessage(SystemMessageId.CRITICAL_HIT)); + PlaySound CRITICAL_HIT_SOUND = new PlaySound(1, "CRITICAL_HIT_SOUND", 0, 0, 0, 0, 0); + this.sendPacket(CRITICAL_HIT_SOUND); + this.broadcastPacket(CRITICAL_HIT_SOUND); //Can hear and those around you + } if (mcrit) + { sendPacket(new SystemMessage(SystemMessageId.CRITICAL_HIT_MAGIC)); + PlaySound MAGICAL_HIT_SOUND = new PlaySound(1, "MAGICAL_HIT_SOUND", 0, 0, 0, 0, 0); + this.sendPacket(MAGICAL_HIT_SOUND); + this.broadcastPacket(MAGICAL_HIT_SOUND); //Can hear and those around you + } SystemMessage sm = new SystemMessage(SystemMessageId.YOU_DID_S1_DMG); sm.addNumber(damage); sendPacket(sm); } Thanks LauQ I will make some soon, and post them here, and if xAddytzu could add them to the first post then ^^ Btw: to prevent hearing two sounds at a normal crit (pcrit) (as you also have the default client side critical hit sound), you could edit ALAudio.int, which is inside your Lineage 2/system folder, with L2FileEdit. There you can find this: [EtcSound] CriticalSound=SkillSound.Critical_Hit_02 CriticalSound_Vol=250.0 CriticalSound_Radius=50.0 And you could set CriticalSound_Vol=0.0 or something, so you don't hear two sounds at the same time if you want ^^ Quote
Kяaσh Posted October 19, 2009 Posted October 19, 2009 add sound when one player hit magic critical or critical Quote
xAddytzu Posted October 19, 2009 Author Posted October 19, 2009 This is to add the sound? Yep, but you must add sounds in game (format ogg) Quote
xAddytzu Posted October 19, 2009 Author Posted October 19, 2009 If you want I can give you some link for program to convert MP3 OGG EDIT : CLICK HERE Quote
Horus Posted October 19, 2009 Posted October 19, 2009 xAddytzu, Correct your message: _log.warning("this.isBack"); makes no sense since this refers to the class and you're using it inside a string lool. So should be: _log.warning(this.getName() + "isBack"); ^^ Quote
xAddytzu Posted October 19, 2009 Author Posted October 19, 2009 xAddytzu, Correct your message: _log.warning("this.isBack"); makes no sense since this refers to the class and you're using it inside a string lool. So should be: _log.warning(this.getName() + "isBack"); ^^ I wanted in a row Quote
zuczek93 Posted October 20, 2009 Posted October 20, 2009 mayby anybody have any sound for critical / magic critical and can share it? Quote
BellaVeladorn Posted October 20, 2009 Posted October 20, 2009 That's a very nice code my friend ;) implementing in my code collection. Quote
xAddytzu Posted October 20, 2009 Author Posted October 20, 2009 That's a very nice code my friend ;) implementing in my code collection. No problem! If I have time, I will create more Quote
LauQ Posted October 22, 2009 Posted October 22, 2009 Very nice share, thanks Yep, but you must add sounds in game (format ogg) Sounds are inside .uax packs, which you can make easily with UnrealED (import .wav's) mayby anybody have any sound for critical / magic critical and can share it? I will make some soon, and post them here, and if xAddytzu could add them to the first post then ^^ Btw: to prevent hearing two sounds at a normal crit (pcrit) (as you also have the default client side critical hit sound), you could edit ALAudio.int, which is inside your Lineage 2/system folder, with L2FileEdit. There you can find this: [EtcSound] CriticalSound=SkillSound.Critical_Hit_02 CriticalSound_Vol=250.0 CriticalSound_Radius=50.0 And you could set CriticalSound_Vol=0.0 or something, so you don't hear two sounds at the same time if you want ^^ Quote
corbas Posted October 22, 2009 Posted October 22, 2009 one question;D im new guy, in this area, and i would like to know where insert this code:)) or just give me some guide :)) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.