• 0
Sign in to follow this  
Followers 0
Atomik

Help Learning Instance and how it works. <3

Question

Hello there, 

Can any one help me with a Simple instance script so i can read it and learn how instance works .

1) A npc that teleport you to an instance.
2) few monsters in that instance
3) Npcs inside the instance that destroys Instance once done. 

Please help <#.

---Atomik.

Share this post


Link to post
Share on other sites

3 answers to this question

  • 0

similar topic appear in rathena forum

prontera,155,180,0	script	Test Instance	1_F_MARIA,{
	if ( has_instance2("guild_vs2") >= 0 ) {
//		dispbottom has_instance2("guild_vs2") +" destroy";
		instance_destroy has_instance2("guild_vs2");
	}
	if ( ( [email protected] = instance_create( "Test Instance", getcharid(CHAR_ID_ACCOUNT), IOT_CHAR ) ) < 0 ) {
		mes "error : "+ [email protected];
		close;
	}
	if ( !getstrlen( instance_attachmap( "guild_vs2", [email protected], true, ( getcharid(CHAR_ID_ACCOUNT) )+"INST" ) ) ) {
		mes "error : 5";
		instance_destroy [email protected];
		close;
	}
	instance_set_timeout 3600, 15, [email protected];
	instance_init [email protected];
	warp has_instance("guild_vs2"), 49,49;
	end;
}
guild_vs2,49,49,5	script	test dialog	1_F_MARIA,{
	dispbottom strnpcinfo(NPC_MAP);
	mesf "%d monsters on this map", 'amount;
	next;
	select "Destroy";
	instance_destroy;
	end;
OnInstanceInit:
	monster has_instance("guild_vs2"), 49,49, "--ja--", PORING, 10, instance_npcname( strnpcinfo(NPC_NAME) )+"::OnMobDead";
	'amount = 10;
	end;
OnMobDead:
	--'amount;
	if ( !'amount )
		instance_announce -1, "all monster killed", bc_map;
	end;
}

few things noted for hercules ones

1. hercules has more instance related script commands, but also make this more flexible to write once you learn them all
a. hercules has *instance_attach script command, make sure this script command is added before trying do anything instance related in the register npc
b. hercules has to emulate the map name with *instance_attachmap if the map name doesn't follow the syntax <number>@<5 string limit>

2. hercules instance ID start from 0, rathena instance ID start from 1
a. make sure the instance_announce is set to -1

3. hercules seems cannot *instance_destroy inside the instance map itself ... has to rely on *instance_set_timeout of the timeout value

Share this post


Link to post
Share on other sites
  • 0

Existing instances no help to you?

Share this post


Link to post
Share on other sites
  • 0
On 5/17/2018 at 8:34 AM, AnnieRuru said:

similar topic appear in rathena forum

prontera,155,180,0	script	Test Instance	1_F_MARIA,{
	if ( has_instance2("guild_vs2") >= 0 ) {
//		dispbottom has_instance2("guild_vs2") +" destroy";
		instance_destroy has_instance2("guild_vs2");
	}
	if ( ( [email protected] = instance_create( "Test Instance", getcharid(CHAR_ID_ACCOUNT), IOT_CHAR ) ) < 0 ) {
		mes "error : "+ [email protected];
		close;
	}
	if ( !getstrlen( instance_attachmap( "guild_vs2", [email protected], true, ( getcharid(CHAR_ID_ACCOUNT) )+"INST" ) ) ) {
		mes "error : 5";
		instance_destroy [email protected];
		close;
	}
	instance_set_timeout 3600, 15, [email protected];
	instance_init [email protected];
	warp has_instance("guild_vs2"), 49,49;
	end;
}
guild_vs2,49,49,5	script	test dialog	1_F_MARIA,{
	dispbottom strnpcinfo(NPC_MAP);
	mesf "%d monsters on this map", 'amount;
	next;
	select "Destroy";
	instance_destroy;
	end;
OnInstanceInit:
	monster has_instance("guild_vs2"), 49,49, "--ja--", PORING, 10, instance_npcname( strnpcinfo(NPC_NAME) )+"::OnMobDead";
	'amount = 10;
	end;
OnMobDead:
	--'amount;
	if ( !'amount )
		instance_announce -1, "all monster killed", bc_map;
	end;
}

few things noted for hercules ones

1. hercules has more instance related script commands, but also make this more flexible to write once you learn them all
a. hercules has *instance_attach script command, make sure this script command is added before trying do anything instance related in the register npc
b. hercules has to emulate the map name with *instance_attachmap if the map name doesn't follow the syntax <number>@<5 string limit>

2. hercules instance ID start from 0, rathena instance ID start from 1
a. make sure the instance_announce is set to -1

3. hercules seems cannot *instance_destroy inside the instance map itself ... has to rely on *instance_set_timeout of the timeout value

Thanks alot <3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0