AinsLord Posted October 11, 2017 Group: Members Topic Count: 261 Topics Per Day: 0.08 Content Count: 758 Reputation: 20 Joined: 11/21/15 Last Seen: April 6 Share Posted October 11, 2017 This is the NPC script pvp_n_4-5 mapflag restricted 7 prontera,127,212,0 script Emperium Breaker Test 1288,{ set .@gm, getgmlevel(); explode( .@b$, $empbrk_record$, "|" ); // Display records // --------------- mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes "Breaker Top 5 :"; if( !getarraysize( .@b$ ) ) mes "^777777*empty*^000000"; for( set .@i, 0; .@i < getarraysize( .@b$ ); set .@i, .@i + 1 ) mes "^777777"+ ( .@i + 1 ) +"- ^5050A0"+ .@b$[ .@i ] +"^000000"+ callsub( L_time_, $empbrk_record[ .@i ] ); if( empbrk_record ) { mes "______________________________"; set .@rec$, callsub( L_time_, empbrk_record ); mes "Your Own Record:"+ .@rec$; } next; mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes "Would you like to try a new record?"; if( empbrk_record ) { mes "______________________________"; mes "Your Own Record:"+ .@rec$; } next; menu "^777777~ Yes^000000", -, ( empbrk_record ? "^777777~ Reset my record^000000" : "" ), L_resc, ( .@gm > 98 && $empbrk_record$ != "" ? "^777777~ [ GM ] Reset all^000000" : "" ), L_reset, ( .@gm > 98 ? "^777777~ [ GM ] Reset Rooms^000000" : "" ), L_emptyrooms, "^777777~ Exit^000000", L_exit; deletearray .arena$; // Area arena for getareausers // --------------------------- setarray .@A1, 94,128,105,139; setarray .@A2, 60,94,71,105; setarray .@A3, 94,60,105,71; setarray .@A4, 128,94,139,105; mes "^FF0000~~ Emperium Breaker Test ~~^000000"; for( set .@i, 1; .@i <= 4; set .@i, .@i + 1 ) { if ( getareausers("pvp_n_4-5", getd( ".@A"+ .@i +"[ 0 ]" ), getd( ".@A"+ .@i +"[ 1 ]" ), getd( ".@A"+ .@i +"[ 2 ]" ), getd( ".@A"+ .@i +"[ 3 ]" ) ) ) mes "Emp n° ^0000DF"+ .@i +" ^FF0000 <Busy>^000000"; else { mes "Emp n° ^0000DF"+ .@i +" ^00A000 <Free>^000000"; set .arena$[ .@i -1 ],"^0000DFRoom n°"+ .@i +"^000000"; } } next; getmapxy( @mpempbrk$, @empbrkx, @empbrky, 0 ); // menu arena // ---------- set .@a, select( .arena$[0], .arena$[1], .arena$[2], .arena$[3], "Quit" ); if( .@a == 5 ) close; // x, y for user warp / arena ; x1, y1, x2, y2... // ---------------------------------------------- setarray .@xy[ 2 ], 99, 128, 68, 99, 100, 68, 130, 99; // select arena is empty ? // ----------------------- if ( !getareausers("pvp_n_4-5", getd( ".@A"+ .@a +"[ 0 ]" ), getd( ".@A"+ .@a +"[ 1 ]" ), getd( ".@A"+ .@a +"[ 2 ]" ), getd( ".@A"+ .@a +"[ 3 ]" ) ) ) { warp "pvp_n_4-5", .@xy[ .@a * 2 ], .@xy[ .@a * 2 + 1 ]; killmonster "pvp_n_4-5","EmpBrk#"+ .@a +"::OnThisMobDeath"; donpcevent "EmpBrk#"+ .@a +"::OnEmpBreak"; sc_end SC_ALL; } else mes "Room is now BUSY"; close; // reset top 5 // ----------- L_reset: mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes "Are you sure to reset official record ?"; if( select( "Yes", "No" ) -1 ) close; mes "All records had been reset."; set $empbrk_record, 0; set $empbrk_record$, ""; close; // reset your record ( + reset record if in top 5 ) // ------------------------------------------------ L_resc: mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes "Are you sure to reset your record?"; if( select( "Yes", "No" ) -1 ) close; if( $empbrk_record$ != "" ) { explode( .@b$, $empbrk_record$, "|" ); for( set .@i, 0; .@i < getarraysize( .@b$ ); set .@i, .@i + 1 ) if( .@b$[ .@i ] == strcharinfo(0) ) { deletearray .@b$[ .@i ], 1; deletearray $empbrk_record[ .@record ], 1; } set $empbrk_record$, implode( .@b$, "|" ); } mes "Your record has been reset."; set empbrk_record, 0; close; // warp all people out of arena // ---------------------------- L_emptyrooms: mapwarp "pvp_n_4-5","prontera",0,0; L_exit: close; // return time of record ( min sec ms ) // ------------------------------------ L_time_: set .@time, getarg(0); set .@m, .@time / 60000; set .@time, .@time - ( .@m * 60000 ); set .@s, .@time /1000; set .@time, .@time - ( .@s * 1000 ); set .@text$, " ^000080"+ .@m +"^000000m ^000080"+ .@s +"^000000s ^000080"+ .@time +"^000000ms"; return .@text$; } pvp_n_4-5,99,125,0 script EmpBrk#1 -1,2,1,{ OnTouch: killmonster "pvp_n_4-5", strnpcinfo(0) +"::OnThisMobDeath"; mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes " "; mes "You cannot exit from small square."; close2; stopnpctimer; set getd( "$@someonegotin"+ strnpcinfo(2) ), 0; warp .map_npc$, .x_npc, .y_npc; end; // Spawn emp // --------- OnEmpBreak: copyarray .@xy[ 0 ], getd( ".xy" + strnpcinfo(2) +"[ 0 ]" ), 6; sleep 3000; if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end; areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"Let's ready to break the Emperium",0; sleep 5000; if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end; for( set .@i, 5; .@i > 0; set .@i, .@i - 1 ) { areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ], (.@i +""),0; sleep 1000; } if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end; areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"GO!!!",0; monster "pvp_n_4-5", .@xy[ 4 ], .@xy[ 5 ],"Emperium",1288,1,"EmpBrk#"+ strnpcinfo(2) +"::OnThisMobDeath"; initnpctimer; end; OnThisMobDeath: copyarray .@xy[ 0 ], getd( ".xy" + strnpcinfo(2) +"[ 0 ]" ), 6; stopnpctimer; set .@time, getnpctimer( 0,"EmpBrk#"+ strnpcinfo(2) ); if ( .@time < empbrk_record || !empbrk_record ) { areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"New Own Record!!!",0; set empbrk_record, .@time; } // set top 5 record ; GM level > 50 excluded // ----------------------------------------- if( getgmlevel() < 50 ) { if ( .@time < $empbrk_record[ 0 ] && !$empbrk_record[ 0 ] ) { areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"New Official Record!!!",0; announce strcharinfo(0)+" is now the NO. 1 Emperium Breaker!!",0; } explode( .@b$, $empbrk_record$, "|" ); if( $empbrk_record$ == "" ) set .@no_mark, 1; else { for( set .@i, 0; .@i < 5; set .@i, .@i + 1 ) { if( .@b$[ .@i ] == strcharinfo(0) ) { if( .@time < $empbrk_record[ .@i ] ) { deletearray .@b$[ .@i ], 1; deletearray $empbrk_record[ .@i ], 1; set .@no_mark, 1; } else set .@no_mark, 0; break; } else if( .@time < $empbrk_record[ .@i ] || !$empbrk_record[ .@i ] ) set .@no_mark, 1; } } } if( .@no_mark ) { for( set .@i, 0; .@i < 5; set .@i, .@i + 1 ) if ( .@time < $empbrk_record[ .@i ] || !$empbrk_record[ .@i ] ) { if( .@i != 4 ) { copyarray .@b$[ .@i+1 ], .@b$[ .@i ], 4 - .@i; copyarray $empbrk_record[ .@i+1 ], $empbrk_record[ .@i ], 4 - .@i; set .@b$[ .@i ], strcharinfo(0); set $empbrk_record[ .@i ], .@time; } else { set .@b$[ getarraysize( .@b$ ) -1 ], strcharinfo(0); set $empbrk_record[ getarraysize( .@b$ ) -1 ], .@time; } set $empbrk_record$, implode( .@b$, "|" ); break; } } set .@m, .@time / 60000; set .@time, .@time - (.@m * 60000); set .@s, .@time /1000; set .@time, .@time - (.@s * 1000); areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"Your time is "+ .@m +"m "+ .@s +"s "+ .@time +"ms",0; sleep 2000; // Debug : warp 20 min later if afk // -------------------------------- OnTimer1200000: areawarp "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ], .map_npc$, .x_npc, .y_npc; stopnpctimer; end; OnInit: getmapxy( .map_npc$, .x_npc, .y_npc, 1, "Emperium Breaker Test" ); // set area for announce + x, y to spawn emp // ----------------------------------------- switch( strnpcinfo(2) ) { case 1: setarray .xy1, 94, 128, 105, 139, 100, 134; break; case 2: setarray .xy2, 60, 94, 71, 105, 65, 99; break; case 3: setarray .xy3, 94, 60, 105, 71, 99, 65; break; case 4: setarray .xy4, 128, 94, 139, 105, 134, 99; } end; } pvp_n_4-5,74,99,0 duplicate(EmpBrk#1) EmpBrk#2 -1,1,2 pvp_n_4-5,100,74,0 duplicate(EmpBrk#1) EmpBrk#3 -1,1,2 pvp_n_4-5,125,100,0 duplicate(EmpBrk#1) EmpBrk#4 -1,1,2 i've tried my best to check whats wrong with it this is the error i got on my console [Error]: status_calc_mob: No castle set at map pvp_n_4-5 thnx for the help Quote Link to comment Share on other sites More sharing options...
1 hendra814 Posted October 11, 2017 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 1281 Reputation: 170 Joined: 06/12/12 Last Seen: 9 hours ago Share Posted October 11, 2017 (edited) 6 hours ago, whodhell said: This is the NPC script pvp_n_4-5 mapflag restricted 7 prontera,127,212,0 script Emperium Breaker Test 1288,{ set .@gm, getgmlevel(); explode( .@b$, $empbrk_record$, "|" ); // Display records // --------------- mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes "Breaker Top 5 :"; if( !getarraysize( .@b$ ) ) mes "^777777*empty*^000000"; for( set .@i, 0; .@i < getarraysize( .@b$ ); set .@i, .@i + 1 ) mes "^777777"+ ( .@i + 1 ) +"- ^5050A0"+ .@b$[ .@i ] +"^000000"+ callsub( L_time_, $empbrk_record[ .@i ] ); if( empbrk_record ) { mes "______________________________"; set .@rec$, callsub( L_time_, empbrk_record ); mes "Your Own Record:"+ .@rec$; } next; mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes "Would you like to try a new record?"; if( empbrk_record ) { mes "______________________________"; mes "Your Own Record:"+ .@rec$; } next; menu "^777777~ Yes^000000", -, ( empbrk_record ? "^777777~ Reset my record^000000" : "" ), L_resc, ( .@gm > 98 && $empbrk_record$ != "" ? "^777777~ [ GM ] Reset all^000000" : "" ), L_reset, ( .@gm > 98 ? "^777777~ [ GM ] Reset Rooms^000000" : "" ), L_emptyrooms, "^777777~ Exit^000000", L_exit; deletearray .arena$; // Area arena for getareausers // --------------------------- setarray .@A1, 94,128,105,139; setarray .@A2, 60,94,71,105; setarray .@A3, 94,60,105,71; setarray .@A4, 128,94,139,105; mes "^FF0000~~ Emperium Breaker Test ~~^000000"; for( set .@i, 1; .@i <= 4; set .@i, .@i + 1 ) { if ( getareausers("pvp_n_4-5", getd( ".@A"+ .@i +"[ 0 ]" ), getd( ".@A"+ .@i +"[ 1 ]" ), getd( ".@A"+ .@i +"[ 2 ]" ), getd( ".@A"+ .@i +"[ 3 ]" ) ) ) mes "Emp n° ^0000DF"+ .@i +" ^FF0000 <Busy>^000000"; else { mes "Emp n° ^0000DF"+ .@i +" ^00A000 <Free>^000000"; set .arena$[ .@i -1 ],"^0000DFRoom n°"+ .@i +"^000000"; } } next; getmapxy( @mpempbrk$, @empbrkx, @empbrky, 0 ); // menu arena // ---------- set .@a, select( .arena$[0], .arena$[1], .arena$[2], .arena$[3], "Quit" ); if( .@a == 5 ) close; // x, y for user warp / arena ; x1, y1, x2, y2... // ---------------------------------------------- setarray .@xy[ 2 ], 99, 128, 68, 99, 100, 68, 130, 99; // select arena is empty ? // ----------------------- if ( !getareausers("pvp_n_4-5", getd( ".@A"+ .@a +"[ 0 ]" ), getd( ".@A"+ .@a +"[ 1 ]" ), getd( ".@A"+ .@a +"[ 2 ]" ), getd( ".@A"+ .@a +"[ 3 ]" ) ) ) { warp "pvp_n_4-5", .@xy[ .@a * 2 ], .@xy[ .@a * 2 + 1 ]; killmonster "pvp_n_4-5","EmpBrk#"+ .@a +"::OnThisMobDeath"; donpcevent "EmpBrk#"+ .@a +"::OnEmpBreak"; sc_end SC_ALL; } else mes "Room is now BUSY"; close; // reset top 5 // ----------- L_reset: mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes "Are you sure to reset official record ?"; if( select( "Yes", "No" ) -1 ) close; mes "All records had been reset."; set $empbrk_record, 0; set $empbrk_record$, ""; close; // reset your record ( + reset record if in top 5 ) // ------------------------------------------------ L_resc: mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes "Are you sure to reset your record?"; if( select( "Yes", "No" ) -1 ) close; if( $empbrk_record$ != "" ) { explode( .@b$, $empbrk_record$, "|" ); for( set .@i, 0; .@i < getarraysize( .@b$ ); set .@i, .@i + 1 ) if( .@b$[ .@i ] == strcharinfo(0) ) { deletearray .@b$[ .@i ], 1; deletearray $empbrk_record[ .@record ], 1; } set $empbrk_record$, implode( .@b$, "|" ); } mes "Your record has been reset."; set empbrk_record, 0; close; // warp all people out of arena // ---------------------------- L_emptyrooms: mapwarp "pvp_n_4-5","prontera",0,0; L_exit: close; // return time of record ( min sec ms ) // ------------------------------------ L_time_: set .@time, getarg(0); set .@m, .@time / 60000; set .@time, .@time - ( .@m * 60000 ); set .@s, .@time /1000; set .@time, .@time - ( .@s * 1000 ); set .@text$, " ^000080"+ .@m +"^000000m ^000080"+ .@s +"^000000s ^000080"+ .@time +"^000000ms"; return .@text$; } pvp_n_4-5,99,125,0 script EmpBrk#1 -1,2,1,{ OnTouch: killmonster "pvp_n_4-5", strnpcinfo(0) +"::OnThisMobDeath"; mes "^FF0000~~ Emperium Breaker Test ~~^000000"; mes " "; mes "You cannot exit from small square."; close2; stopnpctimer; set getd( "$@someonegotin"+ strnpcinfo(2) ), 0; warp .map_npc$, .x_npc, .y_npc; end; // Spawn emp // --------- OnEmpBreak: copyarray .@xy[ 0 ], getd( ".xy" + strnpcinfo(2) +"[ 0 ]" ), 6; sleep 3000; if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end; areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"Let's ready to break the Emperium",0; sleep 5000; if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end; for( set .@i, 5; .@i > 0; set .@i, .@i - 1 ) { areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ], (.@i +""),0; sleep 1000; } if ( !getareausers("pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ] ) ) end; areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"GO!!!",0; monster "pvp_n_4-5", .@xy[ 4 ], .@xy[ 5 ],"Emperium",1288,1,"EmpBrk#"+ strnpcinfo(2) +"::OnThisMobDeath"; initnpctimer; end; OnThisMobDeath: copyarray .@xy[ 0 ], getd( ".xy" + strnpcinfo(2) +"[ 0 ]" ), 6; stopnpctimer; set .@time, getnpctimer( 0,"EmpBrk#"+ strnpcinfo(2) ); if ( .@time < empbrk_record || !empbrk_record ) { areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"New Own Record!!!",0; set empbrk_record, .@time; } // set top 5 record ; GM level > 50 excluded // ----------------------------------------- if( getgmlevel() < 50 ) { if ( .@time < $empbrk_record[ 0 ] && !$empbrk_record[ 0 ] ) { areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"New Official Record!!!",0; announce strcharinfo(0)+" is now the NO. 1 Emperium Breaker!!",0; } explode( .@b$, $empbrk_record$, "|" ); if( $empbrk_record$ == "" ) set .@no_mark, 1; else { for( set .@i, 0; .@i < 5; set .@i, .@i + 1 ) { if( .@b$[ .@i ] == strcharinfo(0) ) { if( .@time < $empbrk_record[ .@i ] ) { deletearray .@b$[ .@i ], 1; deletearray $empbrk_record[ .@i ], 1; set .@no_mark, 1; } else set .@no_mark, 0; break; } else if( .@time < $empbrk_record[ .@i ] || !$empbrk_record[ .@i ] ) set .@no_mark, 1; } } } if( .@no_mark ) { for( set .@i, 0; .@i < 5; set .@i, .@i + 1 ) if ( .@time < $empbrk_record[ .@i ] || !$empbrk_record[ .@i ] ) { if( .@i != 4 ) { copyarray .@b$[ .@i+1 ], .@b$[ .@i ], 4 - .@i; copyarray $empbrk_record[ .@i+1 ], $empbrk_record[ .@i ], 4 - .@i; set .@b$[ .@i ], strcharinfo(0); set $empbrk_record[ .@i ], .@time; } else { set .@b$[ getarraysize( .@b$ ) -1 ], strcharinfo(0); set $empbrk_record[ getarraysize( .@b$ ) -1 ], .@time; } set $empbrk_record$, implode( .@b$, "|" ); break; } } set .@m, .@time / 60000; set .@time, .@time - (.@m * 60000); set .@s, .@time /1000; set .@time, .@time - (.@s * 1000); areaannounce "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ],"Your time is "+ .@m +"m "+ .@s +"s "+ .@time +"ms",0; sleep 2000; // Debug : warp 20 min later if afk // -------------------------------- OnTimer1200000: areawarp "pvp_n_4-5", .@xy[ 0 ], .@xy[ 1 ], .@xy[ 2 ], .@xy[ 3 ], .map_npc$, .x_npc, .y_npc; stopnpctimer; end; OnInit: getmapxy( .map_npc$, .x_npc, .y_npc, 1, "Emperium Breaker Test" ); // set area for announce + x, y to spawn emp // ----------------------------------------- switch( strnpcinfo(2) ) { case 1: setarray .xy1, 94, 128, 105, 139, 100, 134; break; case 2: setarray .xy2, 60, 94, 71, 105, 65, 99; break; case 3: setarray .xy3, 94, 60, 105, 71, 99, 65; break; case 4: setarray .xy4, 128, 94, 139, 105, 134, 99; } end; } pvp_n_4-5,74,99,0 duplicate(EmpBrk#1) EmpBrk#2 -1,1,2 pvp_n_4-5,100,74,0 duplicate(EmpBrk#1) EmpBrk#3 -1,1,2 pvp_n_4-5,125,100,0 duplicate(EmpBrk#1) EmpBrk#4 -1,1,2 i've tried my best to check whats wrong with it this is the error i got on my console [Error]: status_calc_mob: No castle set at map pvp_n_4-5 thnx for the help put your map for emperium test break in castle_db.txt like 34,mapname,,,0 Edited October 11, 2017 by hendra814 1 Quote Link to comment Share on other sites More sharing options...
Question
AinsLord
This is the NPC script
i've tried my best to check whats wrong with it
this is the error i got on my console
thnx for the help
Link to comment
Share on other sites
1 answer 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.