dize11 Posted August 19, 2013 Posted August 19, 2013 I wanted to that script only when night comes but in the 5 main towns cannot effect so just stay off Quote
Capuche Posted August 21, 2013 Posted August 21, 2013 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; } } Quote
Patskie Posted August 19, 2013 Posted August 19, 2013 - 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; } Quote
dize11 Posted August 20, 2013 Author Posted August 20, 2013 Sorry but doesnt work pvp on when night come and pvp off in the day Quote
Patskie Posted August 20, 2013 Posted August 20, 2013 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. Quote
Capuche Posted August 20, 2013 Posted August 20, 2013 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; } Quote
dize11 Posted August 20, 2013 Author Posted August 20, 2013 i have to do something else because doesnt start the pvp Quote
Capuche Posted August 20, 2013 Posted August 20, 2013 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... Quote
dize11 Posted August 20, 2013 Author Posted August 20, 2013 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 Quote
Drakkus Posted August 21, 2013 Posted August 21, 2013 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 Quote
dize11 Posted August 21, 2013 Author Posted August 21, 2013 I have tested and not working I have tested and not working Sorry solved already thanks capuche for you patient! Quote
Capuche Posted August 21, 2013 Posted August 21, 2013 There was a mistake for ea version. Please take again the script in my previous post. Quote
Question
dize11
I wanted to that script only when night comes but in the 5 main towns cannot effect so just stay off
12 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.