prontera,160,178,5 script debug 1_F_MARIA,{
$floorclear = 0;
dispbottom "reset";
}
prontera,156,178,5 script SAO??NO 1_F_MARIA,{
mes "No. of stage beaten : "+( $floorclear +1 == .totalfloor ? "ALL" : $floorclear +" stage" );
mes "Which floor do you want to challenge ?";
next;
for ( .@i = 0; .@i <= $floorclear; .@i++ )
.@menu$ = .@menu$ +"Floor No. "+( .@i +1 )+":";
.@s = select( .@menu$ );
if ( has_instance2("guild_vs2") >= 0 )
instance_destroy has_instance2("guild_vs2");
if ( ( .@ins = instance_create( "Challenge Floor No."+ .@s, getcharid(3), IOT_CHAR ) ) < 0 ) {
mes "error : "+ .@ins;
close;
}
if ( !getstrlen( instance_attachmap( "guild_vs2", .@ins, 1, ( getcharid(3) - 2000000 )+"SAO"+ .@s ) ) ) {
mes "error : 5";
instance_destroy .@ins;
close;
}
instance_set_timeout 3600, 15, .@ins; // 1 hour to kill, 15 seconds to destroy
instance_attach .@ins;
'floor = .@s;
instance_init .@ins;
warp ( getcharid(3) - 2000000 )+"SAO"+ .@s, 50,50;
end;
OnInit:
setarray .floor,
OSIRIS, // 1st floor
BAPHOMET, // 2nd floor
DOPPELGANGER; // 3rd floor
.totalfloor = getarraysize(.floor);
end;
}
guild_vs2,50,50,5 script portal WARPNPC,2,2,{
if ( 'floor == getvariableofnpc( .totalfloor, "SAO??NO" ) ) {
mes "no more";
close2;
warp "Save", 0,0;
instance_destroy has_instance( "guild_vs2" );
end;
}
if ( 'floor > $floorclear ) {
announce "[SAO Instance???] Floor No. "+ 'floor +" has open !", bc_all;
$floorclear = 'floor;
}
.@floor = 'floor +1;
instance_destroy has_instance( "guild_vs2" );
if ( ( .@ins = instance_create( "Challenge Floor No."+ .@floor, getcharid(3), IOT_CHAR ) ) < 0 ) {
mes "error : "+ .@ins;
close;
}
if ( !getstrlen( instance_attachmap( "guild_vs2", .@ins, 1, ( getcharid(3) - 2000000 )+"SAO"+ .@floor ) ) ) {
mes "error : 5";
warp "Save", 0,0;
instance_destroy .@ins;
close;
}
instance_set_timeout 3600, 15, .@ins; // 1 hour to kill, 15 seconds to destroy
instance_attach .@ins;
'floor = .@floor;
instance_init .@ins;
warp ( getcharid(3) - 2000000 )+"SAO"+ .@floor, 50,50;
end;
OnInstanceInit:
monster strnpcinfo(4), 50,50, "--ja--", getelementofarray( getvariableofnpc( .floor, "SAO??NO" ), 'floor -1 ), 1, instance_npcname( strnpcinfo(0) )+"::OnFloorBossDead";
hideonnpc instance_npcname( strnpcinfo(0) );
end;
OnFloorBossDead:
announce "Floor No. "+( 'floor )+" cleared ! Select an item from the drop list as your reward.", bc_map;
mes "Select an item for your reward";
next;
getmobdrops getelementofarray( getvariableofnpc( .floor, "SAO??NO" ), 'floor -1 );
for ( .@i = 0; .@i < $@MobDrop_count -1; .@i++ )
.@menu$ = .@menu$ + getitemname( $@MobDrop_item[.@i] ) +" - "+ $@MobDrop_rate[.@i] / 100 +"."+ $@MobDrop_rate[.@i] % 100 +"%:";
copyarray .@itemid, $@MobDrop_item, $@MobDrop_count -1;
.@s = select( .@menu$ ) -1;
getitem .@itemid[.@s], 1;
hideoffnpc instance_npcname( strnpcinfo(0) );
close;
}