Jump to content
  • 0

Limited Item


Question

Posted

Hi rAthena

 

I need some help about this script .

 

I'm using this script http://rathena.org/board/files/file/2505-limited-items/

 

The problem is doppleganger card i put in weapon and i equip the weapon and enter the pvp room the script can detect Doppleganger card and weapon has limited. But when i unequip the weapon and enter the pvp room again the script cant detect and i can use doppleganger card in pvp room.

 

I hope anyone can help me and understand.

 

Thanks.

8 answers to this question

Recommended Posts

Posted

Hi Emistry

 

Thanks for reply here my script

 


-	script	Limited Items	-1,{
function	LimitItems;
function	CheckItems;

OnInit:
// GM Level to Bypass
set .GMLevel,99;
// Check Every X Seconds
set .Seconds,5;
// Apply on Which Maps and what Zone No.
setarray .DisableMap$, // "<mapname>","<zone number>",
				"pvp_y_1-2","0",
				"pvp_y_2-2","1",
				"pvp_y_3-2","2",
				"pvp_y_4-2","3",
				"pvp_y_6-2","4",
				"guild_vs1","5",
				"gefg_cas01","6",
				"gefg_cas01","7",
				"gefg_cas03","8",
				"gefg_cas04","9",
				"gefg_cas05","10",
				"payg_cas01","11",
				"payg_cas02","12",
				"payg_cas03","13",
				"payg_cas04","14",
				"payg_cas05","15",
				"aldeg_cas01","16",
				"aldeg_cas02","17",
				"aldeg_cas03","18",
				"aldeg_cas04","19",
				"aldeg_cas05","20",
				"prtg_cas01","21",
				"prtg_cas02","22",
				"prtg_cas03","23",
				"prtg_cas04","24",
				"prtg_cas05","25",
				"arug_cas01","26",
				"arug_cas02","27",
				"arug_cas03","28",
				"arug_cas04","29",
				"arug_cas05","30",
				"schg_cas01","31",
				"schg_cas02","32",
				"schg_cas03","33",
				"schg_cas04","34",
				"schg_cas05","35";

// Initialize Mapflags
for( set .i,0; .i < getarraysize( .DisableMap$ ); set .i,.i + 2 )
	setmapflag .DisableMap$[.i],mf_loadevent;
end;

OnPCLoadMapEvent:
if( getgmlevel() >= .GMLevel ) end;
for( set .@i,0; .@i < getarraysize( .DisableMap$ ); set .@i,.@i + 2 )
	while( strcharinfo(3) == .DisableMap$[.@i] ){
		if( LimitItems( atoi( .DisableMap$[.@i+1] ) ) ){
			message strcharinfo(0),"Limited Items Exceeded.";
			mes " ";
			mes "^777777-------------------^000000";
			mes "Please ensure all the Items above didnt reach the Limit / Disabled as stated above.";
			close2;
			warp "SavePoint",0,0;
		}
		sleep2 ( .Seconds * 1000 );
	}
end;

function	LimitItems	{
switch( getarg(0) ){
	// Case <zone>: return CheckItems( <Item>,<Amount>,<Item>,<Amount>,.....,<Item>,<Amount> );
	Case 0:		return CheckItems( 1187,0,1281,0,1282,0,1310,0,1382,0,1426,0,1486,0,1546,0,1576,0,1577,0,1640,0,1641,0,1743,0,1826,0,1827,0,1927,0,1981,0,2002,0,13042,0,13110,0,13176,0,13177,0,16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 1:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 2:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0,31000,0,31001,0,31002,0,31003,0,31004,0,31005,0,31006,0,31007,0,31008,0,31009,0,31010,0,31011,0,32100,32101,0,32102,0,32103,0,32104,0,32105,0,32106,0,32107,0,32108,0 );
	Case 3:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0,31000,0,31001,0,31002,0,31003,0,31004,0,31005,0,31006,0,31007,0,31008,0,31009,0,31010,0,31011,0,32100,32101,0,32102,0,32103,0,32104,0,32105,0,32106,0,32107,0,32108,0 );
	Case 4:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,2410,0,2541,0,4408,0,4399,0,4128,0,4430,0,4357,0,4363,0,4365,0,4367,0,4359,0,4425,0,4372,0,4147,0,4145,0,4168,0,4330,0,4386,0,4142,0,4134,0,4137,0,4123,0,4441,0,4174,0,4324,0,4408,0,4509,0,4047,0,4128,0,4263,0,4403,0,4318,0,4525,0,4419,0,4376,0,4520,0,4146,0,4132,0,4131,0,4456,0,4143,0,4135,0,4144,0,4148,0,4121,0,4507,0,6414,0,4342,0,4302,0,4305,0,4407,0,4198,0,4374,0,4361,0,4352,0,31000,0,31001,0,31002,0,31003,0,31004,0,31005,0,31006,0,31007,0,31008,0,31009,0,31010,0,31011,0,32100,0,32101,0,32102,0,32103,0,32104,0,32105,0,32106,0,32107,0,32108,0 );
	Case 5:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 6:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 7:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 8:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 9:		return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 10:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 11:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 12:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 13:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 14:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 15:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 16:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 17:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 18:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 19:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 20:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 21:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 22:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 23:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 24:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 25:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 26:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 27:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 28:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 29:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 30:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 31:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 32:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 33:	return CheckItems( 16007,0,2629,0,2630,0,1530,0,1599,0,2410,0,2541,0,1161,0,2383,0 );
	Case 34:	return CheckItems( 16007,0 );
	Case 35:	return CheckItems( 16007,0 );

	default:
		debugmes "[NPC : "+strnpcinfo(0)+"] - Invalid Zone : "+getarg(0);
		break;
}
return;
}

function	CheckItems	{
for( set .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 )
	if( isequippedcnt( getarg( .@i ) ) > getarg( .@i + 1 ) || countitem( getarg( .@i ) ) > getarg( .@i + 1 ) ){
		set .@Limit,.@Limit + ( ( !isequippedcnt( getarg( .@i ) ) )? countitem( getarg(.@i) ):isequippedcnt( getarg( .@i ) ) );
		mes "[ ^FF0000"+( ( !getarg( .@i + 1 ) )?"Disabled":"Max : ^0055FF"+getarg(.@i+1)+"ea" )+"^000000 ] "+getitemname( getarg(.@i) );
	}
return .@Limit;
}

}
Posted
when i unequip the weapon and enter the pvp room again the script cant detect and i can use doppleganger card in pvp room.

the script will still detect it after 5 seconds .... the script check the player every short interval ...

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