Jump to content

ankana

Members
  • Posts

    6
  • Joined

  • Last visited

Community Answers

  1. ankana's post in ItemSearch and ShopNPC was marked as the answer   
    I will test it - if im home later.
    Thanks in Advance
    Ankana
    Yeah - i did it - now everything works as mentioned.
    I'll post it here, if i'm home in the evening.
    What is the npc doing:
    1) search for a given itemname within the database
    2) show a list of available items containing this part of item within the name as a menu (maybe i'll sort them within the menu)
    3) ask for an amount of these item
    4) put the amount of the selected item into the player's inventory
    See ya later
    Ankana

    prontera.gat,150,186,5 script Item-Distributor 109,{ mes "[item-Distributor]"; mes "Which item are you looking for?"; next; input .@item$; set @nb,query_sql("select `id`,`name_japanese`,`slots` from `item_db` where `name_japanese` LIKE '%"+.@item$+"%'",.@itemid,.@itemname$,.@slots); mes "[item-Distributor]"; mes "Item Search for : "+.@item$; set $@menu$,"Cancel"; for(set .@i, 0;.@i < getarraysize(.@itemid);set .@i, .@i + 1){ set .@menu$,.@menu$+":"+.@itemname$[.@i]+"["+.@slots[.@i]+"]"; //mes .@itemname$[.@i]+"["+.@slots[.@i]+"] (ID "+.@itemid[.@i]+")"; } mes "Please select your wanted Item from the List."; set .@part,select(.@menu$); mes "How Many Items do you want ?"; input .@number; next; set .@part,.@part -2; mes .@number+" "+.@itemname$[.@part]+"(ID "+.@itemid[.@part]+") was created."; getItem .@itemid[.@part],.@number; close; }
×
×
  • Create New...