Jump to content
  • 0
Sign in to follow this  
Helena

How to do this? Don't allow @load to this town for non-castle owners

Question

Hello all.

 

I have a request to ask. The idea is pretty simple, I am using a shared guild town for players that are victors of the war of emperium, i want to initiate a few checks, but im not sure how to merge them.

 

1) no one can @load if WoE is active

2) if woe is not active only guild possessors can @load.

 

This is what I got so far, it works (1) but I dont know how to initiate (2) the castle owners only warp. I thought i figured it out, but unfortunately it isn't working. Players who are not in a guild or in a guild that doesnt own the castle, can still warp inside.

 

What did i miss? Thanks a lot for the help! ^^

 

-	script	SiegeWarp	-1,{OnInit:    setmapflag "guildtown", mf_loadevent;	set .map_list$, "guildtown";	end; OnPCLoadMapEvent:if ( compare( .map_list$,strcharinfo(3) ) == 0 ) end;	if(agitcheck()){	dispbottom "you can not warp into the War Town map while the War of Emperium is active";	SavePoint "prontera",156,184;	warp "prontera",156,184;	end; if (getcharid(2) != 0 && getcharid(2) == getcastledata("prtg_cas01",1)) {	warp "guildtown",91,102;	end;}if (getcharid(2) != 0 && getcharid(2) == getcastledata("payg_cas01",1)) {	warp "guildtown",91,102;	end;}if (getcharid(2) != 0 && getcharid(2) == getcastledata("aldeg_cas04",1)) {	warp "guildtown",91,102;	end;}if (getcharid(2) != 0 && getcharid(2) == getcastledata("gefg_cas04",1)) {	warp "guildtown",91,102;	end;} dispbottom "you can only enter this map if you are in one of the Guilds that hold a castle!";	sleep2 1000;	atcommand "@refresh";	end; }}

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

can I ask ... why not just use guild instance system ?

hercules emulator can do it

Share this post


Link to post
Share on other sites
  • 0

can I ask ... why not just use guild instance system ?

hercules emulator can do it

 

I'm not sure how to apply that to this script... I've never used instance systems before. :(

Share this post


Link to post
Share on other sites
  • 0

GmOcean gonna drool over this :D

prontera,158,180,0	script	Guild Town	123,{	if ( has_instance2( "guild_vs2" ) >= 0 ) {		warp has_instance( "guild_vs2" ), 0,0;		end;	}	if ( !getcharid(2) ) {		mes "need a guild";		close;	}	if ( agitcheck() || agitcheck2() ) {		mes "woe in progress";		close;	}	if ( getcastledata( "prtg_cas01", 1 ) != getcharid(2) && getcastledata( "payg_cas01", 1 ) != getcharid(2) && getcastledata( "aldeg_cas04", 1 ) != getcharid(2) && getcastledata( "gefg_cas04", 1 ) != getcharid(2) ) {		mes "you need to hold a castle to gain access to guild town map";		close;	}	if ( ( .@ins = instance_create( "Guild Town", getcharid(2), IOT_GUILD ) ) < 0 ) {		mes "error : "+ .@ins;		close;	}	if ( instance_attachmap( "guild_vs2", .@ins, 1, getcharid(2)+"gtown" ) == "" ) {		mes "error : 5";		instance_destroy .@ins;		close;	}	instance_set_timeout 0, 0, .@ins;	instance_init .@ins;	instance_attach .@ins;	.guild_town_id[.count] = .@ins;	.count++;	warp has_instance( "guild_vs2" ), 0,0;	end;OnAgitStart:	for ( .@i = 0; .@i < .count; .@i++ )		instance_destroy .guild_town_id[.@i];	deletearray .guild_town_id;	.count = 0;	end;}guild_vs2	mapflag	nowarptoguild_vs2	mapflag	nomemoguild_vs2	mapflag	nosave	SavePoint
change guild_vs2 into guild_town

Share this post


Link to post
Share on other sites
  • 0

 

GmOcean gonna drool over this :D

prontera,158,180,0	script	Guild Town	123,{	if ( has_instance2( "guild_vs2" ) >= 0 ) {		warp has_instance( "guild_vs2" ), 0,0;		end;	}	if ( !getcharid(2) ) {		mes "need a guild";		close;	}	if ( agitcheck() || agitcheck2() ) {		mes "woe in progress";		close;	}	if ( getcastledata( "prtg_cas01", 1 ) != getcharid(2) && getcastledata( "payg_cas01", 1 ) != getcharid(2) && getcastledata( "aldeg_cas04", 1 ) != getcharid(2) && getcastledata( "gefg_cas04", 1 ) != getcharid(2) ) {		mes "you need to hold a castle to gain access to guild town map";		close;	}	if ( ( .@ins = instance_create( "Guild Town", getcharid(2), IOT_GUILD ) ) < 0 ) {		mes "error : "+ .@ins;		close;	}	if ( instance_attachmap( "guild_vs2", .@ins, 1, getcharid(2)+"gtown" ) == "" ) {		mes "error : 5";		instance_destroy .@ins;		close;	}	instance_set_timeout 0, 0, .@ins;	instance_init .@ins;	instance_attach .@ins;	.guild_town_id[.count] = .@ins;	.count++;	warp has_instance( "guild_vs2" ), 0,0;	end;OnAgitStart:	for ( .@i = 0; .@i < .count; .@i++ )		instance_destroy .guild_town_id[.@i];	deletearray .guild_town_id;	.count = 0;	end;}guild_vs2	mapflag	nowarptoguild_vs2	mapflag	nomemoguild_vs2	mapflag	nosave	SavePoint
change guild_vs2 into guild_town

 

That is a great script annie, but is there a less complex way to do it? If not then thanks a lot for the help. >.<

(My herc doesnt support these commands hence why i ask for a less complex way.)

Share this post


Link to post
Share on other sites
  • 0

(My herc doesnt support these commands hence why i ask for a less complex way.)

that was the least complex method in writing an instance script o.o

 

anyway

prontera,158,180,0	script	Guild Town	123,{	if ( !getcharid(2) ) {		mes "need a guild";		close;	}	if ( agitcheck() || agitcheck2() ) {		mes "woe in progress";		close;	}	if ( getcastledata( "prtg_cas01", 1 ) != getcharid(2) && getcastledata( "payg_cas01", 1 ) != getcharid(2) && getcastledata( "aldeg_cas04", 1 ) != getcharid(2) && getcastledata( "gefg_cas04", 1 ) != getcharid(2) ) {		mes "you need to hold a castle to gain access to guild town map";		close;	}	warp "guild_vs2",49,49;	end;OnAgitStart:	mapwarp "guild_vs2", "prontera",150,180;	end;}guild_vs2	mapflag	nowarptoguild_vs2	mapflag	nomemoguild_vs2	mapflag	nosave	SavePoint

Share this post


Link to post
Share on other sites

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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.