Jump to content
  • 0

@pvp on to all map when night comes


Question

12 answers to this question

Recommended Posts

Posted


-    script    Sample    -1,{

    setarray .map$[0], "prontera", "payon", "morroc";

    set .size, getarraysize(.map$);

    if ( isnight() ) {

        for ( set .@i, 0; .@i < .size; set .@i, .@i + 1 )

            pvpon .map$[.@i];

    } else {

for ( set .@i, 0; .@i < .size; set .@i, .@i + 1 )

pvpoff .map$[.@i];

}

end;

}

Posted

Sorry but doesnt work

pvp on when night come and pvp off in the day

Edited the last post. Set your map you wish to be in pvp mode during night. I guess no command will make all maps go into pvp on unless you specify them one by one. 

Posted

The previous script will never start (none trigger)

 

 

Try

-	script	junho	-1,{
function getarrayvalue { return getd( ".save_map_name" + ( getarg(0)/128 ) +"$["+ ( getarg(0)%128 ) +"]" ); }
function MapInCompare {
	.@map$ = getarg(0);
	.@num_var = .size_array / 128;
	for ( .@i = 0; .@i <= .@num_var; .@i++ )
		if ( compare( getd( ".concat_map_name"+ .@i +"$" ),.@map$ ) ) return 1;
	return 0;
}

OnNight:
	.nightday = 1;
	addrid 0;
OnPCLoadMapEvent:
	.@map$ = strcharinfo(3);
	if ( !.nightday || getmapflag( .@map$,mf_pvp ) || getmapflag( .@map$,mf_battleground ) || getmapflag( .@map$,mf_gvg ) || compare( .map_black_list$,.@map$ ) || MapInCompare( .@map$ ) ) end;
	.@num_var = .size_array / 128;
	setd ".save_map_name"+ .@num_var +"$["+ ( .size_array%128 ) +"]", .@map$;
	setd ".concat_map_name"+ .@num_var +"$", getd( ".concat_map_name"+ .@num_var +"$" ) + .@map$ +"|";
	.size_array++;
	pvpon .@map$;
	end;

OnDay:
	.nightday = 0;
	for ( .@i = 0; .@i < .size_array; .@i++ ) {
		pvpoff getarrayvalue( .@i );
		sleep 1;
	}
	.@num_array = .size_array/128;
	while( .@num_array >= 0 ) {
		setd ".concat_map_name"+ .@num_array +"$", "";
		deletearray getd( ".save_map_name" + .@num_array +"$" );
		.@num_array--;
	}
	.size_array = 0;
	end;

OnInit:
	setarray .@tmp$, "prontera", "geffen";// yours maps no pvp
	.@size = getarraysize( .@tmp$ );
	while( .@i < .@size ) {
		.map_black_list$ = .map_black_list$ + .@tmp$[.@i] +"|";
		.@i++;
	}
}

 

+ some source mod (add OnNight/OnDay label, enable mapflag loadevent by default)

Index: clif.c
===================================================================
--- clif.c	(revision 17459)
+++ clif.c	(working copy)
@@ -9416,7 +9416,7 @@
 		clif_showvendingboard(&sd->bl,sd->message,0);
 	}
 
-	if(map[sd->bl.m].flag.loadevent) // Lance
+	// if(map[sd->bl.m].flag.loadevent) // Lance
 		npc_script_event(sd, NPCE_LOADMAP);
 
 	if (pc_checkskill(sd, SG_DEVIL) && !pc_nextjobexp(sd))
Index: pc.c
===================================================================
--- pc.c	(revision 17459)
+++ pc.c	(working copy)
@@ -9301,6 +9301,7 @@
 	night_flag = 0; // 0=day, 1=night [Yor]
 	map_foreachpc(pc_daynight_timer_sub);
 	strcpy(tmp_soutput, (data == 0) ? msg_txt(NULL,502) : msg_txt(NULL,60)); // The day has arrived!
+	npc_event_doall("OnDay");
 	intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);
 	return 0;
 }
@@ -9322,6 +9323,7 @@
 	night_flag = 1; // 0=day, 1=night [Yor]
 	map_foreachpc(pc_daynight_timer_sub);
 	strcpy(tmp_soutput, (data == 0) ? msg_txt(NULL,503) : msg_txt(NULL,59)); // The night has fallen...
+	npc_event_doall("OnNight");
 	intif_broadcast(tmp_soutput, strlen(tmp_soutput) + 1, 0);
 	return 0;
 }

Posted

It doesn't start in gvg, battleground maps and in the maps you want in the setting

OnInit:
	setarray .@tmp$, "prontera", "geffen";// yours maps no pvp

It start at night.

 

Also you must recompile your server...

Posted

It doesn't start in gvg, battleground maps and in the maps you want in the setting

OnInit:
	setarray .@tmp$, "prontera", "geffen";// yours maps no pvp

It start at night.

 

Also you must recompile your server...

its any diference of about eathena in rathena mod? because i have eathena

Posted

Good idea, let me try this one, btw? can you please add also announced e.g the mapname has activated the pVp and after mapname has deactived the pvp.

something like that make more epic :)

Posted

its any diference of about eathena in rathena mod? because i have eathena

There is a LOT of differences.

You should tell us at first you use ea.. double work for me /sigh

 

Same sources mods (add them manually).

Try this npc script

-	script	junho	-1,{
function getarrayvalue { return getd( ".save_map_name" + ( getarg(0)/128 ) +"$["+ ( getarg(0)%128 ) +"]" ); }
function MapInCompare {
	set .@map$, getarg(0);
	set .@num_var, .size_array / 128;
	for ( set .@i, 0; .@i <= .@num_var; set .@i, .@i +1 )
		if ( compare( getd( ".concat_map_name"+ .@i +"$" ),.@map$ ) ) return 1;
	return 0;
}

OnNight:
	set .nightday, 1;
	set .@size, query_sql( "select `name` from `char` where `online` = 1 limit 128", .@name$ );
	for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 ) {
		getmapxy .@map$, .@x, .@y, 0, .@name$[.@i];
		callsub L_check, .@map$;
	}
	end;
OnPCLoadMapEvent:
	callsub L_check, strcharinfo(3);
	end;

L_check:
	set .@map$, getarg(0);
	if ( !.nightday || getmapflag( .@map$,mf_pvp ) || getmapflag( .@map$,mf_battleground ) || getmapflag( .@map$,mf_gvg ) || compare( .map_black_list$,.@map$ ) || MapInCompare( .@map$ ) ) return;
	set .@num_var, .size_array / 128;
	setd ".save_map_name"+ .@num_var +"$["+ ( .size_array%128 ) +"]", .@map$;
	setd ".concat_map_name"+ .@num_var +"$", getd( ".concat_map_name"+ .@num_var +"$" ) + .@map$ +"|";
	set .size_array, .size_array +1;
	pvpon .@map$;
	return;

OnDay:
	set .nightday, 0;
	for ( set .@i, 0; .@i < .size_array; set .@i, .@i +1 ) {
		pvpoff getarrayvalue( .@i );
		sleep 1;
	}
	set .@num_array, .size_array/128;
	while( .@num_array >= 0 ) {
		setd ".concat_map_name"+ .@num_array +"$", "";
		deletearray getd( ".save_map_name" + .@num_array +"$" );
		set .@num_array, .@num_array -1;
	}
	set .size_array, 0;
	end;

OnInit:
	setarray .@tmp$, "prontera", "geffen";// yours maps no pvp
	set .@size, getarraysize( .@tmp$ );
	while( .@i < .@size ) {
		set .map_black_list$, .map_black_list$ + .@tmp$[.@i] +"|";
		set .@i, .@i +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...