DEsMOn Posted March 21 Share Posted March 21 Hello scripters, Can some one guide me how to add portal on event start n portal hide off after 1 min. prontera,181,157,4 script Poring Race 24004,{ if( .access_Prace == 0 ) { mes "[Poring Race Staff]"; mes "Poring Race has ended."; close; } mes "[Poring Race Staff]"; mes "Do you want to participate on Poring Race?"; if( select( "Yes","No" ) -1 ) { next; mes "[Poring Race Staff]"; mes "See you again next time!"; close; } if( .access_Prace == 0 ) { next; mes "[Poring Race Staff]"; mes "..."; mes "..."; mes "Cheater!!~~"; close; } close2; @prace_winner$ = ""; warp "p_track01",52,41; end; // OnInit: OnClock0001: OnClock0246: OnClock0300: OnClock0600: OnClock0900: OnClock1200: OnClock1500: OnClock1800: OnClock2100: //if( gettime(3)%2 ) end; set .access_Prace, 1; announce "Poring Race is now open!",0,0xFFAB54; setnpctimer 100000,"Bidder#prace0"; startnpctimer "Bidder#prace0"; end; OnPraceEnd: set .access_Prace, 0; announce "Poring Race is over!",0,0xFFAB54; end; } p_track01,58,41,3 script Bidder#prace0 877,{ function checkevent; mes "[Bidder]"; if( getstrlen( @prace_winner$ ) ) { mes "You have choose ^00bb00"+ @prace_winner$ +"^000000"; close; } else if ( checkevent() || .start ) { mes "There is a race in progress..."; close; } else if( !getvariableofnpc( .access_Prace,"Poring Race" ) ) { mes "There is no race."; close; } mes "Choose the poring you want to bet:"; mes "It will cost "+ .zeny_req +" Zeny."; [email protected] = select( .menu_$ ); if( [email protected] == 7 ) { next; mes "[Bidder]"; mes "Goodbye."; close; } [email protected]$ = .monst_$[ [email protected] -1 ]; if ( checkevent() ) { next; mes "[Bidder]"; mes "..."; mes "..."; mes "Cheater!!~~"; close; } else if( Zeny < .zeny_req ) { next; mes "[Bidder]"; mes "You don't have enough Zeny."; close; } Zeny -= .zeny_req; @prace_winner$ = [email protected]$; .prace_bidders[ .prace_bets ] = getcharid(3); .prace_bets++; next; mes "[Bidder]"; mes "I have "+ .prace_bets +" bets."; initnpctimer; npctalk "I got "+ strcharinfo(0) +" bet!"; close; OnTimer60000: npctalk "I got "+ .prace_bets +" bets. Anyone else?"; end; OnTimer80000: npctalk "The race will start soon. Last chance."; end; OnTimer90000: stopnpctimer; .start = 1; mapannounce "p_track01","Porings, on your marks...",1,0xFFAB54; sleep 2500; for( [email protected] = 3; [email protected] > 0; [email protected] ) { mapannounce "p_track01","..."+ [email protected] +"...",1,0xFFAB54; sleep 1000; } donpcevent strnpcinfo(0) +"::OnStartRace"; sleep 1000; mapannounce "p_track01","Gooo!!!",1,0xFFAB54; end; OnTimer320000: mapwarp "p_track01","prontera",142,170; donpcevent "Poring Race::OnPraceEnd"; .prace_winner$ = ""; .start = .prace_bets = 0; donpcevent strnpcinfo(0) +"::OnReturnRace"; end; OnStartRace: callsub L_label, "OnRace"; OnStopRace: callsub L_label, "OnStop"; OnReturnRace: callsub L_label, "OnReturn"; L_label: donpcevent "Metaling#prace3::"+ getarg(0); donpcevent "Poring#prace1::"+ getarg(0); donpcevent "Poporing#prace6::"+ getarg(0); donpcevent "Angeling#prace2::"+ getarg(0); donpcevent "Santa Poring#prace5::"+ getarg(0); donpcevent "Deviling#prace4::"+ getarg(0); if( getarg(0) == "OnStop" && .prace_winner$ != "" ) callsub L_WinRace; end; L_WinRace: mapannounce "p_track01", "The winner is "+ .prace_winner$,1,0xFFAB54; donpcevent strnpcinfo(0) +"::OnChequeo"; sleep 3000; donpcevent strnpcinfo(0) +"::OnReturnRace"; sleep 10000; mapwarp "p_track01","prontera",142,170; donpcevent "Poring Race::OnPraceEnd"; .prace_winner$ = ""; .start = .prace_bets = 0; end; OnChequeo: for( [email protected] = 0 ; [email protected] < getarraysize( .prace_bidders ); [email protected]++ ) { if( attachrid( .prace_bidders[[email protected]] ) && getstrlen( @prace_winner$ ) ) { dispbottom "The winner is "+ .prace_winner$ +" and you have bet for "+ @prace_winner$ +"."; if( @prace_winner$ == .prace_winner$ ) { dispbottom "You have won!"; mapannounce "p_track01"," Congratulations! "+ strcharinfo(0) +" has won!",1,0xFFAB54; getitem .item_gained, .item_num_gain; emotion 21,1; } else { dispbottom "You have lost."; emotion 28,1; } @prace_winner$ = ""; } } deletearray .prace_bidders; end; OnInit: .zeny_req = 3500; .item_gained = 7179; .item_num_gain = 5; setarray .monst_$,"Poring","Angeling","Metaling","Deviling","Santa Poring","Poporing","None"; .menu_$ = implode( .monst_$, ":" ); end; function checkevent { getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Poring#prace1"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Angeling#prace2"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Metaling#prace3"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Deviling#prace4"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Santa Poring#prace5"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Poporing#prace6"; [email protected] = ( [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] ) != 58 * 6; return [email protected]; } } //----------------------------------- // Racer NPC's //----------------------------------- - script pori_race -1,{ OnRace: initnpctimer; end; OnStop: stopnpctimer; end; OnReturn: sleep 1000; while( strnpcinfo(1) != .monst$[ [email protected] ] ) [email protected]++; movenpc strnpcinfo(3), 58, .walk_t[[email protected]]; end; OnTimer1100: getmapxy [email protected]$,[email protected],[email protected],BL_NPC, strnpcinfo(3); if( rand(100) < .prace_random ) npcwalkto [email protected], [email protected]; [email protected] = rand( .prace_random2 ); if ( [email protected] -1 == 29 ) { while( strnpcinfo(1) != .monst$[ [email protected] ] ) [email protected]++; set getvariableofnpc( .prace_winner$, "Bidder#prace0" ), .monst$[ [email protected] ]; emotion 29; donpcevent "Bidder#prace0::OnStopRace"; end; } stopnpctimer; setnpctimer [email protected]; startnpctimer; end; OnInit: deletearray .walk_t; deletearray .monst$; setarray .walk_t, 38, 36, 34, 32, 30, 28; setarray .monst$, "Poring", "Angeling", "Metaling", "Deviling", "Santa Poring", "Poporing"; .prace_random = 70; .prace_random2 = 600; end; } p_track01,58,38,2 duplicate(pori_race) Poring#prace1 1002 p_track01,58,36,2 duplicate(pori_race) Angeling#prace2 1096 p_track01,58,34,2 duplicate(pori_race) Metaling#prace3 1613 p_track01,58,32,2 duplicate(pori_race) Deviling#prace4 1582 p_track01,58,30,2 duplicate(pori_race) Santa Poring#prace5 1062 p_track01,58,28,2 duplicate(pori_race) Poporing#prace6 1031 p_track01,78,42,0 warp p_track002 1,3,prontera,142,170 p_track01 mapflag nobranch p_track01 mapflag noicewall p_track01 mapflag nomemo p_track01 mapflag noreturn p_track01 mapflag noteleport p_track01 mapflag nowarpto p_track01 mapflag nowarp p_track01 mapflag pvp off p_track01 mapflag nosave Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted March 22 Share Posted March 22 (edited) prontera,181,157,0 warp prace_warp_portal 1,1,p_track01,52,41 OnClock2100: //if( gettime(3)%2 ) end; set .access_Prace, 1; announce "Poring Race is now open!",0,0xFFAB54; setnpctimer 100000,"Bidder#prace0"; startnpctimer "Bidder#prace0"; enablenpc "prace_warp_portal"; // <--- ADD THESE sleep 60000; // <--- ADD THESE disablenpc "prace_warp_portal"; // <--- ADD THESE end; and also OnInit: disablenpc "prace_warp_portal"; // <--- ADD THESE end; Edited March 22 by Emistry 1 Quote Link to comment Share on other sites More sharing options...
0 DEsMOn Posted March 22 Author Share Posted March 22 23 hours ago, Emistry said: prontera,181,157,0 warp prace_warp_portal 1,1,p_track01,52,41 OnClock2100: //if( gettime(3)%2 ) end; set .access_Prace, 1; announce "Poring Race is now open!",0,0xFFAB54; setnpctimer 100000,"Bidder#prace0"; startnpctimer "Bidder#prace0"; enablenpc "prace_warp_portal"; // <--- ADD THESE sleep 60000; // <--- ADD THESE disablenpc "prace_warp_portal"; // <--- ADD THESE end; and also OnInit: disablenpc "prace_warp_portal"; // <--- ADD THESE end; It's Working..!! Thank you so much Sir. Is there any possibilities that we can add Race winner announcer? Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted March 23 Share Posted March 23 mapannounce "p_track01"," Congratulations! "+ strcharinfo(0) +" has won!",1,0xFFAB54; already have it. if you meant a server broadcast announce " Congratulations! "+ strcharinfo(0) +" has won!", bc_all, 0xFFAB54; 1 Quote Link to comment Share on other sites More sharing options...
0 DEsMOn Posted March 23 Author Share Posted March 23 4 hours ago, Emistry said: mapannounce "p_track01"," Congratulations! "+ strcharinfo(0) +" has won!",1,0xFFAB54; already have it. if you meant a server broadcast announce " Congratulations! "+ strcharinfo(0) +" has won!", bc_all, 0xFFAB54; Yeah sorry for silly request...!! Thank you so much for your precious time...!! Quote Link to comment Share on other sites More sharing options...
Hello scripters,
Can some one guide me how to add portal on event start n portal hide off after 1 min.
prontera,181,157,4 script Poring Race 24004,{ if( .access_Prace == 0 ) { mes "[Poring Race Staff]"; mes "Poring Race has ended."; close; } mes "[Poring Race Staff]"; mes "Do you want to participate on Poring Race?"; if( select( "Yes","No" ) -1 ) { next; mes "[Poring Race Staff]"; mes "See you again next time!"; close; } if( .access_Prace == 0 ) { next; mes "[Poring Race Staff]"; mes "..."; mes "..."; mes "Cheater!!~~"; close; } close2; @prace_winner$ = ""; warp "p_track01",52,41; end; // OnInit: OnClock0001: OnClock0246: OnClock0300: OnClock0600: OnClock0900: OnClock1200: OnClock1500: OnClock1800: OnClock2100: //if( gettime(3)%2 ) end; set .access_Prace, 1; announce "Poring Race is now open!",0,0xFFAB54; setnpctimer 100000,"Bidder#prace0"; startnpctimer "Bidder#prace0"; end; OnPraceEnd: set .access_Prace, 0; announce "Poring Race is over!",0,0xFFAB54; end; } p_track01,58,41,3 script Bidder#prace0 877,{ function checkevent; mes "[Bidder]"; if( getstrlen( @prace_winner$ ) ) { mes "You have choose ^00bb00"+ @prace_winner$ +"^000000"; close; } else if ( checkevent() || .start ) { mes "There is a race in progress..."; close; } else if( !getvariableofnpc( .access_Prace,"Poring Race" ) ) { mes "There is no race."; close; } mes "Choose the poring you want to bet:"; mes "It will cost "+ .zeny_req +" Zeny."; [email protected] = select( .menu_$ ); if( [email protected] == 7 ) { next; mes "[Bidder]"; mes "Goodbye."; close; } [email protected]$ = .monst_$[ [email protected] -1 ]; if ( checkevent() ) { next; mes "[Bidder]"; mes "..."; mes "..."; mes "Cheater!!~~"; close; } else if( Zeny < .zeny_req ) { next; mes "[Bidder]"; mes "You don't have enough Zeny."; close; } Zeny -= .zeny_req; @prace_winner$ = [email protected]$; .prace_bidders[ .prace_bets ] = getcharid(3); .prace_bets++; next; mes "[Bidder]"; mes "I have "+ .prace_bets +" bets."; initnpctimer; npctalk "I got "+ strcharinfo(0) +" bet!"; close; OnTimer60000: npctalk "I got "+ .prace_bets +" bets. Anyone else?"; end; OnTimer80000: npctalk "The race will start soon. Last chance."; end; OnTimer90000: stopnpctimer; .start = 1; mapannounce "p_track01","Porings, on your marks...",1,0xFFAB54; sleep 2500; for( [email protected] = 3; [email protected] > 0; [email protected] ) { mapannounce "p_track01","..."+ [email protected] +"...",1,0xFFAB54; sleep 1000; } donpcevent strnpcinfo(0) +"::OnStartRace"; sleep 1000; mapannounce "p_track01","Gooo!!!",1,0xFFAB54; end; OnTimer320000: mapwarp "p_track01","prontera",142,170; donpcevent "Poring Race::OnPraceEnd"; .prace_winner$ = ""; .start = .prace_bets = 0; donpcevent strnpcinfo(0) +"::OnReturnRace"; end; OnStartRace: callsub L_label, "OnRace"; OnStopRace: callsub L_label, "OnStop"; OnReturnRace: callsub L_label, "OnReturn"; L_label: donpcevent "Metaling#prace3::"+ getarg(0); donpcevent "Poring#prace1::"+ getarg(0); donpcevent "Poporing#prace6::"+ getarg(0); donpcevent "Angeling#prace2::"+ getarg(0); donpcevent "Santa Poring#prace5::"+ getarg(0); donpcevent "Deviling#prace4::"+ getarg(0); if( getarg(0) == "OnStop" && .prace_winner$ != "" ) callsub L_WinRace; end; L_WinRace: mapannounce "p_track01", "The winner is "+ .prace_winner$,1,0xFFAB54; donpcevent strnpcinfo(0) +"::OnChequeo"; sleep 3000; donpcevent strnpcinfo(0) +"::OnReturnRace"; sleep 10000; mapwarp "p_track01","prontera",142,170; donpcevent "Poring Race::OnPraceEnd"; .prace_winner$ = ""; .start = .prace_bets = 0; end; OnChequeo: for( [email protected] = 0 ; [email protected] < getarraysize( .prace_bidders ); [email protected]++ ) { if( attachrid( .prace_bidders[[email protected]] ) && getstrlen( @prace_winner$ ) ) { dispbottom "The winner is "+ .prace_winner$ +" and you have bet for "+ @prace_winner$ +"."; if( @prace_winner$ == .prace_winner$ ) { dispbottom "You have won!"; mapannounce "p_track01"," Congratulations! "+ strcharinfo(0) +" has won!",1,0xFFAB54; getitem .item_gained, .item_num_gain; emotion 21,1; } else { dispbottom "You have lost."; emotion 28,1; } @prace_winner$ = ""; } } deletearray .prace_bidders; end; OnInit: .zeny_req = 3500; .item_gained = 7179; .item_num_gain = 5; setarray .monst_$,"Poring","Angeling","Metaling","Deviling","Santa Poring","Poporing","None"; .menu_$ = implode( .monst_$, ":" ); end; function checkevent { getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Poring#prace1"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Angeling#prace2"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Metaling#prace3"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Deviling#prace4"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Santa Poring#prace5"; getmapxy [email protected]$, [email protected], [email protected], BL_NPC, "Poporing#prace6"; [email protected] = ( [email protected] + [email protected] + [email protected] + [email protected] + [email protected] + [email protected] ) != 58 * 6; return [email protected]; } } //----------------------------------- // Racer NPC's //----------------------------------- - script pori_race -1,{ OnRace: initnpctimer; end; OnStop: stopnpctimer; end; OnReturn: sleep 1000; while( strnpcinfo(1) != .monst$[ [email protected] ] ) [email protected]++; movenpc strnpcinfo(3), 58, .walk_t[[email protected]]; end; OnTimer1100: getmapxy [email protected]$,[email protected],[email protected],BL_NPC, strnpcinfo(3); if( rand(100) < .prace_random ) npcwalkto [email protected], [email protected]; [email protected] = rand( .prace_random2 ); if ( [email protected] -1 == 29 ) { while( strnpcinfo(1) != .monst$[ [email protected] ] ) [email protected]++; set getvariableofnpc( .prace_winner$, "Bidder#prace0" ), .monst$[ [email protected] ]; emotion 29; donpcevent "Bidder#prace0::OnStopRace"; end; } stopnpctimer; setnpctimer [email protected]; startnpctimer; end; OnInit: deletearray .walk_t; deletearray .monst$; setarray .walk_t, 38, 36, 34, 32, 30, 28; setarray .monst$, "Poring", "Angeling", "Metaling", "Deviling", "Santa Poring", "Poporing"; .prace_random = 70; .prace_random2 = 600; end; } p_track01,58,38,2 duplicate(pori_race) Poring#prace1 1002 p_track01,58,36,2 duplicate(pori_race) Angeling#prace2 1096 p_track01,58,34,2 duplicate(pori_race) Metaling#prace3 1613 p_track01,58,32,2 duplicate(pori_race) Deviling#prace4 1582 p_track01,58,30,2 duplicate(pori_race) Santa Poring#prace5 1062 p_track01,58,28,2 duplicate(pori_race) Poporing#prace6 1031 p_track01,78,42,0 warp p_track002 1,3,prontera,142,170 p_track01 mapflag nobranch p_track01 mapflag noicewall p_track01 mapflag nomemo p_track01 mapflag noreturn p_track01 mapflag noteleport p_track01 mapflag nowarpto p_track01 mapflag nowarp p_track01 mapflag pvp off p_track01 mapflag nosaveLink to comment
Share on other sites