jaiko23 1 Posted July 13, 2015 Hi guys its me again 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? Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 14, 2015 (edited) @@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 July 14, 2015 by Winterfox Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 13, 2015 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} Quote Share this post Link to post Share on other sites
0 jaiko23 1 Posted July 13, 2015 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... Quote Share this post Link to post Share on other sites
0 jaiko23 1 Posted July 14, 2015 Nice ill try this out thanks ! Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 14, 2015 (edited) .@@jaiko23 I made a slight mistake and fixed it, you can grab the fixed version above. Edited July 14, 2015 by Winterfox Quote Share this post Link to post Share on other sites
0 jaiko23 1 Posted July 14, 2015 (edited) yea i was about to tell you that something gone wrong.. okay lemme try it again I got this error.. and its not working.. 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 July 14, 2015 by jaiko23 Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 14, 2015 @@jaiko23 See the update above. Quote Share this post Link to post Share on other sites
0 jaiko23 1 Posted July 14, 2015 (edited) 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 July 14, 2015 by jaiko23 Quote Share this post Link to post Share on other sites
0 Kuya Jeo 120 Posted July 14, 2015 @@jaiko23 you can wear it but the effect/s is disabled Quote Share this post Link to post Share on other sites
0 jaiko23 1 Posted July 14, 2015 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 Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 14, 2015 (edited) @@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 July 14, 2015 by Winterfox Quote Share this post Link to post Share on other sites
0 jaiko23 1 Posted July 14, 2015 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 Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 14, 2015 @@jaiko23 You are welcome i am glad to help. Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted July 14, 2015 (edited) 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 July 14, 2015 by Angelmelody Quote Share this post Link to post Share on other sites
0 mrlongshen 22 Posted July 14, 2015 @@jaiko23 next time @@Winterfox will be new scripter in hercules. hehehe @@jaiko23 next time @@Winterfox will be new scripter in hercules. hehehe Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted July 14, 2015 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. Quote Share this post Link to post Share on other sites
Hi guys its me again
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:
Share this post
Link to post
Share on other sites