I am making an Instance Dungeon. I was able to make a working instance dungeon with instance_create and instance_destroy, however, After I moved into the instance map, I see another player. Instances are supposed to be party-exclusive map just like the Endless Tower and the Orc Memorial. What is wrong with my basic script?
Note: This script was based on the code of Orc Memorial. The 2 NPCs are the Quest Starter and the Quest Ender. I used it as the base of my instance.
<spoiler>
new_2-1,144,95,4 script Payon Digger 78,{
set .@party_id,getcharid(1);
set .@p_name$,getpartyname(.@party_id);
set .@md_name$,"Payon Cave Inferno";
if (!instance_check_party(.@party_id,1,30,80)) {
mes "Only users between Levels ^ff000030 ~ 80^000000 can enter this Dungeon.";
close;
}
set .@paytime,checkquest(70000,PLAYTIME);
if (.@paytime == -1) {
if (getcharid(0) == getpartyleader(.@party_id,2)) {
mes "Party status confirmed. Would you like to book entrance to the "+.@md_name$+"?";
next;
switch(select("Reserve the "+.@md_name$+":Enter the Dungeon:Cancel")) {
case 1:
if (instance_create(.@md_name$) < 0) {
mes "Party Name: "+.@p_name$;
mes "Party Leader: "+strcharinfo(0);
mes "^0000ff"+.@md_name$+" ^000000 - Reservation Failed.";
close;
}
mes "^0000ff"+.@md_name$+"^000000- Attempting to book an entrance";
mes "After making a reservation, you have to select 'Enter the Dungeon' from the menu if you wish to enter the "+.@md_name$+".";
close;
case 2:
callsub L_Enter,0;
case 3:
close;
}
}
if(select(.@md_name$ + " Enter the Memorial Dungeon:Cancel") == 2)
end;
callsub L_Enter,1;
} else if (.@paytime == 0 || .@paytime == 1) {
mes "You can enter the Dungeon if it has been generated.";
next;
if(select("Enter the Dungeon "+.@md_name$+":Cancel") == 2)
close;
callsub L_Enter,0;
} else if (.@paytime == 2) {
mes "^0000ffAll records and after-effects related to the Orc's Memory Dungeon are deleted. You can now regenerate or re-enter the dungeon.^000000";
erasequest 70000;
close;
}
mes "In order to generate a dungeon you must be the Party Leader and have at least 2 members in the party.";
close;
L_Enter:
switch(instance_enter("Payon Cave Inferno")) {
case 3:
mes "An unknown error has occurred.";
close;
case 2:
mes "Memorial Dungeon Payon Cave Inferno does not exist.";
mes "Memorial Dungeon has been destroyed by the Party Leader, or because of the time limit. Please try again after 2 hours.";
close;
case 1:
mes "Only a member of the party can enter the Memorial Dungeon.";
close;
case 0:
mapannounce "gef_fild10",.@p_name$+" party's member "+strcharinfo(0)+" has entered the Payon Cave Inferno.",bc_map,"0x00ff99";
if (checkquest(70000) == -1) setquest 70000;
//warp "1@orcs",179,15;
if (getarg(0) == 0) close;
else end;
}
}
paydun1,29,161,4 script Payon Close 78,{
.@inst = instance_id();
instance_destroy .@inst;
mes "Congratulations";
next;
close;
end;
}
</spoiler>