But I don't want to sell items, what I want to do is to detect for example:
200 White Potions
20 Awakening Potions
The player will put 200 white potions and 20 awakening potions, and what the script should do is to store these numbers and names into vars, but I am failing at this last step (my mind is about to blow X_x).
The bad thing about the script is that it compares @sold_nameid with a white potion and a orange potion, but it does not save it into a var.
I would be REALLY GRATEFUL, for any help, srsly lol.
My badass script /heh
- shop dyn_shop1 -1,501:50- script Test -1,{ callshop "dyn_shop1",2; npcshopattach "dyn_shop1"; end;OnSellItem: for (.@i = 0; .@i < getarraysize(@sold_nameid); .@i++) { if (countitem(@sold_nameid[.@i]) < @sold_quantity[.@i] || @sold_quantity[.@i] <= 0) { mes "omgh4x!"; close; } else if ( @sold_nameid[.@i] > 1 ) set .@item1,@sold_nameid[.@i]; else if ( @sold_nameid[.@i] > 2 ) set .@item2,@sold_nameid[.@i]; else if ( @sold_nameid[.@i] > 3 ) set .@item3,@sold_nameid[.@i]; mes ""+.@item1+","+.@item2+","+.@item3+""; close; deletearray @sold_quantity, getarraysize(@sold_quantity); deletearray @sold_nameid, getarraysize(@sold_nameid); mes "Deal completed."; close; }}prontera,154,182,5 duplicate(Test) Test#1 117
I am using a dynamic shop from trunk>doc>sample>npc_dynamic_shop.txt.
But I don't want to sell items, what I want to do is to detect for example:
200 White Potions
20 Awakening Potions
The player will put 200 white potions and 20 awakening potions, and what the script should do is to store these numbers and names into vars, but I am failing at this last step (my mind is about to blow X_x).
The bad thing about the script is that it compares @sold_nameid with a white potion and a orange potion, but it does not save it into a var.
I would be REALLY GRATEFUL, for any help, srsly lol.
My badass script /heh
I get this:
Share this post
Link to post
Share on other sites