Jump to content
  • 0
Sign in to follow this  
jaiko23

Restricting items

Question

Hi guys its me again :D

 

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? :D

Share this post


Link to post
Share on other sites

16 answers to this question

Recommended Posts

  • 0

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

Edited by Winterfox

Share this post


Link to post
Share on other sites
  • 0

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

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}

Share this post


Link to post
Share on other sites
  • 0

actually its a custom items.. okay ill try that.. thanks ^_^ 

 

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

Share this post


Link to post
Share on other sites
  • 0

yea i was about to tell you that something gone wrong.. okay lemme try it again :D



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

post-10011-0-41604900-1436834890_thumb.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
Edited by jaiko23

Share this post


Link to post
Share on other sites
  • 0

post-10011-0-36815400-1436836064_thumb.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

Edited by jaiko23

Share this post


Link to post
Share on other sites
  • 0

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

Share this post


Link to post
Share on other sites
  • 0

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

Edited by Winterfox

Share this post


Link to post
Share on other sites
  • 0

ohhh sorry sorry sorry...

 

your make extra effort for my trouble :(

 

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 ^_^

Share this post


Link to post
Share on other sites
  • 0

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( 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 );                    }
Edited by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

 

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.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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