Jump to content

Skorm

Forum Moderator
  • Posts

    1268
  • Joined

  • Last visited

  • Days Won

    33

Community Answers

  1. Skorm's post in R> Custom Refiner was marked as the answer   
    No need for that. Let me know if you have any problems. If you ever feel the need to delete the script from your server make sure to remove rf_opt from your sql database.
     
    //https://rathena.org/board/topic/107575-r-custom-refiner/ prontera,150,192,5 script God Refiner 4_F_KAFRA9,{ @menu = 0; mes "[Sample]"; mes "Select you refining options and click refine."; next; while( @menu != 1 ) { rf_opt = rf_opt ^ pow( 2, select ( "[Refine]", ( ( rf_opt & 4 ? "[^0000FFOn^000000] ":"[^FF0000Off^000000] " ) + "Add Chance Refine" ), ( ( rf_opt & 8 ? "[^0000FFOn^000000] ":"[^FF0000Off^000000] " ) + "No Reduction Refine" ) ) ); } if( !countitem( 7806 ) ) { mes "[Sample]"; mes "You need at least one " + getitemname( 7806 ) + " for me to refine your items."; close; } if( ( rf_opt & 4 ) && !countitem( 6232 ) ) { mes "[Sample]"; mes "You need at least one " + getitemname( 6232 ) + " to use the 'Add Chance Refine' option."; close; } if( ( rf_opt & 8 ) && !countitem( 6228 ) ) { mes "[Sample]"; mes "You need at least one " + getitemname( 6228 ) + " to use the 'No Reduction Refine' option."; close; } .@i = select( ""+( ( .@ep = getequipid( EQI_HEAD_TOP ) +1 ) > 0 ? "^0000FF"+getitemname(getequipid( EQI_HEAD_TOP ))+"^000000" : "" ), ""+( ( .@ep[1] = getequipid( EQI_ARMOR ) +1 ) > 0 ? "^0000FF"+getitemname(getequipid( EQI_ARMOR )) +"^000000" : "" ), ""+( ( .@ep[2] = getequipid( EQI_HAND_L ) +1 ) > 0 ? "^0000FF"+getitemname(getequipid( EQI_HAND_L )) +"^000000" : "" ), ""+( ( .@ep[3] = getequipid( EQI_HAND_R ) +1 ) > 0 ? "^0000FF"+getitemname(getequipid( EQI_HAND_R )) +"^000000" : "" ), ""+( ( .@ep[4] = getequipid( EQI_GARMENT ) +1 ) > 0 ? "^0000FF"+getitemname(getequipid( EQI_GARMENT )) +"^000000" : "" ), ""+( ( .@ep[5] = getequipid( EQI_SHOES ) +1 ) > 0 ? "^0000FF"+getitemname(getequipid( EQI_SHOES )) +"^000000" : "" ), ( getarraysize(.@ep) ? "" : "I have nothing equipped!" ) ); if( getequipid( .@i ) != -1 || !.@ep ) { if ( getequipisenableref( .@i ) ) { .@refine = getequiprefinerycnt( .@i ); if ( .@refine >= 10 ) { mes "[Sample]"; mes "That item has already reached max level!"; close; } delitem 7806,1; if ( ( rf_opt & 4 ) ) { delitem 6232,1; .@pr = .plus_refine; } if ( ( rf_opt & 8 ) ) { delitem 6228,1; .@rr++; } .@rand = rand(100) + 1; .@rand_refine = .refine_rates[.@refine] + .@pr; if( .@rand <= .@rand_refine ) { successrefitem .@i; mes "[Sample]"; mes "Success!!!"; } else { if( !.@rr ) { downrefitem .@i; mes "[Sample]"; mes "I failed and the item lost one refine!"; } else { mes "[Sample]"; mes "I failed but your item is fine!"; } } } else { mes "[Sample]"; mes "I'm sorry but I can't refine that item!"; } } else { mes "[Sample]"; mes "You need to equip something first!"; } close; OnInit: .plus_refine = 5; setarray .refine_rates, 100, 100, 100, 100, 100, 15 , 10 , 5 , 3 , 1 ; end; } [External Link]
     
    P.S: Emistry I used your refiner from the other post as a base hope you don't mind. xD
  2. Skorm's post in Easy Instance Maker was marked as the answer   
    I made a tutorial instance script like awhile back. I'm not completely sure if it still applies but I'll drop a link here if you feel the need to check it out.
     
    (Edit: Giving it a quick glance I can see that I was pretty vague back then. If you have any questions about parts of the script let me know.)
    http://upaste.me/r/858a16499f5511742
     
  3. Skorm's post in help please was marked as the answer   
    I assumed the script was functioning correctly before hand.
    guild_vs2,50,49,3 script Mega Lotto 563,{ progressbar "",1; delitem .Cost[0], .Cost[1]; set .@i, rand(1,.Total); if (rand(1,100) > getd(".P"+.@i+"[0]")) { for(set .@j,0; .@j<getarraysize(.Default); set .@j,.@j+2) getitem .Default[.@j], .Default[.@j+1]; } else { for(set .@j,1; .@j<getarraysize(getd(".P"+.@i)); set .@j,.@j+2) { setarray .@k[0], getd(".P"+.@i+"["+.@j+"]"), getd(".P"+.@i+"["+(.@j+1)+"]"); getitem .@k[0], .@k[1]; if( getd(".P"+.@i+"[0]") == 1 ) announce "Congratulations to "+strcharinfo(0)+" for getting "+.@k[1]+"x "+getitemname(.@k[0])+"!",0; } } specialeffect2 248; close; OnTimer1800000: //30 Minutes. announce "I'd like to thank all of our lucky contestants. I'll be back in 5 Hours!",0; disablenpc strnpcinfo(3); end; OnTimer18000000: //5 Hours. initnpctimer; announce "Come test your luck at the Mega Lotta. Only avaliable for the next 30 Minutes!",0; enablenpc strnpcinfo(3); end; OnInit: initnpctimer; waitingroom "Play Lotto Here!",0; // Format: <%>,<item ID>,<count>{,...}; setarray .P1[0],100,607,5; setarray .P2[0],80,607,5; setarray .P3[0],70,607,5; setarray .P4[0],60,607,5; setarray .P5[0],50,607,5; setarray .P6[0],50,607,20; setarray .P7[0],40,607,25; setarray .P8[0],30,607,30; setarray .P9[0],20,607,25; setarray .P10[0],10,607,50; setarray .P11[0],100,30487,10; setarray .P12[0],90,30487,10; setarray .P13[0],50,12202,10; setarray .P14[0],50,12203,10; setarray .P15[0],50,12204,10; setarray .P16[0],50,12205,10; setarray .P17[0],50,12206,10; setarray .P18[0],50,12207,10; setarray .P19[0],20,30487,20; setarray .P20[0],10,30487,25; setarray .P21[0],50,12103,5; setarray .P22[0],40,12103,5; setarray .P23[0],30,12103,5; setarray .P24[0],20,12103,5; setarray .P25[0],10,12103,10; setarray .P26[0],50,12202,5; setarray .P27[0],50,12103,5; setarray .P28[0],50,12204,5; setarray .P29[0],50,12205,5; setarray .P30[0],50,12206,5; setarray .P31[0],50,12207,5; setarray .P32[0],5,7073,1; setarray .P33[0],5,7074,1; setarray .P34[0],5,7075,1; setarray .P35[0],5,7076,1; setarray .P36[0],5,7077,1; setarray .P37[0],5,7078,1; setarray .P38[0],5,7079,1; setarray .P39[0],5,7080,1; setarray .P40[0],5,7081,1; setarray .P41[0],5,7082,1; setarray .P42[0],5,7083,1; setarray .P43[0],5,7084,1; setarray .P44[0],5,7085,1; setarray .P45[0],5,7086,1; setarray .P46[0],5,7087,1; setarray .P47[0],5,7088,1; setarray .P48[0],5,7089,1; setarray .P49[0],5,7090,1; setarray .P50[0],5,7091,1; setarray .P51[0],5,7092,1; setarray .P52[0],1,4395,1; setarray .Default[0],30272,1; setarray .Cost[0],7368,1; set .Total,52; announce "Come test your luck at the Mega Lotta. Only avaliable for the next 30 Minutes!",0; end; }
  4. Skorm's post in Script mod was marked as the answer   
    //= The default points is Kafrapoints change it anyway if you like. //= 1.1 = Check Chatting too //= 1.2 = 5 Minute Idle Check & @at/@autotrade check. //= 1.3 = Corrected the current balance line on 12 Hours Consecutive //==================================================================== - script hourlypoints -1,{ OnPointGet: while(checkvending() >= 1 || checkchatting() == 1) { sleep2 .delay; if(.@mes$=="") dispbottom set(.@mes$,"The hourly points event haulted because you were vending, chatting, or idle."); } set #CASHPOINTS, #CASHPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Kafrapoints by staying ingame for 1 hour"; dispbottom "Current Balance = "+#CASHPOINTS+" Kafrapoints"; set @consecutive_hour, @consecutive_hour + 1; //Check for 3 hours consecutive if(@consecutive_hour == 3) { set @consecutive_hour,0; set #CASHPOINTS, #CASHPOINTS + .cpoint_amt; dispbottom "You receive "+.cpoint_amt+" Kafrapoints in playing for 12 consecutive hours"; dispbottom "Current Balance = "+#CASHPOINTS+" Kafrapoints"; } OnPCLoginEvent: addtimer .timer,"hourlypoints::OnPointGet"; set @hourly_points_timer, gettimetick(2) + ( .timer / 1000 ); end; OnCmdHour: message strcharinfo(0),@hourly_points_timer ? Time2Str( @hourly_points_timer )+" Remaining.":"Something went wrong relog!"; end; OnInit: bindatcmd "hour","hourlypoints::OnCmdHour"; set .timer, 1000*15*15; //Timer in milliseconds. set .cpoint_amt, 15; //Points gained for consecutive time online. set .point_amt, 5; //Normal points gained. set .delay, 1000; //Delay for idle re-check check. set .dlimit, 60*30; //Stop points if afk greater then in seconds (30mins). } Untested so let me know if you run into any problems @hour is the command.
  5. Skorm's post in Requesting Guide: How to make +10 Item as a Quest Recipe was marked as the answer   
    Because of the way countitem2 works items that have added attributes or cards won't count...
    Anyways this should work but it's untested.
    //===== rAthena Script ======================================= //= Euphy's Quest Shop //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.6b //===== 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. //= 1.6b Added 'disable_items' command. //============================================================ // Shop NPCs -- supplying no argument displays entire menu. // callfunc "qshop"{,<shop ID>{,<shop ID>{,...}}}; //============================================================ prontera,164,203,6 script Quest Shop#1 998,{ callfunc "qshop"; } // Script Core //============================================================ - script quest_shop -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],"#CASHPOINTS","Cash 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>,<required refine>{,...}); // ----------------------------------------------------------- Add(1,5022,1,0,0,7086,1,0,969,10,0,999,40,0,1003,50,0,984,2,0); Add(1,5032,1,0,0,1059,250,0,2221,1,0,2227,1,0,7063,600,0); Add(1,5027,1,0,0,2252,1,0,1036,400,0,7001,50,0,4052,1,0); Add(1,5045,1,0,0,2252,1,0,1054,450,0,943,1200,0); Add(2,1224,1,0,0,7297,30,0,969,10,0,999,50,0,714,10,0); Add(2,1225,1,0,0,7292,30,0,969,10,0,999,50,0,714,10,0); Add(3,531,1,3,0,512,1,0,713,1,0); Add(3,532,1,3,0,513,1,0,713,1,0); Add(3,533,1,3,0,514,1,0,713,1,0); Add(3,534,1,3,0,515,1,0,713,1,0); // ----------------------------------------------------------- freeloop(0); set .menu$,""; for(set .@i,1; .@i<=getarraysize(.Shops$); set .@i,.@i+1) { set .menu$, .menu$+.Shops$[.@i]+":"; npcshopdelitem "qshop"+.@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 "qshop"+.@i,1; npcshopattach "qshop"+.@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:"; disable_items; 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+3) mes " > "+Chk( countitem2(.@q[.@i],0,.@q[.@i+2],0,0,0,0,0),.@q[.@i+1]*.@q[1] )+((.ShowID)?"{"+.@q[.@i]+"} ":"")+Slot(.@q[.@i])+" ("+countitem2(.@q[.@i],0,.@q[.@i+2],0,0,0,0,0)+"/"+(.@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]; getitem .@q[0],.@q[2]; 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 "qshop"+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 qshop { deletearray @i[0],getarraysize(@i); for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) set @i[.@i],getarg(.@i); doevent "quest_shop::OnMenu"; end; } // Dummy shop data -- copy as needed. //============================================================ - shop qshop1 -1,909:-1 - shop qshop2 -1,909:-1 - shop qshop3 -1,909:-1 - shop qshop4 -1,909:-1 - shop qshop5 -1,909:-1
  6. Skorm's post in Add Save to Warper was marked as the answer   
    I haven't the time to test or explain but here.
     
    http://upaste.me/28e222294cb8b86d3
  7. Skorm's post in Merging 2 warping scripts was marked as the answer   
    Assuming the above script works well.
    menu "Last Warp ^777777["+lastwarp$+"]^000000",-, getcharid(1)?"Party Warp ^CCCCCC["+getpartyname(getcharid(1))+"]^000000":"",Party, " ~ Towns",Towns, " ~ Fields",Fields, " ~ Dungeons",Dungeons, " ~ Guild Castles",Castles, " ~ Guild Dungeons",Guild_Dungeons, " ~ Instances",Instances, " ~ Special Areas",Special; if (lastwarp$ == "") message strcharinfo(0),"You haven't warped anywhere yet."; else warp lastwarp$,lastwarpx,lastwarpy; end; Party: deletearray .@aid[0],128; deletearray @aid[0],128; set @j,0; set @select$,""; getpartymember getcharid(1),2; set .@num,$@partymembercount; copyarray .@aid[0],$@partymemberaid[0],.@num; set .@num,getarraysize(.@aid); for(set .@i,0;.@i<.@num;set .@i,.@i+1) if(isloggedin(.@aid[.@i])) { set @aid[@j],.@aid[.@i]; set @j,@j+1; set @select$,@select$+":"+rid2name(.@aid[.@i]); } set @menu,select(@select$)-2; if(isloggedin(@aid[@menu])) { getmapxy(@m$,@x,@y,0,rid2name(@aid[@menu])); if( getmapflag(@m$,mf_pvp) || @m$ == "mapname" || @m$ == "mapname" ) { mes "You cant warp to his map now."; close; } else { warp @m$,@x,@y; } } end; P.S: Please use code brackets next time, tyvm!
  8. Skorm's post in About Miner world by Myzter script was marked as the answer   
    Fortunately for you I'm a hoarder of scripts.
     
    Minerworld By Myzter
     
    Unfortunately I never downloaded the bot killer script that or I did and deleted it not knowing what it was.
     
    I've updated the original topic.
  9. Skorm's post in About disabling certain commands! was marked as the answer   
    - script tran_res_cmd -1,{
    OnCMD:
    if( eaclass() & EAJL_UPPER )
    message strcharinfo(0), "Transcendent jobs are not allowed this command.";
    else
    atcommand "@command";
    end;
    OnInit:
    bindatcmd "command","tran_res_cmd::OnCMD";
    }

  10. Skorm's post in What's Wrong with this code? was marked as the answer   
    - script leveling_control -1,{ OnNPCKillEvent: .@range = BaseLevel - getmonsterinfo( killedrid, MOB_LV ); .@range = .@range < 0 ? -.@range : .@range; if ( .@range < 10 ) { .@base = getmonsterinfo( killedrid, MOB_BASEEXP ); .@job = getmonsterinfo( killedrid, MOB_JOBEXP ); if ( .@base > 0 ) set BaseExp, BaseExp + .@base * 35 / 100; if ( .@job > 0 ) set JobExp , JobExp + .@job * 35 / 100; } end; }
  11. Skorm's post in Show Heal in Chat!? was marked as the answer   
    Try replacing ...
    if (src->type == BL_PC) { sprintf(str, "You've healed %s for %dhp!", tsd->status.name, hp); clif_displaymessage(sd->fd, str); } if (target->type == BL_PC && target->id != src->id) { sprintf(str, "You've been healed for %dhp by %s!", hp, sd->status.name); clif_displaymessage(tsd->fd, str); } With:
    if (src->type == BL_PC) { if (target->type == BL_PC) { sprintf(str, "You've healed %s for %dhp!", tsd->status.name, hp); clif_displaymessage(sd->fd, str); } else { sprintf(str, "Target healed for %dhp!", hp); clif_displaymessage(sd->fd, str); } } if (target->type == BL_PC && target->id != src->id) { sprintf(str, "You've been healed for %dhp by %s!", hp, sd->status.name); clif_displaymessage(tsd->fd, str); }
  12. Skorm's post in Calculating the sleep timer for npcwalkto with npcspeed and distance was marked as the answer   
    Why not just time how long it takes for the npc to travel one square... (.@distance * .@time_per_square_in_miliseconds);
     
    Well if the movement speed is like iRO it's 0.15s per-square at the normal walk speed.
    .@sleep = (.@distance * 150);
  13. Skorm's post in Requesting NPC - require x to get y with fail chance was marked as the answer   
    Maybe this will help you out enough with your script.
    prontera,100,100,1 script chance_get 101,{ mes "[ Chancy ]"; mes "Oh hello would you like to try my game?"; next; if( select( "Yes:No" ) == 2 ) { mes "[ Chancy ]"; mes "I'm sorry to hear that. Maybe next time then."; close; } mes "[ Chancy ]"; if( countitem( .gold ) < .gold_amount ) { mes "You don't have enough "+getitemname( .gold )+"."; mes "I require at least "+.gold_amount+"."; close; } else if( Zeny < .zeny ) { mes "It looks like you don't have enough zeny..."; mes "You need at least "+.zeny+"."; close; } Zeny = Zeny - .zeny; delitem .gold, .gold_amount; if( rand( 101 ) <= .chance ) { .@rand = rand( .length ); getitem .rewards[.@rand], .reward_amounts[.@rand]; mes "Congratulations you got "+getitemname( .rewards[.@rand] )+" x"+.reward_amounts[.@rand]+"!!!"; } else mes "I'm sorry you didn't get anything. Come back and try again!"; close; OnInit: .gold = 617; .gold_amount = 100; .zeny = 10000000; .chance = 40; setarray .rewards, 501, 502, 503, 504, 506; setarray .reward_amounts, 1, 1, 1, 2, 2; .length = getarraysize( .rewards ); }
  14. Skorm's post in Autocreate party using waitingroom? HELP was marked as the answer   
    prontera,150,175,0 script testparty 521,{ npctalk "You're required to enter the waitingroom."; end; OnInit: waitingroom "test",11,"testparty::OnFull",3; end; OnFull: getmapxy .@map$, .@x, .@y, 1; warpwaitingpc .@map$, .@x, .@y; for ( .@i = 0; .@i < $@warpwaitingpcnum; .@i++ ) { .@name$ = rid2name($@warpwaitingpc[.@i]); .@char_id = getcharid( 0, .@name$ ); if ( getcharid( 1, .@name$ ) > 0 ) party_delmember( .@char_id ); sleep 100; if ( .@create == 0 ) { while( party_create( "party"+ rand(10000), .@char_id ) == -3 ); .@create = 1; } else if ( $@party_create_id ) party_addmember $@party_create_id, .@char_id; } end; OnPCLogoutEvent: .@logged = 1; OnPCStatCalcEvent: if ( strcharinfo(3) == "prontera" && !.@logged || strcharinfo(3) != "prontera" && .@logged || getcharid(1) == 0 ) end; .@party_id = getcharid(1); if ( getcharid(0) != getpartyleader( .@party_id, 2 ) ) party_delmember(); else { .i = 0; if ( instance_check_party(.@party_id,2) == 0 ) party_destroy(.@party_id); else { addrid( 2, 0, .@party_id ); if( !.i && !.@party_id ) { .i = 1; party_changeleader getcharid(1), getcharid(0); } else if( .@party_id ) party_delmember(); } } end; } Remember to set where it says "prontera" to your map.
  15. Skorm's post in @hold commands was marked as the answer   
    Maybe like this?
     
    - script hold -1,{ OnInit: bindatcmd("hold", strnpcinfo(3)+"::OnHold"); end; OnHold: if ( !@Hold ) { set @Hold, 1; message strcharinfo(0), "Hold mode is ON."; pcblockmove getcharid(3), 1; } else { set @Hold, 0; message strcharinfo(0), "Hold mode is OFF."; pcblockmove getcharid(3), 0; } }
  16. Skorm's post in R> Items = Cash points Converter was marked as the answer   
    Just sell the items you want to convert to cashpoints to this npc he also sells the items for cashpoints to convert them back.
    - shop exg_exp -1,501:50. prontera,100,100,5 script Exchanger Express 100,{ callshop "exg_exp",0; npcshopattach "exg_exp"; end; OnBuyItem: setarray .@choice$, "@bought_", "bought", "-1", "@item"; if( !checkweight2(getd(.@choice$+"nameid"),getd(.@choice$+"quantity")) ) { mes "I'm sorry but purchasing this many items would put you over weight!"; close; } OnSellItem: if( !getarraysize(.@choice$) ) setarray .@choice$, "@sold_", "sold", "1", "@delitem"; .@len = getarraysize(getd(.@choice$+"nameid")); for ( .@i = 0; .@i < .@len; .@i++ ) { if( .@choice$[1] == "sold" ) { if ( countitem(@sold_nameid[.@i]) < @sold_quantity[.@i] || @sold_quantity[.@i] <= 0 ) { mes "Something went wrong!"; close; } } else { if ( @bought_quantity[.@i] <= 0 ) { mes "Something went wrong..."; close; } } for ( .@a = 0; .@a < .len; .@a = .@a + 2 ) { if( getd(.@choice$+"nameid["+.@i+"]") == .item_base[.@a] ) { if ( #CASHPOINTS < .item_base[.@a+1] * @bought_quantity[.@i] && .@choice$[1] != "sold" ) { mes "You have insufficient cashpoints."; close; } atcommand .@choice$[3]+" "+.item_base[.@a]+" "+getd(.@choice$+"quantity["+.@i+"]"); .@cashpoints = ( getd(.@choice$+"quantity["+.@i+"]") * .item_base[.@a+1] ) * atoi(.@choice$[2]); #CASHPOINTS = #CASHPOINTS + .@cashpoints; dispbottom getitemname(.item_base[.@a]) +" x"+ getd(.@choice$+"quantity["+.@i+"]") +" "+ .@choice$[1] +" for "+ .@cashpoints +" CASHPOINTS!"; } } } deletearray getd(.@choice$+"quantity"); deletearray getd(.@choice$+"nameid"); mes "Deal completed."; close; OnInit: setarray .item_base, 7539, 3, 7227, 5, 671, 10; .len = getarraysize(.item_base); npcshopdelitem "exg_exp",501; for ( .@a = 0; .@a < .len; .@a = .@a + 2 ) npcshopadditem "exg_exp",.item_base[.@a],.item_base[.@a+1]; }
  17. Skorm's post in Resting System was marked as the answer   
    Perhaps something like this?

    http://rathena.org/board/topic/93779-hourly-rewards-version-2
  18. Skorm's post in Refine Ticket Custom was marked as the answer   
    prontera,100,100,5 script ticket_refine 100,{ mes .npc$; mes "Which item would you like to refine?"; next; while( .@a++ <= .e_len ) { .@b = .@a -1; if( .eqpl[ .@b ] ) { if( getequipid( .@a ) > -1 ) .@menu$ = .@menu$ + .eqp$[ .@b ]+" - [^0000FF"+getitemname( getequipid( .@a ) )+"^000000]:"; else .@menu$ = .@menu$ + "^adb4be"+.eqp$[ .@b ]+" - [Empty]^000000:"; } else .@menu$ = .@menu$ + ":"; } .@menu = select( .@menu$ ); .@eq_loc = .eqpl[ .@menu -1 ]; .@eq_itm = getequipid( .@eq_loc ); .@eq_ref = getequiprefinerycnt( .@eq_loc ); if( .@eq_itm <= 0 ) { mes .npc$; mes "Hmm, I don't think you have anything equipped there."; close; } if( !getequipisenableref( .@eq_loc ) && .chk_rf_able ) { mes .npc$; mes "Hmm, this item doesn't seem to be refine-able."; close; } if( .@eq_ref < .ref_cap ) { mes .npc$; mes "Sorry but I don't refine items that so weak. Come back when it's at least +"+.ref_cap+"."; close; } mes .npc$; mes "Input desired refine."; next; switch( input( .@ds_ref, (( .@eq_ref < .min_ref )? .min_ref : .@eq_ref+1 ), .max_ref ) ) { case -1: mes .npc$; if( .@eq_ref < .min_ref ) mes "I do not refine items lower than "+.min_ref+"."; else mes "This item can not be refined lower than "+(.@eq_ref+1)+"."; close; case 1: mes .npc$; mes "Items can not be refined above "+.max_ref+"!"; close; default: } .@nw_ref = .@ds_ref - .@eq_ref; for( .@c = .@eq_ref; .@c < .c_len && .@c < .@ds_ref; .@c++ ) .@tk_cost = .@tk_cost + .cost[.@c]; mes .npc$; mes "This new refine will cost you "+.@tk_cost+" "+getitemname(.tk_id)+"(s). Do you accept?"; next; if( select("Yes:No") == 2 ) { mes .npc$; mes "Alright, thanks anyways, goodbye!"; close; } if( .chk_rf_prct ) { mes .npc$; mes "There is a chance that this item will break! Do you still accept?"; next; if( select("Yes:No") == 2 ) { mes .npc$; mes "Alright, that's probably for the best!"; close; } } if( countitem(.tk_id) < .@tk_cost ) { mes .npc$; mes "I'm sorry but you don't have enough tickets for that."; close; } if( .@eq_itm != getequipid( .@eq_loc ) || .@eq_ref != getequiprefinerycnt( .@eq_loc ) ) { mes .npc$; mes "Something went wrong! Aborting!"; close; } if( .chk_rf_gtim ) { .@card1 = getequipcardid( .@eq_loc, 0 ); .@card2 = getequipcardid( .@eq_loc, 1 ); .@card3 = getequipcardid( .@eq_loc, 2 ); .@card4 = getequipcardid( .@eq_loc, 3 ); } while( (.@tmp_ref = getequiprefinerycnt( .@eq_loc )) < .@ds_ref && .@tmp_ref < .c_len ) { if( .chk_rf_prct && getequippercentrefinery(.@eq_loc) <= rand(101) ) { failedrefitem( .@eq_loc ); mes "Ahh! I'm soooo sorry but your item broke!"; close; } if( !.@h ) { successrefitem( .@eq_loc ); if( .chk_rf_gtim ) { delequip(.@eq_loc); getitem2 .@eq_itm, 1, 1, .@ds_ref, 0, .@card1, .@card2, .@card3, .@card4; equip(.@eq_itm); .@h = 1; } } .@tmp_ref2 = getequiprefinerycnt( .@eq_loc ); if( .@tmp_ref == .@tmp_ref2 ) break; delitem .tk_id, .cost[ .@tmp_ref ]; } mes .npc$; mes "All done thanks for stopping bye!."; close; OnInit: .npc$ = "[ Ticket Refiner ]"; .tk_id = 674; setarray .cost, // Ticket cost per level. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1~10 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 11~20 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5; // 21~31 .ref_cap = 10; // An item must be at least this refine before it can be refined by this npc. 0 disabled. .max_ref = 31; // This is the max refine. 0 disabled. .min_ref = 10; // This is the min refine. 0 disabled. .chk_rf_able = 1; // Check if the item is refine-able? 0 disabled. .chk_rf_prct = 0; // Check refine-able percentages? 0 disabled. .chk_rf_gtim = 0; // The npc will switch to getitem if the refine cap is too high. 0 disabled. setarray .eqp$, "Upper Headgear", "Armor", "Left Hand", "Right Hand", "Garment", "Shoes", "Accessory1", "Accessory2", "Mid Headgear", "Low Headgear"; setarray .eqpl, //Set EQI 0 to disable slot. EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW; .e_len = getarraysize( .eqp$ ); .c_len = getarraysize( .cost ); } About the other thing in the item script just do...
    doevent "ticket_refine::OnGoNPCEvent"; getitem 674, 1;
  19. Skorm's post in @autoattack was marked as the answer   
    It might be easier to just disable vending on those maps?
    anthell mapflag novending This might work though...
    - script AT_Command -,{ OnAT_Command: if( !checkvending() ) atcommand "@autoattack"; else message strcharinfo(0), "This command can't be used while vending."; end; OnInit: bindatcmd "autoattack","AT_Command::OnAT_Command"; }
  20. Skorm's post in Setting Multiple Items was marked as the answer   
    Perhaps a little more information is needed?
     
    But maybe something along these lines or?
    getinventorylist; .@len = @inventorylist_count; copyarray .@inv_list[0], @inventorylist_id[0], .@len; setarray .@items, 501, 502, 503; setarray .@exchange, 504, 506, 507; .@l_2 = getarraysize(.@items); .@l_3 = getarraysize(.@exchange); for( .@a = 0; .@a < .@len; .@a++ ) { for( .@b = 0; .@b < .@l_2; .@b++ ) if( .@inv_list[.@a] == .@items[.@b] ) .@selection$ = .@selection$ + getitemname(.@inv_list[.@a]) + ":"; .@selection$ = .@selection$ + ":"; } mes "Pick from the items you'd like to exchange."; .@menu = select(.@selection$)-1; mes "You've selected "+getitemname(.@inv_list[.@menu])+". What would you like to exchange it with?"; for( .@a = 0; .@a < .@l_3; .@a++ ) .@s_2$[getarraysize(.@s_2$)] = getitemname(.@exchange[.@a]); .@s_3$ = implode( .@s_2$, ":" ); .@menu2 = select(.@s_3$)-1; delitem .@inv_list[.@menu], 1; getitem .@exchange[.@menu2], 1;
  21. Skorm's post in Requesting for PVP PK points and PVP NPC SHOP script .TY was marked as the answer   
    Hmm...
    - shop custom_seller2 -1,501:500 prontera.gat,95,99,5 script PK Points Dealer 100,{ mes "[PK Points Dealer]"; mes "I will sell you items for PK points."; mes "Each time you kill a player on "+.map$+" you'll get 1 PK point to spend here!"; next; mes "[PK Points Dealer]"; mes "You currently have [^0000ff"+pk_points+"^000000] PK points to spend."; callshop "custom_seller2",1; npcshopattach "custom_seller2"; end; OnBuyItem: for(set .@i,0; .@i<getarraysize(.customs); set .@i,.@i+1) { for(set .@d,0; .@d<getarraysize(@bought_nameid); set .@d,.@d+1) { if(@bought_nameid[.@d]==.customs[.@i]) { if(checkweight(@bought_nameid[.@d],@bought_quantity[.@d])) { if(pk_points >= .Price[.@i]*@bought_quantity[.@d]) { set pk_points, pk_points - .Price[.@i]*@bought_quantity[.@d]; getitem @bought_nameid[.@d],@bought_quantity[.@d]; } else dispbottom "You don't have enough PK points to purchase that item."; } else dispbottom "Purchasing these items will put you over the weight limit!"; } } } deletearray @bought_quantity, getarraysize(@bought_quantity); deletearray @bought_nameid, getarraysize(@bought_nameid); close; OnPCKillEvent: if( strcharinfo(3) != .map$ ) end; copyarray( @killed$[1], @killed$[0], .saved_l-1 ); @killed$ = ""+killedrid; if( countstr( implode( @killed$, "|" ), ""+killedrid, 0 ) <= .rstrk_l ) { pk_points++; dispbottom "You've gained one point! Your total is ["+pk_points+"] PK point(s)."; } end; OnInit: set .map$, "guild_vs3"; set .saved_l, 3; //Length of saved ids can be up to 127. set .rstrk_l, 2; //Level of restriction. setarray .customs[0], 12103, 607, 678; // Enter the ID of customs here... setarray .Price[0], 20 , 40 , 300; // Price for each custom here... npcshopitem "custom_seller2", 0 , 0; // Don't touch any coding beyond here.. for( set .i,0; .customs[.i]; set .i,.i+1 ) npcshopadditem "custom_seller2",.customs[.i],.Price[.i]; end; }
  22. Skorm's post in Help! edit was marked as the answer   
    Here's an updated version...
     
    @follow.patch
  23. Skorm's post in Random Headgear Bonuses was marked as the answer   
    This is probably a pretty convoluted way of doing it... But I've found with SQL things are either extremely easy or nearly impossible. LOL
    DELIMITER $$ DROP PROCEDURE IF EXISTS dowhile $$ CREATE PROCEDURE dowhile() BEGIN DECLARE v1 INT DEFAULT (SELECT COUNT(*) FROM `item_db2_re` WHERE `equip_locations` & 769 AND `script` IS NULL); DECLARE v2 INT DEFAULT FLOOR( 1 + RAND( ) * 10 ); DECLARE v3 INT DEFAULT FLOOR( 1 + RAND( ) * 100 ); WHILE v1 > 0 DO CASE FLOOR( 1 + RAND( ) * 2 ) WHEN 1 THEN UPDATE `item_db2_re` SET `script` = CONCAT( 'bonus bStr,', v2, ';' ) WHERE `equip_locations` & 769 AND `script` IS NULL ORDER BY RAND() LIMIT 1; WHEN 2 THEN UPDATE `item_db2_re` SET `script` = CONCAT( 'bonus2 bAddEle,', v2, ',', v3, ';' ) WHERE `equip_locations` & 769 AND `script` IS NULL ORDER BY RAND() LIMIT 1; END CASE; SET v1 = v1 - 1; SET v2 = FLOOR( 1 + RAND( ) * 10 ); SET v3 = FLOOR( 1 + RAND( ) * 100 ); END WHILE; END $$ CALL dowhile();
  24. Skorm's post in R> getareauserid command was marked as the answer   
    Personally I hate it when commands use global variables to store these types of things...
    /*========================================== *------------------------------------------*/ static int buildin_getareausers_sub(struct block_list *bl,va_list ap) { int *users=va_arg(ap,int *); struct map_session_data *sd = (TBL_PC *)bl; struct script_state* st; st=va_arg(ap,struct script_state*); if( *users < 128 ) setd_sub(st, NULL, ".@account_ids", *users, (void *)__64BPRTSIZE(sd->status.account_id), NULL); (*users)++; return 0; } BUILDIN_FUNC(getareausers) { const char *str; int16 m,x0,y0,x1,y1,users=0; //doubt we can have more then 32k users on str=script_getstr(st,2); x0=script_getnum(st,3); y0=script_getnum(st,4); x1=script_getnum(st,5); y1=script_getnum(st,6); if( (m=map_mapname2mapid(str))< 0){ script_pushint(st,-1); return 0; } map_foreachinarea(buildin_getareausers_sub, m,x0,y0,x1,y1,BL_PC,&users,st); script_pushint(st,users); return 0; } NPC Example...
    prontera,148,177,5 script getareausers 100,{ .@len = getareausers("prontera",148,175,163,164); for( .@a = 0; .@a < .@len; .@a++ ) npctalk ""+.@account_ids[.@a]; end; }
  25. Skorm's post in Anti Dual Script - Mac was marked as the answer   
    - script dualclientkicker2 -1,{
    OnPCLoginEvent:
    set .@len, query_sql("SELECT DISTINCT `account_id` FROM `char` WHERE `account_id` IN "+
    "(SELECT `account_id` FROM `login` WHERE `last_mac` = "+
    "(SELECT `last_mac` FROM `login` WHERE `account_id`="+getcharid(3)+")) AND `online` <> 0;",.@a);
    sleep2 1000;
    if( .@len > .max )
    atcommand "@kick "+strcharinfo(0);
    end;
    OnInit:
    set .max, 2; //Max Connections.
    }

×
×
  • Create New...