// Capuche cleaning Base on the poring race by Zell_ff8, xianz, Neko prontera,139,184,5 script Poring Race 882,{ if( .access_Prace == 0 ) { mes "[Poring Race Staff]"; mes "กิจกรรม Poring Race ได้สิ้นสุดลงแล้ว."; close; } mes "[Poring Race Staff]"; mes "คุณต้องการที่จะเข้าร่วมกิจกรรม Poring Race ?"; if( select( "เข้าร่วม","ยกเลิกการสนทนา" ) -1 ) { next; mes "[Poring Race Staff]"; mes "เอาล่ะ... เราคงได้พบกันในครั้งหน้า !"; close; } if( .access_Prace == 0 ) { next; mes "[Poring Race Staff]"; mes "..."; mes "..."; mes "นี่คุณกำลังเล่นตลกอะไรอย่างนั้นหรือ !!~~"; close; } close2; @prace_winner$ = ""; warp "p_track01",52,41; end; // OnInit: OnMinute20: if( gettime(3)%2 ) end; set .access_Prace, 1; announce "กิจกรรม Poring Race ได้เปิดแล้วในขณะนี้ !",0,0xFFAB54; setnpctimer 100000,"Bidder#prace0"; startnpctimer "Bidder#prace0"; end; OnPraceEnd: set .access_Prace, 0; announce "กิจกรรม Poring Race ได้จบลงแล้ว",0,0xFFAB54; end; } p_track01,58,41,3 script Bidder#prace0 877,{ function checkevent; mes "[Bidder]"; if( getstrlen( @prace_winner$ ) ) { mes "คุณได้เลือก ^00bb00"+ @prace_winner$ +"^000000"; close; } else if ( checkevent() || .start ) { mes "ขณะนี้การแข่งขันกำลังดำเนินการอยู่..."; close; } else if( !getvariableofnpc( .access_Prace,"Poring Race" ) ) { mes "ยังไม่มีการแข่งขัน."; close; } mes "กรุณาเลือก Poring ที่คุณต้องการเดิมพัน :"; mes "ค่าธรรมเนียมคือ "+ .zeny_req +" Zeny."; .@s = select( .menu_$ ); if( .@s == 7 ) { next; mes "[Bidder]"; mes "บาย."; close; } .@c$ = .monst_$[ .@s -1 ]; if ( checkevent() ) { next; mes "[Bidder]"; mes "..."; mes "..."; mes "นี่คุณกำลังเล่นตลกอะไรอย่างนั้นหรือ !!~~"; close; } else if( Zeny < .zeny_req ) { next; mes "[Bidder]"; mes "ดูเหมือนว่าคุณไม่ได้มีจำนวนเงินเพียงพอสำหรับการใช้จ่ายนะ."; close; } Zeny -= .zeny_req; @prace_winner$ = .@c$; .prace_bidders[ .prace_bets ] = getcharid(3); .prace_bets++; next; mes "[Bidder]"; mes "เราได้รับการเดิมพันจาก"+ .prace_bets +"."; initnpctimer; npctalk "เราได้รับการเดิมพันจาก "+ strcharinfo(0) +"!"; close; OnTimer60000: npctalk "เราได้รับการเดิมพันจาก "+ .prace_bets +". ยังมีใครต้องการที่จะเดิมพันอีกใหม ?"; end; OnTimer80000: npctalk "การแข่งขันกำลังจะเริ่มต้นขึ้นเร็วๆนี้."; end; OnTimer90000: stopnpctimer; .start = 1; mapannounce "p_track01","กรุณาจับตาดู Porings ที่คุณได้วางเดิมพันไว้ให้ดี...",1,0xFFAB54; sleep 2500; for( .@i = 3; .@i > 0; .@i-- ) { mapannounce "p_track01","..."+ .@i +"...",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( .@i = 0 ; .@i < getarraysize( .prace_bidders ); .@i++ ) { if( attachrid( .prace_bidders[.@i] ) && getstrlen( @prace_winner$ ) ) { dispbottom "ผลการชนะคือ "+ .prace_winner$ +" และ คุณได้วางเดิมพัน "+ @prace_winner$ +"."; if( @prace_winner$ == .prace_winner$ ) { dispbottom "คุณเป็นผู้ชนะ !"; mapannounce "p_track01"," ขอแสดงความยินดีด้วย ! "+ strcharinfo(0) +" เป็นผู้ได้รับรางวัล !",1,0xFFAB54; getitem .item_gained, .item_num_gain; emotion 21,1; } else { dispbottom "คุณแพ้."; emotion 28,1; } @prace_winner$ = ""; } } deletearray .prace_bidders; end; OnInit: .zeny_req = 3500; .item_gained = 7199; .item_num_gain = 2; setarray .monst_$,"Poring","Angeling","Metaling","Deviling","Santa Poring","Poporing","None"; .menu_$ = implode( .monst_$, ":" ); end; function checkevent { getmapxy .@mapname$, .@x1, .@y, 1, "Poring#prace1"; getmapxy .@mapname$, .@x2, .@y, 1, "Angeling#prace2"; getmapxy .@mapname$, .@x3, .@y, 1, "Metaling#prace3"; getmapxy .@mapname$, .@x4, .@y, 1, "Deviling#prace4"; getmapxy .@mapname$, .@x5, .@y, 1, "Santa Poring#prace5"; getmapxy .@mapname$, .@x6, .@y, 1, "Poporing#prace6"; .@t = ( .@x1 + .@x2 + .@x3 + .@x4 + .@x5 + .@x6 ) != 58 * 6; return .@t; } } //----------------------------------- // Racer NPC's //----------------------------------- - script pori_race -1,{ OnRace: initnpctimer; end; OnStop: stopnpctimer; end; OnReturn: sleep 1000; while( strnpcinfo(1) != .monst$[ .@i ] ) .@i++; movenpc strnpcinfo(3), 58, .walk_t[.@i]; end; OnTimer1100: getmapxy .@mapname$,.@x,.@y,1, strnpcinfo(3); if( rand(100) < .prace_random ) npcwalkto .@x-1, .@y; .@r = rand( .prace_random2 ); if ( .@x -1 == 29 ) { while( strnpcinfo(1) != .monst$[ .@i ] ) .@i++; set getvariableofnpc( .prace_winner$, "Bidder#prace0" ), .monst$[ .@i ]; emotion 29; donpcevent "Bidder#prace0::OnStopRace"; end; } stopnpctimer; setnpctimer .@r; 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