Helena 0 Posted August 28, 2016 (edited) Hey Hercules!Does anyone know how i can make it so the losers of this script will also get 3x platinum coin (677) instead of only the winners? I've tried to throw in a getitem before the bg_warp when the match is over but it doesn't quite work (player not attached message).Thank you so much! - script bg_emp#control HIDDEN_NPC,{ OnInit: .minplayer2start = 1; // minimum player to start .winningscore = 3; // final score to win .eventlasting = 20 * 60; // abort the system if there's no progress, 20 mins * seconds setarray .rewarditem, 677, 10; // reward to the winning team end; OnStart: if ( getwaitingroomstate( 0, .rednpcname$ ) < .minplayer2start || getwaitingroomstate( 0, .bluenpcname$ ) < .minplayer2start ) end; .red = waitingroom2bg( "bat_b01", 66,149, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ ); copyarray .team1aid, $@arenamembers, $@arenamembersnum; .team1count = .minplayer2start; .blue = waitingroom2bg( "bat_b01", 331,149, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ ); copyarray .team2aid, $@arenamembers, $@arenamembersnum; .team2count = .minplayer2start; delwaitingroom .rednpcname$; delwaitingroom .bluenpcname$; disablenpc .rednpcname$; disablenpc .bluenpcname$; bg_warp .red, "bat_b01", 66,149; bg_warp .blue, "bat_b01", 331,149; bg_updatescore "bat_b01", 0, 0; sleep 6000 * !.skip; mapannounce "bat_b01", "Mini WoE : Welcome to the Mini WoE Event! Both guilds have an Emperium summoned both at the opposite side of the arena. The guild that destroys the other guild's Emperium (3 times) first is the winner!", 0; sleep 3000 * !.skip; mapannounce "bat_b01", "Mini WoE : All participants, please get ready! The battle is about to begin!", 0; sleep 2000 * !.skip; while (1) { for ( .@i = 5; .@i > 0; .@i-- ) { mapannounce "bat_b01", "["+ .@i +"]", 0; sleep 1000 * !.skip; } if ( .score[1] == .winningscore -1 && .score[2] == .winningscore -1 ) mapannounce "bat_b01", "Mini WoE : Final round, get ready!", 0; else mapannounce "bat_b01", "Mini WoE : Round " + (1+(.round++ ))+"/3... go!", 0; bg_monster .red,"bat_b01",61,149, "--ja--",1288, strnpcinfo(3)+"::OnRedDown"; bg_monster .blue,"bat_b01",331,149, "--ja--",1288, strnpcinfo(3)+"::OnBlueDown"; delwall "bg_emp_town_red"; delwall "bg_emp_town_blue"; sleep .eventlasting * 1000 * !.skip; bg_updatescore "bat_b01", .score[1], .score[2]; killmonster "bat_b01", strnpcinfo(3)+"::OnRedDown"; killmonster "bat_b01", strnpcinfo(3)+"::OnBlueDown"; if ( getstrlen( .empkiller$ ) ) mapannounce "bat_b01", .empkiller$ +" has destroyed "+( ( .winside == 1 )?"Blue":"Red" )+" Guild's Emperium! The "+( ( .winside == 1 )?"Red":"Blue" )+" Team scores a point!", 0; if ( .score[1] == .winningscore || .score[2] == .winningscore || !.winside ) break; sleep 5000 * !.skip; bg_warp .red, "bat_b01", 66,149; bg_warp .blue, "bat_b01", 326,149; sleep 1000 * !.skip; .winside = 0; } if ( .winside ) { mapannounce "bat_b01","The "+( ( .winside == 1 )?"Red":"Blue" )+" Guild is the winner of this Mini WoE! Thank you all for participating!", 0; for ( .@i = 0; .@i < getd(".team"+ .winside +"count"); .@i++ ) getitem .rewarditem[0], .rewarditem[1], getd(".team"+ .winside +"aid["+ .@i +"]" ); } else mapannounce "bat_b01", "Time Out. Aborting the match.", 0; sleep 5000; bg_warp .red, "prontera", 155,182; bg_warp .blue, "prontera", 158,182; bg_destroy .red; bg_destroy .blue; delwall "bg_emp_town_red"; delwall "bg_emp_town_blue"; deletearray .team1aid; deletearray .team2aid; .round = .winside = .skip = .score[1] = .score[2] = .team1count = .team2count = 0; enablenpc .rednpcname$; enablenpc .bluenpcname$; donpcevent .rednpcname$ +"::OnStart"; donpcevent .bluenpcname$ +"::OnStart"; end; OnRedDown: callsub L_EmpDown, 2; OnBlueDown: callsub L_EmpDown, 1; L_EmpDown: .empkiller$ = strcharinfo(0); .winside = getarg(0); .score[ .winside ]++; awake strnpcinfo(0); end; OnRedDead: callsub L_dead, 2; OnBlueDead: callsub L_dead, 1; L_dead: for ( .@i = 0; .@i < getd(".team"+ getarg(0) +"count"); .@i++ ) getitem 608, 1, getd(".team"+ getarg(0) +"aid["+ .@i +"]" ); // give a ygg leaf here sleep2 1250; percentheal 100,100; end; OnRedQuit: callsub L_quit, 1, "Red", 2; OnBlueQuit: callsub L_quit, 2, "Blue", 1; L_quit: percentheal 100, 100; while ( getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ) != getcharid(3) && .@i < getd(".team"+ getarg(0) +"count") ) .@i++; deletearray getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ), 1; setd ".team"+ getarg(0) +"count", getd(".team"+ getarg(0) +"count") -1; if ( getd(".team"+ getarg(0) +"count") ) end; mapannounce "bat_a01", "All "+ getarg(1) +" team members have quit the Mini WoE Event!", 0, 0xff3333; // purposely use different color .score[ getarg(2) ] = .winningscore; .winside = getarg(2); .skip = 1; awake strnpcinfo(0); end; } quiz_00,59,37,3 script Red Guild#bg_emp 4_M_CRU_KNT,{ end; OnInit: sleep 1; set getvariableofnpc( .rednpcname$, "bg_emp#control" ), strnpcinfo(0); OnStart: disablenpc "Guildsman Recruiter"; waitingroom "Red Guild", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, strnpcinfo(0)+"::OnJoin", 1; end; OnJoin: // announce "The Red Guild has ["+ getwaitingroomstate(0) +"/"+ getvariableofnpc( .minplayer2start, "bg_emp#control" ) +"] User", 0; donpcevent "bg_emp#control::OnStart"; end; } z_agit,24,186,3 script Blue Guild#bg_emp 4_M_KY_SOLD,{ end; OnInit: sleep 1; set getvariableofnpc( .bluenpcname$, "bg_emp#control" ), strnpcinfo(0); OnStart: disablenpc "Guildsman Recruiter"; waitingroom "Blue Guild", getvariableofnpc( .minplayer2start, "bg_emp#control" ) +1, strnpcinfo(0)+"::OnJoin", 1; end; OnJoin: // announce "The Blue Guild has ["+ getwaitingroomstate(0) +"/"+ getvariableofnpc( .minplayer2start, "bg_emp#control" ) +"] User", 0; donpcevent "bg_emp#control::OnStart"; end; } bat_b01 mapflag battleground 2 bat_b01 mapflag nosave SavePoint bat_b01 mapflag nowarp bat_b01 mapflag nowarpto bat_b01 mapflag noteleport bat_b01 mapflag nomemo bat_b01 mapflag nopenalty bat_b01 mapflag nobranch bat_b01 mapflag noicewall Edited August 28, 2016 by Helena Quote Share this post Link to post Share on other sites
Hey Hercules!
Does anyone know how i can make it so the losers of this script will also get 3x platinum coin (677) instead of only the winners?
I've tried to throw in a getitem before the bg_warp when the match is over but it doesn't quite work (player not attached message).
Edited by HelenaThank you so much!
Share this post
Link to post
Share on other sites