new GM command /playsound

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

new GM command /playsound

Postby Celdron » Thu Apr 30, 2015 9:11 pm

I work on new scripts for quests and have create this command for my own tests.

you can use:
Code: Select all
/code player.Out.SendSoundEffect(ID, 0, 0, 0, 0, 0);
but this is not my way :cry:

I think this is usefull for GMS to find usable sound ids :wink:

Code: Select all
/*
 * DAWN OF LIGHT - The first free open source DAoC server emulator
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */
using System;
using DOL.GS.PacketHandler;


namespace DOL.GS.Commands
{
    [CmdAttribute(
        "&playsound", //command to handle
        ePrivLevel.GM, //minimum privelege level
        "playsound [ID]", //command description
        "'/PlaySound ID <SoundID> usable code for play sound are: player.Out.SendSoundEffect(ID, 0, 0, 0, 0, 0); ")] //usage
    public class PlaySoundIDCommandHandler : AbstractCommandHandler, ICommandHandler
    {
        public void OnCommand(GameClient client, string[] args)
        {
            if (args.Length == 1)
            {
                DisplaySyntax(client);
                return;
            }

            GamePlayer player = client.Player.TargetObject as GamePlayer;

            if (player == null)
                player = client.Player;

            ushort ID;

            if (ushort.TryParse(args[1], out ID) == false)
            {
                DisplaySyntax(client);
                return;
            }

            player.Out.SendSoundEffect(ID, 0, 0, 0, 0, 0);
        }
    }
}



MFG

Elcotek
Celdron
DOL Visitor
 
Posts: 8
Joined: Thu Jan 02, 2014 6:24 pm

Re: new GM command /playsound

Postby Leodagan » Fri May 01, 2015 8:25 am

Hi, Elcotek

Did you test this command as "Game Server Script" ?

It can be a good addition to public SVN GSS collection :)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Location: Lyon

Re: new GM command /playsound

Postby Celdron » Fri May 01, 2015 10:15 am

i have it integrated as gm command in my server source, but you can it intecate in the public source, but i have not test as scirpt yet, but i can do. :)

the command work very good
Celdron
DOL Visitor
 
Posts: 8
Joined: Thu Jan 02, 2014 6:24 pm

Re: new GM command /playsound

Postby Celdron » Fri May 01, 2015 11:07 am

i have now test as script, yes it work :)
Celdron
DOL Visitor
 
Posts: 8
Joined: Thu Jan 02, 2014 6:24 pm

Re: new GM command /playsound

Postby Leodagan » Fri May 01, 2015 11:12 am

Ok I just need some time to branch my local repo and I'll integrate it to SVN :)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Location: Lyon

Re: new GM command /playsound

Postby whria78 » Sun May 03, 2015 11:18 am

Hey~ I have a question.

I have tested but I can find only several soundeffect. not background music ( albiontown.mp3 .... ).

Dose the background music played when player enter some area, exist within soundeffects ?
User avatar
whria78
Contributor
 
Posts: 128
Joined: Fri Sep 21, 2007 11:27 pm

Re: new GM command /playsound

Postby Graveen » Sun May 03, 2015 5:09 pm

Thank you Elcotek !!!
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12613
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: new GM command /playsound

Postby Celdron » Sun May 03, 2015 6:09 pm

Hello,

The next aviable sound and music is at id 600+

MFG
Celdron
DOL Visitor
 
Posts: 8
Joined: Thu Jan 02, 2014 6:24 pm

Re: new GM command /playsound

Postby whria78 » Sun May 03, 2015 11:04 pm

Hey.

As I have checked, it plays . wav files of client. (I attached CC_sounds.zip)

but, How to play the mp3s (cc_mp3s) ?
Attachments
cc_mp3s.zip
(1 KiB) Downloaded 6 times
CC_sounds.zip
(38.88 KiB) Downloaded 8 times
User avatar
whria78
Contributor
 
Posts: 128
Joined: Fri Sep 21, 2007 11:27 pm

Re: new GM command /playsound

Postby Tolakram » Mon May 04, 2015 3:46 am

All the music has an ID, not sure how it maps. I played just about every piece when trying to find music for my Diablo III event.

client.Out.SendSoundEffect((ushort)714, 0, 0, 0, 0, 0); // music

By the way, the /cast command already can play sounds. :D It's not obvious AT ALL.

/cast sound [id]
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9183
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA


Return to DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest