Jump to content
  • 0

timer


cadz

Question


  • Group:  Members
  • Topic Count:  83
  • Topics Per Day:  0.02
  • Content Count:  243
  • Reputation:   1
  • Joined:  08/29/12
  • Last Seen:  

hi i would like to request a timer when lms starts you will have 10mins of killing then if 10mins passed by and there's still people inside the LMS the most kill will win.

 

-	script	LMS#disable	-1,{

OnInit:
disablenpc "Mr.Banker";
disablenpc "All Job Manager";

end;
}

-	script	LMS	-1,{

OnClock0045:
OnClock0245:
OnClock0445:
OnClock0645:
OnClock0845:
OnClock1045:
OnClock1245:
OnClock1445:
OnClock1645:
OnClock1845:
OnClock2045:
OnClock2245:

startlmsevent:
announce "Mr. Manager: The Last Man Standing event will be starting shortly.",0;
sleep2 10000;
announce "Mr. Manager: Those who want to play, please proceed to Prontera and Register.",0;
sleep2 10000;
announce "Mr. Manager: After 1 Minute the Registration will close.",0;
sleep2 10000;
announce "Mr. Manager: Please go to Prontera and Register now if you want to join.",0;
enablenpc "All Job Manager";
initnpctimer;
end;

OnTimer30000:
announce "Mr. Manager: Last 30 seconds.",0;
sleep2 5000;
announce "Mr. Manager: If you want to join please Register in Prontera.",0;
end;

OnTimer50000:
announce "Mr. Manager: Last 10 seconds.",0;
end;

OnTimer55000:
announce "Mr. Manager: 5.",0;
end;

OnTimer56000:
announce "Mr. Manager: 4.",0;
end;

OnTimer57000:
announce "Mr. Manager: 3.",0;
end;

OnTimer58000:
announce "Mr. Manager: 2.",0;
end;

OnTimer59000:
announce "Mr. Manager: 1.",0;
end;

OnTimer60000:
announce "Mr. Manager: Time's up.",0;
end;

OnTimer61000:
disablenpc "All Job Manager";
donpcevent "Mr.Banker::OnEnable";
stopnpctimer;
end;
}
//---------All Job Registration---------------
prontera,155,181,5	script	All Job Manager	106,{

if( Class == Job_Novice ){
   mes "Novice cant join.";
   close;
}

if ( getcharid(1) ) {
   mes "You have a party you cannot enter";
   close;
}

mes "[Mr. Manager]";
mes "Hello What can I do for you?";
next;

menu "Register",-,"What is LMS?",what,"Leave",leave;
next;
mes "[Mr. Manager]";
mes "Thankyou for registering Mr. " + strcharinfo(0) + ", Have fun!";
warp "1@pump",0,0;
end;
what:
mes "[Mr. Manager]";
mes "LMS is also known as Last Man Standing Event";
next;
mes "[Mr. Manager]";
mes "LMS is also like a PvP.";
mes "The only difference is at LMS you will TCG Card if you are the Last Man Standing at the arena.";
next;
mes "[Mr. Manager]";
mes "That's all";
close;
leave:
mes "[Mr. Manager]";
mes "I hope you will register next time";
close;


}

//--------------------------

//--------------------------
1@pump,52,99,6	script	Mr.Banker	56,{

mes "[Banker]";
mes "Congrats. You've won.";
next;
announce "Mr. Manager: We have a winner! well done "+strcharinfo(0)+".",0;
getitem 7227,50;
getitem 12103,1; // Change This item id to what ever you want . item id,amount
getitem 7829,10;
getitem 7828,10;
mes "You will return now";
warp "prontera",155,182;
atcommand "@alive";
disablenpc "Mr.Banker";
close;
end;
OnEnable:
pvpoff "1@pump";
mapannounce "1@pump","Mr. Manager:The Last Man Standing Event will start shortly",0;
sleep2 10000;
mapannounce "1@pump","Mr. Manager:But before we start this is just a few reminders..",0;
sleep2 10000;
mapannounce "1@pump","Mr. Manager: Only the Last Man Standing will win this event!!",0;
sleep2 10000;
mapannounce "1@pump","Mr. Manager: What are we waiting for?..Let's Get Ready to Rumble!!...",0;
sleep2 10000;
goto L_Start;
end;
L_Start:
if(getmapusers("1@pump") == 1) goto L_Champ;
if(getmapusers("1@pump") == 0) goto L_None;
if(getmapusers("1@pump") > 1) {
mapannounce "1@pump","Mr. Manager: Get ready at the count of 5 we will start!....",0;
sleep2 10000;
mapannounce "1@pump","Mr. Manager: 5",0;
sleep2 5000;
mapannounce "1@pump","Mr. Manager: 4",0;
sleep2 4000;
mapannounce "1@pump","Mr. Manager: 3",0;
sleep2 3000;
mapannounce "1@pump","Mr. Manager: 2",0;
sleep2 2000;
mapannounce "1@pump","Mr. Manager: 1",0;
sleep2 1000;
pvpon "1@pump";
goto timer;
end;
}
timer:
initnpctimer;
end;

OnTimer1000:
end;

OnTimer1100:
if(getmapusers("1@pump") == 1) goto L_Champ;
if(getmapusers("1@pump") > 2) goto timer;
if(getmapusers("1@pump") == 2) goto champ;
stopnpctimer;
end;

champ:
announce "Mr. Manager: Last 2 Brave warriors are still alive!",0;
sleep2 10000;
if(getmapusers("1@pump") == 1) goto L_Champ;
if(getmapusers("1@pump") > 1) goto timer;
end;

L_Champ:
mapannounce "1@pump","Mr.Banker: Please talk to me to get your prize..",0;
pvpoff "1@pump";
enablenpc "Mr.Banker";
end;

L_None:
disablenpc "Banker";
pvpoff "1@pump";
end;
}
//----- Die = warp prt -----
-	script	Killa_warp	-1,{

OnPCDieEvent:
	getmapxy(.@map$,.@x,.@y,0);
	if(.@map$=="1@pump")
	{
		set #kill_point, 0;
		announce ""+strcharinfo(0)+" died, and out of the game!.",bc_all;
		warp "prontera",150,150;
		atcommand "@alive";
		end;
	}
OnPCKillEvent:
	getmapxy(.@map$,.@x,.@y,0);
	if(.@map$=="1@pump")
	{
	set #kill_point,#kill_point+1;
	if ( #kill_point % 4 == 0) {
	announce ""+strcharinfo(0)+" have made 4 Consecutive Kills!!He will be granted an item",bc_all;
	getitem 7829,10;
	getitem 7828,10;
	end;
	}
	}
	}


// == Mapflags
1@pump	mapflag	nowarp
1@pump	mapflag	nowarpto
1@pump	mapflag	noteleport
1@pump	mapflag	nosave
1@pump	mapflag	nomemo
1@pump	mapflag	nobranch
1@pump	mapflag	pvp_noparty
1@pump	mapflag	partylock





//	....... if your server has { Overwriting user function [int__] } don't blame me ..........
function	script	int__	{
	set .@num, atoi(getarg(0)+"");
	if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0);
	set .@l, getstrlen(.@num+"");
	for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) {
		set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$;
		if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$;
	}
	return .@num$;
}

 



thanks in advance =) welcome back rathena!

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Try this :

-	script	LMS_npc	-1,{

OnClock0045:
OnClock0245:
OnClock0445:
OnClock0645:
OnClock0845:
OnClock1045:
OnClock1245:
OnClock1445:
OnClock1645:
OnClock1845:
OnClock2045:
OnClock2245:
	announce "Mr. Manager: The Last Man Standing event will be starting shortly.",0;
	sleep 10000;
	announce "Mr. Manager: Those who want to play, please proceed to Prontera and Register.",0;
	sleep 10000;
	announce "Mr. Manager: After 1 Minute the Registration will close.",0;
	sleep 10000;
	announce "Mr. Manager: Please go to Prontera and Register now if you want to join.",0;
	enablenpc "All Job Manager";
	sleep 30000;
	announce "Mr. Manager: Last 30 seconds.",0;
	sleep 5000;
	announce "Mr. Manager: If you want to join please Register in Prontera.",0;
	sleep 15000;
	announce "Mr. Manager: Last 10 seconds.",0;
	sleep 5000;
	for( set .@i, 5; .@i > 0; set .@i, .@i -1 ) {
		announce "Mr. Manager: "+ .@i +".",0;
		sleep 1000;
	}
	announce "Mr. Manager: Time's up.",0;
	sleep 1000;
	disablenpc "All Job Manager";
	donpcevent "All Job Manager::OnEnable";
	end;
OnInit:
	disablenpc "Mr.Banker";
	disablenpc "All Job Manager";
	disablenpc "Killa_warp";
	end;
}

//---------All Job Registration---------------
prontera,155,181,5	script	All Job Manager	106,{
	if( Class == Job_Novice ){
	   mes "Novice cant join.";
	   close;
	}
	else if ( getcharid(1) ) {
	   mes "You have a party you cannot enter";
	   close;
	}
	mes "[Mr. Manager]";
	mes "Hello What can I do for you?";
	next;

	menu "Register",-,"What is LMS?",what,"Leave",leave;
	next;
	mes "[Mr. Manager]";
	mes "Thank you for registering Mr. " + strcharinfo(0) + ", Have fun!";
	close2;
	warp "1@pump",0,0;
	if( .size ) {
		while( .@i < .size && .name_reg$[.@i] != strcharinfo(0) ) set .@i, .@i +1;
		if( .@i == .size ) end;
	}
	.aid_reg[.size] = getcharid(3);
	.name_reg$[.size] = strcharinfo(0);
	.size++;
	#kill_point = 0;
	end;
what:
	mes "[Mr. Manager]";
	mes "LMS is also known as Last Man Standing Event";
	next;
	mes "[Mr. Manager]";
	mes "LMS is also like a PvP.";
	mes "The only difference is at LMS you will TCG Card if you are the Last Man Standing at the arena.";
	next;
	mes "[Mr. Manager]";
	mes "That's all";
	close;
leave:
	mes "[Mr. Manager]";
	mes "I hope you will register next time";
	close;
OnEnable:
	pvpoff "1@pump";
	mapannounce "1@pump","Mr. Manager: The Last Man Standing Event will start shortly",0;
	sleep 10000;
	mapannounce "1@pump","Mr. Manager: But before we start this is just a few reminders..",0;
	sleep 10000;
	mapannounce "1@pump","Mr. Manager: Only the Last Man Standing will win this event!!",0;
	sleep 10000;
	mapannounce "1@pump","Mr. Manager: What are we waiting for?..Let's Get Ready to Rumble!!...",0;
	sleep 10000;

	if(getmapusers("1@pump") == 1) goto L_Champ;
	else if(getmapusers("1@pump") == 0) end;
	else if(getmapusers("1@pump") > 1) {
		mapannounce "1@pump","Mr. Manager: Get ready at the count of 5 we will start!....",0;
		sleep 1000;
		for( set .@i, 5; .@i > 0; set .@i, .@i -1 ) {
			mapannounce "1@pump","Mr. Manager: "+ .@i +" !",0;
			sleep 1000;
		}
		pvpon "1@pump";
		enablenpc "Killa_warp";
		initnpctimer;
	}
L_loop:
	sleep 2000;
	if(getmapusers("1@pump") == 1) {	// winner
	L_Champ:
		mapannounce "1@pump","Mr.Banker: Please talk to me to get your prize..",0;
		pvpoff "1@pump";
		enablenpc "Mr.Banker";
		stopnpctimer;
		sleep 60000;
		goto L_disable;
	}
	else if(getmapusers("1@pump") == 2) {
		announce "Mr. Manager: Last 2 Brave warriors are still alive!",0;
		sleep 10000;
		if(getmapusers("1@pump") == 1) goto L_Champ;
		else if(getmapusers("1@pump") > 1) goto L_loop;
	}
	else if(getmapusers("1@pump") > 2) goto L_loop;
L_disable:
	mapwarp "1@pump", "prontera",155,182;
	disablenpc "Mr.Banker";
	disablenpc "Killa_warp";
	stopnpctimer;
	deletearray .aid_reg;
	deletearray .name_reg$;
	.size = 0;
	end;
OnTimer600000:		// out of time
	announce "Mr. Manager: Out of time ! End of the event !", 0;
	for ( .@i = 0; .@i < .size; .@i++ )
		if( !getmapxy( .@map$, .@x, .@y, 0, .name_reg$[.@i] ) && .@map$ == "1@pump" ) {
			attachrid .aid_reg[.@i];
			if ( .@points <= #kill_point ) {
				.@points = #kill_point;
				.@winner = .aid_reg[.@i];
				.@winner_name$ = .name_reg$[.@i];
			}
		}
	detachrid;
	announce "Mr. Manager: We have a winner! well done "+ .@winner_name$ +".",0;
	getitem 7227,50, .@winner;
	getitem 12103,1, .@winner; // Change This item id to what ever you want . item id,amount
	getitem 7829,10, .@winner;
	getitem 7828,10, .@winner;
	sleep 1000;
	goto L_disable;
}

1@pump,52,99,6	script	Mr.Banker	56,{
	mes "[Banker]";
	mes "Congrats. You've won.";
	close2;
	announce "Mr. Manager: We have a winner! well done "+strcharinfo(0)+".",0;
	getitem 7227,50;
	getitem 12103,1; // Change This item id to what ever you want . item id,amount
	getitem 7829,10;
	getitem 7828,10;
	warp "prontera",155,182;
	disablenpc "Mr.Banker";
	disablenpc "Killa_warp";
	end;
}
//----- Die = warp prt -----
-	script	Killa_warp	-1,{

OnPCDieEvent:
	if( strcharinfo(3) == "1@pump" ) {
		set #kill_point, 0;
		announce ""+strcharinfo(0)+" died, and out of the game!.",bc_all;
		warp "prontera",150,150;
	}
	end;
OnPCKillEvent:
	if( strcharinfo(3) =="1@pump") {
		set #kill_point,#kill_point+1;
		if ( #kill_point % 4 == 0) {
			announce ""+strcharinfo(0)+" have made 4 Consecutive Kills!!He will be granted an item",bc_all;
			getitem 7829,10;
			getitem 7828,10;
		}
	}
	end;
}


// == Mapflags
1@pump	mapflag	nowarp
1@pump	mapflag	nowarpto
1@pump	mapflag	noteleport
1@pump	mapflag	nosave
1@pump	mapflag	nomemo
1@pump	mapflag	nobranch
1@pump	mapflag	pvp_noparty
1@pump	mapflag	partylock
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  83
  • Topics Per Day:  0.02
  • Content Count:  243
  • Reputation:   1
  • Joined:  08/29/12
  • Last Seen:  

i check the script but the npc that give the prize didnt show up

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

Capuche, can we use this?

 

OnInit:
set .Time,10;	
Edited by uDe
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

i check the script but the npc that give the prize didnt show up

It shows up when I try.. weird. Do you have any error on mapserv console ?

 

@uDe

I don't get what you mean

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