Jump to content
  • 0

Change count PvP ranking


Question

23 answers to this question

Recommended Posts

Posted
//|==================================================================================|
//|          ___           ___           ___           ___           ___            |
//|         /\  \         /\  \         /\  \         /|  |         /\  \           |
//|        |::\  \       /::\  \       /::\  \       |:|  |        /::\  \          |
//|        |:|:\  \     /:/\:\  \     /:/\:\  \      |:|  |       /:/\:\  \         |
//|      __|:|\:\  \   /:/  \:\  \   /:/  \:\  \   __|:|  |      /:/ /::\  \        |
//|     /::::|_\:\__\ /:/__/ \:\__\ /:/__/ \:\__\ /\ |:|__|____ /:/_/:/\:\__\       |
//|     \:\--\  \/__/ \:\  \ /:/  / \:\  \ /:/  / \:\/:::::/__/ \:\/:/  \/__/       |
//|      \:\  \        \:\  /:/  /   \:\  /:/  /   \::/__/       \::/__/            |
//|       \:\  \        \:\/:/  /     \:\/:/  /     \:\  \        \:\  \            |
//|        \:\__\        \::/  /       \::/  /       \:\__\        \:\__\           |
//|         \/__/         \/__/         \/__/         \/__/         \/__/           |
//| ================================================================================ |
//|   Script Desenvolvido Por Mooka | eAthena | Por Favor, Não Retire Os Créditos.   |
//| ================================================================================ |
//|         Observação! O MapFlag Está No Final Do Script !                 |
//| ================================================================================ |
//|[v1.2.4]: Mapflags são definidos automaticamente.            {Mooka}         |
//| v1.2.3 : Novo campo na tabela 'pvpm_map'. (noguild)            {Mooka}         |
//| v1.2.2 : Alteração na função "Changeleader".            {Mooka}         |
//| v1.2.1 : Implementada opção para WoE. (Contagem de pontos na WoE)    {Mooka}         |
//| v1.2.0 : Novo comando remoto. (!map)                {Mooka}         |
//| ------                                         |
//| v1.1.9 : Comandos !pvp\!gvg\!baby mergidos no novo comando !warp.     {Mooka}         |
//| v1.1.8 : Reformulado Sistema das Arenas.                {Mooka}         |
//| v1.1.7 : Nova tabela no PvP Master. (pvpm_map)            {Mooka}         |
//| v1.1.6 : Ranking não mostra mais valores com 0.            {Mooka}         |
//| v1.1.5 : Novos comandos remotos. (!ban;!truncate)            {Mooka}         |
//| v1.1.4 : Adicionado opção de Ranking Ratio aos Menus e CMD Remotos.    {Mooka}         |
//| v1.1.3 : Otimizado IF's dos comandos remotos.            {Mooka}         |
//| v1.1.2 : Desenvolvida nova opção de Ranking. (Ratio)        {Mooka}         |
//| v1.1.1 : Alteração na tabela pvpm_data. (Adicionado campo 'ratio')    {Mooka}         |
//| v1.1.0 : Novo comando remoto. (!help)                {Mooka}         |
//| ------                                         |
//| v1.0.9 : Adicionado duplicações do npc em todas as cidades.        {Mooka}         |
//| v1.0.8 : Adicionada opção para retirar buffs.            {Mooka}         |
//| v1.0.7 : Correção na função Ranking2.                {Mooka}         |
//| v1.0.6 : Correção no comando !exit.                    {Mooka}         |
//| v1.0.5 : Correção no bug de enviar o som "end" causando erro.    {Mooka}         |
//| v1.0.4 : Implementado Sons do Unreal Tournament.            {Mooka}         |
//| v1.0.3 : Adicionado novo tipo de contagem de Pontos com Announce.    {Mooka}         |
//| v1.0.2 : Adicionada opção para servidores PK.            {Mooka}         |
//| v1.0.1 : Adicionado PvP Baby.                    {Mooka}         |
//| v1.0.0 : Desenvolvida Versão.                    {Mooka}         |
//| ================================================================================ |
//| Table update (v1.2.3+):                                 |
//| alter table pvpm_map add noguild int(11) not null default '0';             |
//| update pvpm_map set noguild=1 where map='guild_vs1';                 |
//| -------------------------------------------------------------------------------- |
//| Table update (v1.1.7+):                                 |
//| DROP TABLE IF EXISTS `pvpm_map`;                             |
//| CREATE TABLE `pvpm_map` (                                 |
//| `id` int(11) unsigned NOT NULL default '0',                         |
//| `map` varchar(255) NOT NULL default 'NULL',                         |
//| `type` int(11) unsigned NOT NULL default '0',                     |
//| KEY `id` (`id`)                                     |
//| ) TYPE=MyISAM;                                     |
//| insert into pvpm_map (id,map,type) values (0,'guild_vs3',0);             |
//| insert into pvpm_map (id,map,type) values (1,'pvp_n_1-5',0);             |
//| insert into pvpm_map (id,map,type) values (2,'guild_vs1',2);             |
//| insert into pvpm_map (id,map,type) values (3,'prt_are01',2);             |
//| insert into pvpm_map (id,map,type) values (4,'guild_vs2',1);             |
//| -------------------------------------------------------------------------------- |
//| Table update (v1.1.1+):                                 |
//| alter table pvpm_data add ratio int(11) not null default '0' after dies         |
//| -------------------------------------------------------------------------------- |
//| Table PvP Master Ultimate (v1.0.0+):                         |
//|                                             |
//| DROP TABLE IF EXISTS `pvpm_data`;                             |
//| CREATE TABLE `pvpm_data` (                                 |
//| `id` int(11) unsigned NOT NULL default '0',                         |
//| `name` varchar(255) NOT NULL default '',                         |
//| `kills` int(11) unsigned NOT NULL default '0',                     |
//| `dies` int(11) unsigned NOT NULL default '0',                     |
//| `leader` int(11) unsigned NOT NULL default '0',                     |
//| `annc` int(11) unsigned NOT NULL default '0',                     |
//| `ban` int(11) unsigned NOT NULL default '0',                     |
//| `type` int(11) unsigned NOT NULL default '0',                     |
//| KEY `id` (`id`),                                     |
//| KEY `kills` (`kills`),                                 |
//| KEY `dies` (`dies`)                                     |
//| ) TYPE=MyISAM;                                     |
//|                                             |
//| ================================================================================ |
prontera,160,186,4    script    [PvP] Arena    899,{
//| ================================================================================ |
goto Begin;                                                   // |
//|                                                           |
//| -------------------------------------------------------------------------------- |
//| |<!!!> Aviso importante sobre as configurações.                   | |
//| |O Sistema de Arena terá problemas com um número de mapas menor que cinco.       | |
//| |O máximo de mapas é 10, mas é possível alterar editando o script, caso queira | |
//| |fale comigo.                                   | |
//| -------------------------------------------------------------------------------- |
//|                                                           |
OnInit:                                                        // |
//| Configurações:                                                                 |
//|                                                           |
//|~> Nome do npc.                                     |
set $@pvpm_name$,"[ ^FF0000 Arena ^000000 ]";                          // |
//|                                              |
//|~> Deseja usar o Ranking Ratio como principal? [ 1 = Sim ]                 |
//|---> Nota: Ranking Ratio: Pontuação = Kills - Mortes                     |
set $@mainRanking,1;                                  // |
//|                                              |
//|~> Até onde o Ranking irá mostrar. [ Máximo 127 ]                     |
set $@showsRankUntil,25;                              // |
//|                                              |
//|~> Modo PK. Está configurado para alterar automatico, mude se necessário.         |
set $@PK_Mode,getbattleflag("pk_mode");                          // |
//|                                              |
//|~> Deseja que ao player entrar no pvp perca os buff? [ 1 = Sim]             |
set $@breakBuffs,1;                                  // |
//|                                              |
//|~> Deseja ativar a contagem de pontos nos mapas da WoE?                 |
//|---> Nota 1: Não são enviandos sons/broadcast nos mapas da WoE.             |
//|---> Nota 2: Opções de contagem.                             |
//|--> 0: Desativado.                                     |
//|--> 1: Ativar contagem somente do PvP.                         |
//|--> 2: Ativar contagem somente do GvG.                         |
//|--> 3: Ativar ambos.                                     |
set $@CountPointsInWoE,3;                              // |
//|                                              |
//|~> Configuração do Som!                                 |
//|---> Nota 1: Os sons devem ser colocados na pasta data/wav em formato .wav         |
//|---> Nota 2: Se desativar o som do UT, desativará o broadcast dele também.(2)     |
//|--> 0   : Desativar Todas Opções.                             |
//|--> 1   : Ativar somente broadcast Global.                         |
//|--> 2   : Ativar somente sons/broadcast do Unreal Tournament.             |
//|--> 3   : Ativar Ambos.                                 |
set $@sound,3;                                      // |
//|                                              |
//|~> Lista com o nomes dos Sons Unreal Tournament.                     |
//|---> Nota: $@SoundList$[Pontos em que irá tocar o som(Max. 127)],"Nome do Som";   |
//|---> Nota 2: A partir do ultimo, será somado 10 e repetirá o som, o set         |
//|--->     com "end" indica que o ultimo som será repetido dali em diante.         |
//|---> Nota 3: O nome do arquivo é o mesmo que será exibido no announce.         |
set $@SoundList$[1],"firstblood";                          // |
set $@SoundList$[2],"doublekill";                          // |
set $@SoundList$[3],"triplekill";                          // |
set $@SoundList$[5],"megakill";                          // |
set $@SoundList$[10],"ultrakill";                          // |
set $@SoundList$[15],"killingspree";                          // |
set $@SoundList$[20],"ownage";                              // |
set $@SoundList$[25],"holyshit";                          // |
set $@SoundList$[30],"godlike";                          // |
set $@SoundList$[35],"dominating";                          // |
set $@SoundList$[40],"unstoppable";                          // |
set $@SoundList$[50],"monsterkill";                          // |
set $@SoundList$[51],"end";                              // |
//|==================================================================================|

query_sql("select name from pvpm_data where leader=1 and type=0 limit 1",$@Player_Lider$);
query_sql("select name from pvpm_data where leader=1 and type=2 limit 1",$@Guild_Lider$);

OnReloadListMap:
    deletearray $@IDPM,10;
    deletearray $@mapPM$,10;
    deletearray $@MapTypePM,10;
    deletearray $@menu$,10;
    query_sql("select * from pvpm_map order by id asc limit 10",$@IDPM,$@mapPM$,$@MapTypePM,$@mfPM);
    setarray $@TypeArena$[0],"^CD5C5C<PvP>","^FF4500<PvP Baby>","^8B5742<GvG>","^0047AB<Evento>";
    for(set .@j,0;.@j!=(getarraysize($@IDPM)-1);set .@j,.@j+1)
    {
        set $@menu$[.@j],"^000000- Arena "+(.@j+1)+" "+$@TypeArena$[$@MapTypePM[.@j]];
    setmapflag $@mapPM$[.@j],mf_nosave;    
    setmapflag $@mapPM$[.@j],mf_noteleport;
    setmapflag $@mapPM$[.@j],mf_nowarpto;
    setmapflag $@mapPM$[.@j],mf_nowarp;
    setmapflag $@mapPM$[.@j],mf_nomemo;
    setmapflag $@mapPM$[.@j],mf_nopenalty;
    setmapflag $@mapPM$[.@j],mf_nobranch;
    if(!$@MapTypePM[.@j] && !$@mfPM) setmapflag $@mapPM$[.@j],mf_pvp; else
    if(!$@MapTypePM[.@j]) setmapflag $@mapPM$[.@j],mf_pvp_noguild;
    if($@MapTypePM[.@j]==2) setmapflag $@mapPM$[.@j],mf_gvg;
    } end;

Begin:
    while(1)
    {
    mes $@pvpm_name$;
    mes "Bem vindo as nossas Arenas de luta!";
    mes "Os atuais liders são:";
    mes "^008B8B< PvP Lider - ^FFA500"+$@Player_Lider$+"^008B8B >";
    mes "^008B8B< GvG Lider - ^FFA500"+$@Guild_Lider$+"^008B8B >";
        switch(select("^FFA500- Entrar na Arena^000000:- Ranking:- Comandos Remotos:- Sair"))
        {
    case 1:
    for(set @i,0;@i<=(getarraysize($@IDPM)-1);set @i,@i+1) set @m$[@i]," ^0000FF["+getmapusers($@mapPM$[@i])+"]";
            switch(getarraysize($@IDPM))
            {
        case 1: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0]));
        case 2: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1]));
        case 3: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2]));
        case 4: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3]));
        case 5: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4]));
        case 6: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5]));
        case 7: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5],$@menu$[6]+@m$[6]));
        case 8: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5],$@menu$[6]+@m$[6],$@menu$[7]+@m$[7]));
        case 9: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5],$@menu$[6]+@m$[6],$@menu$[7]+@m$[7],$@menu$[8]+@m$[8]));
        case 10: callfunc("pvpm_func","Warp",1,select($@menu$[0]+@m$[0],$@menu$[1]+@m$[1],$@menu$[2]+@m$[2],$@menu$[3]+@m$[3],$@menu$[4]+@m$[4],$@menu$[5]+@m$[5],$@menu$[6]+@m$[6],$@menu$[7]+@m$[7],$@menu$[8]+@m$[8],$@menu$[9]+@m$[9]));
            }

    case 2:    
            switch(select("- PvP:- PvP (Mortes):- PvP (Ratio):- GvG:- GvG (Mortes):- GvG (Ratio):- Minha Colocação"))
            {
        case 1: callfunc "pvpm_func","Ranking1","kills",0,"PvP"; next; continue;
        case 2: callfunc "pvpm_func","Ranking1","dies",0,"PvP (Mortes)"; next; continue;
        case 3:    callfunc "pvpm_func","Ranking1","ratio",0,"PvP (Ratio)"; next; continue;
        case 4:    callfunc "pvpm_func","Ranking1","kills",2,"GvG"; next; continue;
        case 5:    callfunc "pvpm_func","Ranking1","dies",2,"GvG (Mortes)"; next; continue;
        case 6: callfunc "pvpm_func","Ranking1","ratio",2,"GvG (Ratio)"; next; continue;        
        case 7:
                switch(select("- Minha Colocação Do PvP:- Minha Colocação Do PvP (Mortes):- Minha Colocação Do PvP (Ratio):- Minha Colocação Do GvG:- Minha Colocação Do GvG (Mortes):- Minha Colocação Do GvG (Ratio)"))
                {
            case 1:    callfunc "pvpm_func","Ranking2","kills",0; next; continue;
            case 2:    callfunc "pvpm_func","Ranking2","dies",0; next; continue;
            case 3:    callfunc "pvpm_func","Ranking2","ratio",0; next; continue;
            case 4:    callfunc "pvpm_func","Ranking2","kills",2; next; continue;
            case 5:    callfunc "pvpm_func","Ranking2","dies",2; next; continue;
            case 6:    callfunc "pvpm_func","Ranking2","ratio",2; next; continue;
                }
            }
    case 3:
        mes $@pvpm_name$;
        mes "O sistema de comandos remotos funciona da seguinte mandeira:";
        mes "- Envie uma PM(Player Message) para  ^008B8Bnpc:cmd.";
        mes "- Esse é o nome do npc. Ele automaticamente retornará uma lista de comandos para você.";
        next; continue;
    case 4:
        close;
        }
    }
}

-    script    cmd    -1,{

OnWhisperGlobal:

        if(compare(@whispervar0$,"!warp"))
        {
        set @ArenaID,@whispervar1$;
            if(!@ArenaID)
            {
            dispbottom "<!!!> Você deve informar o número da Arena.";
            end;
            }
                switch(getarraysize($@IDPM))
                {
            case 5: callfunc("pvpm_func","Warp",0,@ArenaID);
            case 6: callfunc("pvpm_func","Warp",0,@ArenaID);
            case 7: callfunc("pvpm_func","Warp",0,@ArenaID);
            case 8: callfunc("pvpm_func","Warp",0,@ArenaID);
            case 9: callfunc("pvpm_func","Warp",0,@ArenaID);
            case 10: callfunc("pvpm_func","Warp",0,@ArenaID);
                }
        }

        if(compare(@whispervar0$,"!ranking"))
        {      if(compare(@whispervar0$,"2"))
            {
                if(compare(@whispervar1$,"pvp"))
                {    if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking2","ratio",0,"Ratio"; end; }
                    if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking2","kills",0; else
                    callfunc "pvpm_func","Ranking2","dies",0;
                    end;
                }

                if(compare(@whispervar1$,"gvg"))
                {    if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking2","ratio",2,"Ratio"; end; }
                    if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking2","kills",2; else
                    callfunc "pvpm_func","Ranking2","dies",2;
                    end;
                }
            }

            if(compare(@whispervar1$,"pvp"))
            {    if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking1","ratio",0,"Ratio"; end; }
                if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking1","kills",0,"PvP"; else
                callfunc "pvpm_func","Ranking1","dies",0,"PvP ( Mortes )";
                end;
            }

            if(compare(@whispervar1$,"gvg"))
            {    if(compare(@whispervar2$,"ratio")) { callfunc "pvpm_func","Ranking1","ratio",2,"Ratio"; end; }
                if(!compare(@whispervar2$,"die")) callfunc "pvpm_func","Ranking1","kills",2,"GvG"; else
                callfunc "pvpm_func","Ranking1","dies",2,"GvG";
                end;
            }
        }

        if ( compare(@whispervar0$,"!exit") )
        {
        getmapxy(@map$,@x,@y,0);
            for(set @i,0;@i!=getarraysize($@mapPM$);set @i,@i+1)
            {
                if (@map$ !=  $@mapPM$[@i]) continue;
                sleep2 1000; dispbottom "<!!!> Aguarde 5 Segundos . . .";
                sleep2 1000; dispbottom "<!!!> Aguarde 4 Segundos . . .";
                sleep2 1000; dispbottom "<!!!> Aguarde 3 Segundos . . .";
                sleep2 1000; dispbottom "<!!!> Aguarde 2 Segundos . . .";
                sleep2 1000; dispbottom "<!!!> Aguarde 1 Segundo  . . .";
                sleep2 1000; warp "SavePoint",0,0;
                end;
            }
        dispbottom "<!!!> Está função só pode ser usada dentro da Arena.";
        end;
        }

        if (compare(@whispervar0$,"lider"))
        {
        if(compare(@whispervar0$,"pvp")) dispbottom "O Lider da arena é: "+$@Player_Lider$; else
        dispbottom "O Lider da arena é: "+$@Guild_Lider$;
        end;
        }

        if(compare(@whispervar0$,"!truncate") && getgmlevel()>=70)
        {
            if(compare(@whispervar1$,"pvp"))
            {
            query_sql("delete from pvpm_data where type=0");
            dispbottom "<!!!> Ranking do PvP foi limpo.";
            end;
            }
            if(compare(@whispervar1$,"gvg"))
            {
            query_sql("delete from pvpm_data where type=2");
            dispbottom "<!!!> Ranking do PvP foi limpo.";
            end;
            } dispbottom "<!!!> Você deve especificar qual arena deseja resetar o Ranking.";
        }

        if (compare(@whispervar0$,"!ban"))
        {
            if(@whispervar1$=="") { dispbottom "É necessário que o Nome seja informado."; end; }
            if(@whispervar2$=="") { dispbottom "É necessário que o Tempo seja informado."; end; }
            if(@whispervar3$=="") { dispbottom "É necessário que o Tipo de banimento seja informado."; end; }
            if(@whispervar2$=="showtime")
            { query_sql("select ban from pvpm_data where name='"+@whispervar1$+"' limit 1",@showtime);
            dispbottom "<!!!> O tempo de banimento de(o) "+@whispervar1$+" é de "+@showtime+" minutos.";
            end;
            }    if(@whispervar2$=="unban")
                { query_sql("update pvpm_data set ban=0 where name='"+@whispervar1$+"' limit 1");
                dispbottom "<!!!> O banimento foi retirado de(o) "+@whispervar1$+" com sucesso.";
                message @whispervar1$,"[GM Mensagem] Você foi desbanido da Arena PvP.";
                end;
                } set @time,@whispervar2$;
            if(@time==0 && @whispervar2$!="unban" || @time==0 && @whispervar2$!="showtime") { dispbottom "O valor do Tempo não é válido, por favor utilize caracteres de 0 à 9."; end; }
        set @id,0;
        query_sql("select id from pvpm_data where name='"+@whispervar1$+"' and type="+@whispervar3$,@id);
                if(!@id && @whispervar3$=="0") { dispbottom "<!!!> Nenhum player foi encontrado com este nome."; end; }
                if(!@id && @whispervar3$=="2") { dispbottom "<!!!> Nenhuma guild foi encontrada com este nome."; end; }        
         set @bantime,0;
        if(compare(@whispervar2$,"-")) query_sql("update pvpm_data set ban=ban"+@time+" where id="+@id+" limit 1"); else
        query_sql("update pvpm_data set ban=ban+"+@time+" where id="+@id+" limit 1");
        query_sql("select ban from pvpm_data where id="+@id+" limit 1",@bantime);
        dispbottom "<!!!> Tempo de banimento alterado. ("+@bantime+" Minutos)";
        message @whispervar1$,"[GM Mensagem] Você está banido da Arena PvP por "+@bantime+" minutos.";
        warpchar "prontera",150,150,getcharid(0,@whispervar1$);
        end;        
        }

        if (compare(@whispervar0$,"!map") && getgmlevel()>=70)
        {
            if (compare(@whispervar1$,"add"))
            {
                if(getarraysize($@IDPM)>=10)
                {
                dispbottom "<!!!> O sistema de arenas não suporta mais de 10 mapas.";
                dispbottom "<!!!> Se quiser alterar o valor máximo, entre em contado com Mooka. ([email protected])";
                end;
                } set @type,@whispervar3$;            
                    if(!@type && @whispervar3$==""||@type>2)
                    {
                    dispbottom "<!!!> 1. Por favor, defina o tipo de arena.";
                    dispbottom "<!!!> 2. Só é permitido o uso dos caracteres de 0 à 2.";
                    dispbottom "<!!!> - 0 = Arena de PvP; 1 = Arena de PvP Baby; 2 Arena de GvG;";
                    end;
                    } set @mapcheck$,"";
                query_sql("select map from pvpm_map where map='"+@whispervar2$+"' limit 1",@mapcheck$);
                if(@mapcheck$!="")
                {
                dispbottom "<!!!> Esse mapa já está sendo usado pelo [PvP Master].";
                end;
                } query_sql("insert into `pvpm_map` (id,map,type) values ("+(getarraysize($@IDPM)-1)+",'"+@whispervar2$+"',"+@type+")");
            dispbottom "<!!!> O mapa \""+@whispervar2$+"\" foi adicionado.";
            }

            if (compare(@whispervar1$,"del"))
            {
                if(getarraysize($@IDPM)<=5)
                {
                dispbottom "<!!!> Opa! Você não pode retirar mais mapas do PvP Master, isto causará problemas!";
                end;
                } query_sql("select map from pvpm_map where map='"+@whispervar2$+"'",@mapcheck$);
                    if(@mapcheck$=="")
                    {
                    dispbottom "<!!!> Nenhum mapa com este nome está sendo usado.";
                    end;
                    } query_sql("delete from pvpm_map where map='"+@whispervar2$+"'");
            dispbottom "<!!!> O mapa \""+@whispervar2$+"\" foi retirado.";
            } doevent "[PvP] Arena::OnReloadListMap";
        end;
        }

        if (compare(@whispervar0$,"!help"))
        {
            if(compare(@whispervar1$,"!warp")) {
            dispbottom "<!!!>";
            dispbottom "O comando '!pvp' serve para teleportá-lo à arena desejada, para usá-lo você deve enviar a mensagem:";
            dispbottom "- !warp#1;!warp#2;...!warp#5 ..";
            dispbottom "Após o '#' é o número da arena.";
            end;
            }

            if(compare(@whispervar1$,"!ranking")) {
            dispbottom "<!!!>";
            dispbottom "!ranking serve para mostrar o Ranking. Para isso, você deve enviar uma das mensagens abaixo:";
            dispbottom "- !ranking#pvp;!ranking#pvp#die;!ranking#gvg;!ranking#gvg#die;!ranking#ratio";
            dispbottom "- !ranking2#pvp;!ranking2#pvp#die;!ranking2#gvg;!ranking2#gvg#die;!ranking2#ratio; (Mostra somente sua posição)";
            dispbottom "Você deve especificar qual ranking você deseja visualizar (#pvp ou #gvg), caso deseje o ranking de mortes adicione #die no final.";
            end;
            }

            if(compare(@whispervar1$,"!pvplider") || compare(@whispervar1$,"!gvglider")) {
            dispbottom "<!!!>";
            dispbottom "!pvplider ou !gvglider serve para mostrar o player ou guild com mais pontos.";
            end;
            }

            if(compare(@whispervar1$,"!exit")) {
            dispbottom "<!!!>";
            dispbottom "Serve para retirá-lo da arena, teleportando-o para seu savepoint.";
            end;
            }

            if(compare(@whispervar1$,"!ban") && getgmlevel()>=70) {
            dispbottom "<!!!>";
            dispbottom "Este comando irá banir determinado player/guild pelo nome, o tempo é em minutos.";
            dispbottom "Exemplo: !ban#nome#tempo(em minutos)#0(Player)/2(Guild) -> !ban#Player1#60#1 / !ban#EmpBreak#60#2";
            dispbottom "Você deve definir se está banindo um player ou guild, colocando ao final 1 para Player e 2 para Guild.";
            dispbottom "Para diminuir o tempo, utilize o sinal de menos(-) antes do valor. Para desbanir o mesmo, envie no campo de Tempo \"unban\".";
            dispbottom "Caso deseje ver o tempo restante, envie no campo do Tempo \"showtime\".";
            end;
            }

            if(compare(@whispervar1$,"!map") && getgmlevel()>=70) {
            dispbottom "<!!!>";
            dispbottom "Comando para limpar a tabela do ranking.";
            dispbottom "-> !map#add#mapname#type para adicionar um mapa.";
            dispbottom "- Type: 0 = Arena de PvP; 1 = Arena de PvP Baby; 2 Arena de GvG;";
            dispbottom "-> !map#del#mapname para deletar um mapa.";
            end;
            }

            if(compare(@whispervar1$,"!truncate") && getgmlevel()>=70) {
            dispbottom "<!!!>";
            dispbottom "Comando para limpar a tabela do ranking.";
            dispbottom "-> !truncate#pvp para limpar o ranking do PvP.";
            dispbottom "-> !truncate#gvg para limpar o ranking do GvG.";
            end;
            } dispbottom "<!!!> Nenhum comando foi encontrado.";
        end;
        }

    dispbottom "- Lista De Comandos -";
    dispbottom "--- Use !help#!COMANDO para mais informações. ---";
    dispbottom "- !warp#número (Teleporta-o para fora da Arena)";
    dispbottom "- !ranking (Ranking normal)";
    dispbottom "- !ranking2 (Mostra sua posição no Ranking)";
    dispbottom "- !pvplider (Mostra o lider do PvP)";
    dispbottom "- !gvglider (Mostra o lider do GvG)";
    dispbottom "- !exit (Sai da arena)";
        if(getgmlevel()>=70)
        {
        dispbottom "--- GM's Comandos ---";
        dispbottom "- !truncate (Limpa o Ranking)";
        dispbottom "- !ban (Bani o player da arena)";
        dispbottom "- !map (Add ou Del um mapa do PvP Master)";
        }
        
}

-    script    event#pvpm    -1,{
OnInit:
OnTimer60000:
    query_sql("update pvpm_data set ban=ban-1 where ban>0");
    initnpctimer;
    end;

OnPCKillEvent:
callfunc("pvpm_func","PCKillEvent");
end;

OnPCDieEvent:
callfunc("pvpm_func","PCDieEvent");
end;

OnPCLoadMapEvent:
callfunc("pvpm_func","PCLoadEvent");
}

function    script    pvpm_func    {

        if (getarg(0) == "Ranking1")
        {
        deletearray @name$[0],getarraysize(@name$);
        deletearray @points[0],getarraysize(@points);
        query_sql "select name,"+getarg(1)+" from pvpm_data where type="+getarg(2)+" and "+getarg(1)+"!=0 order by "+getarg(1)+" desc limit 125",@name$,@points;
        dispbottom "======= Ranking - "+getarg(3)+" =======";
            for(set @i,0;@i != $@showsRankUntil;set @i,@i+1)
            {
            if(@name$[@i]=="") return;
            dispbottom (@i+1)+"º | "+@name$[@i]+" | Pontos: "+@points[@i];
            } return;
        }

        if (getarg(0) == "Ranking2")
        {
        deletearray @name$[0],getarraysize(@name$);
        deletearray @points[0],getarraysize(@points);
        query_sql "select id,"+getarg(1)+" from pvpm_data where type="+getarg(2)+" order by "+getarg(1)+" desc limit 125",@id,@points;
            for(set @i,0;@i <= 125;set @i,@i+1)
            {
                if (@id[@i] == getcharid(getarg(2)))
                {
                dispbottom "- "+strcharinfo(getarg(2))+" | "+(@i+1)+"º | Pontos: "+@points;
                return;
                }
            }
        dispbottom "<!!!> Você não está entre os 125 colocados do Ranking.";
        return;
        }

        if(getarg(0)=="Warp")
        {
            if(getarg(1))
            {
                if($@MapTypePM[(getarg(2)-1)]==2 && !getcharid(2))
                {
                mes $@pvpm_name$;
                mes "Desculpe, mas você precisa está em uma Guild para entrar nesta Arena.";
                close;
                }    if($@MapTypePM[(getarg(2)-1)]==1 && Upper!=2)
                    {
                    mes $@pvpm_name$;
                    mes "Olhe o seu tamanho! Esta arena é restrita a Baby's!";
                    close;
                    } if($@MapTypePM==0||$@MapTypePM==1) callfunc("pvpm_func","ban",0,1); else callfunc("pvpm_func","ban",2,1);
            } else    {
                    getmapxy(@map$,@x,@y,0);
                    if($@mapPM$[(getarg(2)-1)]==@map$)
                    {
                    dispbottom "<!!!> Você não pode usar está função dentro da Arena.";
                    end;
                    }

                if($@MapTypePM[(getarg(2)-1)]==2)
                {
                dispbottom "<!!!> Desculpe, mas você precisa está em uma Guild para entrar nesta Arena.";
                end;
                }    if($@MapTypePM[(getarg(2)-1)]==1 && Upper!=2)
                    {
                    dispbottom "<!!!> Olhe o seu tamanho! Esta arena é restrita a Baby's!";
                    end;
                    } if($@MapTypePM==0||$@MapTypePM==1) callfunc("pvpm_func","ban",0); else callfunc("pvpm_func","ban",2);
                } set @MapIDx,(getarg(2)-1);
        if($@breakBuffs) sc_end 184;
        sc_end 115;
        announce "Arena PvP: O jogador [ "+strcharinfo(0)+" ]  Acabou de entrar no PvP.",8;
        warp $@mapPM$[(getarg(2)-1)],0,0;
        end;
        }

        if (getarg(0) == "ban")
        {
        set @bantime,0;
        query_sql("select ban from pvpm_data where id="+getcharid(getarg(1))+" limit 1",@bantime);
        if(!@bantime) return;
            if(!getarg(2,0)) { dispbottom "<!!!> Você está banido da Arena por "+@bantime+" minutos!"; end; } else
            { mes "^FF7F50<!!!> ^FFA500Você está banido da Arena por ^FF7F50"+@bantime+"^FFA500 minutos!"; close; }
        }

        if (getarg(0) == "Up")
        {
        set @name$,"";
        set @points,0;
        query_sql("select name,"+getarg(1)+" from pvpm_data where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1",@name$,@points);
            if (@name$=="")
            {
            query_sql("INSERT INTO pvpm_data (id,"+getarg(1)+",name,annc,type) values ("+getcharid(getarg(2))+",1,'"+strcharinfo(getarg(2))+"',"+getarg(3)+","+getarg(2)+")");
            dispbottom "Score: 1";
            end;
            } query_sql("update pvpm_data set "+getarg(1)+"="+getarg(1)+"+1 where id="+getcharid(getarg(2)));
            set @points,@points+1;
                if($@mainRanking)
                {
                set @kills,0;
                set @dies,0;
                query_sql("select kills,dies from pvpm_data where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1",@kills,@dies);
                query_sql("update pvpm_data set ratio="+(@kills-@dies)+" where id="+getcharid(getarg(2))+" and type="+getarg(2)+" limit 1");
                set @points,@kills-@dies;
                return;                
                } return;
        }

        if (getarg(0) == "ChangeLeader")
        {
        set @L_name$,"";
        set @L_points,0;
        if(!$@mainRanking) query_sql("select name,kills from pvpm_data where leader=1 and type="+getarg(1)+" limit 1",@L_name$,@L_points); else
        query_sql("select name,ratio from pvpm_data where leader=1 and type="+getarg(1)+" limit 1",@L_name$,@L_points);
            if (@points > @L_points && @L_name$ != strcharinfo(getarg(1)))
            {
            query_sql("update pvpm_data set leader=0 where type="+getarg(1));
            query_sql("update pvpm_data set leader=1 where id="+getcharid(getarg(1))+" and type="+getarg(1));
            mapannounce @map$,strcharinfo(getarg(1))+" | É o Novo Lider !",bc_map,0xFF7F50;
            set $@Player_Lider$,"";
            set $@Guild_Lider$,"";
            query_sql("select name from pvpm_data where leader=1 and type=0 limit 1",$@Player_Lider$);
            query_sql("select name from pvpm_data where leader=1 and type=2 limit 1",$@Guild_Lider$);
            } return;
        }

        if (getarg(0) == "Annc")
        {
        set @points,0;
        set @annc,0;
        query_sql "select kills,annc from pvpm_data where id="+getcharid(getarg(1))+" and type="+getarg(1),@points,@annc;
        if(!@annc) query_sql "update pvpm_data set annc=annc+"+getarg(2)+" where id="+getcharid(getarg(1))+" and type="+getarg(1);
            if (@points >= @annc)
            {
            Announce strcharinfo(getarg(1))+" | Fez "+@points+" Pontos No "+getarg(3)+" !",bc_all,0xFF7F50;
            query_sql "update pvpm_data set annc=annc+"+getarg(2)+" where id="+getcharid(getarg(1))+" and type="+getarg(1);
            if($@sound==1||$@sound==3) soundeffectall "Monster Kill.wav",0;
            } if(!$@sound||$@sound==1) return;
                if(getarg(3)=="PvP")
                {
                    if(@noMoreSounds&&@withoutDying==@withoutDyingAnnc)
                    {
                    mapannounce @map$,strcharinfo(0)+" | "+$@SoundList$[@noMoreSounds]+" !! [ "+@withoutDying+" Pontos ]",bc_map,0xFF7F50;
                    soundeffectall $@SoundList$[@noMoreSounds]+".wav",0,@map$;
                    set @withoutDyingAnnc,@withoutDyingAnnc+5;
                    return;
                    }
                        if($@SoundList$[@withoutDying]=="end")
                        {
                        set @withoutDyingAnnc,@withoutDyingAnnc+5;
                        set @noMoreSounds,@withoutDying-1;
                        }
                            if($@SoundList$[@withoutDying]!=""&&!@noMoreSounds)
                            {
                            mapannounce @map$,strcharinfo(0)+" | "+$@SoundList$[@withoutDying]+" !! [ "+@withoutDying+" Pontos ]",bc_map,0xFF7F50;
                            soundeffectall $@SoundList$[@withoutDying]+".wav",0,@map$;
                            }
                } return;
        }

        if(getarg(0) == "PCKillEvent")
        {
                if(@RightWoEMap)
                {
                if($@CountPointsInWoE==1 || $@CountPointsInWoE==3) callfunc "pvpm_func","Up","kills",0,100;
                dispbottom "Player Score: "+@points;
                if($@CountPointsInWoE==2 || $@CountPointsInWoE==3) callfunc "pvpm_func","Up","kills",2,1000;
                dispbottom "Guild Score: "+@points;
                end;
                } getmapxy(@map$,@x,@y,0);
            if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]>=0 && $@MapTypePM[@MapIDx]<=1 || $@PK_Mode)
            {
            set @withoutDying,@withoutDying+1;
            callfunc("pvpm_func","Up","kills",0,100);
            dispbottom "Score: "+@points;
            callfunc("pvpm_func","ChangeLeader",0);
            callfunc("pvpm_func","Annc",0,100,"PvP");
            }
                if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]==2 && getcharid(2) || $@PK_Mode && getcharid(2))
                {
                callfunc("pvpm_func","Up","kills",2,1000);
                dispbottom "Guild Score: "+@points;
                callfunc("pvpm_func","ChangeLeader",2);
                callfunc("pvpm_func","Annc",2,1000,"GvG");
                }
        }

        if(getarg(0) == "PCDieEvent")
        {
                if(@RightWoEMap)
                {
                if($@CountPointsInWoE==1 || $@CountPointsInWoE==3) callfunc "pvpm_func","Up","dies",0,100;
                dispbottom "Player Score: "+@points;
                if($@CountPointsInWoE==2 || $@CountPointsInWoE==3) callfunc "pvpm_func","Up","dies",2,1000;
                dispbottom "Guild Score: "+@points;
                }
            set @withoutDying,0;
            set @noMoreSounds,0;
            set @withoutDyingAnnc,0;
            set @MapIDx,0;
            set @RightWoEMap,0;
        getmapxy(@map$,@x,@y,0);
        if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]>=0 && $@MapTypePM[@MapIDx]<=1 || $@PK_Mode) callfunc "pvpm_func","Up","dies",0,100;
        if(@map$==$@mapPM$[@MapIDx] && $@MapTypePM[@MapIDx]==2 && getcharid(2) || $@PK_Mode && getcharid(2)) callfunc "pvpm_func","Up","dies",2,1000;
        end;
        }

        if(getarg(0) == "PCLoadEvent")
        {
        getmapxy(@map$,@x,@y,0);
        if(getcastlename(@map$)=="") { set @RightWoEMap,0; end; }
        if(agitcheck() || agitcheck()) set @RightWoEMap,1;
        end;
        }
}

//================== DUPLICATE =====================

morocc,152,97,4    duplicate([PvP] Arena)    [PvP] Arena#2    899
geffen,127,65,4    duplicate([PvP] Arena)    [PvP] Arena#3    899
alberta,26,240,4    duplicate([PvP] Arena)    [PvP] Arena#4    899
izlude,122,119,4    duplicate([PvP] Arena)    [PvP] Arena#5    899
aldebaran,147,119,4    duplicate([PvP] Arena)    [PvP] Arena#6    899
xmas,145,136,4    duplicate([PvP] Arena)    [PvP] Arena#7    899
comodo,184,158,4    duplicate([PvP] Arena)    [PvP] Arena#8    899
gonryun,161,126,4    duplicate([PvP] Arena)    [PvP] Arena#9    899
louyang,226,106,4    duplicate([PvP] Arena)    [PvP] Arena#10    899
ayothaya,155,121,4    duplicate([PvP] Arena)    [PvP] Arena#11    899
hugel,87,164,4    duplicate([PvP] Arena)    [PvP] Arena#12    899
moscovia,209,190,5    duplicate([PvP] Arena)    [PvP] Arena#13    899

//================== WOE =====================

//Necessário para ativar o sistema de contagem dos pontos na woe,
//caso queira desativar algum mapa, retire-o daqui.

aldeg_cas01    mapflag    loadevent
aldeg_cas02    mapflag    loadevent
aldeg_cas03    mapflag    loadevent
aldeg_cas04    mapflag    loadevent
gefg_cas01    mapflag    loadevent
gefg_cas02    mapflag    loadevent
gefg_cas03    mapflag    loadevent
gefg_cas04    mapflag    loadevent
gefg_cas05    mapflag    loadevent
payg_cas01    mapflag    loadevent
payg_cas02    mapflag    loadevent
payg_cas03    mapflag    loadevent
payg_cas04    mapflag    loadevent
payg_cas05    mapflag    loadevent
prtg_cas01    mapflag    loadevent
prtg_cas02    mapflag    loadevent
prtg_cas03    mapflag    loadevent
prtg_cas04    mapflag    loadevent
prtg_cas05    mapflag    loadevent
schg_cas01    mapflag    loadevent
schg_cas02    mapflag    loadevent
schg_cas03    mapflag    loadevent
schg_cas04    mapflag    loadevent
schg_cas05    mapflag    loadevent
arug_cas01    mapflag    loadevent
arug_cas02    mapflag    loadevent
arug_cas03    mapflag    loadevent
arug_cas04    mapflag    loadevent
arug_cas05    mapflag    loadevent

//NÃO APAGUE DAQUI PARA BAIXO!
alde_gld    mapflag    loadevent
pay_gld    mapflag    loadevent
prt_gld    mapflag    loadevent
sch_gld    mapflag    loadevent
Posted (edited)

Add after if(getarg(0) == "PCKillEvent")

if(getarg(0) == "PCKillEvent")// well don't add this line (lol)
{
	if( @last_killed$ == rid2name( killedrid ) ) end;
	set @last_killed$, rid2name( killedrid );

 

and after if(getarg(0) == "PCDieEvent")

if(getarg(0) == "PCDieEvent")
{
	if( @last_killer$ == rid2name( killerrid ) ) end;
	set @last_killer$, rid2name( killerrid );
Edited by Capuche
  • Upvote 1
Posted (edited)

Thank you. Taking advantage of the post you would know how I Faso to make an award for the top 3 automatically placed on the PvP ranking every 30 days?

 

 

 

A friend sent me this script, the more I want to do the awards for the top 3 and every 30 days

- Script PremiaçãoPVP -1 {
OnSun2100: / / Sunday, 9 pm
setarray. @ $ message,
150000, / / Sender ID (character)
"Ranking PVP", / / sender's name
"Ranking PVP", / / Title of the message
"Congratulations,% s! With% s points you scored the highest rank in PVP this week." / / Message sent to the winner
setarray. @ $ item,
0, / / Number of data to be zeny
606, / / ID of the prize (item)
1, / / Number of items to be given
setarray. @ $ table,
"battle_npc", / / ​​Table PVP
"kill_btl", / / Column with scores
"name_btl" / / Column IDs with characters
September @ $ query, "INSERT INTO` mail `(send_name, send_id, dest_name, dest_id, title, message, zeny, NameID, amount, identify,` time `)";
September @ $ query,. $ + @ query "SELECT '" +. @ $ message [1] + "', '" +. @ $ message [0] + "'";
September @ $ query,. @ query + $ "` char `. name,` "+. @ $ table [0] +" '.' "+. @ $ table [2] +" '";
September @ $ query,. $ @ query + "'" +. @ $ message [2] + "', CONCAT ('" + sprintf (. @ $ messages [3] "',` char `. name, '""', '"+. @ $ table [0] +"'. '"+. @ $ table [1] +"', '") +"') ";
September @ $ query,. $ @ query + "'" +. @ $ item [0] + "', '" +. @ $ item [1] + "', '" +. @ $ item [2] + "', 1, NOW ()";
September @ $ query,. $ @ query + "FROM` "+. @ $ table [0] +" '";
September @ $ query,. $ @ query + "LEFT JOIN` char `ON` char `. char_id = '" +. @ $ table [0] + "'. '" +. @ $ table [2] + "`";
/ / Set. @ $ Query,. $ @ Query + "WHERE <condition>";
September @ $ query,. $ @ query + 'ORDER BY `" +. @ $ table [0] + "'. '" +. @ $ table [1] + "` DESC LIMIT 1 ";
query_sql. @ $ query;
end;
}
Edited by cumbe11
Posted (edited)
Thank you. Taking advantage of the post you would know how I Faso to make an award for the top 3 automatically placed on the PvP ranking every 30 days?

Top 3 for ratio ? or

Top 3 for kills ?

Edited by Capuche
  • Upvote 1
Posted (edited)

Add

 

 

OnDay0101:
OnDay0201:
OnDay0301:
OnDay0401:
OnDay0501:
OnDay0601:
OnDay0701:
OnDay0801:
OnDay0901:
OnDay1001:
OnDay1101:
OnDay1201:
    query_sql "SELECT `name` FROM `pvpm_data` WHERE `type`=0 ORDER BY `ratio` DESC LIMIT 3", .@name$;
    if( getarraysize( .@name$ ) )
        set $top3_pvprank$, implode( .@name$, "?" );
    end;
 

after

        if(getarg(0) == "PCLoadEvent")
        {
        getmapxy(@map$,@x,@y,0);
        if(getcastlename(@map$)=="") { set @RightWoEMap,0; end; }
        if(agitcheck() || agitcheck()) set @RightWoEMap,1;
        end;
        }

 

 

 

Then add

 

   if( $top3_pvprank$ != "" ) {
        explode( .@name$, $top3_pvprank$, "?" );
        for( set .@i, 0; .@i < getarraysize( .@name$ ); set .@i, .@i + 1 ) {
            if( .@name$[ .@i ] == strcharinfo(0) ) {
                deletearray .@name$[ .@i ], 1;
                if( getarraysize( .@name$ ) )
                    set $top3_pvprank$, implode( .@name$, "?" );
                else
                    set $top3_pvprank$, "";
                getitem 501, 1;
                mes "Congratulation you were in the top 3 last month.";
                close;
            }
        }
    }
 

 

after

Begin:
    while(1)
    {
Edited by Capuche
  • Upvote 1
Posted (edited)

Thank you, but I want to make the awards with different items for the first second and third place in the ranking, being awarded this script just put the 3 right?

Edited by cumbe11
Posted

Reward for top 3

 

	setarray .@item_top, 501,502,503;// ID reward in order by rank - here top 1 gains item ID 501
	if( $top3_pvprank$ != "" ) {
		explode( .@name$, $top3_pvprank$, "?" );
		for( set .@i, 0; .@i < getarraysize( .@name$ ); set .@i, .@i + 1 ) {
			if( .@name$[ .@i ] == strcharinfo(0) ) {
				set .@name$[ .@i ], "";
				set $top3_pvprank$, implode( .@name$, "?" );
				getitem .@item_top[ .@i ], 1;
				mes "Congratulation you were in the top 3 last month.";
				close;
			}
		}
	}

 

after

Begin:
while(1)
{
  • Upvote 1
Posted

Thank Capuche, now I have doubts where to fit these changes in the script, I can add anywhere? could set an example

 

 

place where I add this in my scrip?

 

OnDay0101:
OnDay0201:
OnDay0301:
OnDay0401:
OnDay0501:
OnDay0601:
OnDay0701:
OnDay0801:
OnDay0901:
OnDay1001:
OnDay1101:
OnDay1201:
    query_sql "SELECT `name` FROM `pvpm_data` WHERE `type`=0 ORDER BY `ratio` DESC LIMIT 3", .@name$;
    if( getarraysize( .@name$ ) )
        set $top3_pvprank$, implode( .@name$, "?" );
    end;
Posted


        mes "- Esse é o nome do npc. Ele automaticamente retornará uma lista de comandos para você.";

        next; continue;

    case 4:

        close;

        }

    }

OnDay0101:

OnDay0201:

OnDay0301:

OnDay0401:

OnDay0501:

OnDay0601:

OnDay0701:

OnDay0801:

OnDay0901:

OnDay1001:

OnDay1101:

OnDay1201:

    query_sql "SELECT `name` FROM `pvpm_data` WHERE `type`=0 ORDER BY `ratio` DESC LIMIT 3", .@name$;

    if( getarraysize( .@name$ ) )

        set $top3_pvprank$, implode( .@name$, "?" );

    end;

}

  • Upvote 1
Posted

Replace x2

set $top3_pvprank$, implode( .@name$, "?" );

 

to

	for( set .@tmp, 0; .@tmp < getarraysize( .@name$ ); set .@tmp, .@tmp + 1 )
		set $top3_pvprank$, $top3_pvprank$ + .@name$[ .@tmp ] + ( .@tmp == getarraysize( .@name$ ) -1 ? "" : "?" );
  • Upvote 2
Posted (edited)
[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/strikero/pvp_master.txt', line '255'. Stopping...
 * w1=if(getarg(0) == "PCLoadEvent")
 * w2=
 * w3=
 * w4=

I made the changes, the first error is gone, only that persists

 

 

 

 

my script looks like this

}
    case 3:
        mes $@pvpm_name$;
        mes "O sistema de comandos remotos funciona da seguinte mandeira:";
        mes "- Envie uma PM(Player Message) para  ^008B8Bnpc:cmd.";
        mes "- Esse é o nome do npc. Ele automaticamente retornará uma lista de comandos para você.";
        next; continue;
    case 4:
        close;
        }
    }

OnDay0101:
OnDay0201:
OnDay0301:
OnDay0401:
OnDay0501:
OnDay0601:
OnDay0701:
OnDay0801:
OnDay0901:
OnDay1001:
OnDay1101:
OnDay1201:
    query_sql "SELECT `name` FROM `pvpm_data` WHERE `type`=0 ORDER BY `ratio` DESC LIMIT 3", .@name$;
    if( getarraysize( .@name$ ) )
        for( set .@tmp, 0; .@tmp < getarraysize( .@name$ ); set .@tmp, .@tmp + 1 )
        set $top3_pvprank$, $top3_pvprank$ + .@name$[ .@tmp ] + ( .@tmp == getarraysize( .@name$ ) -1 ? "" : "?" );
    end;

}

    if(getarg(0) == "PCLoadEvent")
    {
    getmapxy(@map$,@x,@y,0);
    if(getcastlename(@map$)=="") { set @RightWoEMap,0;         end;
    }
    if(agitcheck() || agitcheck()) set @RightWoEMap,1;
    end;
    }
    setarray .@item_top, 501,502,503;// ID reward in order by rank - here top 1 gains item ID 501
    if( $top3_pvprank$ != "" ) {
        explode( .@name$, $top3_pvprank$, "?" );
        for( set .@i, 0; .@i < getarraysize( .@name$ ); set .@i, .@i + 1 ) {
            if( .@name$[ .@i ] == strcharinfo(0) ) {
                set .@name$[ .@i ], "";
                    for( set .@tmp, 0; .@tmp < getarraysize( .@name$ ); set .@tmp, .@tmp + 1 )
        set $top3_pvprank$, $top3_pvprank$ + .@name$[ .@tmp ] + ( .@tmp == getarraysize( .@name$ ) -1 ? "" : "?" );
                getitem .@item_top[ .@i ], 1;
                mes "Congratulation you were in the top 3 last month.";
                close;
            }
        }
    }
Begin:
while(1)
{
Edited by cumbe11
Posted

appeared the following errors in the console this time

 

[Error]:  Loading NPC file: npc/strikero/pvp_master.txt
script error on npc/strikero/pvp_master.txt line 187
    parse_line: expect command, missing function name or calling undeclared function
   182 :
   183 :        // Rewards TOP 3
   184 :        // -------------
   185 :        setarray .@item_top, 501,502,503;// ID reward in order by rank - here top 1 gains item ID 501
   186 :        if( $top3_pvprank$ != "" ) {
*  187 :                'e'xplode( .@name$, $top3_pvprank$, "?" );
   188 :                for( set .@i, 0; .@i < getarraysize( .@name$ ); set .@i, .@i + 1 ) {
   189 :                        if( .@name$[ .@i ] == strcharinfo(0) ) {
   190 :                                set .@name$[ .@i ], "";
   191 :                                set $top3_pvprank$, "";
   192 :                                for( set .@tmp, 0; .@tmp < getarraysize( .@name$ ); set .@tmp, .@tmp + 1 )
Posted (edited)

The following error appeared

[Error]:  Loading NPC file: npc/strikero/pvp_master.txt
script error on npc/strikero/pvp_master.txt line 188
    parse_simpleexpr: unmatch ')'
   183 :        // Rewards TOP 3
   184 :        // -------------
   185 :        setarray .@item_top, 501,502,503;// ID reward in order by rank - here top 1 gains item ID 501
   186 :        if( $top3_pvprank$ != "" ) {
   187 :                for( set .@i, 0; .@i < getstrlen( $top3_pvprank$ ); set .@i, .@i + 1 ) {
*  188 :                        if( charat'(' $top3_pvprank$,.@i ) == "?" )
   189 :                                set .@j, .@j + 1;
   190 :                        else
   191 :                                set .@name$[ .@j ], .@name$[ .@j ] + charat( $top3_pvprank$,.@i );
   192 :                }
   193 :                for( set .@i, 0; .@i < getarraysize( .@name$ ); set .@i, .@i + 1 ) {

 

Capuche eu lhe agradeço muito você estar sendo muito prestativo.

 

 

Edited by cumbe11
Posted (edited)

It worked perfectly. Thank you for everything Capuche.


feathers recap

  The top 1 ranging won the item relating to the id 501 the top 2 will win the item id for the 502 and the top 3 will be the id 503 is not it?



setarray. @ item_top, 501,502,503;/ / ID reward in order by rank - Gains item here top 1 ID 501

Edited by cumbe11
Posted

It worked perfectly. Thank you for everything Capuche.

  The top 1 ranging won the item relating to the id 501 the top 2 will win the item id for the 502 and the top 3 will be the id 503 is not it?

 

Yes that works like that

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...