Jump to content
  • 0

need support for Breaker Room Script.


Question

Posted

when i run this script i got errors in line 48 and line 157.

im using eathena svn.

 

here's the script and SS

 

Advance tnx to everyone  /kis2

 

2vsqe0j.jpg

 

/*
# Advance Breaker Room

CREATE TABLE IF NOT EXISTS `E-Breakers` (
	`no` mediumint(9) unsigned NOT NULL auto_increment,
	`char_id` int(11) unsigned NOT NULL default '0',
	`name` varchar(30) NOT NULL DEFAULT '',
	`time` bigint(11) NOT NULL default '0',
	`mob_id` mediumint(9) unsigned NOT NULL default '0',
	
	PRIMARY KEY  ( `no` )
) ENGINE=MyISAM;

#  Random Sample Data for viewing the Data in Games / SQL
# =============================================================
INSERT INTO `E-Breakers` ( `char_id`,`name`,`time`,`mob_id` ) VALUES ( 10000'Amistry','12411',3000 );
INSERT INTO `E-Breakers` ( `char_id`,`name`,`time`,`mob_id` ) VALUES ( 20000,'Emistry1','28211',3000 );
INSERT INTO `E-Breakers` ( `char_id`,`name`,`time`,`mob_id` ) VALUES ( 10000,'Amistry','32511',1899 );
INSERT INTO `E-Breakers` ( `char_id`,`name`,`time`,`mob_id` ) VALUES ( 20000,'Emistry1','42161',1899 );

*/





// ====== mob_db.txt / mob_db2.txt =======
// 3000,EMPELIUM,Emperium,Emperium,90,700,1,0,0,1,60,73,64,50,1,17,80,50,26,20,10,12,0,8,26,0x160,300,1288,288,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
// ====== mob_avail.txt =======
// 3000,1288

prontera,148,163,4	script	Adv Breaker Room Manager	100,{
	if( select( "Rent a Room","View Ladder" ) == 1 ){

		if( !instance_id(1) ){
			
			if( .Cost ){
				mes "it cost ^0055FF"+.Cost+" Zeny^000000 to rent a Breaker Room for "+.Minute+" Minutes.";
				if( select("Confirm:Cancel") == 2 ) close;
			}
			
			if( !getcharid(1) || !instance_check_party( getcharid(1),1,90,150 ) ){
				mes "Required a Party which have at least 1 Member with at least level 90 ~ 150";
				close;
			}
			
			set .@instance,instance_create( " Adv. Breaker Room ",getcharid(1));
			
			if( .@instance < 0 ){
				switch( .@instance ){
					Case -2: mes "Invalid Party ID"; break;
					Case -3: mes "Max Instances Exceed."; break;
					Case -4: warpparty has_instance( "1@room" ),25,25,getcharid(1); break;
					Case -1:
				default:
					mes "Failed to Create an Instances.";
				}
				
			}else{
				set Zeny,Zeny - .Cost;
				instance_attachmap( "1@room",.@instance );
				instance_set_timeout ( .Minute * 60 ),( .Timeout * 60 ),.@instance;
				instance_init .@instance;
				instance_attach .@instance;
				warpparty has_instance( "1@room" ),25,25,getcharid(1);
				donpcevent instance_npcname( "Helper#Breaker Room",instance_id() )+"::OnInstanceInit";
				end;
			}
			
		}else{
			warpparty has_instance( "1@room" ),25,25,getcharid(1);
		}
		
	}else{
		switch( select( "Own Ladder","Overall Top Breaker","^FF0000Remove Records^000000" ) ){
		default:
			Case 1:
			.@query_size = query_sql( "SELECT `mob_id`,`time` FROM `E-Breakers` WHERE `char_id`='"+getcharid(0)+"' GROUP BY `mob_id` ORDER BY `time` ASC LIMIT "+.size,.@MobID,.@Time );
			
			if( !.@query_size ){
				mes "No Records found !";
			}else{
				mes "^0055FF[ "+strcharinfo(0)+"'s Record ]^000000";
				for( .@i = 0; .@i < .@query_size; .@i++ ){
					mes "^DDBB00"+getmonsterinfo( .@MobID[.@i],MOB_NAME )+" : ^FF0000"+( .@Time[.@i] / 1000 )+"."+( .@Time[.@i] % 1000 )+" sec^000000";
				}
			}
			break;
			Case 2:
			for( .@i = 0; .@i < .size; .@i++ )
			.@Menu$ = .@Menu$ + getmonsterinfo( .MonsterList[.@i],MOB_NAME )+":";
			
			do{
				.@mob = select( .@Menu$ ) - 1;
				
				do{
					.@query_size = query_sql( "SELECT `name`,`time`,`mob_id` FROM `E-Breakers` WHERE `mob_id`='"+.MonsterList[.@mob]+"' GROUP BY `name` ORDER BY `time` ASC LIMIT 10 OFFSET "+.@Offset+" ",.@Name$,.@Time,.@MobID );
					
					mes "Monster : ^FF0000"+getmonsterinfo( .MonsterList[.@mob],MOB_NAME )+"^000000";
					if( !.@query_size ){
						mes "No extra Records found !";
					}else{
						for( .@i = 0; .@i < .@query_size; .@i++ )
						mes "^0055FF[ "+( .@Offset + .@i + 1 )+"th : "+.@Name$[.@i]+" ] : ^FF0000"+( .@Time[.@i] / 1000 )+"."+( .@Time[.@i] % 1000 )+"sec^000000";
						.@Offset += 10;
					}
					next;
				}while( select( ( .@query_size )?"Next 10 Rank":"","Back" ) == 1 );
				
				mes "Please choose your option...";
			}while( select( "View Breaker Rank","Back" ) == 1 );
			break;
			Case 3:
			mes "What Record you want to clear ?";
			if( select( "Personal Record",( getgmlevel() < .GMLevel )?"":"[ GM ] All Record" ) == 1 ){
				query_sql( "DELETE FROM `E-Breakers` WHERE `char_id`='"+getcharid(0)+"'" );
				mes "^FF0000Removed All "+strcharinfo(0)+"'s Breaker Records.^000000";
			}else{
				query_sql( "TRUNCATE `E-Breakers`" );
				mes "^FF0000Removed All Records.^000000";
			}
			break;
		}

	}
	close;


OnInit:
	// GM Level
	.GMLevel = 99;
	// Cost to Rent Room
	.Cost = 1000000;
	// Room Duration
	.Minute = 30;
	// Room Timeout
	.Timeout = 5;
	// Edit Monster Lists
	setarray .MonsterList[0],3000,1899,1900,1905,1906,1907,1908,1909,1910,1911,1912,1913,1914,1915;


	.size = getarraysize( .MonsterList );
	end;
}



1@room,99,102,4	script	Helper#Breaker Room	100,{
	if( !instance_id(1) ) end;

	.@mobcount = mobcount( "1@room",instance_npcname( "Helper#Breaker Room",instance_id(1) )+"::OnMyMobDead" );

	switch( select( "^0055FFHeal^000000",
	( getcharid(0) != getpartyleader( getcharid(1),2 ) )? ""  .@mobcount )? "Remove Monster":"Summon Monster",
	"Go out",
	( getcharid(0) == getpartyleader( getcharid(1),2 ) )?"^FF0000Terminate Room^000000":"" )){
	default:
		Case 1:
		percentheal 100,100;
		skilleffect 28,MaxHP;
		specialeffect2 313;
		break;
		Case 2:
		if( .@mobcount ){
			stopnpctimer;
			npctalk "All monster has been removed by Party Leader.";
			killmonsterall "1@room";
			close;
		}else{
			mes "Please select a Monster...";
			'selected = getelementofarray( getvariableofnpc( .MonsterList, "Adv Breaker Room Manager" ),( select( 'Menu$ ) - 1 ) );
			close2;
			monster "1@room",-1,-1,"--ja--",'selected,1,instance_npcname("Helper#Breaker Room", instance_id())+"::OnMyMobDead";
			initnpctimer;
			end;
		}
		break;
	Case 3:
		warp "SavePoint",0,0;
		dispbottom "You may enter this Room anytime as long as it's not terminated or timeout";
		break;
	Case 4:
		mes "Are you sure ?";
		mes "If you terminate this Room, you will never able to come in again.";
		if( select("Confirm:Cancel") == 1 ){
			instance_destroy instance_id(1);
		}
		break;
}
close;

OnInstanceInit:
	'Menu$ = "";
	for( .@i = 0; .@i < getvariableofnpc( .size,"Adv Breaker Room Manager" ); .@i++ )
		'Menu$ = 'Menu$ +getmonsterinfo( getelementofarray( getvariableofnpc( .MonsterList, "Adv Breaker Room Manager" ),.@i ),0 ) +":";

	sleep 2000;
	npctalk "Please get yourself ready...";
	instance_announce 0,"Welcome to Adv. Breaker Room",0;
	sleep 3000;
	npctalk "Select a monster ... and Break it into pieces...and Skills are Disabled.";
	end;
	
OnMyMobDead:
	stopnpctimer;
	.@timer = getnpctimer(0);
	instance_announce 0,"========== [ "+getmonsterinfo( 'selected,MOB_NAME )+" ] ==========",0;
	instance_announce 0,"Average Damage Per Seconds : "+( getmonsterinfo( 'selected,MOB_MAXHP ) / ( .@timer / 1000 ) ),0;

	instance_announce 0,"Total Time Spent  : "+( .@timer / 1000 )+"."+( .@timer % 1000 )+" seconds.",0;
	
	if( getmapusers( has_instance("1@room") ) == 1 ){
		emotion e_heh;
		mes "Not bad, i would like to save / update your record into the Database.";
		
		query_sql(" SELECT `time` FROM `E-Breakers` WHERE `char_id`='"+getcharid(0)+"' AND `mob_id`='"+'selected+"' ORDER BY `time` ASC",.@Record );
			mes "Best Record : ^0055FF"+( .@Record / 1000 )+"."+( .@Record % 1000 )+" seconds^000000";
			mes " ";
			mes "Current Record : ^0055FF"+( .@timer / 1000 )+"."+( .@timer % 1000 )+" seconds^000000";
			
			if( select("Record ^0055FF"+( .@timer / 1000 )+"."+( .@timer % 1000 )+" seconds^000000:Nope") == 1 ){
				query_sql( "DELETE FROM `E-Breakers` WHERE `char_id`='"+getcharid(0)+"' AND `mob_id`='"+'selected+"' AND `time` > '"+.@timer+"'" );
			query_sql( "INSERT INTO `E-Breakers` ( `char_id`,`name`,`time`,`mob_id` ) VALUES ( '"+getcharid(0)+"','"+strcharinfo(0)+"','"+.@timer+"','"+'selected+"' )" );
			}
			close;
		}else{
			emotion e_sry;
			npctalk "Not bad, but Record will not store for Grouped Team. Only for Solo Player will store the records.";
		}
		end;
		
	}

// ==== MAP FLAGS ====
1@room	mapflag	nogo
1@room	mapflag	nomemo
1@room	mapflag	nosave
1@room	mapflag	nobranch
1@room	mapflag	nowarp
1@room	mapflag	nobaseexp
1@room	mapflag	nojobexp
1@room	mapflag	nomobloot
1@room	mapflag	nomvploot
1@room	mapflag	nowarpto
1@room	mapflag	noskill

2 answers to this question

Recommended Posts

Posted

switch to rA....if i am not mistaken...only rA have this script command..i dont think 3ceam / eAthena have it.

*instance_check_party(<party id>{,<amount>{,<min>{,<max>}}});

This function checks if a party meets certain requirements, returning 1 if all
conditions are met and 0 otherwise. It will only check online characters.

amount - number of online party members (default is 1).
min    - minimum level of all characters in the party (default is 1).
max    - maximum level of all characters in the party (default is max level in conf).

  • Upvote 1
Posted

Switching to rAthena will also fix the 2nd error

.@mobcount = mobcount( "1@room",instance_npcname( "Helper#Breaker Room",instance_id(1) )+"::OnMyMobDead" );
(eAthena does not support direct variable assignment. You have to use set)
set .@mobcount, mobcount( "1@room",instance_npcname( "Helper#Breaker Room",instance_id(1) )+"::OnMyMobDead" );

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...