[Script] PvP with sounds & announce

06/16/2011 12:41 De4Su#1
This script give you new Pvp Experience/Feeling ;> the wav sounds support your aggressivity ;>



You must add the wav files into your client


[Script Pvp Arena]

PHP Code:
//= eAthena Emulator    www.eathena.ws
//=============================================================
//EditBuild by Semi
//===== Arena of Death With sounds ========================================
//Normal
prontera,152,193,5    script    Arena des Todes    613,{
//Xmas
//xmas,144,136,5    script    Arena des Todes    613,{

//===== Name the npc. ==========================================
set @nome$,"[ ^FF0000 Arena Des Todes ^000000 ]";

//===== Arena PvP =============================================
set $pvp$[0],"guild_vs3";

//===== Arena GvG =============================================
set $gvg$[0],"guild_vs1";

//===== Block Use of Items in PvP [ 2 = No e 1 = Yes ] ========
set $pvpmosca,1;
set $pvpantonio,1;
set $pvpygg,1;
set $pvpseed,1;
set killingspree,0;
set .map2$,"guild_vs3";

//===== Block Use of Items in GvG [ 2 = No e 1 = Yes ] ========
set $gvgmosca,1;
set $gvgantonio,1;
set $gvgygg,2;
set $gvgseed,2;

//===== Itens blocked... ======================================
// Winf of Fly    = [ID: 601]
// Card Antonio   = [ID: 4243]
// Yggdrasil      = [ID: 607]
// Yggdrasil Seed = [ID: 608]
//=============================================================

    
mes @nome$;
    
mes "^008B8BPvP | Player vs Player: ^FFA500"+getmapusers($pvp$[$pvp])+"^008B8B Players";
    
mes "^008B8BGvG | Guild vs Guild: ^FFA500"+getmapusers($gvg$[$gvg])+"^008B8B Players";
    
next;
    
mes @nome$;
    
mes "Huhu "+strcharinfo(0)+".";
    
next;
    
mes @nome$;
    
mes "Wähle die Arena";
    
next;
    switch(
select("- Playes vs Player ^0000FF["+getmapusers($pvp$[$pvp])+"]^000000","- Guild vs Guild ^0000FF["+getmapusers($gvg$[$gvg])+"]^000000","- Sair"))
    {

case 
1:

    if ((
$pvpmosca == 1 & countitem(601)>0)){ mes .nome_do_npc$; mes "The entry of wing is not allowed to fly!"; close; }
    if ((
$pvpantonio == 1 & countitem(4243)>0)){ mes .nome_do_npc$; mes "The entry of the Card Antonio is not allowed!"; close; }
    if ((
$pvpygg == 1 & countitem(607)>0)){ mes .nome_do_npc$; mes "The entry of the Yggdrasil is not allowed!"; close; }
    if ((
$pvpseed == 1 & countitem(608)>0)){ mes .nome_do_npc$; mes "AThe entry of Yggdrasil Seed is not allowed!"; close; }

    
warp $pvp$,0,0;    end;


case 
2:

    if(
getcharid(2) == 0) {    mes .nome_do_npc$; mes "I can not help you, you do not have a guild."; close;}
    if ((
$gvgmosca == 1 & countitem(601)>0)){ mes .nome_do_npc$; mes "The entry of wing is not allowed to fly!"; close; }
    if ((
$gvgantonio == 1 & countitem(4243)>0)){ mes .nome_do_npc$; mes "The entry of the Card Antonio is not allowed!"; close; }
    if ((
$gvgygg == 1 & countitem(607)>0)){ mes .nome_do_npc$; mes "The entry of the Yggdrasil is not allowed!"; close; }
    if ((
$gvgseed == 1 & countitem(608)>0)){ mes .nome_do_npc$; mes "AThe entry of Yggdrasil Seed is not allowed!"; close; }

    
warp $gvg$,0,0;    end;



case 
3:
    
mes @nome$;
    
mes "komme wieder wen du Mein Service Nutzen wills.";
    
close;

    }
}


//

-    script    Arena#PCKill    -1,{

OnPCKillEvent:


if(
BaseLevel>=400) end;
                    
getmapxy @map$,@x,@y,0;
            if ( @
map$ == $pvp$[$pvp] ) goto PvP;
            if ( @
map$ == $gvg$[$gvg] ) goto GvG;
                        
end;
PvP:
set killingspree,killingspree+1;
if(
killingspree == 2) { announce strcharinfo(0)+" is on a  DoubleKill",bc_map,0xFF0000; soundeffectall "DoubleKill.wav",0; }
if(
killingspree == 3) {  announce strcharinfo(0)+" is on Triplekill",bc_map,0xFF0000; soundeffectall "TripleKill.wav",0; }
if(
killingspree == 5) { announce strcharinfo(0)+" is on Multikill",bc_map,0xFF0000; soundeffectall "MultiKill.wav",0; }
if(
killingspree == 7) { announce strcharinfo(0)+" is on Holyshit",bc_map,0xFF0000; soundeffectall "HolyShit.wav",0; }
if(
killingspree == 10) { announce strcharinfo(0)+" is on a  Killingspree",bc_map,0xFF0000; soundeffectall "KillingSpree.wav",0;  }
if(
killingspree == 12) { announce strcharinfo(0)+" is on Monsterkill",bc_map,0xFF0000; soundeffectall "MonsterKill.wav",0;  }
if(
killingspree == 15) { announce strcharinfo(0)+" is on Megakill",bc_map,0xFF0000; soundeffectall "MegaKill.wav",0; }
if(
killingspree == 16) { announce strcharinfo(0)+" is on a Ludricous",bc_map,0xFF0000; soundeffectall "LudricousKill.wav",0;  }
if(
killingspree == 17) { announce strcharinfo(0)+" is on a  Rampage",bc_map,0xFF0000; soundeffectall "Rampage.wav",0; }
if(
killingspree == 18) { announce strcharinfo(0)+" is on a Ultrakill",bc_map,0xFF0000; soundeffectall "UltraKill.wav",0; }
if(
killingspree == 19) { announce strcharinfo(0)+" is on a Unstoppable",bc_map,0xFF0000; soundeffectall "Unstoppable.wav",0; }
if(
killingspree == 20) { announce strcharinfo(0)+" is GoDLiKe",bc_map,0xFF0000; soundeffectall "GodLike.wav",0; }

        
set @CID,getcharid(0);set @name$,"";set @points,0;
                    
query_sql "SELECT `kills` FROM `pvp` WHERE `char_id`="+@CID+"",@points;
                    
query_sql "SELECT `name` FROM `pvp` WHERE `char_id`="+@CID+"",@name$;
            if ( @
name$ == "" ) { query_sql "INSERT INTO `pvp` (`char_id`,`name`,`kills`) VALUES ("+@CID+",'"+strcharinfo(0)+"',1)",@esc$; dispbottom "Kills + 1 "; end; }
                    
query_sql "UPDATE `pvp` SET `kills` = `kills` +1 WHERE `char_id`="+@CID+"",@esc$;
        
set @points,@points+1;
        
dispbottom "Kills: "+@points;
                        
end;
GvG:
        
set @GID,getcharid(2);set @name$,"";set @points,0;
                    
query_sql "SELECT `kills` FROM `gvg` WHERE `guild_id`="+@GID+"",@gpoints;
                    
query_sql "SELECT `name` FROM `gvg` WHERE `guild_id`="+@GID+"",@name$;
            if ( @
name$ == "" ) { query_sql "INSERT INTO `gvg` (`guild_id`,`name`,`kills`) VALUES ("+@GID+",'"+strcharinfo(2)+"',1)",@esc$; dispbottom "Deine guild:  1 Punkt"; end; }
                    
query_sql "UPDATE `gvg` SET `kills` = `kills` + 1 WHERE `guild_id`="+@GID+"",@esc$;
        
set @gpoints,@gpoints+1;
        
dispbottom "Deine Guild hat: "+@gpoints;
                        
end;
}




-    
script    Arena#PCDie    -1,{

OnPCDieEvent:

if(
BaseLevel>=400) end;

                    
getmapxy @map$,@x,@y,0;
            if ( @
map$ == $pvp$[$pvp] ) goto PvP;
            if ( @
map$ == $gvg$[$gvg] ) goto GvG;
                        
end;
PvP:
        
set killingspree,0;
        
set @CID,getcharid(0);set @name$,"";set @points,0;
                    
query_sql "SELECT `deaths` FROM `pvp` WHERE `char_id`="+@CID+"",@points;
                    
query_sql "SELECT `name` FROM `pvp` WHERE `char_id`="+@CID+"",@name$;
            if ( @
name$ == "" ) { query_sql "INSERT INTO `pvp` (`char_id`,`name`,`deaths`) VALUES ("+@CID+",'"+strcharinfo(0)+"',1)",@esc$; dispbottom "Kills : 1"; end; }
                    
query_sql "UPDATE `pvp` SET `deaths` = `deaths` + 1 WHERE `char_id`="+@CID+"",@esc$;
                        
end;
GvG:
        
set @GID,getcharid(2);set @name$,"";set @gpoints,0;
                    
query_sql "SELECT `deaths` FROM `gvg` WHERE `guild_id`="+@GID+"",@gpoints;
                    
query_sql "SELECT `name` FROM `gvg` WHERE `guild_id`="+@GID+"",@name$;
            if ( @
name$ == "" ) { query_sql "INSERT INTO`gvg` (`guild_id`,`name`,`deaths`) VALUES ("+@GID+",'"+strcharinfo(2)+"',1)",@esc$; dispbottom "Deine Guild: 1"; end; }
                    
query_sql "UPDATE `gvg` SET `deaths` = `deaths` + 1 WHERE `guild_id`="+@GID+"",@esc$;
                        
end;
}

//==============Dubli ==================
//PvP
guild_vs3,12,50,0    warp    gvs01    1,1,prontera,155,191
guild_vs3
,50,87,0    warp    gvs02    1,1,prontera,155,191
guild_vs3
,87,49,0    warp    gvs03    1,1,prontera,155,191
guild_vs3
,50,12,0    warp    gvs04    1,1,prontera,155,191

//Guild
guild_vs1,50,8,0    warp    gvs05    1,1,prontera,155,191
guild_vs1
,91,49,0    warp    gvs06    1,1,prontera,155,191
guild_vs1
,49,91,0    warp    gvs07    1,1,prontera,155,191
guild_vs1
,8,49,0    warp    gvs08    1,1,prontera,155,191

//============== MAP FLAG ===============
// Player
guild_vs3    mapflag    nosave
guild_vs3    mapflag    noteleport
guild_vs3    mapflag    nowarpto
guild_vs3    mapflag    nowarp
guild_vs3    mapflag    nomemo
guild_vs3    mapflag    gvg    off
guild_vs3    mapflag    pvp    on
guild_vs3    mapflag    nopenalty
guild_vs3    mapflag    nobranch
guild_vs3    mapflag    pvp_noguild
guild_vs3    mapflag    noloot
guild_vs3    mapflag    noexp


// Guild
guild_vs1    mapflag    nosave
guild_vs1    mapflag    noteleport
guild_vs1    mapflag    nowarpto
guild_vs1    mapflag    nowarp
guild_vs1    mapflag    nomemo
guild_vs1    mapflag    gvg    off
guild_vs1    mapflag    pvp    on
guild_vs1    mapflag    nopenalty
guild_vs1    mapflag    nobranch
guild_vs1    mapflag    noloot
guild_vs1    mapflag    noexp 

Ranking NPC

PHP Code:
//Normal
prontera,150,193,4    script    Ranking PvP & GvG    569,{
//xmas
//xmas,142,136,4    script    Ranking PvP & GvG    569,{



set @nome$,"[ ^FF0000 Ranking PvP & GvG ^000000 ]";

    
mes @nome$;
    
mes "Huhu "+strcharinfo(0)+".";
    
next;
    
mes @nome$;
    
mes "Choose your ranking list?";
    
next;
    switch(
select("- ^FFA500Rankings of PvP [TOP 10]^000000","- ^008B8BRankings of GvG [TOP 10]^000000"))
{
case 
1:

    
mes @nome$;
    
mes "Okay, das is die liste vom PvP [TOP 10]";
    
next;
    
query_sql "SELECT name, kills, deaths FROM PVP ORDER BY kills DESC LIMIT 10",@name$,@kills,@deaths;
    
dispbottom "Ranking PvP [TOP 10]";
    
dispbottom " ";
    
dispbottom "Position <~> Name <~> Kill <~> Died";
    
dispbottom " ";
    for(
set @i,0;@i<=9;set @i,@i+1) {
        
dispbottom "["+(@i+1)+"] <~> "+@name$[@i]+" <~> "+@kills[@i]+" <~> "+@deaths[@i]+"";
    }
    
close;

case 
2:

    
mes @nome$;
    
mes "Okay, das ist die Liste vom GvG[TOP 10]";
    
next;
    
query_sql "SELECT name, kills, deaths FROM gvg ORDER BY kills DESC LIMIT 10",@guild_name$,@guild_kills,@guild_deaths;
    
dispbottom "Ranking GvG [TOP 10]";
    
dispbottom " ";
    
dispbottom "Position <~> Name of the Guild <~> Wins <~> Loses";
    
dispbottom " ";
    for(
set @i,0;@i<=9;set @i,@i+1) {
        
dispbottom "["+(@i+1)+"] <~> "+@guild_name$[@i]+" <~> "+@guild_kills[@i]+" <~> "+@guild_deaths[@i]+"";
    }
    
close;

    }
}
}
} 
SQL DB <- you need this to run this NPCs

PVP Ranking
PHP Code:

CREATE TABLE 
IF NOT EXISTS `pvp` (
  `
char_id` int(11) unsigned NOT NULL auto_increment,
  `
name` varchar(255) NOT NULL default '0',
  `
kills` int(11) unsigned NOT NULL default '0',
  `
deaths` int(11) unsigned NOT NULL default '0',
  
KEY `char_id` (`char_id`),
  
KEY `kills` (`kills`),
  
KEY `deaths` (`deaths`)
) 
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=151750 ; 
GVG Ranking

PHP Code:
CREATE TABLE IF NOT EXISTS `gvg` (
  `
guild_id` int(11) unsigned NOT NULL auto_increment,
  `
name` varchar(255) NOT NULL default '0',
  `
kills` int(11) unsigned NOT NULL default '0',
  `
deaths` int(11) unsigned NOT NULL default '0',
  
KEY `guild_id` (`guild_id`),
  
KEY `kills` (`kills`),
  
KEY `deaths` (`deaths`)
) 
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=95 ;