Jump to content
  • 0

treasure box not spawn


YuliChenz

Question


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

please check this script, treasure chests not spawn after killing devil square bos.

//   Made:By Kirlein (Tyirial Script Concept)  //
// Devil Square based off the mmorpg Muonline  //
// Have Fun and feel free to leave suggestions //
//          Leave This intacted                //
// +   Translated by Stillhard aka Dewa        //
// +  Add times for 24 hours of play         //
// +  Add a little bit infos for newbie users  //
//      Completely rewrite by ~AnnieRuru~      //
// +  Tested with rAthena 17101                //
// http://rathena.org/board/topic/77632-devil-square/
/////////////////////////////////////////////////

ayothaya,170,153,5	script	Devil Square	100,{
	mes "[Devil Square Guardian]";
	mes "Welcome to the entrance door to ^FF0000Devil Square^000000";
	mes "If you failed or die, the door will be closed and you have to wait until it start to open again";
	next;
	if ( select ( "Enter", "Info", "Cancel " ) == 3 ) {
		mes "[Devil Square Guardian]";
		mes "See ya";
		close;
	}
	else if ( @menu == 2 ) { // Info
		mes "[Devil Square Guardian]";
		mes "There are 3 level monster you'll encounter";
		mes "Each level the enemies will grow stronger";
		mes "If you succeded to win all 3 level monster, you'll get the opportunity to open 10 Treasure Box with items, equips, and rare cards inside!!";
		close;
	}
	else if ( .start != 1 ) { // time
		mes "[Devil Square Guardian]";
		mes "Devil Square is now closed";
		mes "It'll be open again at:";
		mes "00:00 , 02:00 , 04:00 , 06:00"; // display your time here
		mes "08:00 , 10:00 , 12:00 , 14:00";
		mes "16:00 , 18:00 , 20:00 , 22:00";
		close;
	}
	else if ( baselevel < 70 || zeny < 500000 ) { // requirement
		mes "[Devil Square Guardian]";
		mes "Minimum base level to enter is 70";
		mes "The registration fee is 500,000z";
		close;
	}
	else if ( .register_num >= .register_limit ) { // room FULL
		mes "[Devil Square Guardian]";
		mes "I'm sorry but the Devil Square is FULL";
		mes "Maximum users to enter is "+ .register_limit +" players";
		close;
	}
	zeny = zeny - 500000;
	announce strcharinfo(0)+" has entered the Devil Square", bc_npc;
	percentheal 100,100;
	warp "ordeal_3-1",184,184;
	.register_aid[ .register_num ] = getcharid(3);
	.register_num++;
	end;

OnInit:
	.register_limit = 10; // maximum amount of players can play in this event
	.ann_survive = 30000; // the rate at which announce the players that still survive in devil square, in mili-seconds
	bindatcmd "devilsquare", strnpcinfo(0)+"::Onatcmd", 99,100;
	end;

Onatcmd:
	if ( compare( .@atcmd_parameters$, "on" ) || compare( .@atcmd_parameters$, "start" ) ) {
		if ( .start )
			dispbottom "Devil Square Event already started.";
		else
			goto L_Start;
	}
	else if ( compare( .@atcmd_parameters$, "off" ) || compare( .@atcmd_parameters$, "end" ) ) {
		if ( !.start )
			dispbottom "Devil Square Event not yet start.";
		else
			goto L_End;
	}
	else if ( !.start ) {
		dispbottom "Devil Square Event is currently not running.";
		dispbottom "Use "+ .@atcmd_command$ +" on | start to start the event.";
		dispbottom "Use "+ .@atcmd_command$ +" off | end to end this event";
	}
	else if ( .start == 1 )
		dispbottom "Devil Square Event is currently accepting participations.";
	else
		dispbottom "Devil Square Event is currently running. Currently on Round "+ .round +" with "+ .mob +" mobs left.";
	end;

L_Start:
OnClock0000: // yeah I know about OnMinute ... it just that more people knows better using OnClock
OnClock0200:
OnClock0400:
OnClock0600:
OnClock0800:
OnClock1000:
OnClock1200:
OnClock1400:
OnClock1600:
OnClock1800:
OnClock2000:
OnClock2200:
	if(agitcheck() == 1) end;
	.start = 1;
	disablenpc "Exit#DS";
	mapannounce "ordeal_3-1","Devil Square is now closed", bc_map;
	getmapxy .@map$, .@x, .@y, 1;
	mapwarp "ordeal_3-1", .@map$, .@x, .@y;
	killmonsterall "ordeal_3-1";
	announce "Devil Square is OPENED NOW!! 5 Minutes until it starts..!!", bc_all;
	sleep 60000;
	announce "Devil Square will begin in 4 minutes..!!", bc_all;
	sleep 60000;
	announce "Devil Square will begin in 3 minutes..!!", bc_all;
	sleep 60000;
	announce "Devil Square will begin in 2 minutes..!!", bc_all;
	sleep 60000;
	announce "Devil Square will begin in 1 minutes..!!", bc_all;
	sleep 60000;
	announce "Devil Square is STARTED NOW !!", bc_all;
	if ( !.register_num )
		goto L_End;
	.start = 2;
	donpcevent strnpcinfo(0)+"::OnSurvive";
	.round = 1;
	.mob = 100;
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1652,15,strnpcinfo(0)+"::Ondevildead";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1653,20,strnpcinfo(0)+"::Ondevildead";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1654,15,strnpcinfo(0)+"::Ondevildead";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1655,20,strnpcinfo(0)+"::Ondevildead";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1656,15,strnpcinfo(0)+"::Ondevildead";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1657,15,strnpcinfo(0)+"::Ondevildead";
	end;

Ondevildead:
	.mob--;
	if ( .mob == 25 || .mob == 5 )
		announce "Devil Square : "+ .mob +" mobs to enter the 2nd round", bc_map;
	else if ( !.mob ) {
		announce "Devil Square will enter to 2nd round", bc_map;
		sleep 5000;
		goto Ondevil2;
	}
	end;

Ondevil2:
	.round = 2;
	.mob = 75;
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1634,15,strnpcinfo(0)+"::Ondevildead2";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1635,15,strnpcinfo(0)+"::Ondevildead2";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1636,10,strnpcinfo(0)+"::Ondevildead2";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1637,10,strnpcinfo(0)+"::Ondevildead2";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1638,15,strnpcinfo(0)+"::Ondevildead2";
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Mob",1639,10,strnpcinfo(0)+"::Ondevildead2";
	end;

Ondevildead2:
	.mob--;
	if ( .mob == 25 || .mob == 5 )
		announce "Devil Square : "+ .mob +" mobs left to enter the 3rd round", bc_map;
	else if ( !.mob ) {
		announce "Devil Square will enter to 3rd round", bc_map;
		sleep 5000;
		goto Ondevil3;
	}
	end;

Ondevil3:
	.round = 3;
	.mob = 1;
	areamonster "ordeal_3-1",183,180,248,249,"Devil Square Boss",1832,1,strnpcinfo(0)+"::Ondevildead3";
	end;

Ondevildead3:
	.mob--;
	if ( .mob == 25 || .mob == 5 )
		announce "Devil Square : "+ .mob +" mobs left to VICTORY", bc_map;
	else if ( !.mob ) {
		setmapflag "ordeal_3-1",mf_noskill;
		announce "Devil Square : CONGRATULATION - 10 Treasure Boxs will be yours now", bc_map;
		sleep 2000;
		announce "Devil Square : Treasure Box Spawn Has Been Delayed To Prevent Stealing", bc_map;
		sleep 13000;
		goto Ondevil4;
	}
	end;

Ondevil4:
	.round = 4;
	.mob = 10;
	monster "ordeal_3-1",231,250,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",234,247,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",237,244,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",240,241,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",243,238,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",246,235,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",249,232,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",252,229,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",249,241,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	monster "ordeal_3-1",240,249,"Treasure Box",2500,1,strnpcinfo(0)+"::Onboxdead";
	end;

Onboxdead:
	.mob--;
	announce "Devil Square : "+ strcharinfo(0) +" has opened the treasure box at Devil Square", bc_all;
	if ( !.mob )
		goto L_End;
	end;

L_End:
	killmonsterall "ordeal_3-1";
	enablenpc "Exit#DS";
	deletearray .register_aid;
	.start = .round = .mob = .register_num = 0;
	end;

OnPCDieEvent:
OnPCLogoutEvent:
	if ( .start && strcharinfo(3) == "ordeal_3-1" ) {
		while ( .register_aid[.@i] != getcharid(3) && .@i < .register_num ) .@i++;
		deletearray .register_aid[.@i], 1;
		.register_num--;
		if ( !.register_num ) {
			announce "All players failed to survive at Devil Square", bc_all;
			killmonsterall "ordeal_3-1";
			goto L_End;
		}
	}
	end;

OnSurvive:
	while ( .start == 2 ) {
		mapannounce "ordeal_3-1", .register_num +" players is still survive at Devil Square", bc_map;
		sleep .ann_survive;
	}
	end;
}

ordeal_3-1,246,246,4	script	Exit#DS	51,{
	mes "[Exit]";
	mes "See ya";
	next;
	warp "SavePoint", 0,0 ;
	removemapflag "ordeal_3-1",mf_noskill;
	close;
}

ordeal_3-1	mapflag	nowarp
ordeal_3-1	mapflag	nowarpto
ordeal_3-1	mapflag	noteleport
ordeal_3-1	mapflag	nosave	SavePoint
ordeal_3-1	mapflag	nomemo
ordeal_3-1	mapflag	nobranch
ordeal_3-1	mapflag	nopenalty
ordeal_3-1	mapflag	noicewall
ordeal_3-1	mapflag nocommand	80

 

Link to comment
Share on other sites

6 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:  

In your script

		sleep 2000;
		announce "Devil Square : Treasure Box Spawn Has Been Delayed To Prevent Stealing", bc_map;

sleep don't keep the rid but bc_map in the announce need a player attached

 

 

- bc_map: Message is sent to everyone in the same map as the source of the broadcast (see below).

Source flags:
- bc_pc: Broadcast source is the attached player (default).

 

 

 

Just change sleep to sleep2 to keep the rid

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

Thanks ^^ i will try it later

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

thank you Capuche, it works, now only 1 prob left..

my exit npc doesnt disabled when the event started.. here is the script

OnClock2127:
	if(agitcheck() == 1) end;
	.start = 1;
	disablenpc "Exit#DS";
	mapannounce "ordeal_3-1","Devil Square is now closed", bc_map;
	getmapxy .@map$, .@x, .@y, 1;
	mapwarp "ordeal_3-1", .@map$, .@x, .@y;
	killmonsterall "ordeal_3-1";
	announce "Devil Square is OPENED NOW!! 5 Minutes until it starts..!!", bc_all;
	sleep 60000;
Onboxdead:
	.mob--;
	announce "Devil Square : "+ strcharinfo(0) +" has opened the treasure box at Devil Square", bc_all;
	if ( !.mob )
		goto L_End;
	end;

L_End:
	killmonsterall "ordeal_3-1";
	enablenpc "Exit#DS";
	deletearray .register_aid;
	.start = .round = .mob = .register_num = 0;
	end;
ordeal_3-1,246,246,4	script	Exit#DS	51,{
	mes "[Exit]";
	mes "See ya";
	next;
	warp "SavePoint", 0,0 ;
	removemapflag "ordeal_3-1",mf_noskill;
	close;
}

please check

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

Bump

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 don't have this kind of problem on my local /hmm

My Exit NPC is disabled when the event start

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   0
  • Joined:  11/04/12
  • Last Seen:  

I tried to change "disable" and "enable" to "hideonnpc" and "hideoffnpc" but the npc still there -_-"

 

 

could anyone help me please?

Edited by YuliChenz
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...