Jump to content
  • 0
Sign in to follow this  
Abadd0n

erro ao tocar som no pvp

Question

Estou com um problema nesse npc, emuladores mais antigos funciona normal, mais no atualizado na hora que vai tocar a musica te double kill ou etc no pvp, aparece esse erro baixo.


[Warning]: script: buildin_atcommand: failed to execute command 'Somno:@sound megakill.wav'
[Debug]: Source (NPC): OnPCKillEvent (invisible/not on a map)
[Debug]: Source (NPC): OnPCKillEvent (invisible/not on a map)
 

 

segue o npc abaixo, 

-    script    OnPCKillEvent    -1,{                    
OnPCKillEvent:
attachrid killedrid;
getmapxy(@mapname$,@mapx,@mapy,0,strcharinfo(0));
if(@mapname$ != "pvp_y_1-1" && @mapname$ != "pvp_y_1-2" && @mapname$ != "pvp_y_1-3" && @mapname$ != "pvp_y_1-4" && @mapname$ != "pvp_y_1-5"
 && @mapname$ != "pvp_y_2-1" && @mapname$ != "guild_vs2" && @mapname$ != "prt_are01" && @mapname$ != "sec_pri"
 && @mapname$ != "arug_cas01" && @mapname$ != "prtg_cas01" && @mapname$ != "prtg_cas02"
 && @mapname$ != "prtg_cas03" && @mapname$ != "prtg_cas04" && @mapname$ != "prtg_cas05"
 && @mapname$ != "guild_vs1" && @mapname$ != "guild_vs2" && @mapname$ != "guild_vs3"
 && @mapname$ != "guild_vs4" && @mapname$ != "guild_vs5" && @mapname$ != "pvp_y_2-2" && @mapname$ != "payg_cas04" && @mapname$ != "payg_cas03" && @mapname$ != "pvp_y_8-2") close;
if(playerattached() != 0) {
    set $@PlayerKilled$, strcharinfo(0);
//    query_sql "SELECT name FROM ranking WHERE char_id = '"+getcharid(0)+"'",@name$;
    query_sql "SELECT SUM(case when char_id = '"+getcharid(0)+"' then 1 else 0 end) FROM `ranking` WHERE char_id = '"+getcharid(0)+"'",@code;
    set @anted$, escape_sql(strcharinfo(0));
    if(!@code) {
        query_sql "INSERT INTO ranking (char_id, name) VALUES ('"+getcharid(0)+"','"+@anted$+"')";
    }
    query_sql "SELECT streak FROM ranking WHERE char_id = '"+getcharid(0)+"'",$@antesdemorrer;
    set $@newzeny, $@antesdemorrer * 10000;
    set $@killed, getcharid(0);
    if ($@newzeny == 0) {
        set $@newzeny, 10000;
    }
    if ($@antesdemorrer > 10) {
        set $@antesdemorrer, 10;
    }
    set KillAdaga, KillAdaga / 2;
    query_sql "UPDATE ranking SET deaths = deaths + 1, streak = 0, pontos = ((kills * 10) - (deaths * 3)) WHERE char_id = '"+getcharid(0)+"'";
}
attachrid killerrid;
if(playerattached() != 0) {
    set @PlayerKiller$, strcharinfo(0);
    if (isequipped(13045) && Mato1 != $@killed) set KillAdaga, KillAdaga+1;
    set Mato1, $@killed;
    query_sql "SELECT SUM(case when char_id = '"+getcharid(0)+"' then 1 else 0 end) FROM `ranking` WHERE char_id = '"+getcharid(0)+"'",@code;
//    query_sql "SELECT name FROM ranking WHERE char_id = '"+getcharid(0)+"'",@namea$;
    set @anteda$, escape_sql(strcharinfo(0));
    if (!@code) {
        query_sql "INSERT INTO ranking (char_id, name) VALUES ('"+getcharid(0)+"','"+@anteda$+"')";
    }
    query_sql "UPDATE ranking SET kills = kills + 1, streak = streak + 1, pontos = ((kills * 10) - (deaths * 3)) WHERE char_id = '"+getcharid(0)+"'";
    query_sql "SELECT `data` FROM ranking WHERE char_id = '"+getcharid(0)+"'",@horantes$;
    if (@horantes$ == "") {
        set @horantes$, gettimestr("%Y-%m-%d %H:%M:%S",21);
    }
    set @agora$, gettimestr("%Y-%m-%d %H:%M:%S",21);
    query_sql "UPDATE ranking SET `data` = '"+@agora$+"' WHERE char_id = '"+getcharid(0)+"'";
    query_sql "SELECT ADDTIME('"+@horantes$+"', 10)",@novahora$;
    query_sql "SELECT '"+@novahora$+"' >= '"+@agora$+"'", @verif;
    query_sql "INSERT INTO ranklog (char_id1, char_id2, `data`) VALUES ("+getcharid(0)+","+$@killed+",'"+@agora$+"')";
    if (!@verif) {
        query_sql "UPDATE ranking SET ultima = 1 WHERE char_id = '"+getcharid(0)+"'";
    } else {
        query_sql "UPDATE ranking SET ultima = ultima + 1 WHERE char_id = '"+getcharid(0)+"'";
    }
    query_sql "SELECT ultima, kills, deaths, streak FROM ranking WHERE char_id = '"+getcharid(0)+"'",@ultima, @kills, @deaths, @streak;
    if (playerattached()){
        set @hahad, @ultima;
        set @newzeny2, @hahad * 10000;
        if(@hahad > 4) {
            set @hahad, 4;
        }
    }
    announce ""+@PlayerKiller$+" matou "+$@PlayerKilled$+" por "+$@newzeny+" zenys! ("+@kills+" / "+@deaths+" / "+@streak+")",17;
    if (@streak > 10) {
        set @streak, 10;
    } else {
        set @streak, @streak;
    }
    set Zeny, Zeny+$@newzeny;
    if (@verif) {
        set Zeny, Zeny + $@newzeny2;
    }
    if ($@antesdemorrer >2) {
        announce "O "+$@fases$[$@antesdemorrer]+" do "+$@PlayerKilled$+" foi terminado por "+@PlayerKiller$+" !",17;
    }
    set @mapname$, "";
    if (@streak > 2) {
        announce ""+@PlayerKiller$+" esta em "+$@fases$[@streak]+" ! ",17;
        atcommand strcharinfo(0)+":@sound "+$@song$[@streak];
        getmapxy(@mapname$,@mapx,@mapy,0,strcharinfo(0));
        soundeffectall $@song$[@streak],0,@mapname$;
//        debugmes @mapname$;
    }
    if (playerattached() && @verif && @hahad > 1) {
        announce ""+@PlayerKiller$+" conseguiu um "+$@cacaca$[@hahad]+" ! (+"+@newzeny2+" zenys)",17;
        atcommand strcharinfo(0)+":@sound "+$@keke$[@hahad];
        getmapxy(@mapname$,@mapx,@mapy,0,strcharinfo(0));
//        debugmes @mapname$;
//        sleep 2000;
        soundeffectall $@keke$[@hahad],0,@mapname$;
        //ogmes @mapname$;

initnpctimer;
OnTimer04000:
if (playerattached() && $@verif) if(@hahad != 0) announce ""+$@PlayerKiller$+" conseguiu um "+$@cacaca$[@hahad]+" ! (+"+$@newzeny2+" zenys)",17;
if (playerattached() && $@verif) if(@hahad != 0) atcommand strcharinfo(0)+":@sound "+$@keke$[@hahad];
end;
}
}
}

-    script    Init    -1,{
    OnInit:
    setarray $@fases$,"0","0","0","KILLING SPREE","DOMINATING","MEGA KILL","UNSTOPPABLE","WICKED SICK","MONSTER KILL","GOD LIKE","BEYOND GODLIKE";
    setarray $@song$,"0","0","0","killing_spree.wav","dominating.wav","megakill.wav","unstoppable.wav","whickedsick.wav","monster_kill.wav","godlike.wav","holyshit.wav";
    setarray $@cacaca$,"0","0","DOUBLE KILL","TRIPLE KILL","ULTRA KILL";
    setarray $@keke$,"0","0","double_Kill.wav","triple_kill.wav","ultraKill.wav";

}

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 1
Posted (edited)

Olá Abadd0n,

Ajuste as linhas que contém o @sound para a nova formatação com o soundeffectall.

soundeffectall "<effect filename>",<type>{,"<map name>"}{,<x0>,<y0>,<x1>,<y1>};
These two commands will play a sound effect to either the invoking
character only ('soundeffect') or multiple characters ('soundeffectall').
If the running code does not have an object ID (a 'floating' NPC) or is
not running from an NPC object at all (an item script) the sound will be
centered on the character who's RID got attached to the script, if any.
If it does, it will be centered on that object. (an NPC sprite)
Effect filename is the filename in a GRF. It must have the .wav extension.
It's not quite certain what the 'type' actually does, it is sent to the
client directly. It probably determines which directory to play the effect
from. It's certain that giving 0 for the number will play sound files from
'\data\wav\', but where the other numbers will read from is unclear.
The sound files themselves must be in the PCM format, and file names
should also have a maximum length of 23 characters including the .wav
extension:
soundeffectall "1234567890123456789.wav", 0; // will play the soundeffect
You can add your own effects this way, naturally.


Substitua isso: atcommand strcharinfo(0)+":@sound "+$@song$[@streak];

Por isso: soundeffectall $@song$[@streak], 0;

Edited by Chengue

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

Seja bem vindo ao Cronus-Emulator.
É sempre um prazer te-lo conosco.
Você pode visualizar nossas áreas de suporte para encontrar suas soluções sem a necessidade de se registrar!
Registrando em nossa comunidade, você poderá conhecer mais sobre nosso projeto, criar tópicos, responder tópicos existentes, baixar milhares de recursos em nosso sistema de downloads, participar de nossa comunidade, customizar seu perfil e muito mais... Se você já possui uma conta, faça seu login - ou crie uma conta. Também temos integração com Google+ e Facebook.

×
×
  • Create New...