Secret Experience

Secret Experience (https://secretexperience.net/index.php)
-   [Lineage] Java Mods (https://secretexperience.net/forumdisplay.php?f=636)
-   -   [L2JServer] Critical/Magical HIT com SOM! (https://secretexperience.net/showthread.php?t=14919)

SheZ 24-10-2009 05:56 PM

Critical/Magical HIT com SOM!
 
Esse código faz um som, quando um Fighter ou Mage der um critical.

Citação:

================================================== ===================
Index: net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
================================================== ===================

public final void sendDamageMessage(L2Character target, int damage, boolean mcrit, boolean pcrit, boolean miss)
{
+ L2PcInstance player = (L2PcInstance)activeChar;
// 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);
+ player.sendPacket(CRITICAL_HIT_SOUND);
+ player.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);
+ player.sendPacket(MAGICAL_HIT_SOUND);
+ player.broadcastPacket(MAGICAL_HIT_SOUND); //Can hear and those around you
+ }

SystemMessage sm = new SystemMessage(SystemMessageId.YOU_DID_S1_DMG);
sm.addNumber(damage);
sendPacket(sm);
}
Para evitar de ouvir dois sons em um critical normal (PCrit) (como você também tem o padrão de som do lado do cliente acerto crítico), você poderia editar ALAudio.int, que está dentro de sua pasta system, com L2FileEdit. Lá você pode encontra isto:

[EtcSound]
CriticalSound=SkillSound.Critical_Hit_02
CriticalSound_Vol=250.0
CriticalSound_Radius=50.0


E você pode definir CriticalSound_Vol = 0,0 ou algo assim, então você não ouve dois sons ao mesmo tempo, se você quiser.

Créditos: xAddytzu

Handy 24-10-2009 06:25 PM

Quando vi o titulo achei que era: Critical/Magical HIT com SOM (Sword of Miracles)
Huahuahua
Vou testar depois isso ai.
Obrigado!

UchihaItachI 21-05-2010 07:06 AM

handy pensei a mesma coisa
kkkkkk

gta2 30-12-2010 10:55 AM

dkakdopakd tambem pensei lol


Horários baseados na GMT -3. Agora são 12:52 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.