Restricting items

jaiko23

New member
Messages
94
Points
0
Hi guys its me again
default_biggrin.png


i just wanna ask.. how can i restrict specific items on woe? i already tried putting it in the map_zone_db but still not getting the result i want..

here:

 
disabled_items: {
Assumptio_5_Scroll: true
Greed_Scroll: true
Pty_Assumptio_Scroll: true
ID30145: true
ID30158: true
ID30159: true
ID30160: true
ID30161: true
ID30162: true
ID30163: true
ID30164: true
ID30165: true
ID30166: true
ID30167: true
ID30168: true
ID30169: true
ID30170: true
}
/* 5 second duration increase on GvG */
/* knockback disabled */
/* GvG Mode Damage Reductions */
/* - weapon_damage_rate -40% */
/* - magic_damage_rate  -40% */
/* - misc_damage_rate   -40% */
/* - long_damage_rate   -20% */
/* - short_damage_rate  -20% */
mapflags: (
"invincible_time_inc 5000",
"noknockback",
"weapon_damage_rate 60",
"magic_damage_rate 60",
"misc_damage_rate 60",
"long_damage_rate 80",
"short_damage_rate 80",
"nocashshop",
"gvg_noparty",
)
 
 
 
these items are costume and located at shadow armor/65536... so can anybody help me about this one?
default_biggrin.png

 
Why don't you try it with the english names of the item? As far as i can see the configuration uses those.

Code:
disabled_items: {	Assumptio_5_Scroll: true	Greed_Scroll: true	Pty_Assumptio_Scroll: true	Velum_Jamadhar: false	Velum_Scare: false	Velum_Buster: false	Velum_Guillotine: false	Velum_Spear: false	Velum_Glaive: false	Velum_Bible: false	Velum_Encyclopedia: false	Velum_Claw: false	Velum_Arc_Wand: false	Velum_Damascus: false	Velum_Stunner: false	Velum_Flail: false	Velum_Arbalest: false	Velum_CrossBow: false	Velum_Claymore: false	Velum_Katzbalger: false	Siege_Arrow_A: false	Siege_Arrow_S: false	Siege_Greave: false	Siege_Boots: false	Siege_Shoes: false	Siege_Manteau: false	Siege_Muffler: false	Siege_White_Potion: false	Siege_Blue_Potion: false	Woe_Violet_Potion: false	Woe_White_Potion: false	Woe_Blue_Potion: false	Siege_Plate: false	Siege_Suits: false	Siege_Robe: false	C_Beginner_Cap: true}
 
actually its a custom items.. okay ill try that.. thanks
default_happy.png
 

and also will this automatically unequip the item when entering woe cast? like for example prtg_cas01? i have read one before about using script like onpcevent or something like that... 

 
@@jaiko23 You could try this one: 

- script ItemRestrictionSystem 1,{ OnInit: setarray( .mapNames$, "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05", "aldeg_cas01", "aldeg_cas02", "aldeg_cas03", "aldeg_cas04", "aldeg_cas05", "payon" ); setarray( .restrictedItemIds, 30158, 30159, 30160, 30161, 30162, 30163, 30164, 30165, 30166, 30167, 30168, 30169, 30170, 30145 ); for( .@i = 0; .@i < getarraysize( .mapNames$ ); .@i++ ) setmapflag(.mapNames$[ .@i ], mf_loadevent ); end; OnPCLoadMapEvent: getmapxy( .@currentMap$, .@x, .@y, 0 ); for( .@i = 0; .@i < getarraysize( .mapNames$ ); .@i ++) { if( .@currentMap$ == .mapNames$[ .@i ] ) { .@onMap$ = .mapNames$[ .@i ]; break; } } if( .@onMap$ == "" ) end; while( sleep2( 200 ) && .@currentMap$ == .@onMap$ ) { for( .@i = 1; .@i <= 20; .@i++ ) { for( .@j = 0; .@j < getarraysize( .restrictedItemIds ); .@j++ ) { if ( getequipid( .@i ) == .restrictedItemIds[ .@j ] ) { unequip( .@i ); dispbottom( "Equipment " + getitemname( .restrictedItemIds[ .@j ] ) + " is not permitted on map " + .@onMap$ + ". It has been stripped." ); } } } getmapxy( .@currentMap$, .@x, .@y, 0 ); } end;} 

It is based on the one you saw but i extended it. In .mapNames$ you need to put the maps you want the function to work on and in .restrictedItemids holds the list of item ids that are restricted.

 
Last edited by a moderator:
.@@jaiko23 I made a slight mistake and fixed it, you can grab the fixed version above.

 
Last edited by a moderator:
yea i was about to tell you that something gone wrong.. okay lemme try it again
default_biggrin.png


I got this error.. and its not working.. 

Error.jpg

here is the code...

- script ItemRestrictionSystem 1,{
OnInit:
setarray( .mapNames$,  "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05", "aldeg_cas01", "aldeg_cas02", "aldeg_cas03", "aldeg_cas04", "aldeg_cas05", "payon" );
setarray( .restrictedItemIds, 30158, 30159, 30160, 30161, 30162, 30163, 30164, 30165, 30166, 30167, 30168, 30169, 30170, 30145 );
 
for( .@i = 0; .@i < getarraysize( .mapNames$ ); .@i++ )
setmapflag(.mapNames$[ .@i ], mf_loadevent );
end;
OnPCLoadMapEvent:
getmapxy( .@currentMap$, .@x, .@y, 0 );
for( .@i = 0; .@i < getarraysize( .mapNames$ ); .@i ++) {
if( .@currentMap$  == .mapNames$[ .@i ] ) {
.@onMap$ = .mapNames$[ .@i ];
break;
}
}

if( !.@onMap$ == "" ) end;
 
freeloop( 1 );
while( .@currentMap$ == .@onMap$ ) { 
for( .@i = 1; .@i <= 20; .@i++ )
for( .@j = 0; .@j < getarraysize( .restrictedItemIds ); .@j++ )
if ( getequipid( .@i ) == .restrictedItemIds[ .@j ] )
unequip .restrictedItemIds[ .@j ];

getmapxy( .@currentMap$, .@x, .@y, 0 );
sleep2 2000; 
}
freeloop( 0 );
end;
}
 
 
any idea? @@Winterfox
 
Last edited by a moderator:
Untitled.jpg

got no error but nothing happens.. i can still wear the item and when im entering payon, i still wear the item... >.< sorry for the trouble @@Winterfox

 
Last edited by a moderator:
oooh so thats how this script works... erm... is there anyway possible to make it like auto unequipped.. and cannot be equipped on that certain map? i wanna disable this item while on woe

do you have idea mr @@Zhao Chow

 
@@jaiko23 It is not your fault. It is mine since i am to lazy to debug things properly. Mostly i drop scripts and hope they work, i just check if the drop a errormessage when you load them. But you can check the latest update above. I debugged it properly this time.

Also Zhao didn't talk about the script but the map_zone configuration. It just disables the effects not the item itself to be worn.

 
Last edited by a moderator:
ohhh sorry sorry sorry...

your make extra effort for my trouble
default_sad.png


sorry for causing you guys lots of trouble :|

Yay thanks a lot @@Winterfox your script is working perfectly ! phew.. so happy to have you here
default_happy.png


 
you don't need freeloop if you have used sleep2 inside the while loop and sleep2 can check if the invoked player was

online or not ,and player should be checked

Code:
        while( slppe2(200) && .@currentMap$ == .@onMap$ ) {            for( .@i = 1; .@i <= 20; .@i++ ) {                for( .@j = 0; .@j < getarraysize( .restrictedItemIds ); .@j++ ) {                    if ( getequipid( .@i ) == .restrictedItemIds[ .@j ] ) {                        unequip( .@i );			dispbottom( "Equipment " + getitemname( .restrictedItemIds[ .@j ] ) + " is not permitted on map " + .@onMap$ + ". It has been stripped." );					}                }			}            getmapxy( .@currentMap$, .@x, .@y, 0 );                    }
 
Last edited by a moderator:
you don't need freeloop if you have used sleep2 inside the while loop and sleep2 can check if the invoked player was

online or not ,and player should be checked

while( sleep2(200) && .@currentMap$ == .@onMap$ ) { for( .@i = 1; .@i <= 20; .@i++ ) { for( .@j = 0; .@j < getarraysize( .restrictedItemIds ); .@j++ ) { if ( getequipid( .@i ) == .restrictedItemIds[ .@j ] ) { unequip( .@i ); dispbottom( "Equipment " + getitemname( .restrictedItemIds[ .@j ] ) + " is not permitted on map " + .@onMap$ + ". It has been stripped." ); } } } getmapxy( .@currentMap$, .@x, .@y, 0 ); }
Nice to know, i wasn't sure if sleep2 is needed with freeloop or not. I saw both either freeloop and sleep2, but also either standalone. I allways thought freeloop will be allways needed to prevent the infinity check from triggering.

It is also good to know that sleep2 can be checked if the user is still online. That is really a nice way of handling the loop and online check all at once.

Thank you for sharing.

 
Back
Top