Jump to content
  • 0
Sign in to follow this  
karazu

Another Devil Square (MAKE IT AUTOMATED)

Question

Can someone please make it an automated event?

According to  Goddameit its working in Hercules.

SOURCE
 

https://rathena.org/board/topic/102134-another-devil-square/#entry285737 

 

//////	Author		Goddameit//	Version		2015/06/10//	Web		http://goo.gl/0vY9GV//////-------------------------------------------------------////-------------------------------------------------------////---------------------Reward Setting--------------------////-------------------------------------------------------////-------------------------------------------------------//ordeal_1-1, 149, 149, 4	script	#DevilSquarewarp2zoon6	1324,{	warp "prontera", 150, 180;	getitem 607, 1;	end;}//-------------------------------------------------------////-------------------------------------------------------////---------------------NPC location----------------------////-------------------------------------------------------////-------------------------------------------------------//prontera,150,180,4	script	Another Devil Square	100,{	callsub OnPlayerClickNPC;//-------------------------------------------------------////-------------------------------------------------------////---------------------Level Setting---------------------////-------------------------------------------------------////-------------------------------------------------------//OnSpawnMob:	switch(getarg(0,0)) {		case 1:			switch(getarg(1,0)) {				case 1:					callsub OnTimeLeftAnnounce, 100;					callsub OnSMob, 234, 61, 245, 52, 1002, 2;					break;				case 2:					callsub OnTimeLeftAnnounce, 100;					callsub OnSMob, 234, 61, 245, 52, 1002, 1;					callsub OnSMob, 234, 61, 245, 52, 1083, 1;					break;				case 3:					callsub OnTimeLeftAnnounce, 100;					callsub OnSMob, 234, 61, 245, 52, 1002, 10;					break;				case 4:					callsub OnTimePauseDelay, 30;					enablenpc "#DevilSquarewarp2zoon2";					break;			}			break;		case 2:			switch(getarg(1,0)) {				case 1:					callsub OnTimePauseDelay, 10;					enablenpc "#DevilSquarewarp2zoon3";					break;			}			break;		case 3:			switch(getarg(1,0)) {				case 1:					callsub OnTimePauseDelay, 10;					enablenpc "#DevilSquarewarp2zoon4";					break;			}			break;		case 4:			switch(getarg(1,0)) {				case 1:					callsub OnTimePauseDelay, 10;					enablenpc "#DevilSquarewarp2zoon5";					break;			}			break;		case 5:			switch(getarg(1,0)) {				case 1:					callsub OnTimeLeftAnnounce, 100;					callsub OnSMob, 140, 140, 160, 160, 1099, 3;					break;			}			break;					default: // Game Over, go to reward			mapannounce "ordeal_1-1", "[Devil Square]: You win!!", bc_map, 0x00FF00, 400, 18;			enablenpc "#DevilSquarewarp2zoon6";			stopnpctimer;			sleep2 5000;			callsub OnEndd;			break;	}	if(.wave_complete == 1) { // No more wave on this level		.game_level++;		.game_wave = 0;	}	return;//-------------------------------------------------------////-------------------------------------------------------////-------------------------------------------------------////-------------------------------------------------------////---I guess you don't need to care about below things---////-------------------------------------------------------////-------------------------------------------------------////-------------------------------------------------------////-------------------------------------------------------//OnPlayerClickNPC:	if(getgroupid() >= 99) {		switch(prompt("Active", "End", "Nothing")) {			default:				break;			case 1:				callsub OnEndd;				.game_status = 1;				announce "[Devil Square]: GM active this game.", bc_all, 0x00FF00, 400, 18;				break;			case 2:				callsub OnEndd;				announce "[Devil Square]: GM close this game.", bc_all, 0x00FF00, 400, 18;				break;		}	}	if(.game_status == 0) {		mes "This game doesn't be actived yet.";		close;	}	if(.game_status >= 3) {		mes "This game is running";		close;	}	for(.@i = 0; .@i < .game_player_num; .@i++) {		if(.game_player_name$[.@i] == strcharinfo(0)) {			mes "You have already joined this game";			close;		}	}	if(prompt("Join", "Leave") != 1) {		close;	}	if(.game_status == 0) {		mes "This game doesn't be actived yet.";		close;	}	if(.game_status >= 3) {		mes "This game is running";		close;	}	if(.game_player_name$[0] == "") {		.game_player_num = 1;		.game_player_name$[0] = strcharinfo(0);		query_sql "SELECT DATE_FORMAT(TIMESTAMPADD(SQL_TSI_SECOND, "+.time_joining+", NOW( )), '%T'), CURTIME( )", .@time_fstr$, .@time_nstr$;		announce "[Devil Square]: Game will start at "+.@time_fstr$+" (Now: "+.@time_nstr$+")", bc_all, 0x00FF00, 400, 18;		.time_delay = gettimetick(2) + .time_joining;		.game_status = 2;		initnpctimer;	} else {		.game_player_name$[.game_player_num] = strcharinfo(0);		.game_player_num++;	}	mes "Done";	close;	end;OnTimer5000:	if(.time_delay <= gettimetick(2)) {		if(.game_status == 2) { // Warp player to zone 1			.game_status = 3;			killmonsterall "ordeal_1-1";			for(.@i = 0; .@i < .game_player_num; .@i++)				warpchar "ordeal_1-1", 186, 112, getcharid(0, .game_player_name$[.@i]); // zone 1 enter			.game_level = 1;			.game_wave = 1;			callsub OnSpawnMob, .game_level, .game_wave;		} else if(.game_status == 3) { // Loop check level and wave			if(.wave_complete == 0) {				mapannounce "ordeal_1-1", "[Devil Square]: You lose!!", bc_map, 0x00FF00, 400, 18;				.game_status = 0;				sleep2 30000;				callsub OnEndd;			} else {				.game_wave++;				callsub OnSpawnMob, .game_level, .game_wave;			}		} else			;	}	if(.game_status != 0)		initnpctimer;	else		stopnpctimer;	end;OnSMob:	areamonster "ordeal_1-1",getarg(0),getarg(1),getarg(2),getarg(3),"--en--",getarg(4),getarg(5),strnpcinfo(0)+"::OnMobKill";	return;OnMobKill:	if(.game_status == 0)		end;	sleep2 1000;	.@left = mobcount("ordeal_1-1", strnpcinfo(0)+"::OnMobKill");	if(.@left <= 0) {		.time_delay = 0;		.wave_complete = 1;	}	mapannounce "ordeal_1-1", "[Devil Square]: Remain "+.@left+" Mob"+(.@left > 1 ? "s" : ""), bc_map, 0x00FF00, 400, 18;	end;OnTimeLeftAnnounce:	sleep2 1000;	query_sql "SELECT DATE_FORMAT(TIMESTAMPADD(SQL_TSI_SECOND, "+getarg(0)+", NOW( )), '%T'), CURTIME( )", .@time_fstr$, .@time_nstr$;	mapannounce "ordeal_1-1", "[Devil Square]: Level:"+.game_level+"-"+.game_wave+" will end at "+.@time_fstr$+" (Now: "+.@time_nstr$+")", bc_map, 0x00FF00, 400, 18;	.time_delay = gettimetick(2) + getarg(0);	.wave_complete = 0;	sleep2 5000;	initnpctimer;	return;OnTimePauseDelay:	query_sql "SELECT DATE_FORMAT(TIMESTAMPADD(SQL_TSI_SECOND, "+getarg(0)+", NOW( )), '%T'), CURTIME( )", .@time_fstr$, .@time_nstr$;	mapannounce "ordeal_1-1", "[Devil Square]: Game will start at "+.@time_fstr$+" (Now: "+.@time_nstr$+")", bc_map, 0x00FF00, 400, 18;	.time_delay = gettimetick(2) + getarg(0);	initnpctimer;	return;OnEndd:	disablenpc "#DevilSquarewarp2zoon2";	disablenpc "#DevilSquarewarp2zoon3";	disablenpc "#DevilSquarewarp2zoon4";	disablenpc "#DevilSquarewarp2zoon5";	disablenpc "#DevilSquarewarp2zoon6";	killmonsterall "ordeal_1-1";	deletearray .game_player_name$;	.game_player_num = 0;	.game_status = 0;	.time_delay = 0;	.wave_complete = 0;	.game_level = 0;	.game_wave = 0;	getmapxy .@m$, .@x, .@y, 1, strnpcinfo(0);	mapwarp "ordeal_1-1", .@m$, .@x, .@y;	stopnpctimer;	return;OnInit:	callsub OnEndd;	.time_joining = 100; // How long that game will start after first join. (second)	end;}ordeal_1-1, 245, 51, 4	script	#DevilSquarewarp2zoon2	45,3,3,{	warp "ordeal_1-1", 98, 148;	end;}ordeal_1-1, 26, 150, 4	script	#DevilSquarewarp2zoon3	45,3,3,{	warp "ordeal_1-1", 149, 98;	end;}ordeal_1-1, 150, 25, 4	script	#DevilSquarewarp2zoon4	45,3,3,{	warp "ordeal_1-1", 201, 150;	end;}ordeal_1-1, 274, 150, 4	script	#DevilSquarewarp2zoon5	45,3,3,{	warp "ordeal_1-1", 149, 149;	end;} 



Thank you!

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

replace this

    if(.game_player_name$[0] == "") {        .game_player_num = 1;        .game_player_name$[0] = strcharinfo(0);        query_sql "SELECT DATE_FORMAT(TIMESTAMPADD(SQL_TSI_SECOND, "+.time_joining+", NOW( )), '%T'), CURTIME( )", .@time_fstr$, .@time_nstr$;        announce "[Devil Square]: Game will start at "+.@time_fstr$+" (Now: "+.@time_nstr$+")", bc_all, 0x00FF00, 400, 18;        .time_delay = gettimetick(2) + .time_joining;        .game_status = 2;        initnpctimer;    } else {        .game_player_name$[.game_player_num] = strcharinfo(0);        .game_player_num++;    }

  with

		.game_player_name$[.game_player_num] = strcharinfo(0);		.game_player_num++;		if(.game_status < 2) {			query_sql "SELECT DATE_FORMAT(TIMESTAMPADD(SQL_TSI_SECOND, "+.time_joining+", NOW( )), '%T'), CURTIME( )", .@time_fstr$, .@time_nstr$;			announce "[Devil Square]: Game will start at "+.@time_fstr$+" (Now: "+.@time_nstr$+")", bc_all, 0x00FF00, 400, 18;			.time_delay = gettimetick(2) + .time_joining;			.game_status = 2;			initnpctimer;		}

then add this

OnClock<hour><minute>:	if(.game_status) end;	query_sql "SELECT DATE_FORMAT(TIMESTAMPADD(SQL_TSI_SECOND, "+.time_joining+", NOW( )), '%T'), CURTIME( )", .@time_fstr$, .@time_nstr$;	announce "[Devil Square]: Game will start at "+.@time_fstr$+" (Now: "+.@time_nstr$+")", bc_all, 0x00FF00, 400, 18;	.time_delay = gettimetick(2) + .time_joining;	.game_status = 2;	initnpctimer;	end;

 



the 'OnClock<hour><minute>:' is your automated event starting time

Edited by Angelmelody

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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