Jump to content
  • 0

Instance Script


Question

Posted

Hello

I would like a script based on an instance.

What this script have to do ?

It create a NPC who is just in front of the Payon Donjon.

The leader of the team talk to this NPC and it creates an instance of the pay_dun00 map with mobs waves.

Everybody of the party can die, return in town and come back in the instance by talking to the NPC !

When all mobs on pay_dun00 are died, a voice says : go to the next level, pay_dun01, and then, a second instance is created for this map with mob waves !

When all mobs are died, it gives any items (for example Apple of Archer)

all players are ejected (warp in front of the npc).

Can someone help me ? Or can someone explains me how to make this script ? :D

Nobody have an issue ? :'(

5 answers to this question

Recommended Posts

Posted (edited)

resnametable.txt

1@pay_d.gnd#pay_dun00.gnd#
1@pay_d.gat#pay_dun00.gat#
1@pay_d.rsw#pay_dun00.rsw#
À¯ÀúÀÎÅÍÆäÀ̽º\map\1@pay_d.bmp#À¯ÀúÀÎÅÍÆäÀ̽º\map\pay_dun00.bmp#
2@pay_d.gnd#pay_dun01.gnd#
2@pay_d.gat#pay_dun01.gat#
2@pay_d.rsw#pay_dun01.rsw#
À¯ÀúÀÎÅÍÆäÀ̽º\map\2@pay_d.bmp#À¯ÀúÀÎÅÍÆäÀ̽º\map\pay_dun01.bmp#

function    script    instance__    {
   if ( set( .@ins, instance_create( getarg(0), getcharid(1) ) ) < 0 )
   return .@ins;
   set .@i, 3;
   while ( getarg( .@i, "" ) != "" ) {
       if ( instance_attachmap( getarg(.@i), .@ins ) == "" ) {
           instance_destroy .@ins;
           return -5;
       }
       set .@i, .@i +1 ;
   }
   if ( getarg(1) || getarg(2) )
   instance_set_timeout getarg(1), getarg(2), .@ins;
   instance_init .@ins;
   instance_attach .@ins;
   return .@ins;
}

prontera,156,185,5    script    kdsfjhsdkfj    100,{
   if ( getcharid(1) == 0 ) {
       mes "you need a party to get in";
       close;
   }
   if ( getstrlen( has_instance("1@pay_d") ) ) {
       instance_attach instance_id(1);
       warp has_instance( 'instance_map_id +"@pay_d" ), 0,0;
       end;
   }
   if ( getpartyleader( getcharid(1), 2 ) != getcharid(0) ) {
       mes "party leader only";
       close;
   }
   if ( callfunc( "instance__", "Payon Donjon", 600,600, "1@pay_d", "2@pay_d" ) < 0 ) {
       mes "failed to create instance";
       close;
   }
   monster "1@pay_d",0,0,"--ja--",1001,10, instance_npcname("bleh")+"::Onblah1";
   warpparty "1@pay_d", 0,0, getcharid(1);
   'instance_map_id = 1;
   close;
}
1@pay_d,0,0,0    script    bleh    -1,{
Onblah1:
   'count++;
   if ( 'count < 10 ) end;
   announce "a voice says : go to the next level", 1;
   'instance_map_id = 2;
   instance_warpall "2@pay_d",0,0;
   monster "2@pay_d",0,0,"--ja--",1001,10, instance_npcname("bleh")+"::Onblah2";
   'count = 0;
   end;
Onblah2:
   'count++;
   if ( 'count < 10 ) end;
   instance_warpall "prontera",156,185;
   getpartymember getcharid(1), 1;
   getpartymember getcharid(1), 2;
   for ( .@i = 0; .@i < $@partymembercount; .@i++ )
       if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
           getitem "Apple_Of_Archer", 1, $@partymemberaid[.@i];
   sleep2 1;
   instance_destroy;
   end;
}

Edited by AnnieRuru
Posted

Thanks a lot Annie !!

It's really nice, i like it !

But i have a problem, it doesn't work :'(, failed to create instance, call func instance___ return a <0 number i think !

Posted

change this

	if ( callfunc( "instance__", "Payon Donjon", 600,600, "1@pay_d", "2@pay_d" ) < 0 ) {
	mes "failed to create instance";
	close;
}

into this

    if ( .@int = callfunc( "instance__", "Payon Donjon", 600,600, "1@pay_d", "2@pay_d" ) ) {
       mes "failed to create instance";
       mes "Reason = "+ .@int;
       close;
   }

if you get a -5, means you didn't duplicate the map successfully

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...