Jump to content
  • 0

Allow only maximum 1 MVP card in a map


donkeyg

Question


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

how do i make only allow maximjum 1 MVP card in a map ? (Means u cant bring more than 2 MVP cards into the map)

 

MAP: Guild_vs2

Edited by donkeyg
Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

imput all mvp card id's

 

guild_vs2 is

Case 1:    CheckItems( 607,5,608,1 );    break;

z.b 4236,1,Next_Item,Amount usw.

 

 

all mvps  

http://ratemyserver.net/index.php?all_mob_select=%23&mob_id=&mob_name=&element=-1&race=-1&size=-1&mlvsn=0&mlv=&mlv2=&bxpsn=0&exp=&exp2=&jxpsn=0&jexp=&jexp2=&flee=&dr=95&hit=&hr=100&rgc=0&immu=0&mvp=1&minib=0&aggr=0&assi=0&sense=0&det=0&natk=0&immo=0&chcha=0&loot=0&chtar=0&plt=0&sort_r=0&sort_o=0&page=mob_db&f=1&mob_search=Search

Good Luck   /meh

-    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 number>",
                "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 .@i,0; .@i < getarraysize( .DisableMap$ ); set .@i,.@i + 2 )
    if( strcharinfo(3) == .DisableMap$[.@i] )
        LimitItems( atoi( .DisableMap$[.@i+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 .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
    set .@Limit,0;
    for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
        for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
            if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
                set .@Limit,.@Limit + 1;
    set .@Limit,.@Limit + countitem( getarg(.@i) );
    if( .@Limit > getarg(.@i+1) ){
        set @Exceed,1;
        mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
    }
}
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


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

321

 

imput all mvp card id's

 

guild_vs2 is

Case 1:    CheckItems( 607,5,608,1 );    break;

z.b 4236,1,Next_Item,Amount usw.

 

 

all mvps  

http://ratemyserver.net/index.php?all_mob_select=%23&mob_id=&mob_name=&element=-1&race=-1&size=-1&mlvsn=0&mlv=&mlv2=&bxpsn=0&exp=&exp2=&jxpsn=0&jexp=&jexp2=&flee=&dr=95&hit=&hr=100&rgc=0&immu=0&mvp=1&minib=0&aggr=0&assi=0&sense=0&det=0&natk=0&immo=0&chcha=0&loot=0&chtar=0&plt=0&sort_r=0&sort_o=0&page=mob_db&f=1&mob_search=Search

Good Luck   /meh

-    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 number>",
                "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 .@i,0; .@i < getarraysize( .DisableMap$ ); set .@i,.@i + 2 )
    if( strcharinfo(3) == .DisableMap$[.@i] )
        LimitItems( atoi( .DisableMap$[.@i+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 .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
    set .@Limit,0;
    for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
        for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
            if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
                set .@Limit,.@Limit + 1;
    set .@Limit,.@Limit + countitem( getarg(.@i) );
    if( .@Limit > getarg(.@i+1) ){
        set @Exceed,1;
        mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
    }
}
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;
}
}

 

 

 

Tested.... still get kick even i got 1 tao gunka card ONLY.. i wan to make it cant bring 2 tao gunka..  maximum 1 tao gnuka.... but why cant??

 


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

OnInit:
// GM Level to Bypass
set .GMLevel,3;
// Check Every X Seconds
set .Seconds,5;
// Apply on Which Maps and what Zone No.
setarray .DisableMap$, // "<mapname>","<zone number>",
//				"pvp_n_1-5","0",
//				"yggdrasil01","1",
				"guild_vs2","2",
				"payon","3",
				"guild_vs4","4",
				"pvp_y_5-2","5";



// Initialize Mapflags
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 .@i,0; .@i < getarraysize( .DisableMap$ ); set .@i,.@i + 2 )
    if( strcharinfo(3) == .DisableMap$[.@i] )
        LimitItems( atoi( .DisableMap$[.@i+1] ) );
end;





function	LimitItems	{
switch( getarg(0) ){
	// Case <zone>: return CheckItems( <Item>,<Amount>,<Item>,<Amount>,.....,<Item>,<Amount> );

	Case 2:	return CheckItems( 4302,0 );

	Case 3:	return CheckItems( 4302,0 );
	Case 4:	return CheckItems( 4302,0 );
	Case 5:	return CheckItems( 4302,0 );


//	Case 3:	return CheckItems( 607,5,608,1,4002,1,5022,1 );
//	Case 4:	return CheckItems( 607,1,608,15,5022,2,7227,10 );
	default:
		debugmes "[NPC : "+strnpcinfo(0)+"] - Invalid Zone : "+getarg(0);
		break;
}
return;
}



	function    CheckItems    {
	for( set .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
	set .@Limit,1;	
	for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
	for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
	if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
	set .@Limit,.@Limit + 1;
	set .@Limit,.@Limit + countitem( getarg(.@i) );
	if( .@Limit > getarg(.@i+1) ){
	set @Exceed,1;
	mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
    	}
	}
	if( @Exceed ){
	mes "Please ensure all the Items above didnt reach the Limit as stated above.";
 	close2;
	warp "prontera",0,0;
	deltimer strnpcinfo(0)+"::OnPCLoadMapEvent";
	}else{
	addtimer ( .Seconds * 1000 ),strnpcinfo(0)+"::OnPCLoadMapEvent";
	end;
	}
	return;
	}
	}
	}

thi sis my script

Edited by donkeyg
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

CheckItems( Item_ID,Max_Amount,Item_ID,Max_Amount usw); break; z.b 4302,2 then you can 1~2 Tao Cards

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

CheckItems( Item_ID,Max_Amount,Item_ID,Max_Amount usw); break; z.b 4302,2 then you can 1~2 Tao Cards

nono.. sorry .. what i was asking is how do i make MAXIMUM they can bring 1 MVP card only into the room? 

Example: a user will get kick from the room if they are using 1 Tao gunka + 1 Golden thief bug card. (Players are allow  to bring only ONE card Either Tao Gunka or Golden Thief bug card into the room. They cant bring BOTH cards into the room)

t

I want to make it MAXIMUM 1 MVP card can bring in only..

Edited by donkeyg
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

bump???????????

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

if you're using above script, you can simply achieve the same result by removing this line.


function    CheckItems    {
for( set .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
    set .@Limit,0;                                  // <------------------ REMOVE THIS LINE
    for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
        for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
            if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
                set .@Limit,.@Limit + 1;
    set .@Limit,.@Limit + countitem( getarg(.@i) );
    if( .@Limit > getarg(.@i+1) ){
        set @Exceed,1;
        mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
    }
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

p[]p[][p][p


 

if you're using above script, you can simply achieve the same result by removing this line.


function    CheckItems    {
for( set .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
    set .@Limit,0;                                  // <------------------ REMOVE THIS LINE
    for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
        for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
            if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
                set .@Limit,.@Limit + 1;
    set .@Limit,.@Limit + countitem( getarg(.@i) );
    if( .@Limit > getarg(.@i+1) ){
        set @Exceed,1;
        mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
    }
}

 

 

it seems the script doesnt work.. i can bring Devilnig  / taogunka cards to payon town in the same time..

 

 

 

 

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


OnInit:
// GM Level to Bypass
set .GMLevel,3;
// Check Every X Seconds
set .Seconds,5;
// Apply on Which Maps and what Zone No.
setarray .DisableMap$, // "<mapname>","<zone number>",
// "pvp_n_1-5","0",
// "yggdrasil01","1",
"yggdrasil02","2",
"payon","3",
"guild_vs4","4",
"pvp_y_5-2","5";






// Initialize Mapflags
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 .@i,0; .@i < getarraysize( .DisableMap$ ); set .@i,.@i + 2 )
    if( strcharinfo(3) == .DisableMap$[.@i] )
        LimitItems( atoi( .DisableMap$[.@i+1] ) );
end;










function LimitItems {
switch( getarg(0) ){
// Case <zone>: return CheckItems( <Item>,<Amount>,<Item>,<Amount>,.....,<Item>,<Amount> );


Case 2: return CheckItems( 4302,0 );


Case 3: return CheckItems( 4302,0,4174,0 );
Case 4: return CheckItems( 4302,0 );
Case 5: return CheckItems( 4302,0 );




// Case 3: return CheckItems( 607,5,608,1,4002,1,5022,1 );
// Case 4: return CheckItems( 607,1,608,15,5022,2,7227,10 );
default:
debugmes "[NPC : "+strnpcinfo(0)+"] - Invalid Zone : "+getarg(0);
break;
}
return;
}






function    CheckItems    {
for( set .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
// set .@Limit,1; 
for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
set .@Limit,.@Limit + 1;
set .@Limit,.@Limit + countitem( getarg(.@i) );
if( .@Limit > getarg(.@i+1) ){
set @Exceed,1;
mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
     }
}
if( @Exceed ){
mes "Please ensure all the Items above didnt reach the Limit as stated above.";
  close2;
warp "prontera",0,0;
deltimer strnpcinfo(0)+"::OnPCLoadMapEvent";
}else{
addtimer ( .Seconds * 1000 ),strnpcinfo(0)+"::OnPCLoadMapEvent";
end;
}
return;
}
}
}

this is my script..

Edited by donkeyg
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  86
  • Topics Per Day:  0.02
  • Content Count:  591
  • Reputation:   146
  • Joined:  06/19/12
  • Last Seen:  

To test it with GM acc

//if( getgmlevel() >= .GMLevel ) end;  

map is Payon

-	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 number>",
                "payon","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 .@i,0; .@i < getarraysize( .DisableMap$ ); set .@i,.@i + 2 )
    if( strcharinfo(3) == .DisableMap$[.@i] )
        LimitItems( atoi( .DisableMap$[.@i+1] ) );
end;

function    LimitItems    {
switch( getarg(0) ){
    // Case <zone>: CheckItems( <Item>,<Amount>,<Item>,<Amount>,.....,<Item>,<Amount> ); break;
    Case 0:    CheckItems( 4302,1,4174,1 );    break;
    Case 1:    CheckItems();    break;
    Case 2:    CheckItems();    break;
    Case 3:    CheckItems();    break;
    Case 4:    CheckItems();    break;
    default:
        debugmes "[NPC : "+strnpcinfo(0)+"] - Invalid Zone:"+getarg(0);
        break;
}
return;
}

function    CheckItems    {
for( set .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
    for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
        for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
            if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
                set .@Limit,.@Limit + 1;
    set .@Limit,.@Limit + countitem( getarg(.@i) );
    if( .@Limit > getarg(.@i+1) ){
        set @Exceed,1;
        mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
    }
}
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;
}
}
Edited by EL Dragon
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

 

To test it with GM acc

//if( getgmlevel() >= .GMLevel ) end;  

map is Payon

-	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 number>",
                "payon","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 .@i,0; .@i < getarraysize( .DisableMap$ ); set .@i,.@i + 2 )
    if( strcharinfo(3) == .DisableMap$[.@i] )
        LimitItems( atoi( .DisableMap$[.@i+1] ) );
end;

function    LimitItems    {
switch( getarg(0) ){
    // Case <zone>: CheckItems( <Item>,<Amount>,<Item>,<Amount>,.....,<Item>,<Amount> ); break;
    Case 0:    CheckItems( 4302,1,4174,1 );    break;
    Case 1:    CheckItems();    break;
    Case 2:    CheckItems();    break;
    Case 3:    CheckItems();    break;
    Case 4:    CheckItems();    break;
    default:
        debugmes "[NPC : "+strnpcinfo(0)+"] - Invalid Zone:"+getarg(0);
        break;
}
return;
}

function    CheckItems    {
for( set .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
    for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
        for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
            if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
                set .@Limit,.@Limit + 1;
    set .@Limit,.@Limit + countitem( getarg(.@i) );
    if( .@Limit > getarg(.@i+1) ){
        set @Exceed,1;
        mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
    }
}
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;
}
}

 

 

can u help me check... im still can wear the both items into prtg_cas03 without been kick from the system.. here is my script

 


- 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 number>",


"prtg_cas03","0";




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 .@i,0; .@i < getarraysize( .DisableMap$ ); set .@i,.@i + 2 )
    if( strcharinfo(3) == .DisableMap$[.@i] )
        LimitItems( atoi( .DisableMap$[.@i+1] ) );
end;


function    LimitItems    {
switch( getarg(0) ){
    // Case <zone>: CheckItems( <Item>,<Amount>,<Item>,<Amount>,.....,<Item>,<Amount> ); break;
    Case 0:    CheckItems( 4302,1,4174,1 );    break;
        default:
        debugmes "[NPC : "+strnpcinfo(0)+"] - Invalid Zone:"+getarg(0);
        break;
}
return;
}


function    CheckItems    {
for( set .@i,0; getarg( .@i,0 ); set .@i,.@i + 2 ){
    for( set .@eq,0; .@eq <= 10; set .@eq,.@eq + 1 )
        for( set .@slot,0; .@slot <= getequipcardcnt( .@eq ); set .@slot,.@slot + 1 )
            if( getequipcardid( .@eq,.@slot ) == getarg(.@i) )
                set .@Limit,.@Limit + 1;
    set .@Limit,.@Limit + countitem( getarg(.@i) );
    if( .@Limit > getarg(.@i+1) ){
        set @Exceed,1;
        mes "[ ^FF0000Limit : ^0000FF"+getarg(.@i+1)+"^000000 ] "+getitemname( getarg(.@i) );
    }
}
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;
}
}
Edited by donkeyg
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...