Jump to content

caspa

Members
  • Posts

    499
  • Joined

  • Last visited

Everything posted by caspa

  1. hello everyone i would like to ask for your help.... in regards to this script.. i'm having real troulbe with gettime scripts this is the script invek,136,148,5 script Daily Quest 733,{ mes "[ Daily Quest ]"; mes "Hello ^0000ff"+strcharinfo(0)+"^000000,"; mes "How can i help you?"; mes " "; mes "^ff0000NOTE^000000 :"; mes "Daily quest starts every"; mes "1:00 A.M and 1:00 P.M"; next; menu "Do the Daily Quest",doquest,"^ff0000Exit^000000",dontdodaily; dontdodaily: close; doquest: set .@t,gettime(4)*2 + ( gettime(3) > 12 ? 1 : 0 ); mes "[ Daily Quest ]"; mes ""+ .week$[.@t] + " Quest Detail :"; mes "^777777Required Items^000000 :"; set .@size,getarraysize( getd( ".req_item"+ .@t ) ); for ( set .@i,1; .@i < .@size; set .@i,.@i+2) mes ""+((countitem( getd( ".req_item"+ .@t +"["+ .@i +"]" ) ) < getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) ) ? "^ff0000":"^008800")+""+getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) +"x "+ getitemname( getd( ".req_item"+ .@t +"["+ .@i +"]" ) )+" ("+countitem( getd( ".req_item"+ .@t +"["+ .@i +"]" ) )+"/"+getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) +")"; mes "^777777Reward Items^000000 :"; mes "1x "+getitemname( getd( ".req_item"+ .@t ) ); mes "1x Refinement Card"; next; if ( select ( "Submit ^0000ffDaily Quest Items", "^ff0000Exit^000000" ) == 2 ) { close; } else if( #the_day_today == gettime(4)*2 + ( gettime(3) > 12 ? 1 : 0 ) ) { mes "[ Daily Quest ]"; mes "I'm sorry, but you have completed"; mes "the ^ff0000"+( gettime(3) > 12 ? "P.M" : "A.M" )+"^000000 quest for today already."; mes "Please comeback later for"; mes "the ^0000ff"+(gettime(3) > 12 ? "A.M" : "P.M" )+"^000000 quest."; close; } else if ( gettime(4)*2 + ( gettime(3) > 12 ? 1 : 0 ) != .@t ) { mes "[ Daily Quest ]"; mes "I'm sorry, but the daily quest has just been updated."; mes "I now require a new set of quest items."; close; } mes "[ Daily Quest ]"; mes "^ff0000*Checking Inventory*^000000"; mes "Please wait...."; sleep2 5000; mes " "; mes " "; mes "• ^008800Inventory Check Complete^000000"; next; for ( set .@i,1; .@i < .@size; set .@i,.@i+2 ) { if ( countitem( getd( ".req_item"+ .@t +"["+ .@i +"]" ) ) < getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) ) { setarray .@not_enough[.@c], getd( ".req_item"+ .@t +"["+ .@i +"]" ), getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ) - countitem( getd( ".req_item"+ .@t +"["+ .@i +"]" ) ); set .@c,.@c + 2; } } if ( .@c ) { mes "[ Daily Quest ]"; mes "You do not have enough ^ff0000Quest Items^000000."; close; } for ( set .@i,1; .@i < .@size; set .@i,.@i + 2 ) delitem getd( ".req_item"+ .@t +"["+ .@i +"]" ), getd( ".req_item"+ .@t +"["+( .@i +1 )+"]" ); getitem getd( ".req_item"+ .@t ), 1; set #the_day_today,gettime(4)*2 + ( gettime(3) > 12 ? 1 : 0 ); mes "[ Daily Quest ]"; mes "^777777Quest Completed^000000 :"; mes "^009900"+ .week$[.@t]+" Quest^000000"; mes " "; mes "^777777Received Items^000000 :"; mes "• ^0000ff1x "+getitemname( getd( ".req_item"+ .@t ) ); mes "• ^0000ff1x Refinement card^000000"; getitem 21013,1; close; OnInit: waitingroom "Daily Quest",0; setarray .week$, "Sunday's (A.M)", "Sunday's (P.M)", "Monday's (A.M)", "Monday's (P.M)", "Tuesday's (A.M)", "Tuesday's (P.M)", "Wednesday's (A.M)", "Wednesday's (P.M)", "Thursday's (A.M)", "Thursday's (P.M)", "Friday's (A.M)", "Friday's (P.M)", "Saturday's (A.M)", "Saturday's (P.M)"; setarray .req_item0, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1;// sunday setarray .req_item1, 21010, rand( 901,1070 ),rand( 10,20 ), 502,20, 503,30, 504, 40;// sunday PM etc.. setarray .req_item2, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item3, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item4, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item5, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item6, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item7, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item8, 21010, rand( 901,1070 ),rand( 10,20 ), 502,20, 503,30, 504, 40; setarray .req_item9, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item10, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item11, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item12, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; setarray .req_item13, 21010, rand( 901,1070 ),rand( 10,20 ), 502,1; end; } this is a a script made by CAPUCHE from the scripting request way back in 2013 or 2014 if i'm correct....... i can submit the daily quest if its morning however when it becomes 1 pm and above it's telling me directly that i completed the quest already. thank you so much
  2. caspa

    Refill NPC

    oh i'm sorry sir... can you please help me? i dont know where to find the restock npc of emistry sir..
  3. caspa

    Refill NPC

    can anyone give a script that when click will give you 100 white pots and 50 blue pots, but if u consume 8 white pots and 20 blue ul have 92 wp and 30 bp by then so when you u click the npc again it will give 8 wp and 20 bp so you would have a total of 100 wp and 50 bp again... its the same as refill NPC brian made but i don't want the refill set-up... thank you guys...
  4. Hi guys i would like to ask for ur help....i was about to ask for a script help a while ago but i saw this script.. it was similar to what was i supposed to ask for somebody's help.. however this script is beyond to what i need.... i only need an npc that refill your storage 100 blue and 50 white pots... i don't need the refill set-up ncp.. i tried to mess and see if i could recreate this but to no avail.. i failed miserably... i humbly ask for your help.. i need this kind of npc but just the refill npc.... i need it to give only 100 white potion and 50 blue potion and then if the person has only 20 white potion and 46 blue potion if cliked.. it would give 80 wp and 4 bp as a refill... and if u have 100 white potion and 50 white pots.. it would not give any.. also i would like for the npc to check the weight... thank you guys.. //===== eAthena Script ======================================= //= Item Refiller //===== By: ================================================== //= Brian //===== Current Version: ===================================== //= 1.0 //===== Compatible With: ===================================== //= eAthena SVN + ToastOfDoom's String Commands Package //= http://www.eathena.ws/board/index.php?showtopic=204976 //===== Description: ========================================= //= 1. setup a list of items & amounts //= 2. one-click to refill those items //===== Additional Comments: ================================= //= http://www.eathena.ws/board/index.php?showtopic=279904 //============================================================ poring_c01,105,100,0 script Refill NOW 910,{ doevent "refill::OnRefill"; end; } poring_c01,100,100,0 script Novice Helper::refill 837,{ if (getarraysize(.usable) == 0) donpcevent strnpcinfo(3)+"::OnInit"; mes "[Refill Setup]"; switch(select((refill_list$ == "") ? "Make a refill list" : ":View my refill list:Edit my refill list:^FF0000Delete^000000 my refill list")) { case 2: // VIEW M_view: explode .@items$, refill_list$, ","; for (set .@i,0; .@i<getarraysize(.@items$); set .@i,.@i+1) { explode .@part$, .@items$[.@i], ":"; mes .@part$[1] + " " + getitemname(atoi(.@part$[0])); set .@total_weight, .@total_weight + getiteminfo(atoi(.@part$[0]),6)*atoi(.@part$[1]); } mes "Total Weight : ^" + ((.@total_weight <= MaxWeight) ? "008000" : "FF0000") + .@total_weight/10 + "^000000 / " + MaxWeight/10; break; case 3: // EDIT - load their refill list first explode .@items$, refill_list$, ","; for (set .@i,0; .@i<getarraysize(.@items$); set .@i,.@i+1) { explode .@part$, .@items$[.@i], ":"; setd ".@"+.@part$[0], .@part$[1]; } case 1: // CREATE mes "What item(s) do you want?"; select("Usable Items:Other Items:^008000All done, save my refill list^000000"); while (@menu <= 2) { switch(@menu) { // Usable Items case 1: set .@menu$, ""; for (set .@i,0; .@i<getarraysize(.usable); set .@i,.@i+1) set .@menu$, .@menu$ + (getd(".@"+.usable[.@i]) ? getd(".@"+.usable[.@i]) : "--") +" "+ getitemname(.usable[.@i])+":"; select(.@menu$ + "<< Back"); while (@menu <= getarraysize(.usable)) { set .@item_id, .usable[@menu-1]; mes "How many "+getitemname(.@item_id)+"?"; input .@amt,0,30000; setd ".@"+.@item_id, .@amt; // refresh menu set .@menu$, ""; for (set .@i,0; .@i<getarraysize(.usable); set .@i,.@i+1) set .@menu$, .@menu$ + (getd(".@"+.usable[.@i]) ? getd(".@"+.usable[.@i]) : "--") +" "+ getitemname(.usable[.@i])+":"; select(.@menu$ + "<< Back"); }; break; // Other Items case 2: set .@menu$, ""; for (set .@i,0; .@i<getarraysize(.other); set .@i,.@i+1) set .@menu$, .@menu$ + (getd(".@"+.other[.@i]) ? getd(".@"+.other[.@i]) : "--") +" "+ getitemname(.other[.@i])+":"; select(.@menu$ + "<< Back"); while (@menu <= getarraysize(.other)) { set .@item_id, .other[@menu-1]; mes "How many "+getitemname(.@item_id)+"?"; input .@amt,0,30000; setd ".@"+.@item_id, .@amt; // refresh menu set .@menu$, ""; for (set .@i,0; .@i<getarraysize(.other); set .@i,.@i+1) set .@menu$, .@menu$ + (getd(".@"+.other[.@i]) ? getd(".@"+.other[.@i]) : "--") +" "+ getitemname(.other[.@i])+":"; select(.@menu$ + "<< Back"); }; break; } select("Usable Items:Other Items:^008000All done, save my refill list^000000"); }; // SAVE // concatenate into string --> item:amt,item:amt, for (set .@i,0; .@i<getarraysize(.usable); set .@i,.@i+1) { if (getd(".@"+.usable[.@i])) set .@refill_list$, .@refill_list$ + .usable[.@i]+":"+getd(".@"+.usable[.@i])+","; } for (set .@i,0; .@i<getarraysize(.other); set .@i,.@i+1) { if (getd(".@"+.other[.@i])) set .@refill_list$, .@refill_list$ + .other[.@i]+":"+getd(".@"+.other[.@i])+","; } if (getstrlen(.@refill_list$) > 255) { mes "I'm sorry, your refill list is too long. " + "The limit is 25~42 items."; // 6*42=252 ~ 10*25=250 } else if (getstrlen(.@refill_list$) > 4) { set refill_list$, .@refill_list$; mes "^008000Your refill list has been saved!^000000"; next; mes "[Refill Setup]"; goto M_view; // show them their list } else { mes "You did not select any items."; } break; case 4: // DELETE set refill_list$, ""; mes "Your refill list has been deleted."; break; } close; OnRefill: // parse their refill list explode .@items$, refill_list$, ","; for (set .@i,0; .@i<getarraysize(.@items$); set .@i,.@i+1) { explode .@part$, .@items$[.@i], ":"; setd ".@"+.@part$[0], (.@part$[1]); } for (set .@i,0; .@i<getarraysize(.usable); set .@i,.@i+1) { set .@amt, getd(".@"+.usable[.@i]); if (.@amt && countitem(.usable[.@i])<.@amt) { set .@get_amt, .@amt-countitem(.usable[.@i]); if (checkweight(.usable[.@i],.@get_amt)) { getitem .usable[.@i],.@get_amt; set .@refilled$, .@refilled$ + .@get_amt+" "+getitemname(.usable[.@i])+", "; } else { set .@overweight,1; break; } } } for (set .@i,0; .@i<getarraysize(.other); set .@i,.@i+1) { set .@amt, getd(".@"+.other[.@i]); if (.@amt && countitem(.other[.@i])<.@amt) { set .@get_amt, .@amt-countitem(.other[.@i]); if (checkweight(.other[.@i],.@get_amt)) { getitem .other[.@i],.@get_amt; set .@refilled$, .@refilled$ + .@get_amt+" "+getitemname(.other[.@i])+", "; } else { set .@overweight,1; break; } } } if (.@overweight) { dispbottom "You are overweight or carrying too many items."; emotion e_swt,1; } else if (.@refilled$ != "") { dispbottom "Refilled " + substr(.@refilled$,0,getstrlen(.@refilled$)-3) + " !"; emotion e_thx,1; } else { // already have all items in refill list emotion e_no1,1; } end; OnInit: setarray .usable[0], 504, // White_Potion 505, // Blue_Potion 12016, // Speed_Up_Potion 0; // OR just delete this line and end the previous line with a semi-colon setarray .other[0], 7136, // Acid_Bottle 7135, // Fire_Bottle 678, // Poison_Bottle 0; end; }
  5. hi guys... can anybody help me with this script? can't seem to make it work... mes "^ff0000Online Users^000000 :"; //---------------------------------------------------------------------------------------------------------------- set .@size, query_sql( "SELECT `name` FROM `char` WHERE `online` = 1 AND `account_id` NOT IN ( SELECT `account_id` FROM `login` WHERE `level` > 0 ) ORDER BY `name` DESC LIMIT 128", .@name$ ); //----------------------------------------------------------------------------------------------------------------- for( set .@i,0; .@i < .@size; set .@i,.@i+1 ) { getmapxy( .@map$, .@x, .@y, 0, .@name$[.@i] ); set .@base, readparam( 11,.@name$[.@i] ); set .@jobl, readparam( 55,.@name$[.@i] ); set .@jname$,jobname( readparam( 19,.@name$[.@i] ) ); mes ""+( .@i+1 ) +". ^007700"+ .@name$[.@i] +"^000000"; } for (set .@z,0; .@z<getarraysize(.@name$); set .@z,.@z+1) set .@menu$, .@menu$ + .@name$[.@z]+":"; set .@num, select(.@menu$) -1; next; mes "^ff0000"+.@name$[.@num]+" Info^000000 :"; mes "^777777Class^000000 : ^0055FF"+.@jname$[.@i]+""; mes "^777777Base Lvl^000000 : ^0055FF"+ .@base[.@i] +""; mes "^777777Job Lvl^000000 : ^0055FF"+ .@jobl[.@i]+""; mes "^777777Map^000000 : ^0055FF"+ .@map$ +" "+.@x+", "+.@y+""; close;
  6. good day fellow rathena user.. i'm having trouble with defining the max guild member on my server...i followed all the necessary things to do for reducing the max members..this is the results and what i did.....
  7. if i do that then the waiting room will display something like [PvP Room - [100 Users]]i need it to add all the user on all 3 maps and show it on the waitingroom as 1so if pvp_1 has 3 people and pvp_room has 2 people then pvp_3 has 4 people... i want the waiting room to show [9 Users] help please....
  8. hello fellow rathena users.. i just want to know why this particular script does not work.. it doesn't read any user on the maps... OnInIt: set .@pvp_maps,getmapusers("pvp_y_room") + getmapusers("pvp_y_1-2") + getmapusers("pvp_2v2"); while(1){ delwaitingroom; waitingroom "PvP Room ["+.@pvp_maps+" User"+(( .@pvp_maps >= 2 ) ? "s" : "" )+"]",0; sleep 1000; } end; }
  9. caspa

    Zeny ranker

    can somebody please help me create a zeny ranker script.... the script would have a function like this mes "How can i help you?"'; next; menu "View zeny ranking",1; 1: mes "Alright, here's the top 10 richest character on the server :" top 1 - name 1 top 2 - name 2 top 3 - name 3 top 4 - name 4 top 5 - name 5 top 6 - name 6 top 7 - name 7 top 8 - name 8 top 9 - name 9 top 10 - name 10 next; menu "name 1",n1," "name 2",n2," "name 2",n2," "name 3",n3," "name 4",n4," "name 5",n5," "name 6",n6," and so on..... n1: name : job : blvl : jlvl : guild : current zeny : 1 billion n2: name : job : blvl : jlvl : guild : current zeny : 900 million and so on.....
  10. caspa

    server time

    when i use this one my map server crash....
  11. caspa

    server time

    this is a 24 hour based script...... this is the one i'm currently using..
  12. caspa

    server time

    can i have a script where it would display a 12 hour based times and not 24 hour based time on the waitingroom? like if the time is 1:00 PM ........ it displays 1:00 P.M and not 13:00 PM
  13. can someone please share(if anybody has it already) or make(out of generosity) it.. its like a pvp ladder where it displays 10 user who are killer... i mean my server is pk on and if a player kills a novice or whatsoever on fields, dungeon and other places they'll be put on the bounty list... and if you kill them you'll gain zeny or rewards... =3
  14. yeah i think it's kinda similar but i want names not rewards... =3
  15. can i request for an npc that has this kind of function.. -START an event gm has conducted an event.... then after the event 'size' is the winner... now that gm has no @item so the only thing he could do is go to the record npc... in that npc he will write the name of the player... then after the player has been written it'll ask for some description now hell put = winner of blah blah event... after the description has been set-up it'll ask for what is his prize? then he'll put the id of the item that the player is supposed to get.... now that hes finished he decided to conduct another event so it's now the 2nd event. the winner of this event is 'tantrum' he will go again to the npc and add tantrum on the list........ now the event gm has log off... The admin has logged in... the admin now goes to the npc and after he clicked the npc he will see things like this --------------------------------------- [ Record NPC ] Hello GM ( Name )! How can i help you? --------------------------------------- Then a menu will appear 'View list & Close' if he clicked View List it'll display the 2 names that won the event. something like this ------------------------------------------ [ Record NPC ] Select a character. ----------------------------------------- menu 1. size 2. tantrum then the admin click 'size' the description & prize info will be shown to the admin... it'll be something like this ------------------------------------- [ Record NPC ] Name : size Description : winner of blah blah event Prize info : 100x tcg card 1x gold (or whatever the event gm has put on the prize info.) --------------------------------------- after he finishes reading the info. he will press next and a menu shall appear "Delete & Close" if he decided to delete the 'size' info there will be a RECYCLE BIN on the npc meaning there's a record of the files that was deleted and on that BIN there will be an option 'DELETE PERMANENTLY' which will delete the 'size' info permanently.. like 'woosshhh' GONE!!!! also if there's no pending list....... the npc will say... List empty... THank you for whoever will create this script =D @BUMP!
  16. It would probably be best to just check for a null menu anyways. So between the select and the loop that makes the menu add... if(.@menu$=="") { mes "OMG put some clothes on!"; close; } If you don't understand what I mean or think the the script works differently but don't want to paste it just send me a message with the script. I can't do much with the small snipit you gave me. I already figured it out... LOL!! i just came up with a more primitive solution... ( getequipid(1) == -1 && getequipid(2) == -1 && getequipid(3) == -1 && getequipid(4) == -1 && getequipid(5) == -1 && getequipid(6) == -1 && getequipid(7) == -1 && getequipid(8) == -1 && getequipid(9) == -1 && getequipid(10) == -1 ) hahahaha!! thx by the way sir skorm for giving your time...
  17. still not working boss..... the npc still tells me "please select the item" even though i'm not wearing any equipment.
  18. well i just want the npc to check if your wearing any item at all coz w/o the checker the npc show a blank menu without any item at all because your not wearing any..
  19. Boss Skorm, i forgot to mention i'm using 3ceAm... can you please convert it to 3ceam? please!!
  20. hi, i need a script where it would check if the player is wearing any item at all (exclude costume item)
  21. can somebody help me add a view headgear function on this script? Its Emistry's Multi currency shop // Settings : // - Only required to edit the ShopSetting() Function // Notes : You may also add / remove Menu ( If any ) // - Shop Currency can be either ItemID or Variable Name, but must write within Quotation Marks ( "" ) // Ex. of Variable. -> Zeny , #CASHPOINTS , #KAFRAPOINTS , CustomVariable , #CustomVariable // - ERROR Message are used to show Invalid Settings in your NPC. // Leave this alone... - shop Emistry_Shop -1,512:100 prontera,155,181,5 script Sample 757,{ function ShopSettings; function ValidateCost; function CurrencyInfo; function ClearData; function ValueConvert; function ErrorNotice; mes "Each Shop from the Menu may purchase using ^FF0000Different Currency^000000."; mes "^00FF00____________________________^000000"; mes "So,Which shop you would like to look at it"; next; // Menu Selection select("Shop 1","Shop 2","Shop 3"); ClearData(); ShopSettings( @menu ); npcshopitem "Emistry_Shop",512,100; npcshopdelitem "Emistry_Shop",512; for(set .@i,0; .@i < getarraysize( @ItemLists ); set .@i,.@i+1) npcshopadditem "Emistry_Shop",@ItemLists[.@i],@ItemCost[.@i]; mes "Okay...wait awhile"; mes "^00FF00____________________________^000000"; CurrencyInfo( @Currency$ ); mes "^00FF00____________________________^000000"; callshop "Emistry_Shop",1; npcshopattach "Emistry_Shop"; end; function ShopSettings { switch( getarg(0) ){ Case 1: // Currency [ Item ID / Variable Name ] set @Currency$,"7179"; // Item ID Lists setarray @ItemLists[0],6153,7227; // Item Price setarray @ItemCost[0],100,1; break; Case 2: // Currency [ Item ID / Variable Name ] set @Currency$,"7227"; // Item ID Lists setarray @ItemLists[0],2306,2302,2303,2304,2305,2301; // Item Price setarray @ItemCost[0],2,2,3,4,5,6; break; Case 3: // Currency [ Item ID / Variable Name ] set @Currency$,"#CASHPOINTS"; // Item ID Lists setarray @ItemLists[0],2306,2302,2303,2304,2305,2301; // Item Price setarray @ItemCost[0],20,22,34,445,52,641; break; // Case 4,5,6.....etc... default: ErrorNotice( "Invalid Menu Selection for Menu "+@menu+"." ); close; } if( @Currency$ == "" ) ErrorNotice( "Invalid Currency Setting in Menu "+@menu+" ." ); if( getarraysize( @ItemCost ) != getarraysize( @ItemLists ) || getarraysize( @ItemLists ) != getarraysize( @ItemCost ) ) ErrorNotice( "Missing or Extra Value of Item or Cost Settings in Menu "+@menu+" ." ); return; } function ErrorNotice { mes "^FF0000ERROR^000000 - "+getarg(0); mes "^00FF00____________________________^000000"; mes "Inform this Message to ^0000FFGame Staffs^000000 immediately !"; close; } function CurrencyInfo { if( getitemname( atoi( getarg(0) ) ) != "null" ){ mes "Item Currency : ^FF0000"+getitemname( atoi( getarg(0) ) )+"^000000"; mes "Available Amount : ^0000FF"+ValueConvert( countitem( atoi( getarg(0) ) ) )+"^000000"; }else if( getitemname( atoi( getarg(0) ) ) == "null" ){ mes "Variable Currency : ^FF0000"+getarg(0)+"^000000"; mes "Available Amount : ^0000FF"+ValueConvert( getd( getarg(0) ) )+"^000000"; } return; } function ValidateCost { if( getitemname( atoi( getarg(0) ) ) != "null" ){ if( countitem( atoi( getarg(0) ) ) < getarg(1) ) return 1; }else{ if( getd( getarg(0) ) < getarg(1) ) return 1; } return 0; } function ClearData { set @Currency$,""; set @TotalCost,0; deletearray @bought_nameid[0],getarraysize( @bought_nameid ); deletearray @bought_quantity[0],getarraysize( @bought_quantity ); deletearray @ItemLists[0],getarraysize( @ItemLists ); deletearray @ItemCost[0],getarraysize( @ItemCost ); return; } function ValueConvert { set .@num, atoi(""+getarg(0)); if ( .@num == 0 || .@num >= 2147483647 ) return getarg(0); set .@l, getstrlen(""+.@num); for ( set .@i,0; .@i < .@l; set .@i, .@i + 1 ) { set .@num$, .@num % pow(10,.@i+1) / pow(10,.@i) + .@num$; if ( (.@i+1) % 3 == 0 && .@i+1 != .@l ) set .@num$, ","+ .@num$; } return .@num$; } OnBuyItem: ShopSettings( @menu ); for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1) for(set @j,0; @j < getarraysize( @ItemLists ); set @j,@j+1) if( @ItemLists[@j] == @bought_nameid[@i] ) set @TotalCost,@TotalCost + ( @ItemCost[@j] * @bought_quantity[@i] ); mes "^FF0000 BILLING LIST^000000"; mes "^00FF00____________________________^000000"; for( set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1 ) mes "^FF0000"+@bought_quantity[@i]+" x ^0000FF"+getitemname( @bought_nameid[@i] )+"^000000"; mes "^00FF00____________________________^000000"; if( getitemname( atoi( @Currency$ ) ) != "null" ) mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" x "+getitemname( atoi( @Currency$ ) )+"^000000"; else if( getitemname( atoi( @Currency$ ) ) == "null" ){ mes "Total Cost : ^0000FF"+ValueConvert( @TotalCost )+" "+@Currency$+"^000000"; } mes "^00FF00____________________________^000000"; if( ValidateCost( @Currency$,@TotalCost ) ){ if( getitemname( atoi( @Currency$ ) ) != "null" ) mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+getitemname( atoi( @Currency$ ) )+"^000000"; else{ mes "[ ^FF0000X^000000 ] Insufficient ^0000FF"+@Currency$+"^000000"; } }else{ if( select( "^0000FFPurchase^000000:Cancel" ) == 1 ){ if( getitemname( atoi( @Currency$ ) ) != "null" ) delitem atoi( @Currency$ ),@TotalCost; else{ set getd( @Currency$ ),getd( @Currency$ ) - @TotalCost; } for(set @i,0; @i < getarraysize( @bought_nameid ); set @i,@i+1) getitem @bought_nameid[@i],@bought_quantity[@i]; message strcharinfo(0),"Purchased "+getarraysize( @bought_nameid )+" Items."; mes "Thank you for shopping."; } } ClearData(); close; } BUMP !
  22. Sir euphy how do i make the part where it says you dont have enough materials into this mes "I'm sorry, but you don't have"; mes "the following quest materials :"; mes "1x jellopy (coz i have 9 out of 10 jellopy)"; mes "10x green potion (coz i have 10 out of 2 green potion)"; mes "10x red herb (coz i have 10 out of 20 red herb)"; mes "9x skel-bone (coz i have 11 out of 20 skel-bone)"; BUMP !
  23. can i request a script where if a guild leader exchange 1x TCG Card to the npc it'll give him and all the members who's currently online on the guild a 100x ygg berry?
×
×
  • Create New...