- script PVPLADDEROPTIONS -1,{
end;
OnInit:
set $@languageselect, 0; //Enable/Disable language selection [English/German] (Default: 1)
set $@LadderAnnounce, 0; //Enable/Disable the announcement when a char reaches a new position in the ladder (Default: 1)
set $@LadderLength, 30; //Set the length of the Ladder [!Not higher than 128!] (Default: 30)
set $@LadderSteps, 10; //Set the views per page (Default: 10)
set $@LadderExpGain, 0; //Enable/Disable experience gain when reaching a new position in the ladder (*Note1)
set $@LadderExp, 50; //Set Experience gain value (*Note1)
// Update v1.7.0
set $@LadderZenyGain, 0; //Enable/Disable zeny gain when reaching a new position in the ladder
set $@LadderZeny, 50; //Set Zeny gain value
set $@LadderChatRoom, 1; //Enable/Disable an Chat Room over the NPC with the message "PvP Ladder" (Users can not enter the Chat room)
// Update v1.7.1 (Thanks to AnnieRuRu)
// Added GM PvP Ladder Reset Function
// Update v1.7.2
// Thanks to for the Feedback
set $@LadderAskLogin, 3; //Enable/Disable that the NPC asks about the Broadcast when a Player logins / or with the Npc Chat (0 = Login Ask , 1 = Npc Chat) Related: 0
}
- script PVPLADDER -1,{
OnPCKillEvent:
if (terces_PVP_resets != $terces_PVP_resets) {
dispbottom "Please relog your character, in order to get the correct kills for you in the PVP ladder.";
dispbottom "Because a GM just reset the ladder.";
end;
}
if ( killedrid == getcharid(3) ) {
set PVPDeaths, PVPDeaths +1;
set #PVPDeathsAccount, #PVPDeathsAccount +1;
set @PVPDeathstoday, @PVPDeathstoday +1;
end;
}
set $@PVPcounter,$@PVPcounter+1;
set getd("$@PVPKill"+$@PVPcounter),getcharid(3); //getd to avoid errors when more than 1 people kill someone
attachrid(killedrid);
set PVPDeaths,PVPDeaths+1;
set @PVPDeathstoday,@PVPDeathstoday+1;
set #PVPDeathsAccount,#PVPDeathsAccount+1;
set getd("$@PVPkilledplayer"+$@PVPcounter+"$"), strcharinfo(0); //again, getd to avoid possible glitches
detachrid;
attachrid(getd("$@PVPKill"+$@PVPcounter));
CountKills:
set PVPKills,PVPKills+1;
set @PVPKillstoday,@PVPKillstoday+1;
set #PVPKillsAccount,#PVPKillsAccount+1;
setarray @playerstats[0],@PVPKillstoday,@PVPDeathstoday,PVPKills,PVPDeaths,#PVPKillsAccount,#PVPDeatsAccount;
l_ladder:
set @considerdeath,0;
for (set @PosinLadder, 0; @PosinLadder < $@LadderLength; set @PosinLadder, @PosinLadder + 1){
if (PVPKills >= $terces_PVP_kills[@PosinLadder]){ //Player deserves to be in the ladder
//Check if Death plays a role on the position
if ((PVPKills == $terces_PVP_kills[@PosinLadder]) && (PVPDeaths > $terces_PVP_deaths[@PosinLadder])) set @considerdeath,1; //Consider Deaths
//Check if the player only topped his own scores
if ($terces_PVP_names$[@PosinLadder] == strcharinfo(0)){
set $terces_PVP_kills[@PosinLadder],PVPKills;
set $terces_PVP_deaths[@PosinLadder],PVPDeaths;
end;
}
//Moves all characters in the Ladder
for (set @beginmoving, $@LadderLength; @beginmoving >= (@PosinLadder+@considerdeath); set @beginmoving, @beginmoving - 1){
if ($terces_PVP_names$[@beginmoving] == strcharinfo(0)){
//If the player already is in the Ladder it only has to move players between characters new position and characters old position
callsub L_LadderMove,0;
end;
}
else if (@beginmoving == (@PosinLadder+@considerdeath)){
//Player is not in the Ladder and therefor it has to move all players from characters new position downwards
callsub L_LadderMove,1;
end;
}
}
end;
}
}
L_LadderMove:
if (getarg(0) == 0) set @length,@beginmoving;
if (getarg(0) == 1) set @length,$@LadderLength;
for (set @movecycle, @length; @movecycle > (@PosinLadder+@considerdeath);
set @movecycle, @movecycle - 1){
set $terces_PVP_names$[@movecycle],$terces_PVP_names$[(@movecycle-1)];
set $terces_PVP_kills[@movecycle],$terces_PVP_kills[(@movecycle-1)];
set $terces_PVP_deaths[@movecycle],$terces_PVP_deaths[(@movecycle-1)];
set $terces_PVP_times[@movecycle],$terces_PVP_times[(@movecycle-1)];
}
//sets the character's stats in the new position
set $terces_PVP_names$[(@PosinLadder+@considerdeath)],strcharinfo(0);
set $terces_PVP_kills[(@PosinLadder+@considerdeath)],PVPKills;
set $terces_PVP_deaths[(@PosinLadder+@considerdeath)],PVPDeaths;
set $terces_PVP_times[(@PosinLadder+@considerdeath)],gettimetick(2);
//Experience Gain
if ($@LadderExpGain == 1){
set BaseExp,BaseExp+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp);
dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp)+" base experience points";
}
//Zeny Gain
if ($@LadderZenyGain == 1){
set Zeny,Zeny+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny);
dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny)+" Zeny";
}
//Announcement (Setting for Char)
if (pvpbroadcast == 2){
announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",16;
}
//Announcement (Setting for Account)
if (#pvpbroadcast == 2){
announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",16;
}
end;
OnPCLoginEvent:
if (terces_PVP_resets != $terces_PVP_resets){
set PVPDeaths,0;
set @PVPDeathstoday,0;
set #PVPDeathsAccount,0;
set PVPKills,0;
set @PVPKillstoday,0;
set #PVPKillsAccount,0;
set terces_PVP_resets,$terces_PVP_resets;
}
}
prontera,164,171,4 script PvP Lider 963,{
if ($@LadderChatRoom == 1) {
waitingroom "Зал славы",0; // Look on the configuration!
}
set @name$,"[Зал славы]";
//Colour of: Позиция Имя Убийства Смерти Время
setarray @colour$[0], "^996600", "^006699", "^00AA00", "^FF0000", "^EE8800";
mes "Привет, "+strcharinfo(0)+"";
mes "Я менеджер Зала славы Laurus Online.";
mes "Чем я могу тебе помочь?";
menu "Статистика PvP",L_pvp,"Отмена",L_ex;
L_ex:
close;
L_pvp:
next;
mes @name$;
mes "Привет, "+strcharinfo(0)+"...";
mes "Я могу показать твой PvP статус и топ PvP";
next;
M_selection_eng:
if ( getgmlevel () < 99 )
menu "Показать топ PvP",M_Ladder_eng,"PvP статус с момента входа в игру",M_seitLogin_eng,"PvP статус этого персонажа",M_dieserChar_eng,"PvP статус этого аккаунта ",M_vomAccount_eng,"Отмена",M_abbrechen_eng;
else
menu "Показать топ PvP",M_Ladder_eng,"PvP статус с момента входа в игру",M_seitLogin_eng,"PvP статус этого персонажа",M_dieserChar_eng,"PvP статус этого аккаунта ",M_vomAccount_eng,"Обнулить топ",L_reset,"Отмена",M_abbrechen_eng;
M_Ladder_eng:
mes "Отлично...Я покажу тебе PvP топ "+ $@LadderLength +" в таком виде:";
mes @colour$[0]+"Позиция^000000: "+@colour$[1]+"<Имя>^000000 :"+@colour$[2]+"<Убийства>^000000:"+@colour$[3]+"<Смерти>^000000 "+@colour$[4]+"<Время>";
next;
callsub L_Ladder;
goto M_selection_eng;
M_seitLogin_eng:
mes @name$;
mes "Твой статус с момента последнего входа в игру:";
mes @PVPKillstoday+"/"+@PVPDeathstoday+"(Убийства/Смерти)";
next;
goto M_selection_eng;
M_dieserChar_eng:
mes @name$;
mes "Статус этого персонажа";
mes PVPKills+"/"+PVPDeaths+"(Убийства/Смерти)";
next;
goto M_selection_eng;
M_vomAccount_eng:
mes @name$;
mes "Статус этого аккаунта";
mes #PVPKillsAccount+"/"+#PVPDeathsAccount+"(Убийства/Смерти)";
next;
goto M_selection_eng;
M_abbrechen_eng:
mes @name$;
mes "ОК. Приходи в любое время.";
close;
L_reset:
if (getgmlevel() < 99) end;
mes "Обнулить ПвП топ?";
if (select ("Да","Нет") == 2) goto L_end;
mes "Вы уверены?";
menu "Да!",-,"Нет",L_end;
deletearray $terces_PVP_kills,128;
deletearray $terces_PVP_deaths,128;
deletearray $terces_PVP_names$,128;
deletearray $terces_PVP_times,128;
set $terces_PVP_resets,$terces_PVP_resets +1;
L_end:
mes "Ок. До свидания.";
close;
L_Ladder:
for (set @y,0; @y < $@LadderLength; set @y,@y+$@LadderSteps){
for (set @x,@y; (@x < (@y+$@LadderSteps)) && (@x < ($@LadderLength)); set @x,@x+1){
if ($terces_PVP_names$[@x] != ""){
mes @colour$[0]+(@x+1)+"^000000: "+@colour$[1]+$terces_PVP_names$[@x]+"^000000 "+@colour$[2]+$terces_PVP_kills[@x]+"^000000:"+@colour$[3]+$terces_PVP_deaths[@x]+"^000000 ~ "+@colour$[4]+callfunc ("Gettime",$terces_PVP_times[@x])+"^000000";
} else {
mes "^DD0000"+(@x+1)+": ^006699None^000000 ";
}
}
next;
}
return;
}
function script Gettime {
if (getarg(0)==0) return;
set @difftimedays,(gettimetick(2) - getarg(0));
set @difftimehours,@difftimedays%86400;
set @difftimeminutes,@difftimehours%3600;
set @difftimeseconds,@difftimeminutes%60;
set @days,@difftimedays/86400;
set @hours,@difftimehours/3600;
set @minutes,@difftimeminutes/60;
set @seconds,@difftimeseconds;
set @result$,"";
if(@days != 0) set @result$,@result$+@days+"d ";
if(@hours != 0) set @result$,@result$+@hours+"h ";
if(@minutes != 0) set @result$,@result$+@minutes+"m ";
if(@seconds != 0) set @result$,@result$+@seconds+"s";
return (@result$);
}
end;
OnInit:
set $@languageselect, 0; //Enable/Disable language selection [English/German] (Default: 1)
set $@LadderAnnounce, 0; //Enable/Disable the announcement when a char reaches a new position in the ladder (Default: 1)
set $@LadderLength, 30; //Set the length of the Ladder [!Not higher than 128!] (Default: 30)
set $@LadderSteps, 10; //Set the views per page (Default: 10)
set $@LadderExpGain, 0; //Enable/Disable experience gain when reaching a new position in the ladder (*Note1)
set $@LadderExp, 50; //Set Experience gain value (*Note1)
// Update v1.7.0
set $@LadderZenyGain, 0; //Enable/Disable zeny gain when reaching a new position in the ladder
set $@LadderZeny, 50; //Set Zeny gain value
set $@LadderChatRoom, 1; //Enable/Disable an Chat Room over the NPC with the message "PvP Ladder" (Users can not enter the Chat room)
// Update v1.7.1 (Thanks to AnnieRuRu)
// Added GM PvP Ladder Reset Function
// Update v1.7.2
// Thanks to for the Feedback
set $@LadderAskLogin, 3; //Enable/Disable that the NPC asks about the Broadcast when a Player logins / or with the Npc Chat (0 = Login Ask , 1 = Npc Chat) Related: 0
}
- script PVPLADDER -1,{
OnPCKillEvent:
if (terces_PVP_resets != $terces_PVP_resets) {
dispbottom "Please relog your character, in order to get the correct kills for you in the PVP ladder.";
dispbottom "Because a GM just reset the ladder.";
end;
}
if ( killedrid == getcharid(3) ) {
set PVPDeaths, PVPDeaths +1;
set #PVPDeathsAccount, #PVPDeathsAccount +1;
set @PVPDeathstoday, @PVPDeathstoday +1;
end;
}
set $@PVPcounter,$@PVPcounter+1;
set getd("$@PVPKill"+$@PVPcounter),getcharid(3); //getd to avoid errors when more than 1 people kill someone
attachrid(killedrid);
set PVPDeaths,PVPDeaths+1;
set @PVPDeathstoday,@PVPDeathstoday+1;
set #PVPDeathsAccount,#PVPDeathsAccount+1;
set getd("$@PVPkilledplayer"+$@PVPcounter+"$"), strcharinfo(0); //again, getd to avoid possible glitches
detachrid;
attachrid(getd("$@PVPKill"+$@PVPcounter));
CountKills:
set PVPKills,PVPKills+1;
set @PVPKillstoday,@PVPKillstoday+1;
set #PVPKillsAccount,#PVPKillsAccount+1;
setarray @playerstats[0],@PVPKillstoday,@PVPDeathstoday,PVPKills,PVPDeaths,#PVPKillsAccount,#PVPDeatsAccount;
l_ladder:
set @considerdeath,0;
for (set @PosinLadder, 0; @PosinLadder < $@LadderLength; set @PosinLadder, @PosinLadder + 1){
if (PVPKills >= $terces_PVP_kills[@PosinLadder]){ //Player deserves to be in the ladder
//Check if Death plays a role on the position
if ((PVPKills == $terces_PVP_kills[@PosinLadder]) && (PVPDeaths > $terces_PVP_deaths[@PosinLadder])) set @considerdeath,1; //Consider Deaths
//Check if the player only topped his own scores
if ($terces_PVP_names$[@PosinLadder] == strcharinfo(0)){
set $terces_PVP_kills[@PosinLadder],PVPKills;
set $terces_PVP_deaths[@PosinLadder],PVPDeaths;
end;
}
//Moves all characters in the Ladder
for (set @beginmoving, $@LadderLength; @beginmoving >= (@PosinLadder+@considerdeath); set @beginmoving, @beginmoving - 1){
if ($terces_PVP_names$[@beginmoving] == strcharinfo(0)){
//If the player already is in the Ladder it only has to move players between characters new position and characters old position
callsub L_LadderMove,0;
end;
}
else if (@beginmoving == (@PosinLadder+@considerdeath)){
//Player is not in the Ladder and therefor it has to move all players from characters new position downwards
callsub L_LadderMove,1;
end;
}
}
end;
}
}
L_LadderMove:
if (getarg(0) == 0) set @length,@beginmoving;
if (getarg(0) == 1) set @length,$@LadderLength;
for (set @movecycle, @length; @movecycle > (@PosinLadder+@considerdeath);
set @movecycle, @movecycle - 1){
set $terces_PVP_names$[@movecycle],$terces_PVP_names$[(@movecycle-1)];
set $terces_PVP_kills[@movecycle],$terces_PVP_kills[(@movecycle-1)];
set $terces_PVP_deaths[@movecycle],$terces_PVP_deaths[(@movecycle-1)];
set $terces_PVP_times[@movecycle],$terces_PVP_times[(@movecycle-1)];
}
//sets the character's stats in the new position
set $terces_PVP_names$[(@PosinLadder+@considerdeath)],strcharinfo(0);
set $terces_PVP_kills[(@PosinLadder+@considerdeath)],PVPKills;
set $terces_PVP_deaths[(@PosinLadder+@considerdeath)],PVPDeaths;
set $terces_PVP_times[(@PosinLadder+@considerdeath)],gettimetick(2);
//Experience Gain
if ($@LadderExpGain == 1){
set BaseExp,BaseExp+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp);
dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp)+" base experience points";
}
//Zeny Gain
if ($@LadderZenyGain == 1){
set Zeny,Zeny+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny);
dispbottom "You have just been rewarded with "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny)+" Zeny";
}
//Announcement (Setting for Char)
if (pvpbroadcast == 2){
announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",16;
}
//Announcement (Setting for Account)
if (#pvpbroadcast == 2){
announce strcharinfo(0)+" just claimed the "+((@PosinLadder+@considerdeath)+1)+". Position in the Top "+$@LadderLength+" after killing "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",16;
}
end;
OnPCLoginEvent:
if (terces_PVP_resets != $terces_PVP_resets){
set PVPDeaths,0;
set @PVPDeathstoday,0;
set #PVPDeathsAccount,0;
set PVPKills,0;
set @PVPKillstoday,0;
set #PVPKillsAccount,0;
set terces_PVP_resets,$terces_PVP_resets;
}
}
prontera,164,171,4 script PvP Lider 963,{
if ($@LadderChatRoom == 1) {
waitingroom "Зал славы",0; // Look on the configuration!
}
set @name$,"[Зал славы]";
//Colour of: Позиция Имя Убийства Смерти Время
setarray @colour$[0], "^996600", "^006699", "^00AA00", "^FF0000", "^EE8800";
mes "Привет, "+strcharinfo(0)+"";
mes "Я менеджер Зала славы Laurus Online.";
mes "Чем я могу тебе помочь?";
menu "Статистика PvP",L_pvp,"Отмена",L_ex;
L_ex:
close;
L_pvp:
next;
mes @name$;
mes "Привет, "+strcharinfo(0)+"...";
mes "Я могу показать твой PvP статус и топ PvP";
next;
M_selection_eng:
if ( getgmlevel () < 99 )
menu "Показать топ PvP",M_Ladder_eng,"PvP статус с момента входа в игру",M_seitLogin_eng,"PvP статус этого персонажа",M_dieserChar_eng,"PvP статус этого аккаунта ",M_vomAccount_eng,"Отмена",M_abbrechen_eng;
else
menu "Показать топ PvP",M_Ladder_eng,"PvP статус с момента входа в игру",M_seitLogin_eng,"PvP статус этого персонажа",M_dieserChar_eng,"PvP статус этого аккаунта ",M_vomAccount_eng,"Обнулить топ",L_reset,"Отмена",M_abbrechen_eng;
M_Ladder_eng:
mes "Отлично...Я покажу тебе PvP топ "+ $@LadderLength +" в таком виде:";
mes @colour$[0]+"Позиция^000000: "+@colour$[1]+"<Имя>^000000 :"+@colour$[2]+"<Убийства>^000000:"+@colour$[3]+"<Смерти>^000000 "+@colour$[4]+"<Время>";
next;
callsub L_Ladder;
goto M_selection_eng;
M_seitLogin_eng:
mes @name$;
mes "Твой статус с момента последнего входа в игру:";
mes @PVPKillstoday+"/"+@PVPDeathstoday+"(Убийства/Смерти)";
next;
goto M_selection_eng;
M_dieserChar_eng:
mes @name$;
mes "Статус этого персонажа";
mes PVPKills+"/"+PVPDeaths+"(Убийства/Смерти)";
next;
goto M_selection_eng;
M_vomAccount_eng:
mes @name$;
mes "Статус этого аккаунта";
mes #PVPKillsAccount+"/"+#PVPDeathsAccount+"(Убийства/Смерти)";
next;
goto M_selection_eng;
M_abbrechen_eng:
mes @name$;
mes "ОК. Приходи в любое время.";
close;
L_reset:
if (getgmlevel() < 99) end;
mes "Обнулить ПвП топ?";
if (select ("Да","Нет") == 2) goto L_end;
mes "Вы уверены?";
menu "Да!",-,"Нет",L_end;
deletearray $terces_PVP_kills,128;
deletearray $terces_PVP_deaths,128;
deletearray $terces_PVP_names$,128;
deletearray $terces_PVP_times,128;
set $terces_PVP_resets,$terces_PVP_resets +1;
L_end:
mes "Ок. До свидания.";
close;
L_Ladder:
for (set @y,0; @y < $@LadderLength; set @y,@y+$@LadderSteps){
for (set @x,@y; (@x < (@y+$@LadderSteps)) && (@x < ($@LadderLength)); set @x,@x+1){
if ($terces_PVP_names$[@x] != ""){
mes @colour$[0]+(@x+1)+"^000000: "+@colour$[1]+$terces_PVP_names$[@x]+"^000000 "+@colour$[2]+$terces_PVP_kills[@x]+"^000000:"+@colour$[3]+$terces_PVP_deaths[@x]+"^000000 ~ "+@colour$[4]+callfunc ("Gettime",$terces_PVP_times[@x])+"^000000";
} else {
mes "^DD0000"+(@x+1)+": ^006699None^000000 ";
}
}
next;
}
return;
}
function script Gettime {
if (getarg(0)==0) return;
set @difftimedays,(gettimetick(2) - getarg(0));
set @difftimehours,@difftimedays%86400;
set @difftimeminutes,@difftimehours%3600;
set @difftimeseconds,@difftimeminutes%60;
set @days,@difftimedays/86400;
set @hours,@difftimehours/3600;
set @minutes,@difftimeminutes/60;
set @seconds,@difftimeseconds;
set @result$,"";
if(@days != 0) set @result$,@result$+@days+"d ";
if(@hours != 0) set @result$,@result$+@hours+"h ";
if(@minutes != 0) set @result$,@result$+@minutes+"m ";
if(@seconds != 0) set @result$,@result$+@seconds+"s";
return (@result$);
}