Jump to content
  • 0

custom Script for BlowSound


Question

Posted

if someone is interested

i was thinking to test this 

but im not sure if it can be outside FatalBlow.Java

 

i created BlowSound.Java
data\scripts\custom

but i know im missing something

it stills gives errors

 

everyone is welcome to workaround with this

i used the example of pirama  to begin

package custom;

import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.serverpackets.PlaySound;


public final class BlowSound
{
            if (activeChar.isPlayer())
        {
            L2PcInstance activePlayer = activeChar.getActingPlayer();
            activePlayer.sendDamageMessage(target, (int) damage, false, crit, false);
      activeChar.sendPacket(new PlaySound("skillsound.critical_hit_02"));
        }

    }
}


laters
 

7 answers to this question

Recommended Posts

  • 0
Posted

so is different of what im trying to do

 

my ideas was  to add in the skill  mortal blow

 

<for>
            <effect name="FatalBlow" />
            <effect name="BlowSound" />        
</for>

and then call the sound in BlowSound.java as custom script

 

later i was wondering if it can be done like

 

if critical  hit

PlaySound("skillsound.critical_hit_02"));

 

i dont get why they did it as MagicSkillUse 
well perhaps im trying to do this in High Five

 

JLisvus  implemented it but is for C4  and it works

will keep looking how to solve it

 

thnx for the info Tryskell
 

  • 0
Posted

for example  JFrozen have done the fix inside the core

 

Formulas.calcLethalHit(activeChar, target, skill);
          PlaySound PlaySound = new PlaySound("skillsound.critical_hit_02");
          activeChar.sendPacket(PlaySound);

 

 

now im dizzy
it is a bad way to redone this by custom script isnt it ?  will be calling a lag each time the script is executed?

 

i tryed to make something like this in the high five pack of l2devs  but still

 

import com.l2jserver.gameserver.network.serverpackets.PlaySound;

 

if (activeChar.isPlayer())
		{
			L2PcInstance activePlayer = activeChar.getActingPlayer();
			activePlayer.sendDamageMessage(target, (int) damage, false, crit, false);

                        PlaySound playSound = new PlaySound("skillsound.critical_hit_02");
                        activeChar.sendPacket(playSound);
      
		}


 

 

 


 ERROR in C:\L2JDevs\game\data\scripts\handlers\effecthandlers\instant\FatalBlow.java (at line 113)
        PlaySound playSound = new PlaySound("skillsound.critical_hit_02");
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The constructor PlaySound(String) is not visible

no matter how much i change the ways there is always a error regarding playsound

i also compiled from Jserver git repo a fresh build but it happens the same 

 

 

  • 0
Posted (edited)

Using PlaySound is bad, with a script (or adding a new effect for it) is simply overkill. It got nothing to do with lag/performance (even if you save ressources simply tagging a boolean to true instead of creating new effects), it's simply ugly.

 

One packet (which is already sent, btw) is supposed to do the job - that's how NCSoft decided to do it, no really need to argue about it, that's what the client understands - simply put the boolean to true to get a sound.

 

The constructor you try to use is now private, check PlaySound packet uses to see the correct writting style (not sure why they used static approach, since a new PlaySound is anyway generated).

 

Since the amount of skills is really low, you can simply hardcode it. Past in the time, I figured out than some skills launched status as 0, 1, 2 - so it can't be resolved by a simply boolean, and L2JFrozen fix isn't even complete (so it is both clunky AND incomplete).

Edited by Tryskell
  • 0
Posted (edited)
public final class MagicSkillUse extends L2GameServerPacket
{
    private final int _skillId;
    private final int _skillLevel;
    private final int _hitTime;
    private final int _reuseDelay;
    private final L2Character _activeChar;
    private final L2Character _target;
    // private final List<Integer> _unknown = Collections.emptyList();
    private boolean _success = false;
    private final List<Location> _groundLocations;

    public MagicSkillUse(L2Character cha, L2Character target, int skillId, int skillLevel, int hitTime, int reuseDelay, boolean crit)
    {
        this(cha, target, skillId, skillLevel, hitTime, reuseDelay);
        _success = crit;
    }

    public MagicSkillUse(L2Character cha, L2Character target, int skillId, int skillLevel, int hitTime, int reuseDelay)
    {
        _activeChar = cha;
        _target = target;
        _skillId = skillId;
        _skillLevel = skillLevel;
        _hitTime = hitTime;
        _reuseDelay = reuseDelay;
        _groundLocations = cha.isPlayer() && (cha.getActingPlayer().getCurrentSkillWorldPosition() != null) ? Arrays.asList(cha.getActingPlayer().getCurrentSkillWorldPosition()) : Collections.<Location> emptyList();
    }

    public MagicSkillUse(L2Character cha, int skillId, int skillLevel, int hitTime, int reuseDelay)
    {
        this(cha, cha, skillId, skillLevel, hitTime, reuseDelay);
    }

    @Override
    protected final void writeImpl()
    {
        writeC(0x48);
        writeD(_activeChar.getObjectId());
        writeD(_target.getObjectId());
        writeD(_skillId);
        writeD(_skillLevel);
        writeD(_hitTime);
        writeD(_reuseDelay);
        writeLoc(_activeChar);
        // writeH(_unknown.size()); // TODO: Implement me!
        // for (int unknown : _unknown)
        // {
        // writeH(unknown);
        // }
        if (_success)
        {
            writeD(0x01);
            writeH(0x00);
        }
        else
        {
            writeD(0x00);
        }
        writeH(_groundLocations.size());
        for (IPositionable target : _groundLocations)
        {
            writeLoc(target);
        }
        writeLoc(_target);
    }
}

ShinichiYao  posted this code in l2jserver bitbucket

 

so i guess must start looking to make with this then

perhaps in the same post

 

Sdw-

Edited by etherian
  • 0
Posted (edited)

can close topic

resolved in a dirty way modification

 

		if (crit)
		{
			damage *= 2;
		}

		effector.doAttack(damage, effected, skill, false, false, true, false);
        effector.sendPacket(new PlaySound("skillsound.critical_hit_02"));
          }
         }

 

original file

https://bitbucket.org/MobiusDev/l2j_mobius/src/master/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/FatalBlow.java

 

laters ppl

Edited by etherian
Guest
This topic is now closed to further replies.


  • Posts

    • Vouch for @Ave i can say im very statisfied with the order I've made he was fast and reliable i totally recommend him to anyone who wants a decent updater with high quality design.
    • What can I say other than that I’m satisfied with the order I made. The guy is reliable and very good at what he does. I recommend him 100%.
    • Lineage2 Freya High Five @ Reshade with fog and rain etc @ Gracia final epilogue atmosphere   this reshade will eat lots of GPU power 50% or more of an RTX 3060 so be carefull depending on what effects are activated and their settings will eat even more GPU recomended 60hz monitor settings and via nvidia panel in Lineage2 game profile vsync settings to on effects are set up till film deck and the rest are not used but still working again this can eat alot of GPU Don't overheat GPU this is for freya high five but might work on others too copy in the  System  folder the folder  reshade-shaders  and the files  d3d9.dll  ReShade.ini  ReShadePreset.ini  ReShade.log  CccDddCcc.ini insert opens the menu and delete is on and of some settings need  ctrl + left click  to be changed   making another profile will reset the not activated effects to their default values so just copy the profile  CccDddCcc  and rename if needed also something needs to be closed from settings in game menu, the blur at distance and advanced shaders but keeping the advanced water effects all reflections   for those that don't like the h5 look of the sky and the red fog and rain and ambien red at night on all maps well if we want the cool gracia final epilogue back then we need to do this rename the  Maps  folder to Mapsretail or whatever copy the  Maps  folder from gracia final epilogue to h5 also we need the  L2_Skies.utx  from gracia final epilogue  Textures  folder to be replaced and also we need to do the same to the files  timeenv0.int  timeenv1.int  timeenv2.int  timeenv3.int  found in  system  folder   another setting that will probably be needed but not really tested out is to open file  option.ini  from  system  folder and add cachesize like this   [FirstRun] FirstRun=2   [Engine.GameEngine] CacheSizeMegs=512   also maybe is good to change those to 4.000000   [ClippingRange] Terrain=4.000000 Actor=4.000000 StaticMesh=4.000000 StaticMeshLod=4.000000 Pawn=4.000000       sorry bad english   https://mega.nz/file/aRNXxDrQ#mbxrNERBtW0XEEezK6w8-86oZWuX1k6NgtR6RZWKRVM   the compression on the video is kinda bad but meh    
    • Thanks, tho if possible let's lock the topic. I decided to finish up myself as I only created this to save up my time, but seems that while waiting for prop dev. finished myself.
  • 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..