Jump to content
  • 0
VladimirCastro

gold room 1 a week

Question

2 answers to this question

Recommended Posts

  • 1

Like this?

I was looking at this topic and I think the script would work better like this so the player can enter multiple times throughout the week if he didn't use his 30 minutes up.
prontera,150,150,5	script	gold room	456,{
function t {
function s;
	set [email protected], getarg(0);
	if ( [email protected] <= 0 ) return getarg(0);
	set [email protected], [email protected] / 86400;
	set [email protected], [email protected] % 86400 / 3600;
	set [email protected], [email protected] % 3600 / 60;
	set [email protected], [email protected] % 60;
	return ( ( [email protected] ? [email protected] +" day"+ s( [email protected] ) : "" ) + ( [email protected] ? [email protected] +" hour"+ s( [email protected] ) : "" ) + ( [email protected] ? [email protected] +" min"+ s( [email protected] ) : "" ) + ( [email protected] ? [email protected] +" sec"+ s( [email protected],1 ) : "" ) );
function s { return ( ( getarg(0) > 1 ? "s" : "" ) + ( getarg(1,0) ? "" : " " ) ); }
}
	
	if ( gltimer <= 0 && enter_gold_room < gettimetick(2) ) {
		set gltimer, .glt;
		enter_gold_room = gettimetick(2) + 86400 * .dly;
	} else if ( enter_gold_room > gettimetick(2) && gltimer <= 0 ) {
		mes "I'm sorry you can't enter in the gold room. You must wait "+ t( enter_gold_room - gettimetick(2) )+".";
		close;
	}
	mes "You have "+t( gltimer )+" remaining.";
	select( "enter in the gold room" );
	warp .map$,0,0;
	end;

OnPCLoadMapEvent:
	if(strcharinfo(3)==.map$) {
		attachnpctimer;
		initnpctimer;
	} end;
	
OnTimer1000:
	if( playerattached() ){
		if(strcharinfo(3)!=.map$) {
			stopnpctimer;
			end;
		}
		set gltimer, gltimer-1;
		attachnpctimer; initnpctimer;
		if( gltimer <= 0 ) {
			stopnpctimer;
			warp "prontera",0,0;
			message strcharinfo(0), "end of time for the gold room";
			end;
		}
	}
	end;

OnInit:
	set        .dly ,	7           ; //Delay in days.
	set        .glt ,	1800        ; //Gold Room Timer in seconds.
	set        .map$,	"geffen"    ; //Gold Room map.
	setmapflag .map$,	mf_loadevent;
	end;
	
}
I was also thinking about doing this with a rental item like a pass but I'm not sure if the time is consumed while the player is offline. Edited by Skorm
  • Upvote 1
Link to comment
Share on other sites

Like this?

prontera,150,150,5	script	gold room	456,{
function t {
function s;
	set [email protected], getarg(0);
	if ( [email protected] <= 0 ) return getarg(0);
	set [email protected], [email protected] / 86400;
	set [email protected], [email protected] % 86400 / 3600;
	set [email protected], [email protected] % 3600 / 60;
	set [email protected], [email protected] % 60;
	return ( ( [email protected] ? [email protected] +" day"+ s( [email protected] ) : "" ) + ( [email protected] ? [email protected] +" hour"+ s( [email protected] ) : "" ) + ( [email protected] ? [email protected] +" min"+ s( [email protected] ) : "" ) + ( [email protected] ? [email protected] +" sec"+ s( [email protected],1 ) : "" ) );
function s { return ( ( getarg(0) > 1 ? "s" : "" ) + ( getarg(1,0) ? "" : " " ) ); }
}

	if ( enter_gold_room > gettimetick(2) ) {
		mes "I'm sorry you can't enter in the gold room. you must wait "+ t( enter_gold_room - gettimetick(2) );
		close;
	}
	select( "enter in the gold room" );
	warp "geffen",0,0;	// your gold room map
	attachnpctimer;
	initnpctimer;
	enter_gold_room = gettimetick(2) + 86400 * 7;	// 1 week of delay
	end;
OnTimer1800000:	// 30 mins
	stopnpctimer;
	warp "prontera",0,0;
	message strcharinfo(0), "end of time for the gold room";
	end;
}

Read the comment in the script

Link to comment
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.   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...

Important Information

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