virusytb Posted May 1, 2018 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 6 Reputation: 0 Joined: 04/25/18 Last Seen: May 3, 2018 Share Posted May 1, 2018 How do I turn this Script into Cash Shop? A_quest.txt Quote Link to comment Share on other sites More sharing options...
0 Tisuuu Posted May 1, 2018 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 37 Reputation: 3 Joined: 02/14/14 Last Seen: June 15, 2020 Share Posted May 1, 2018 11 minutes ago, virusytb said: How do I turn this Script into Cash Shop? A_quest.txt In line 139: // -------- Dummy data (duplicate as needed) -------- - shop qshop1 -1,909:-1 To: // -------- Dummy data (duplicate as needed) -------- - cashshop qshop1 -1,909:-1 Quote Link to comment Share on other sites More sharing options...
0 virusytb Posted May 1, 2018 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 6 Reputation: 0 Joined: 04/25/18 Last Seen: May 3, 2018 Author Share Posted May 1, 2018 (edited) 17 minutos atrás, Tisuuu disse: Na linha 139: Pára: Eu fiz isso mais eu não posso usar, tipo eu não posso adicionar os itens, você pode mostrar um exemplo com o item adicionado? Edited May 1, 2018 by virusytb Quote Link to comment Share on other sites More sharing options...
0 Tisuuu Posted May 1, 2018 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 37 Reputation: 3 Joined: 02/14/14 Last Seen: June 15, 2020 Share Posted May 1, 2018 (edited) 10 minutes ago, virusytb said: Eu fiz isso mais eu não posso usar, tipo eu não posso adicionar os itens, você pode mostrar um exemplo com o item adicionado? Na verdade agora que eu parei pra vê o script e realmente não é do jeito que eu postei lá em cima, vou lhe dá um exemplo de como faz, só me responde uma pergunta... Você quer um npc de cash shop que vende itens de cash mas que são comprados através de outros itens como uma quest ou somente através de cash? Poderia simplificar o pedido? Obs: Um item de cash pedindo outros itens como compra é a mesma coisa de quest, tem nada haver com cash... O modelo de como o npc foi feito é algo a parte. Edited May 1, 2018 by Tisuuu Quote Link to comment Share on other sites More sharing options...
0 virusytb Posted May 1, 2018 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 6 Reputation: 0 Joined: 04/25/18 Last Seen: May 3, 2018 Author Share Posted May 1, 2018 2 minutes ago, Tisuuu said: Na verdade, você pode ver o script e realmente não fazer o mesmo que eu tenho a oportunidade de fazer uma loja de dinheiro que vende itens. de cash mas que são comprados através de outros itens como uma missão ou somente através de quest? Poderia simplificar o pedido? Obs: Um item de pagamento com outros itens como a compra é uma coisa de busca, tem nada a ver com dinheiro ... To tell you the truth I wanted to turn him into a cash salesman, for the option to try the item before buying, If I can get an NPC with such a function I will be very grateful for the help. Quote Link to comment Share on other sites More sharing options...
0 Tisuuu Posted May 1, 2018 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 37 Reputation: 3 Joined: 02/14/14 Last Seen: June 15, 2020 Share Posted May 1, 2018 i don't know, used function getiteminfo(itemid,14) to construct script but not return nothing.. sorry... Quote Link to comment Share on other sites More sharing options...
0 iamhyd Posted May 1, 2018 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 64 Reputation: 9 Joined: 09/28/13 Last Seen: March 9, 2023 Share Posted May 1, 2018 Hope this one helps you. Quote Add(<shop number>,<reward ID>,<reward amount>,<Zeny cost>,<point cost>,<required item ID>,<required item amount>{,...}); Add(1,20050,1,7500000,change_this_to_cashpoint_value,5170,1,983,6,7180,10); Quote Link to comment Share on other sites More sharing options...
0 Sikdope Posted September 11, 2020 Group: Members Topic Count: 9 Topics Per Day: 0.01 Content Count: 51 Reputation: 0 Joined: 08/28/20 Last Seen: January 24, 2021 Share Posted September 11, 2020 (edited) prontera, 127,210.4 script Quests Spartacus-ro 74, { function Add; function Chk; function Slot; function A_An; mes "^ FF1493 [Quest Master] ^ 000000"; mes (gettime (3)> = 6 && gettime (3) <= 12? "Good morning" :( gettime (3)> = 13 && gettime (3) <= 18? "Good afternoon": "Good evening")) + ", ^ 008aff" + strcharinfo (0) + "^ 000000!"; mes "Here at HeroBRO we have a new quest system that works like a store that asks for items."; next; mes "^ FF1493 [Quest Master] ^ 000000"; mes "So, what kind of item do you want to make?"; next; if (.Shops $! = "") set. @ i, 1; else { set. @ menu $, ""; for (set. @ i, 1;. @ i <= getarraysize (.Shops $); set. @ i,. @ i + 1) set. @ menu $ ,. @ menu $ +. Shops $ [. @ i ] + ":"; set. @ i, select (. @ menu $); } dispbottom "Select one item at a time."; callshop "qshop" +. @ i, 1; npcshopattach "qshop" +. @ i; end; function Add { if (getitemname (getarg (1)) == "null") { debugmes "Quest reward #" + getarg (1) + "invalid (skipped)."; return; } for (set. @ n, 5 ;. @ n <127; set. @ n ,. @ n + 2) { if (! getarg (. @ n, 0)) break; if (getitemname (getarg (. @ n)) == "null") { debugmes "Quest requirement #" + getarg (. @ n) + "invalid (skipped)."; return; }} for (set. @ i, 2 ;. @ i <. @ n; set. @ i ,. @ i + 1) set getd (". q _" + getarg (1) + "[" + (. @ i-2) + "]"), getarg (. @ i); npcshopadditem "qshop" + getarg (0), getarg (1), ((. ShowZeny)? getarg (3): 0); return; } function Chk { if (getarg (0) <getarg (1)) {set @ qe0,1; return " set. @ s $, getitemname (getarg (0)); switch (.ShowSlot) { case 1: if (! getitemslots (getarg (0))) return. @ s $; case 2: if (getiteminfo (getarg (0), 11)> 0) return. @ s $ + "[" + getitemslots (getarg (0)) + "]"; default: return. @ s $; }} function A_An { setarray. @ A $ [0], "a", "e", "i", "o", "u"; set. @ B $, "_" + getarg (0); for (set. @ i, 0;. @ i <5; set. @ i,. @ i + 1) if (compare (. @ B $, "_" +. @ A $ [. @ i])) return "an" + getarg (0); return "a" + getarg (0); } OnBuyItem: set. @ Q [0], @ bought_nameid; copyarray. @ q [1], getd (". q _" + @ bought_nameid + "[0]"), getarraysize (getd (". q _" + @ bought_nameid + "[0]")); if (!. @ q [1]) {message strcharinfo (0), "An error occurred."; end; } mes "^ FF1493 [Quest Master] ^ 000000"; mes "Reward: ^ 0055FF" + ((. @ q [1]> 1)?. @ q [1] + "x": "") + Slot (. @ q [0]) + "^ 000000"; mes "Requirements:"; if (. @ q [2]) mes ">" + Chk (Zeny,. @ q [2]) +. @ q [2] + "Zeny ^ 000000"; if (. @ q [3]) mes ">" + Chk (getd (.Points $ [0]),. @ q [3]) +. @ q [3] + "" + .Points $ [1] + "(" + getd (.Points $ [0]) + "/" +. @ q [3] + ") ^ 000000"; if (. mes ">" + Chk (countitem (. @ q [. @ i]),. @ q [. @ i + 1]) + ((. DisplayID)? "[" +. @ q [. @ i] + "]": "") + Slot (. @ Q [. @ I]) + "(" + countitem (. @ Q [. @ I]) + "/" +. @ Q [. @ I + 1] + ") ^ 000000"; next; set @ qe1, getiteminfo (. @ q [0], 5); set @ qe2, getiteminfo (. @ q [0], 11); addtimer 1000, strnpcinfo (1) + ":: OnEnd"; while (1) { switch (select ("[^ 008000» ^ 000000] Do ^ 0055FF "+ getitemname (. @ q [0]) +" ^ 000000: "+ (((((@ qe1 & 1) || (@ qe1 & 256 ) || (@ qe1 & 512)) && @ qe2> 0 &&! @ qe6)? "[^ 008000» ^ 000000] Try Item. ":" ") +": ^ 777777Cancel. ^ 000000 ")) { case 1: if (@ qe0) { mes " close; } if (! checkweight (. @ q [0],. @ q [1])) { mes "^ FF1493 [Quest's Master] ^ 000000"; mes "^ FF0000You need" + ((((. @ q [1] * getiteminfo (. @ q [0], 6)) + Weight-MaxWeight) / 10) + "additional weight capacity to complete this purchase. ^ 000000 "; close; } if (. @ q [2]) set Zeny, Zeny -. @ q [2]; if (. @ q [3]) setd .Points $ [0], getd (.Points $ [0]) -. @ q [3]; if (. @ q [4]) for (set. @ i, 4;. @ i <getarraysize (. @ q); set. @ i ,. @ i + 2) delitem. @ q [. @ i], . @ q [. @ i + 1]; getitem. @ q [0],. @ q [1]; if (.Announce) announce strcharinfo (0) + "just completed the item quest: [" + (getitemname (. @ q [0])) + "]!", 0; specialeffect2 699; close; case 2: set @ qe3, getlook (3); set @ qe4, getlook (4); set @ qe5, getlook (5); if (@ qe1 & 1) atcommand "@changelook 3" + @ qe2; if (@ qe1 & 256) atcommand "@changelook 1" + @ qe2; if (@ qe1 & 512) atcommand "@changelook 2" + @ qe2; set @ qe6,1; break; case 3: close; }} OnEnd: if (@qe6) { atcommand "@changelook 3 "+@qe3; atcommand "@changelook 1 "+@qe4; atcommand "@changelook 2 "+@qe5; } for(set .@i,0; .@i<7; set .@i,.@i+1) setd "@qe"+.@i,0; end; OnPCLoadMapEvent: if( strcharinfo(3) == strnpcinfo(4) ) showevent 1,0; end; OnInit: freeloop(1); // --------------------- Config --------------------- // Custom points, if needed: "<variable>","<name to display>" setarray .Points$[0],"#CASHPOINTS","Cash Points"; set .Announce,1; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,2; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .DisplayID,1; // Show item IDs? (1: yes / 0: no) set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) // Shop categories, if needed: "<Shop 1>","<Shop 2>"{,...}; // Duplicate dummy data for any additional shops (bottom of script). // If no categories, use the second line instead (remove //). setarray .Shops$[1],"[^FF000001^000000] Quest [^008000Hats Colorido^000000]."; // set .Shops$,"n/a"; // Add (<shop number>, <reward ID>, <reward amount>, <Zeny cost>, <point cost>, // <required item ID>, <required item amount> {, ...}); // Shop number corresponds with order above (default is 1). // Note: Do NOT use a reward item more than once! // Sinx Add (1,20050,1,7500000,0,5170,1,983,6,7180,10); // ------------------------------------------------ - freeloop (0); for (set. @ i, 1;. @ i <= getarraysize (.Shops $); set. @ i ,. @ i + 1) npcshopdelitem "qshop" +. @ i, 909; end; } // -------- Dummy data (duplicate as needed) -------- - shop qshop1 -1,909: -1 Edited September 12, 2020 by Emistry codebox Quote Link to comment Share on other sites More sharing options...
Question
virusytb
How do I turn this Script into Cash Shop?
A_quest.txt
Link to comment
Share on other sites
7 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.