Emistry icon

[RO] Thana Event - 3 Hours

Emistry | PRO | 03/11/17 03:24:44 PM UTC | 0 ⭐ | 702 👁️ | Never ⏰ | []
text |

2.36 KB

|

None

|

0 👍

/

0 👎

// https://www.messenger.com/t/WDS.Denz
 prontera,155,181,5	script	Thana Event	4_F_KAFRA1,{
	doevent "thana_main::OnTalk";
}
  boss,51,43,5	script	Thana Summoner	4_F_KAFRA1,{
	doevent "thana_main::OnSummon";
}
 -	script	thana_main	-1,{
 	OnInit:
		.minute = 60;
		.map$ = "boss";
 		setarray .required_nameid,501,502,503,504;
		setarray .required_amount,1,2,3,4;
		.required_nameid_size = getarraysize( .required_nameid );
 		.npc_name$ = strnpcinfo(3);
		end;
 	OnMinute00:
		if ( gettime(3) % 3 == 0 ) {
			.status = 1;
			announce "<Thana Event> available now.",bc_all;
 			sleep ( .minute * 60000 );
 			mapwarp .map$,"prontera",155,181;
			.party_id = 0;
			.status = 0;
			.password$ = "";
			sleep 3000;
			announce "<Thana Event> closed now.",bc_all;
		}
		end;
 	OnTalk:
		.@party_id = getcharid(1);
		.@cid = getcharid(0);
 		if ( !.@party_id ) {
			mes "You dont have party.";
		}
		else if ( .@cid != getpartyleader( .@party_id,2 ) ) {
			mes "You're not party leader.";
		}
		else if ( .password$ != "" && .party_id == .@party_id ) {
			input .@password$;
			if ( .@password$ == .password$ ) {
				warp .map$,0,0;
			}
			else {
				mes "Invalid password.";
			}
		}
		else if ( getmapusers( .map$ ) > 0 ) {
			mes "Another party already entered.";
		}
		else {
			.party_id = .@party_id;
			.can_summon = 1;
			mes "Enter Password for the room.";
			input .password$;
			warp .map$,0,0;
		}
		close;
 	OnSummon:
		.@party_id = getcharid(1);
		.@cid = getcharid(0);
 		if ( !.@party_id ) {
			mes "You dont have party.";
		}
		else if ( .@cid != getpartyleader( .@party_id,2 ) ) {
			mes "You're not party leader.";
		}
		else if ( !.can_summon ) {
			mes "You cant summon more than once.";
		}
		else {
			mes "Required item:";
			for ( .@i = 0; .@i < .required_nameid_size; .@i++ ) {
				mes "> "+.required_amount[.@i]+"x "+getitemname( .required_nameid[.@i] );
				if ( countitem( .required_nameid[.@i] ) < .required_amount[.@i] )
					.@fail++;
			}
			if ( !.@fail )
				if ( select( "Summon","Cancel" ) == 1 ) {
					for ( .@i = 0; .@i < .required_nameid_size; .@i++ )
						delitem .required_nameid[.@i], .required_amount[.@i];
					monster .map$,0,0,"--ja--",1708,1,.npc_name$+"::OnKill";
					.can_summon = 0;
				}
		}
		close;
 	OnKill:
		awake .npc_name$;
		end;
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎