instance,329,142,3 script Tower Protection Stone 406,{
set .@party_id,getcharid(1);
set .@ins_mas,getpartyleader(.@party_id,2);
set .@p_name$,getpartyname(.@party_id);
set .@p_reader$,strcharinfo(0);
set .@md_name$,"Mammoth's Haven";
set .@p_name2$,strcharinfo(0);
getpartymember(.@party_id);
set .@partymembercount,$@partymembercount;
copyarray .@partymembername$[0],$@partymembername$[0],.@partymembercount;
set .@mammoth_timer,checkquest(60500,PLAYTIME); // 1 week
set .@mammoth_timer2,checkquest(60501,PLAYTIME); // 4 hours
set .@dun_lim_time,mammoth_timer+604800; // 1week
set .@dun_lim_time2,mammoth_timer+14400; // 4hours
set .@dun_cur_time,gettimetick(2);
set .@dun_ent_t,(.@dun_lim_time - .@dun_cur_time);
set .@dun_h,(.@dun_ent_t / 3600);
set .@dun_m,(.@dun_ent_t - (.@dun_h * 3600)) / 60;
set .@dun_s,.@dun_ent_t - ((.@dun_h * 3600) + (.@dun_m * 60));
if ((.@party_id > 0) && (.@partymembercount > 1)) {
if (.@mammoth_timer == -1) {
if (.@ins_mas == getcharid(0)) {
mes "Confirmed the party has been made. Would you like to reserve entrance to the Mammoth Instance?";
next;
switch(select(.@md_name$ + " Instance Generated:Enter the Instance:Return to Prontera:Cancel")) {
case 1:
set .@instance, instance_create(.@md_name$, .@party_id);
if (.@instance < 0) {
mes "Party Name:"+.@p_name$+"";
mes "Party Leader:"+.@p_reader$+"";
mes "^0000ff"+.@md_name$+" ^000000- Reservation Failed!";
}
else {
mes "^0000ff"+.@md_name$+"^000000 - Try to reserve";
mes "After making a reservation, you have to talk to the totem again and select the menu 'Enter the Instance' to enter the Mammoth's Haven";
close;
// 1,2,3,
for( set .@i, 1; .@i <= 3; set .@i, .@i + 1 ) {
if( instance_attachmap(.@i + "mammoth", .@instance) == "" ) {
mes "^0000ff"+.@md_name$+" ^000000- Reservation Failed!";
instance_destroy(.@instance);
close;
}
}
instance_attach(.@instance);
instance_set_timeout 14400,300,.@instance;
instance_init(.@instance);
// Spawn the first floor of each map, which will then spawn the rest when cleared.
donpcevent instance_npcname("Mammoth01", instance_id())+"::OnInstanceInit";
}
break;
case 2:
if (has_instance("1mammoth") == "") {
mes "The memorial dungeon " + .@md_name$ + " does not exist.";
mes "The party leader did not generate the dungeon yet.";
}
else if ((has_instance("1mammoth") != "") && (.@partymembercount < 3))
mes "You can enter the instance after making a party.";
else {
mapannounce "instance", .@p_name2$ + " of the party, " + .@p_name$ + ", is entering the Mammoth's Haven Instance, " + .@md_name$ + ".",bc_map,"0x00ff99",FW_NORMAL,12;
set mammoth_timer,gettimetick(2);
setquest 60500;
setquest 60501;
warp "mammoth01",36,233;
end;
}
break;
case 3:
mes "I will move you to Prontera.";
close2;
warp "prontera",156,170;
end;
case 4:
break;
}
close;
}
else {
switch(select(.@md_name$ + "Enter the Instance:Return to Prontera:Cancel")) {
case 1:
if (has_instance("1mammoth") == "") {
mes "The memorial dungeon " + .@md_name$ + " does not exist.";
mes "The party leader did not generate the instance yet.";
}
else if ((has_instance("mammoth01") != "") && (.@partymembercount < 2))
mes "You can enter the instance after making a party.";
else {
mapannounce "instance", .@p_name2$ + " of the party, " + .@p_name$ + ", is entering the Mammoth's Haven Instance, " + .@md_name$ + ".",bc_map,"0x00ff99",FW_NORMAL,12;
set etower_timer,gettimetick(2);
setquest 60500;
setquest 60501;
warp "mammoth01",36,233;
end;
}
break;
case 2:
mes "I will move you to Prontera.";
close2;
warp "prontera",156,170;
end;
case 3:
break;
}
close;
}
}
else if ((.@mammoth_timer >= 0) && (.@mammoth_timer2 < 2)) {
mes "If you have the instance generated already, you can enter it. ";
next;
switch(select(.@md_name$ + "Enter the instance:Return to Prontera:Cancel")) {
case 1:
if (has_instance("1mammoth") == "") {
mes "The memorial dungeon " + .@md_name$ + " does not exist.";
mes "The party leader did not generate the instance yet.";
}
else if ((has_instance("1mammoth") != "") && (.@partymembercount < 2))
mes "You can enter the instance after making a party.";
else {
mapannounce "instance", .@p_name2$ + " of the party, " + .@p_name$ + ", is entering the Mammoth's Haven Instance, " + .@md_name$ + ".",bc_map,"0x00ff99",FW_NORMAL,12;
warp "mammoth01",36,233;
end;
}
break;
case 2:
mes "I will move you to Prontera.";
close2;
warp "prontera",156,170;
end;
case 3:
break;
}
close;
}
else if ((.@mammoth_timer >= 0) && (.@mammoth_timer < 2) && (.@mammoth_timer2 == 2)) {
mes "Due to the instance's aftereffects, you cannot enter the Mammoth's Haven right now, " + .@dun_h + "hours " + .@dun_m + "minutes " + .@dun_s + "seconds left to enter the next instance.";
next;
mes "It is dangerous here. Let me move you to Prontera.";
close2;
warp "prontera",156,170;
end;
}
else {
set mammoth_timer,0;
erasequest 60500;
erasequest 60501;
mes "^0000ffThe records and after effects related to the Mammoth's Haven Instance have been removed. You can generate and enter the Instance again.^000000";
close;
}
}
else {
mes "Make or join a party with more than 1 member and try again.";
close;
}
}
Question
letstry
It always ends up on the Reservation Priority: 0
Edited by ArcencielCodeboxed
Link to comment
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.