prontera,155,181,5 script Sample#rentmap 757,{
if( select( "Rent Map","Cancel" ) == 1 ){
.@gid = getcharid(2);
if( !.@gid ){
mes "You dont have guild.";
}
else if( getguildmasterid( .@gid ) != getcharid(0) ){
mes "You're not guild leader";
}
else if( $rent_map_gid ){
mes "Map has been rent by Guild "+getguildname( $rent_map_gid );
mes "Contract end after next WOE";
}
else if( getcastledata( .castle_map$,1 ) != .@gid ){
mes "Your guild didnt conquer castle "+getcastlename( .castle_map$ );
}
else{
$rent_map_gid = .@gid;
mes "You have rent a Map. Contract end after next WOE";
}
}
close;
OnPCLoadMapEvent:
if( strcharinfo(3) == .rent_map$ && getcharid(2) != $rent_map_gid ){
mes "You cant access this map, it's belong to "+getguildname( $rent_map_gid );
close2;
warp "SavePoint",0,0;
}
end;
OnAgitEnd:
$rent_map_gid = 0;
end;
OnInit:
.castle_map$ = "prtg_cas01";
.rent_map$ = "payon";
setmapflag .rent_map$,mf_loadevent;
end;
}