// Insert into your instance_db.txt ( change 1 to whatever last instance you have).
// 1,Training Grounds,14400,jupe_ele,45,50,jupe_ele
prontera,148,145,2 script Training Grounds#Ins 4_M_ROYALGUARD,{
.@md_namenpc$ = "[ ^ee7600Training Grounds^000000 ]";
.@instance$ = "Training Grounds";
if (instance_id()) {
mes .@md_namenpc$;
mes "You are already part of an instance.";
next;
switch(select("Enter Instance.:Cancel.")) {
case 1:
break;
case 2:
mes .@md_namenpc$;
mes "You don't want to try again?";
emotion e_sob;
close;
}
} else {
mes .@md_namenpc$;
mes "Hello there "+strcharinfo(0)+".";
mes "Would you like to enter the Training Grounds?";
next;
mes .@md_namenpc$;
mes "Info:";
.@size = 4;
for ( .@i = 1; .@i <= .@size; .@i++ )
{
mes "Training Ground "+.@i+": (Lv. ^FF0000"+$@MinRange[.@i]+"^000000 ~ ^0000FF"+$@MaxRange[.@i]+ "^000000 )";
}
next;
mes .@md_namenpc$;
switch(select("Create "+.@md_namenpc$+":Cancel.")) {
case 1:
.@create = instance_create( .@instance$ );
if (.@create < 0) {
mes "Time to train!";
mes "...";
switch (.@create) {
case -1: mes "ERROR: Invalid type."; break;
case -2: mes "ERROR: Party not found."; break;
case -3: mes "ERROR: Instance already exists."; break;
case -4: mes "ERROR: No free instances."; break;
}
mes " ";
mes "Instance creation ^FF0000failed^000000.";
emotion e_omg;
close;
}
mes "Instance created.";
mes " ";
mes "Now entering the Training Grounds..";
next;
break;
case 2:
mes "Okay. Maybe next time!";
close;
}
}
.@enter = instance_enter(.@instance$);
if (.@enter != 0) {
mes .@md_namenpc$;
switch (.@enter) {
case 1: mes "ERROR: Party not found."; break;
case 2: mes "ERROR: Party does not have an instance."; break;
case 3: mes "ERROR: Unknown error."; break;
}
mes " ";
mes "Instance entry ^FF0000failed^000000.";
emotion e_omg;
close;
}
close;
OnInit:
setarray $@MinRange[1],1,5,10,20;
setarray $@MaxRange[1],5,10,20,99;
setarray $@MinBase[1],2,5,10,15;
setarray $@MaxBase[1],3,10,15,25;
end;
}
jupe_ele,42,45,4 script Training System#Ins 4_M_ROYALGUARD,{
.@md_namenpc$ = "[ ^ee7600Training System^000000 ]";
mes .@md_namenpc$;
if ( 'CurrentRound )
{
mes "There is a round currently in progress.";
close;
}
mes "Spawn Training Mobs?";
next;
switch(select("Sure","Leave Instance."))
{
case 1:
'CurrentRound++;
if ( BaseLevel <= $@MaxRange[1] ) {
dispbottom "type 1";
'TotalCount = 'MobAM[1];
areamonster instance_mapname("jupe_ele"),47,35,34,54,"--ja--",'MobID[1],'MobAM[1],instance_npcname("Training System#Ins")+"::OnThisMobDeath";
end;
}
if ( BaseLevel >= $@MinRange[2] && BaseLevel < $@MaxRange[2] ) {
dispbottom "type 2";
'TotalCount = 'MobAM[2];
areamonster instance_mapname("jupe_ele"),47,35,34,54,"--ja--",'MobID[2],'MobAM[2],instance_npcname("Training System#Ins")+"::OnThisMobDeath";
end;
}
if ( BaseLevel >= $@MinRange[3] && BaseLevel < $@MaxRange[3] ) {
dispbottom "type 3";
'TotalCount = 'MobAM[3];
areamonster instance_mapname("jupe_ele"),47,35,34,54,"--ja--",'MobID[3],'MobAM[3],instance_npcname("Training System#Ins")+"::OnThisMobDeath";
end;
}
if ( BaseLevel >= $@MinRange[4] && BaseLevel < $@MaxRange[4] ) {
dispbottom "type 4";
'TotalCount = 'MobAM[4];
areamonster instance_mapname("jupe_ele"),47,35,34,54,"--ja--",'MobID[4],'MobAM[4],instance_npcname("Training System#Ins")+"::OnThisMobDeath";
end;
}
case 2: // Leave Instance
instance_announce -1,"Finished Training...",bc_self;
instance_destroy();
end;
}
OnThisMobDeath:
'MobCount++;
if ( 'MobCount == 'TotalCount )
{
dispbottom "Finished mobs.";
dispbottom "Current round reset.";
'CurrentRound--;
'MobCount = 0;
}
if ( BaseLevel <= $@MaxRange[1] ) {
BaseLevel += rand($@MinBase[1],$@MaxBase[1]);
end;
}
if ( BaseLevel >= $@MinRange[2] && BaseLevel < $@MaxRange[2] ) {
BaseLevel += rand($@MinBase[2],$@MaxBase[2]);
end;
}
if ( BaseLevel >= $@MinRange[3] && BaseLevel < $@MaxRange[3] ) {
BaseLevel += rand($@MinBase[3],$@MaxBase[3]);
end;
}
if ( BaseLevel >= $@MinRange[4] && BaseLevel < $@MaxRange[4] ) {
BaseLevel += rand($@MinBase[4],$@MaxBase[4]);
end;
}
end;
OnInstanceInit:
enablenpc instance_npcname ("Training System#Ins");
setarray 'MobID[1],1002,1002,1002,1002;
setarray 'MobAM[1],2,3,4,5;
setmapflag instance_mapname ("jupe_ele"),mf_nobaseexp;
setmapflag instance_mapname ("jupe_ele"),mf_nojobexp;
end;
}