Jump to content
  • 0

How to proper make instance generator? Current script can spam enter.. [SOLVED]


rakuzas

Question


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.03
  • Content Count:  459
  • Reputation:   7
  • Joined:  06/29/12
  • Last Seen:  

Hello,

May I know what is the proper script to generate instance? I follow some instance example and working script for generate instance.. But somehow its not properly making cooling down.. So player can keep spamming entering the dungeon.. Tried few days to figure it out and asked some advise around but still can spam (can keep entering after respawn in town).. Please guide me.. 

Sample Instance Generator Script : 

prontera,50,50,11	script	Instance Generator	10056,{
		set .@instance_time,checkquest(66003,PLAYTIME); //23 Hours
			if (.@instance_time == 2) {
				erasequest 66003;
				end;
			}
			else  if ((.@instance_time == 1) || (.@instance_time == 0)) {
				mes "^You must wait 23 hours before we can infiltrate the Prison again.^000000";
				close;
			}
			else if (.@instance_time == -1) {
				set .@party_id,getcharid(1);
				set .@p_name$,getpartyname(.@party_id);
				set .@md_name$,"Test Instance";
				
				if (!instance_check_party(.@party_id,1)) {
					mes "Make a party";
					close;
				}
				if (getcharid(0) == getpartyleader(.@party_id,2))
					set .@menu$, "Generate Instance:Enter Test Instance:Cancel";
				else
				set .@menu$, ":Enter Test Instance:Cancel";
				switch(select(.@menu$)) 
				{
				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 "^ff0000Preparing..^000000";
					mes "^ff0000Please wait!^000000";
					close;
				case 2:
					switch(instance_enter(.@md_name$))
					{
						case 0:
							if (getcharid(0) == getpartyleader(.@party_id,2)) {
								if(prison_instance == 0) {
									mapannounce "prontera",strcharinfo(0)+", member of the party "+.@p_name$+" entered the instance "+.@md_name$+".",bc_map,"0x00ff99";
									setquest 66003;
									specialeffect2 EF_WARP;
									end;
								} else {
									mapannounce "prontera",strcharinfo(0)+", member of the party "+.@p_name$+" entered the instance "+.@md_name$+".",bc_map,"0x00ff99";
									setquest 66003;
									set prison_instance,0;
									specialeffect2 EF_WARP;
									end;
								}
							} else {
								if(prison_instance == 0) {
									mes "[Escaped Prisoner]";
									mes "Start in the moment!";
									next;
									mes "^ff0000You cannot enter again till 23 hours has passed!^000000";
									next;
									mes "^ff0000The party leader did not generate a instance in time.^ff0000";
									mapannounce "prontera",strcharinfo(0)+", member of the party "+.@p_name$+" entered the instance "+.@md_name$+".",bc_map,"0x00ff99";
									setquest 66003;
									specialeffect2 EF_WARP;
									sleep2 1000;
									close;
								} else {
									mes "[Escaped Prisoner]";
									mes "Start in the moment!";
									set prison_instance,0;
									next;
									mes "^ff0000You cannot enter again till 23 hours has passed!^000000";
									next;
									mes "^ff0000The party leader did not generate a instance in time.^ff0000";
									mapannounce "prontera",strcharinfo(0)+", member of the party "+.@p_name$+" entered the instance "+.@md_name$+".",bc_map,"0x00ff99";
									setquest 66003;
									specialeffect2 EF_WARP;
									sleep2 1000;
									close;
								}
							}
						//custom @ official server kRO simple when click nothing happens.
						case 1:
							mes "Only the registered members can enter the instance "+.@md_name$+".";
							close;
						case 2:
							mes "The memorial dungeon "+.@md_name$+" does not exist.";
							mes "The party leader did not generate the dungeon yet.";
							close;
						case 3:
							mes "Unkwnon error";
							close;
					}
				case 3:
					close;	
				}
			} else {
		mes "^ff0000ERROR 503 : Please report to admin!^000000";
		close;
	}
}

Sample db/re/quest_db.txt : 

// Sample Instance
66002,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Memorial Dungeon: Test Instance"
66003,82800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"Test Instance Exploration"

Sample db/re/instance_db.txt

105,Test Instance,3600,300,1@prison,245,16


EDIT : SOLVED. Thanks to @Ninja for spending his valueable time to help me and guide me.. /no1 For those who seek custom scripter, I highly recommend him.

Edited by rakuzas
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

×
×
  • Create New...