Peopleperson49 Posted April 7, 2013 Group: Members Topic Count: 219 Topics Per Day: 0.05 Content Count: 1181 Reputation: 141 Joined: 01/27/12 Last Seen: April 15 Share Posted April 7, 2013 I'm looking for a script command that allows the script to check and see if an item is an etc type. I thought there was something of the sort, but I can't seem to figure out what that was. Thanks. Peopleperson49 Quote Link to comment Share on other sites More sharing options...
1 Emistry Posted April 7, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted April 7, 2013 like this ? prontera,155,181,5 script Sample 757,{ getinventorylist; while( .@i < @inventorylist_count ){ if( getiteminfo( @inventorylist_id[.@i],2 ) == 3 ){ .@item_id[.@found] = @inventorylist_id[.@i]; .@found++; .@menu$ = .@menu$ + getitemname( @inventorylist_id[.@i] ) +":"; } .@i++; } if( .@found ){ .@i = select( .@menu$ ) - 1; mes "You selected "+getitemname( .@item_id[.@i] ); }else{ mes "No items."; } close; } 1 Quote Link to comment Share on other sites More sharing options...
clydelion Posted April 7, 2013 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 754 Reputation: 186 Joined: 05/22/12 Last Seen: October 15, 2022 Share Posted April 7, 2013 Quoted from script_commands.txt *getiteminfo(<item ID>,<type>)This function will look up the item with the specified ID number in the databaseand return the info set by TYPE argument.It will return -1 if there is no such item.Valid types are: 0 - Buy Price; 1 - Sell Price; 2 - Item Type; 3 - maxchance (max drop chance of this item, e.g. 1 = 0.01%) if = 0, then monsters don't drop it at all (rare or a quest item) if = 10000, then this item is sold in NPC shops only 4 - sex; 5 - equip; 6 - weight; 7 - atk; 8 - def; 9 - range; 10 - slot; 11 - look; 12 - elv; 13 - wlv; 14 - view id (from 'db/item_avail.txt') If RENEWAL is defined, 15 - matkSee the sample in 'doc/sample/getiteminfo.txt'. Quote Link to comment Share on other sites More sharing options...
Peopleperson49 Posted April 7, 2013 Group: Members Topic Count: 219 Topics Per Day: 0.05 Content Count: 1181 Reputation: 141 Joined: 01/27/12 Last Seen: April 15 Author Share Posted April 7, 2013 (edited) Thanks for the reply. I guess I need to be a bit more specific. I wrote a very nice enchantment script which I want to enchant only etc type items. It works good if I specify a range of items, but since there are so many spread out places that contain etc items I need it to check if the item is an etc item in the players inventory instead. For example if the player has 12 etc items and 6 weapons in there inventory. I want it to only show the 12 etc items in the list of options to choose from. Peopleperson49 I currently use this: mes "["+getarg(0)+"]";mes "Which charm do you want to upgrade with?";set .@CharmMenu$,"";for(set .@i,22001; .@i<=22043; set .@i,.@i+1) { if(countitem(.@i)>0) { set .@CharmMenu$,.@CharmMenu$+""+getitemname(.@i)+""; } else { set .@CharmMenu$,.@CharmMenu$+":"; } }set .@CharmType,select(.@CharmMenu$);set .@CharmType,.@CharmType+22000;mes ""+.@CharmType+""; Edited April 7, 2013 by Peopleperson49 Quote Link to comment Share on other sites More sharing options...
Peopleperson49 Posted April 8, 2013 Group: Members Topic Count: 219 Topics Per Day: 0.05 Content Count: 1181 Reputation: 141 Joined: 01/27/12 Last Seen: April 15 Author Share Posted April 8, 2013 Thanks Emistry for the suggestion. I had already tried this way before, but never could seem to get it right. Your idea worked quite nicely for what I needed. Peopleperson49 Quote Link to comment Share on other sites More sharing options...
Question
Peopleperson49
I'm looking for a script command that allows the script to check and see if an item is an etc type. I thought there was something of the sort, but I can't seem to figure out what that was. Thanks.
Peopleperson49
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.