Jump to content
  • 0

reward per month pvp ladder


Notorius

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

Hello, I am using tercer_pvp_ladder on my server and I have established a reward to earn silver coin for entering the top, but I would like to make this reward only at the end of the month, not every time someone advances to the top, I don't know if I am giving understand but I want each of the top players to receive their reward at the end of the month and so every month please help me I'm new to this and I don't know how to do it: c

edit:

In addition, at the end of the month the top pvp ladder restarts automatically: s

 

//item
set $@LadderItemGain, 1;    //Habilitar/deshabilitar la ganancia de silver coin al alcanzar una nueva posición en la escalera
set $@LadderItem, 1;        //Establecer el valor de ganancia de silver coin 
set $@LadderChatRoom, 1;

 

    //item gain
        if ($@LadderItemGain == 1){
        getitem 675, (($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderItem);
        dispbottom "Acabas de ser recompensado con "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderItem)+" Silver Coin";
    }

 

 

//===== eAthena Script =======================================
//= eAthena PVP-Ladder
//===== By: ==================================================
//= Terces
//===== Current Version: =====================================
//= 1.7.2
//===== Compatible With: =====================================
//= Any Athena Version that has "for" implemented
//===== Credits: =============================================
//= The whole eAthena Board and the eAthena Chat
//===== Notes: ===============================================
//= Note 1:
//= Experience gain works like this formula:
//= ($@LadderLength-(<new position>-1))*$@LadderExp
//= so if someone gets the first place he'll get
//= $@LadderLength*$@LadderExp experience points.
//============================================================
//= Fixxed by Dante
//= V1.7.2
//= Hosted by Dant3 aka Dante
// HAFE FUN! READ THE TOPIC! IT DONT WORKS MAYBE ON OLDER REV
//
//
//  LAST UPDATE: 12th,February.2008
//
// Main Script - Terces (Main Thanks to Terces )
// V1.7.0 - Dant3
// v1.7.1 - AnnieRuRu
// v1.7.2 - Dant3

// THIS SCRIPT WORKS ONLY ON THE NEW EATHENA REVISIONS! ENJOY!

-	script	PVPLADDEROPTIONS	-1,{
end;
OnInit:
// 0 = Disabled (NO)
// 1 = Enable   (YES)
set $@languageselect, 0;	//Habilitar/deshabilitar la selección de idioma [inglés/alemán] (predeterminado: 1)
set $@LadderAnnounce, 1;	//Habilitar/deshabilitar el anuncio cuando un personaje alcanza una nueva posición en la escalera (Predeterminado: 1)

set $@LadderLength, 15;		//Establezca la longitud de la escalera [! ¡No más de 128!] (Predeterminado: 30)
set $@LadderSteps, 10;		//Establecer las vistas por página (Predeterminado: 10)

set $@LadderExpGain, 100;		//Habilitar/Deshabilitar la ganancia de experiencia al alcanzar una nueva posición en la escalera (* Nota 1)
set $@LadderExp, 150;		//Establecer valor de ganancia de experiencia (* Nota 1)

// Update v1.7.0
set $@LadderZenyGain, 1;	//Habilitar/deshabilitar la ganancia zeny al alcanzar una nueva posición en la escalera
set $@LadderZeny, 20;		//Establecer el valor de ganancia de Zeny 
set $@LadderChatRoom, 1;	//Habilitar/deshabilitar una sala de chat sobre el NPC con el mensaje "Escalera PvP" (los usuarios no pueden ingresar a la sala de chat)

//item
set $@LadderItemGain, 1;	//Habilitar/deshabilitar la ganancia de silver coin al alcanzar una nueva posición en la escalera
set $@LadderItem, 1;		//Establecer el valor de ganancia de silver coin 
set $@LadderChatRoom, 1;
// Update v1.7.1 (Thanks to AnnieRuRu)
// Added GM PvP Ladder Reset Function

// Update v1.7.2
// Thanks to for the Feedback
set $@LadderAskLogin, 1;	//Habilitar/Deshabilitar que el NPC pregunte sobre la transmisión cuando un jugador inicia sesión o con el Npc Chat (0 = Preguntar inicio de sesión, 1 = Npc Chat) Relacionado: 0
}

-	script	PVPLADDERS	-1,{
OnPCKillEvent:
setarray .@Map$[0],"cell_game";
if (terces_PVP_resets != $terces_PVP_resets) {
	dispbottom "Vuelva a iniciar sesion en su personaje para obtener las muertes correctas para usted en la escala de PVP.";
	dispbottom "Porque un GM acaba de restablecer la escalera.";
	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 para evitar errores cuando mas de 1 personas matan a alguien
attachrid(killedrid);
set PVPDeaths,PVPDeaths+1;
set @PVPDeathstoday,@PVPDeathstoday+1;
set #PVPDeathsAccount,#PVPDeathsAccount+1;
set getd("$@PVPkilledplayer"+$@PVPcounter+"$"), strcharinfo(0);	//de nuevo, getd para evitar posibles fallas
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,#PVPDeathsAccount;

l_ladder:
	set @considerdeath,0;
	for (set @PosinLadder, 0; @PosinLadder < $@LadderLength; set @PosinLadder, @PosinLadder + 1){
		if (PVPKills >= $terces_PVP_kills[@PosinLadder]){	//El jugador merece estar en la escalera
			//Compruebe si la muerte juega un papel en la posición
			if ((PVPKills == $terces_PVP_kills[@PosinLadder]) && (PVPDeaths > $terces_PVP_deaths[@PosinLadder])) set @considerdeath,1; //Considere las muertes
			//Comprobar si el jugador solo superó sus propios puntajes
			if ($terces_PVP_names$[@PosinLadder] == strcharinfo(0)){
				set $terces_PVP_kills[@PosinLadder],PVPKills;
				set $terces_PVP_deaths[@PosinLadder],PVPDeaths;
				end;
			}
			//Mueve todos los personajes en la escalera.
			for (set @beginmoving, $@LadderLength; @beginmoving >= (@PosinLadder+@considerdeath); set @beginmoving, @beginmoving - 1){
				if ($terces_PVP_names$[@beginmoving] == strcharinfo(0)){
					//Si el jugador ya está en la escalera, solo tiene que mover a los jugadores entre la nueva posición de los personajes y la posición anterior de los personajes.
					callsub L_LadderMove,0;
					end;
				}
				else if (@beginmoving == (@PosinLadder+@considerdeath)){
					//El jugador no está en la escalera y, por lo tanto, tiene que mover a todos los jugadores desde la nueva posición del personaje hacia abajo.
					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)];
	}
	//establece las estadísticas del personaje en la nueva posición
	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 "Acabas de ser recompensado con "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderExp)+" base experience points";
	}
	//Zeny Gain
	if ($@LadderZenyGain == 1){
		set Zeny,Zeny+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny);
		dispbottom "Acabas de ser recompensado con "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderZeny)+" Zeny";
	}
	//item gain
		if ($@LadderItemGain == 1){
		getitem 675, (($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderItem);
		dispbottom "Acabas de ser recompensado con "+(($@LadderLength-((@PosinLadder+@considerdeath)-1))*$@LadderItem)+" Silver Coin";
	}
	//Announcement (Setting for Char)
	if (pvpbroadcast == 2){
	announce strcharinfo(0)+" acaba de reclamar el "+((@PosinLadder+@considerdeath)+1)+". Posicion en el TOP "+$@LadderLength+" despues de matar a "+getd("$@PVPkilledplayer"+$@PVPcounter+"$")+".",16;
	}
	//Announcement (Setting for Account)
	if (#pvpbroadcast == 2){
	announce strcharinfo(0)+" acaba de reclamar el "+((@PosinLadder+@considerdeath)+1)+". Posicion en el TOP "+$@LadderLength+" despues de matar a "+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;
	}
if ($@LadderAskLogin == 0){
	if (#pvpbroadcast == 2) goto L_ignore;
	if (pvpbroadcast == 2) goto L_ignore;
	if (#pvpbroadcast == 1) goto L_ignore;
	if (pvpbroadcast == 1) goto L_ignore;

	if (pvpbroadcast == 0)
	mes "Hey, "+strcharinfo(0)+"";
	mes "Yo soy la alta gerencia de PvP!";
	mes "Dejame hacerte una pregunta y te dejare jugar.!";
	menu "Mas tarde por favor",L_close,"Okay, bien",L_fine;

	L_fine:
	next;
	mes "Bueno, ¿quieres leer Mensajes de difusion cuando un jugador alcanza una nueva posicion en la lista de PvP Ranglist?";
	menu "Si, Por que no",L_accept,"No, gracias",L_accept_2,"Wtf es transmitido?",L_broadcast;

	L_accept:
	next;
	mes "gracias! ^_^";
	mes "Funcionara esta configuracion en todos sus personaje en esta cuenta o solo en este personaje?";
	menu "Cuenta",L_account,"Solo este personaje",L_char;

	L_account:
	set #pvpbroadcast,2;
	next;
	mes "Bueno, "+strcharinfo(0)+"";
	mes "Gracias por tu tiempo y diviertete!";
	close;

	L_char:
	set pvpbroadcast,2;
	next;
	mes "Bueno, "+strcharinfo(0)+"";
	mes "Gracias por tu tiempo y diviertete!";
	goto access_eng;
	close;
	
	L_accept_2:
	next;
	mes "gracias! ^_^";
	mes "Funcionara esta configuracion en todos sus personaje en esta cuenta o solo en este personaje?";
	menu "Cuenta",L_account_2,"Solo este personaje",L_char_2;

	L_close:
	close;

	L_account_2:
	set #pvpbroadcast,1;
	next;
	mes "Bueno, "+strcharinfo(0)+"";
	mes "Gracias por tu tiempo y diviertete!";
	close;

	L_char_2:
	set pvpbroadcast,1;
	next;
	mes "Bueno, "+strcharinfo(0)+"";
	mes "Gracias por tu tiempo y diviertete!";
	goto access_eng;
	close;


	L_broadcast:
	mes "Los Broadcasts son estos mensajes amarillos de los GM";
	goto L_fine;
	}
}

prontera,164,172,1	script	PvP Ladder	57,{
if ($@LadderChatRoom == 1) {
		waitingroom "PvP Top "+$@LadderLength+"",0;   // Look on the configuration!
}
	set @name$,"[PvP-Ladder]";
	//Colour of:			Position	Name		Kills		Deaths		Time
	setarray @colour$[0],	"^996600",	"^006699",	"^00AA00",	"^FF0000",	"^EE8800";
if ($@LadderAskLogin == 1){
	if (#pvpbroadcast == 2) goto 	access_eng;
	if (pvpbroadcast == 2) goto 	access_eng;
	if (#pvpbroadcast == 1) goto 	access_eng;
	if (pvpbroadcast == 1) goto 	access_eng;
	if (pvpbroadcast == 0)
	mes "Hi, "+strcharinfo(0)+"";
	mes "Yo soy la alta gerencia de PvP!";
	mes "Dejame hacerte una pregunta y te dejare jugar.!";
	menu "Despues",L_close,"Okay, fine",L_fine;

	L_fine:
	next;
	mes "Bueno, ¿quieres leer Mensajes de Broadcast cuando un jugador alcanza una nueva posicion en la lista de PvP Ranglist?";
	menu "Si, Por que no",L_accept,"No, Gracias",L_accept_2,"Que es Broadcast?",L_broadcast;

	L_accept:
	next;
	mes "gracias! ^_^";
	mes "Funcionara esta configuracion en todos sus personajes en esta cuenta o solo en este personaje?";
	menu "Account",L_account,"Solo este personaje",L_char;

	L_account:
	set #pvpbroadcast,2;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Gracias por tu tiempo y diviertete!";
	close;

	L_char:
	set pvpbroadcast,2;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Gracias por tu tiempo y diviertete!";
	goto access_eng;
	close;
	
	L_accept_2:
	next;
	mes "Yay, thank you! ^_^";
	mes "Funcionara esta configuracion en todos sus personajes en esta cuenta o solo en este personaje?";
	menu "Account",L_account_2,"solo este personaje",L_char_2;

	L_close:
	close;

	L_account_2:
	set #pvpbroadcast,1;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Gracias por tu tiempo y diviertete!";
	close;

	L_char_2:
	set pvpbroadcast,1;
	next;
	mes "Okay, "+strcharinfo(0)+"";
	mes "Gracias por tu tiempo y diviertete!";
	goto access_eng;
	close;


	L_broadcast:
	mes "Los Broadcast son estos mensajes amarillos de los GM";
	goto L_fine;
}
	access_eng:
	mes @name$;
	mes "Hello "+strcharinfo(0)+"...";
	mes "Si quieres, puedo mostrarte tus estadisticas de PvP.";
	next;
	M_selection_eng:
	if ( getgmlevel () < 99 )
		menu "Muestrame el PVP Ladder",M_Ladder_eng,"Estadisticas PvP desde mi inicio de sesion",M_seitLogin_eng,"Estadisticas PvP de este Char",M_dieserChar_eng,"Estadisticas de toda la cuenta",M_vomAccount_eng,"Cancel",M_abbrechen_eng;
	else
		menu "Muestrame el PVP Ladder",M_Ladder_eng,"Estadisticas PvP desde mi inicio de sesion",M_seitLogin_eng,"Estadisticas PvP de este Char",M_dieserChar_eng,"Estadisticas de toda la cuenta",M_vomAccount_eng,"Reset Ladder",L_reset,"Cancel",M_abbrechen_eng;

	M_Ladder_eng:
	mes "Muy bien... te mostrare el To "+ $@LadderLength +" with "+$@LadderSteps+" entradas por pagina.";
	mes "Se vera asi:";
	mes @colour$[0]+"Place^000000: "+@colour$[1]+"<name>^000000 :"+@colour$[2]+"<kills>^000000:"+@colour$[3]+"<deaths>^000000 "+@colour$[4]+"<time>";
	next;
	callsub L_Ladder;
	goto M_selection_eng;

	M_seitLogin_eng:
	mes @name$;
	mes "Tus estadisticas desde que iniciaste sesion:";
	mes @PVPKillstoday+"/"+@PVPDeathstoday+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_dieserChar_eng:
	mes @name$;
	mes "Tus estadisticas de este Char:";
	mes PVPKills+"/"+PVPDeaths+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_vomAccount_eng:
	mes @name$;
	mes "Tus estadisticas de toda la cuenta:";
	mes #PVPKillsAccount+"/"+#PVPDeathsAccount+"(Kills/Deaths)";
	next;
	goto M_selection_eng;

	M_abbrechen_eng:
	mes @name$;
	mes "DE ACUERDO. Puedes volver a mi y ver tus estadisticas cuando quieras.";
	close;

L_reset:
	if (getgmlevel() < 99) end;
	mes "Quieres restablecer la escalera?";
	if (select ("Yes","No") == 2) goto L_end;
	mes "Estas realmente seguro de que quieres restablecerlo?";
	menu "Yes, ffs!!",-,"No",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 "Okay...cya";
	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$);
}

 

Edited by Notorius
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Donators
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   2
  • Joined:  10/31/12
  • Last Seen:  

Try using this 

 

Quote

 

*gettime(<type>)

This function will return specified information about the current system time.

DT_SECOND - Seconds (of the current minute)
DT_MINUTE - Minutes (of the current hour)
DT_HOUR - Hour (of the current day)
DT_DAYOFWEEK - Week day (constants for MONDAY to SUNDAY are available)
DT_DAYOFMONTH - Day of the current month
DT_MONTH - Month (constants for JANUARY to DECEMBER are available)
DT_YEAR - Year
DT_DAYOFYEAR - Day of the year
DT_YYYYMMDD - current date in the form YYYYMMDD

It will only return numbers. If another type is supplied -1 will be returned.

    if (gettime(DT_DAYOFWEEK) == SATURDAY) mes "It's a Saturday. I don't work on Saturdays.";

 

 

so it should go like this

if(gettime(DT_DAYOFMONTH) == 30 || gettime(DT_DAYOFMONTH) == 31){
 //SCRIPT FOR REWARD THE TOP LADDER AND RESET THE LADDER

}

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

On 4/8/2023 at 10:18 PM, ryzenthird said:

Try using this 

 

 

so it should go like this

if(gettime(DT_DAYOFMONTH) == 30 || gettime(DT_DAYOFMONTH) == 31){
 //SCRIPT FOR REWARD THE TOP LADDER AND RESET THE LADDER

}

how should i add it? Could you give me an example of how it should look inside the script?

Link to comment
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.

×
×
  • Create New...