-
Posts
2407 -
Joined
-
Last visited
-
Days Won
52
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Capuche
-
like this? prontera,148,189,5 script Map Warper 456,{ function t; @stoptrick = 0; if ( #allow_use_warper > gettimetick(2) ) {// can use the warper mes "you can use the warp for "+ t( #allow_use_warper - gettimetick(2) ); next; } else { if ( #allow_use_warper && #allow_use_warper < gettimetick(2) ) { #allow_use_warper = 0; } if ( BaseLevel < .level_required ) { mes "you must be level "+ .level_required +" to go further."; close; } else if ( #delay_special_warp > gettimetick(2) ) { mes "I'm sorry you can't use this warper. you must wait "+ t( #delay_special_warp - gettimetick(2) ); close; } else if ( countitem( .item_required ) == 0 ) { mes "you need a "+ getitemname( .item_required ); close; } } mes "Where would you want to go?"; next; switch( select( "map_01:map_02:map_03" ) ) { case 1: if ( @stoptrick ) { mes "I'm sorry you can't use this warper. you must wait "+ t( #delay_special_warp - gettimetick(2) ); close; } warp .special_map1$,0,0; // your warp map break; case 2: if ( @stoptrick ) { mes "I'm sorry you can't use this warper. you must wait "+ t( #delay_special_warp - gettimetick(2) ); close; } warp .special_map2$,0,0; // your warp map break; case 3: if ( @stoptrick ) { mes "I'm sorry you can't use this warper. you must wait "+ t( #delay_special_warp - gettimetick(2) ); close; } warp .special_map3$,0,0; // your warp map break; } if ( !#allow_use_warper ) { #allow_use_warper = gettimetick(2) + .timer_allow; #delay_special_warp = gettimetick(2) + 86400 * 7; // 1 week of delay delitem .item_required, 1; } if ( @timer_alreadyon == 0 ) { .@timer = ( #allow_use_warper - gettimetick(2) ) * 1000; addtimer .@timer, strnpcinfo(3) +"::OnEndofTime"; @timer_alreadyon = 1; } end; OnEndofTime: #allow_use_warper = @timer_alreadyon = 0; .@map$ = strcharinfo(3); if ( .@map$ == .special_map1$ || .@map$ == .special_map2$ || .@map$ == .special_map3$ ) { warp "prontera",0,0; message strcharinfo(0), "end of time"; } else @stoptrick = 1; end; OnPCLoginEvent: callsub L_check; end; L_check: if ( #allow_use_warper > gettimetick(2) ) { addtimer ( #allow_use_warper - gettimetick(2) )* 1000, strnpcinfo(3) +"::OnEndofTime"; @timer_alreadyon = 1; } else if ( #allow_use_warper ) #allow_use_warper = 0; return; function t { function s; set .@left, getarg(0); if ( .@left <= 0 ) return getarg(0); set .@day, .@left / 86400; set .@hour, .@left % 86400 / 3600; set .@min, .@left % 3600 / 60; set .@sec, .@left % 60; return ( ( .@day ? .@day +" day"+ s( .@day ) : "" ) + ( .@hour ? .@hour +" hour"+ s( .@hour ) : "" ) + ( .@min ? .@min +" min"+ s( .@min ) : "" ) + ( .@sec ? .@sec +" sec"+ s( .@sec,1 ) : "" ) ); function s { return ( ( getarg(0) > 1 ? "s" : "" ) + ( getarg(1,0) ? "" : " " ) ); } } OnInit: .item_required = 607; .timer_allow = 3600 * 2; // allow to warp 2h .level_required = 255; .special_map1$ = "geffen"; .special_map2$ = "alberta"; .special_map3$ = "payon"; /* // case of reload script - enable if you want .@count = query_sql( "select `account_id` from `char` where `online` = 1", .@account_id ); while( .@i < .@count ) { attachrid .@account_id[.@i]; callsub L_check; .@i++; } */ }
- 1 reply
-
- 1
-
-
Yes that's what I mean. Thanks you I learned something interesting
-
We can retrieve an .@var array in a function with .@var[0] in argument? I though we couldn't
-
Search your vote points variable in V4P npc and replace it in the quest shop for vote points setarray .Points$[0],"#YOUR variable VOTEPOINTS","Vote Points";
-
npc for cahspoint, you can use the normal quest shop since there is already // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0],"#CASHPOINTS","Cash Points"; then you just need to set the amount of point for the cost // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(<shop ID>,<reward ID>,<reward amount>, // <Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // ----------------------------------------------------------- Add(1,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2); for the #VotePoint with rentitem use this one //===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6a //===== Compatible With: ===================================== //= rAthena SVN r16862+ //===== Description: ========================================= //= A dynamic quest shop based on Lunar's, with easier config. //= Includes support for multiple shops & cashpoints. //= Item Preview script by ToastOfDoom. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.2 Added category support. //= 1.3 More options and fixes. //= 1.4 Added debug settings. //= 1.5 Replaced categories with shop IDs. //= 1.6 Added support for purchasing stackables. //= 1.6a Added support for previewing costumes and robes. //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshopbis"{,<shop ID>{,<shop ID>{,...}}}; //============================================================ prontera,164,203,6 script Quest Shop#bis1 998,{ callfunc "qshopbis"; } // Script Core //============================================================ - script quest_shop2 -1,{ function Add; function Chk; function Slot; function A_An; OnInit: freeloop(1); // ----------------------------------------------------------- // Basic shop settings. // ----------------------------------------------------------- set .Announce,1; // Announce quest completion? (1: yes / 0: no) set .ShowSlot,1; // Show item slots? (2: all equipment / 1: if slots > 0 / 0: never) set .ShowID,0; // Show item IDs? (1: yes / 0: no) set .ShowZeny,0; // Show Zeny cost, if any? (1: yes / 0: no) set .MaxStack,100; // Max number of quest items purchased at one time. // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0],"#VOTEPOINTS","Vote Points"; // ----------------------------------------------------------- // Shop IDs -- to add shops, copy dummy data at bottom of file. // setarray .Shops$[1],"<Shop 1>","<Shop 2>"{,...}; // ----------------------------------------------------------- setarray .Shops$[1],"Headgears","Weapons","Other"; // ----------------------------------------------------------- // Quest items -- do NOT use a reward item more than once! // Add(<shop ID>,<reward ID>,<reward amount>, // <Zeny cost>,<point cost>, // <required item ID>,<required item amount>{,...}); // ----------------------------------------------------------- Add(1,5022,1,0,0,7086,1,969,10,999,40,1003,50,984,2); Add(1,5032,1,0,0,1059,250,2221,1,2227,1,7063,600); Add(1,5027,1,0,0,2252,1,1036,400,7001,50,4052,1); Add(1,5045,1,0,0,2252,1,1054,450,943,1200); Add(2,1224,1,0,0,7297,30,969,10,999,50,714,10); Add(2,1225,1,0,0,7292,30,969,10,999,50,714,10); Add(3,531,1,3,0,512,1,713,1); Add(3,532,1,3,0,513,1,713,1); Add(3,533,1,3,0,514,1,713,1); Add(3,534,1,3,0,515,1,713,1); // ----------------------------------------------------------- freeloop(0); set .menu$,""; for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) { set .menu$, .menu$+.Shops$[.@i]+":"; npcshopdelitem "qshopbis"+.@i,909; } end; OnMenu: set .@size, getarraysize(@i); if (!.@size) set .@i, select(.menu$); else if (.@size == 1) set .@i, @i[0]; else { for(set .@j,0; .@j<.@size; set .@j,.@j+1) set .@menu$, .@menu$+.Shops$[@i[.@j]]+":"; set .@i, @i[select(.@menu$)-1]; } deletearray @i[0],getarraysize(@i); if (.Shops$[.@i] == "") { message strcharinfo(0),"An error has occurred."; end; } dispbottom "Select one item at a time."; callshop "qshopbis"+.@i,1; npcshopattach "qshopbis"+.@i; end; OnBuyItem: // .@q[] : RewardID, BoughtAmt, RewardAmt, BaseAmt, ReqZeny, ReqPts, { ReqItem, ReqAmt, ... } setarray .@q[0],@bought_nameid[0],((@bought_quantity[0] > .MaxStack)?.MaxStack:@bought_quantity[0]); copyarray .@q[3],getd(".q_"+.@q[0]+"[0]"),getarraysize(getd(".q_"+.@q[0])); set .@q[2],.@q[1]*.@q[3]; if (!.@q[2] || .@q[2] > 30000) { message strcharinfo(0),"You can't purchase that many "+getitemname(.@q[0])+"."; end; } mes "[Quest Shop]"; mes "Reward: ^0055FF"+((.@q[2] > 1)?.@q[2]+"x ":"")+Slot(.@q[0])+"^000000"; mes "Requirements:"; if (.@q[4]) mes " > "+Chk(Zeny,.@q[4]*.@q[1])+(.@q[4]*.@q[1])+" Zeny^000000"; if (.@q[5]) mes " > "+Chk(getd(.Points$[0]),.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+getd(.Points$[0])+"/"+(.@q[5]*.@q[1])+")^000000"; if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) mes " > "+Chk(countitem(.@q[.@i]),.@q[.@i+1]*.@q[1])+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem(.@q[.@i])+"/"+(.@q[.@i+1]*.@q[1])+")^000000"; next; setarray @qe[1], getiteminfo(.@q[0],5), getiteminfo(.@q[0],11); if (@qe[2] > 0 && ((@qe[1] & 1) || (@qe[1] & 256) || (@qe[1] & 512) || (@qe[1] & 1024) || (@qe[1] & 2048) || (@qe[1] & 4096) || (@qe[1] & 4) || (@qe[1] & 8192))) set .@preview,1; addtimer 1000, strnpcinfo(0)+"::OnEnd"; while(1) { switch(select(" ~ Purchase ^0055FF"+getitemname(.@q[0])+"^000000:"+((.@preview && !@qe[7])?" ~ Preview...":"")+": ~ ^777777Cancel^000000")) { case 1: if (@qe[0]) { mes "[Quest Shop]"; mes "You're missing one or more quest requirements."; close; } if (!checkweight(.@q[0],.@q[2])) { mes "[Quest Shop]"; mes "^FF0000You need "+(((.@q[2]*getiteminfo(.@q[0],6))+Weight-MaxWeight)/10)+" additional weight capacity to complete this trade.^000000"; close; } if (.@q[4]) set Zeny, Zeny-(.@q[4]*.@q[1]); if (.@q[5]) setd .Points$[0], getd(.Points$[0])-(.@q[5]*.@q[1]); if (.@q[6]) for(set .@i,6; .@i<getarraysize(.@q); set .@i,.@i+2) delitem .@q[.@i],.@q[.@i+1]*.@q[1]; for ( .@i = 0; .@i < .@q[2]; .@i++ ) rentitem .@q[0],3600;// 1 hour if (.Announce) announce strcharinfo(0)+" has created "+((.@q[2] > 1)?.@q[2]+"x "+getitemname(.@q[0]):A_An(getitemname(.@q[0])))+"!",0; specialeffect2 EF_FLOWERLEAF; close; case 2: setarray @qe[3], getlook(LOOK_HEAD_BOTTOM), getlook(LOOK_HEAD_TOP), getlook(LOOK_HEAD_MID), getlook(LOOK_ROBE), 1; if ((@qe[1] & 1) || (@qe[1] & 4096)) changelook LOOK_HEAD_BOTTOM, @qe[2]; else if ((@qe[1] & 256) || (@qe[1] & 1024)) changelook LOOK_HEAD_TOP, @qe[2]; else if ((@qe[1] & 512) || (@qe[1] & 2048)) changelook LOOK_HEAD_MID, @qe[2]; else if ((@qe[1] & 4) || (@qe[1] & 8192)) changelook LOOK_ROBE, @qe[2]; break; case 3: close; } } OnEnd: if (@qe[7]) { changelook LOOK_HEAD_BOTTOM, @qe[3]; changelook LOOK_HEAD_TOP, @qe[4]; changelook LOOK_HEAD_MID, @qe[5]; changelook LOOK_ROBE, @qe[6]; } deletearray @qe[0],8; end; function Add { if (getitemname(getarg(1)) == "null") { debugmes "Quest reward #"+getarg(1)+" invalid (skipped)."; return; } setarray .@j[0],getarg(2),getarg(3),getarg(4); for(set .@i,5; .@i<getargcount(); set .@i,.@i+2) { if (getitemname(getarg(.@i)) == "null") { debugmes "Quest requirement #"+getarg(.@i)+" invalid (skipped)."; return; } else setarray .@j[.@i-2],getarg(.@i),getarg(.@i+1); } copyarray getd(".q_"+getarg(1)+"[0]"),.@j[0],getarraysize(.@j); npcshopadditem "qshopbis"+getarg(0),getarg(1),((.ShowZeny)?getarg(3):0); return; } function Chk { if (getarg(0) < getarg(1)) { set @qe[0],1; return "^FF0000"; } else return "^00FF00"; } function Slot { set .@s$,getitemname(getarg(0)); switch(.ShowSlot) { case 1: if (!getitemslots(getarg(0))) return .@s$; case 2: if (getiteminfo(getarg(0),2) == 4 || getiteminfo(getarg(0),2) == 5) 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); } } function script qshopbis { deletearray @i[0],getarraysize(@i); for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) set @i[.@i],getarg(.@i); doevent "quest_shop2::OnMenu"; end; } // Dummy shop data -- copy as needed. //============================================================ - shop qshopbis1 -1,909:-1 - shop qshopbis2 -1,909:-1 - shop qshopbis3 -1,909:-1 - shop qshopbis4 -1,909:-1 - shop qshopbis5 -1,909:-1 rentitem .@q[0],3600;// 1 hour here to define the timer // ----------------------------------------------------------- // Points variable -- optional quest requirement. // setarray .Points$[0],"<variable name>","<display name>"; // ----------------------------------------------------------- setarray .Points$[0],"#VOTEPOINTS","Vote Points"; here to define the variable and like the previous one, set the amount of point in Add function
-
There is already a guild chat.. I don't get the benefit of this npc
-
oO I believe you need source mod for this
-
You just need to duplicate the main npc (it support only one variable) and change to rentitem
-
You're kidding right ? xD when you click on the link, you have all infos about rentitem
-
You can use quest shop for rent item, just need to replace getitem .@q[0],.@q[2]; by for ( .@i = 0; .@i < .@q[2]; .@i++ ) rentitem .@q[0],3600;// 1 hour NB rentitem doesn't work with stackable item
-
The first time on a special map or all maps?
-
@SpongeBOB http://rathena.org/wiki/Basic_Scripting#NPC
-
Put an expiration on an item.. rentitem ?
-
The same has previously. You just have to read the warning on the console "Unexpected type for argument 1. Expected string." set .@l, getstrlen(.@num); replace by set .@l, getstrlen(.@num+"");
-
you can trade some points vs some item with the script // Menu Selection select("Shop 1","Shop 2","Shop 3"); replace to // Menu Selection select("","","Shop 3"); and in case 3 set your items vs varaible 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; replace to Case 3: // Currency [ Item ID / Variable Name ] set @Currency$,"#MVPPOINTS";// your variable need // Item ID Lists setarray @ItemLists[0],2306,2302,2303,2304,2305,2301; // Item Price setarray @ItemCost[0],20,22,34,445,52,641; break;
-
set .Options, 1|4|8;// enable option => [1] Enable rewards. + [4] Only reward Guild Masters. + [8] Duplicate IP check.
-
Replace to function LastWarp { set @lastwarpname$, getarg(0); set @lastwarpmap$, getarg(1); set @lastwarpx, getarg(2); set @lastwarpy, getarg(3); return; } OnPCLoadMapEvent: OnPCLoginEvent: OnPCLogoutEvent: .@map$ = strcharinfo(3); sleep 1000; if ( .@map$ == "pvp_n_1-5" || .@map$ == "pvp_n_1-2" ) { delwaitingroom; waitingroom "PvP("+getmapusers("pvp_n_1-5")+") GvG("+getmapusers("pvp_y_1-2")+")",0; } end; } pvp_n_1-2 mapflag loadevent pvp_n_1-5 mapflag loadevent geffen,112,64,4 duplicate(Warper#1-1) Warper#1-1983-1 612 alberta,35,240,4 duplicate(Warper#1-1) Warper#1-13-1 612
-
You change this to 7 and the blue team is still 1/1 ? set .minplayer2start, 2; // minimum player to start post your diff
-
The script you gave us is only used to display the time, you can't set the woe timer with this
-
Yes or you can put all these npc in one file, it's the same
-
replace set .@num, atoi(getarg(0)); by set .@num, atoi(getarg(0)+""); or pick the last AnnieRuru's int__ function in script collection
-
Add a delwaitingroom before waitingroom delwaitingroom; waitingroom "PvP("+getmapusers("pvp_n_1-5")+") GvG("+getmapusers("pvp_y_1-2")+")",0; Like your error display, you msut delete the previous waitingroom before create a new one
-
Try the multi currency shop of Emistry I believe it works on ea http://rathena.org/board/files/file/2504-multi-currency-shop/
-
Request NPC Rental Using Cashpoint On Item Id 12622
Capuche replied to Checkmate's question in Script Requests
prontera,150,180,5 script ijniono 56,{ mes "you need "+ .cash_req +" to rent a "+ getitemname( .item_rent ) +" for "+ .rent_time +" seconds"; next; if ( select( "I have the points", "leave" ) == 2 ) close; if ( #CASHPOINTS < .cash_req ) { mes "you don't have enough cashpoint."; close; } #CASHPOINTS = #CASHPOINTS - .cash_req; rentitem .item_rent, .rent_time; end; OnInit: .item_rent = 12622;// item rent .cash_req = 5; // 5 cashpoints .rent_time = 60; // 60secs } -
HAPPY B-DAY EM.