Jump to content
  • 0

@pvp on to all map when night comes


dize11

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

I wanted to that script only when night comes but in the 5 main towns cannot effect so just stay off

Link to comment
Share on other sites

12 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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;
	}
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


-    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;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

Sorry but doesnt work



pvp on when night come and pvp off in the day

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  

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. 

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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;
 }

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

i have to do something else because doesnt start the pvp 

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   15
  • Joined:  11/17/11
  • Last Seen:  

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 :)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

Sorry capuche but doesnt work

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  01/30/12
  • Last Seen:  

I have tested and not working



I have tested and not working

Sorry solved already thanks capuche for you patient!

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

There was a mistake for ea version. Please take again the script in my previous post.

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...