Jump to content

Recommended Posts

Eto try mo yung script ni emistry. yan ung gngamit q na item restriction sa ibat ibang map. :)

http://pastebin.com/raw.php?i=tG483Rsz

- script Limited Items -1,{
function LimitItems;
function CheckItems;
OnInit:
// GM Level to Bypass
set .GMLevel,80;
// Check Every X Seconds
set .Seconds,5;
// Apply on Which Maps and what Zone No.
setarray .DisableMap$, // "<mapname>","<zone numbe",
   "guild_vs1","0",
   "guild_vs2","1",
   "guild_vs3","2",
   "guild_vs4","3",
   "guild_vs5","4";
for( set .i,0; .i < getarraysize( .DisableMap$ ); set .i,.i + 2 )
setmapflag .DisableMap$[.i],mf_loadevent;
end;
OnPCLoadMapEvent:
if( getgmlevel() >= .GMLevel ) end;
set @Exceed,0;
for( set [email protected],0; [email protected] < getarraysize( .DisableMap$ ); set [email protected],[email protected] + 2 )
if( strcharinfo(3) == .DisableMap$[[email protected]] )
 LimitItems( atoi( .DisableMap$[[email protected]+1] ) );
end;
function LimitItems {
switch( getarg(0) ){
// Case <zone>: CheckItems( <Item>,<Amount>,<Item>,<Amount>,.....,<Item>,<Amount> ); break;
Case 0: CheckItems( 607,1 ); break;
Case 1: CheckItems( 607,5,608,1 ); break;
Case 2: CheckItems( 607,2,608,3,4002,1 ); break;
Case 3: CheckItems( 607,5,608,1,4002,1,5022,1 ); break;
Case 4: CheckItems( 607,1,608,15,5022,2,7227,10 ); break;
default:
 debugmes "[NPC : "+strnpcinfo(0)+"] - Invalid Zone:"+getarg(0);
 break;
}
return;
}
function CheckItems {
for( set [email protected],0; getarg( [email protected],0 ); set [email protected],[email protected] + 2 ){
set [email protected],0;
for( set [email protected],0; [email protected] <= 10; set [email protected],[email protected] + 1 )
 for( set [email protected],0; [email protected] <= getequipcardcnt( [email protected] ); set [email protected],[email protected] + 1 )
  if( getequipcardid( [email protected],[email protected] ) == getarg([email protected]) )
   set [email protected],[email protected] + 1;
set [email protected],[email protected] + countitem( getarg([email protected]) );
if( [email protected] > getarg([email protected]+1) ){
 set @Exceed,1;
 mes "[ ^FF0000Limit : ^0000FF"+getarg([email protected]+1)+"^000000 ] "+getitemname( getarg([email protected]) );
}
}
if( @Exceed ){
mes "Please ensure all the Items above didnt reach the Limit as stated above.";
close2;
warp "SavePoint",0,0;
deltimer strnpcinfo(0)+"::OnPCLoadMapEvent";
}else{
addtimer ( .Seconds * 1000 ),strnpcinfo(0)+"::OnPCLoadMapEvent";
end;
}
return;
}
}

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
Reply to this topic...

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

Important Information

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