The forums will be going offline for an extended maintenance period at 1400hrs GMT on 19th June 2025. The number of hours for this downtime is intentionally not advertised due to the nature of these upgrades.
×
- 0
NPC SHOP for +7 or + 10 items
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
celeron0134
prontera,156,181,5 script jfhdksfjhs 100,{ mes "select an item to buy"; next; .@s = select( .menu$ ) -1; if ( countitem( .itemuse ) < .sellcost[.@s] ) { mes "not enough "+ getitemname( .itemuse ); close; } delitem .itemuse, .sellcost[.@s]; getitem2 .sellitem[.@s], 1,1,10,0, 0,0,0,0; close; OnInit: setarray .sellitem, 1101, 1201, 1301; setarray .sellcost, 10, 20, 30; set .itemuse, 674; .@size = getarraysize( .sellitem ); for ( .@i = 0; .@i < .@size; .@i++ ) .menu$ = .menu$ + getitemname( .sellitem[.@i] )+" +10 [Cost -> "+ .sellcost[.@i] +"]:"; end; }
prontera,156,172,5 script market 100,{ dispbottom "You currently have "+ countitem(.itemuse) +" "+ getitemname(.itemuse); callshop "market2#hidden", 1; end; OnBuyItem: if ( !@bought_quantity ) end; .@size = getarraysize( @bought_nameid ); while ( .@i < .@size ) { .@j = 0; while ( @bought_nameid[.@i] != .itemid[.@j] && .@j < .shop_size ) .@j++; .@itemcost = .@itemcost + .itemcost[.@j] * @bought_quantity[.@i]; .@i++; } if ( .@itemcost > countitem(.itemuse) ) { mes "you don't have enough "+ getitemname(.itemuse); close; } delitem .itemuse, .@itemcost; for ( set .@i,0; .@i < .@size; set .@i, .@i +1 ) getitem @bought_nameid[.@i], @bought_quantity[.@i]; deletearray @bought_nameid; deletearray @bought_quantity; end; OnInit: setarray .itemid,1101,1201,1301,1501,1601; setarray .itemcost,10,20,30,40,50; set .itemuse, 674; .shop_size = getarraysize(.itemid); npcshopdelitem "market2#hidden", 512; for ( .@i = 0; .@i < .shop_size; .@i++ ) npcshopadditem "market2#hidden", .itemid[.@i], .itemcost[.@i]; npcshopattach "market2#hidden"; end; } - shop market2#hidden -1,512:10000
how will i combine this two scripts?? my goal is to have a NPC that sells Refined Equipments for Coins .. but it will open a shop where you can see like +7 pole axe,+8 Shield Etc.
thanks in advance..
Link to comment
Share on other sites
5 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.