Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Community Answers

  1. Capuche's post in Edit AnnieRuru mvp summoner was marked as the answer   
    Replace
    monster "this", 0, 0, "--ja--", getd(".group"+ .@group +"id["+ .@menu +"]"), .@amount; by
    monster "this", 56, 56, "--ja--", getd(".group"+ .@group +"id["+ .@menu +"]"), .@amount;
  2. Capuche's post in @pvp on to all map when night comes was marked as the answer   
    There is a LOT of differences.
    You should tell us at first you use ea.. double work for me /sigh
     
    Same sources mods (add them manually).
    Try this npc script
    - script junho -1,{ function getarrayvalue { return getd( ".save_map_name" + ( getarg(0)/128 ) +"$["+ ( getarg(0)%128 ) +"]" ); } function MapInCompare { set .@map$, getarg(0); set .@num_var, .size_array / 128; for ( set .@i, 0; .@i <= .@num_var; set .@i, .@i +1 ) if ( compare( getd( ".concat_map_name"+ .@i +"$" ),.@map$ ) ) return 1; return 0; } OnNight: set .nightday, 1; set .@size, query_sql( "select `name` from `char` where `online` = 1 limit 128", .@name$ ); for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 ) { getmapxy .@map$, .@x, .@y, 0, .@name$[.@i]; callsub L_check, .@map$; } end; OnPCLoadMapEvent: callsub L_check, strcharinfo(3); end; L_check: set .@map$, getarg(0); if ( !.nightday || getmapflag( .@map$,mf_pvp ) || getmapflag( .@map$,mf_battleground ) || getmapflag( .@map$,mf_gvg ) || compare( .map_black_list$,.@map$ ) || MapInCompare( .@map$ ) ) return; set .@num_var, .size_array / 128; setd ".save_map_name"+ .@num_var +"$["+ ( .size_array%128 ) +"]", .@map$; setd ".concat_map_name"+ .@num_var +"$", getd( ".concat_map_name"+ .@num_var +"$" ) + .@map$ +"|"; set .size_array, .size_array +1; pvpon .@map$; return; OnDay: set .nightday, 0; for ( set .@i, 0; .@i < .size_array; set .@i, .@i +1 ) { pvpoff getarrayvalue( .@i ); sleep 1; } set .@num_array, .size_array/128; while( .@num_array >= 0 ) { setd ".concat_map_name"+ .@num_array +"$", ""; deletearray getd( ".save_map_name" + .@num_array +"$" ); set .@num_array, .@num_array -1; } set .size_array, 0; end; OnInit: setarray .@tmp$, "prontera", "geffen";// yours maps no pvp set .@size, getarraysize( .@tmp$ ); while( .@i < .@size ) { set .map_black_list$, .map_black_list$ + .@tmp$[.@i] +"|"; set .@i, .@i +1; } }
  3. Capuche's post in Ultimate WoE Script Set was marked as the answer   
    GMXeon made a new release of this file here
    http://www.eathena.ws/board/index.php?showtopic=198420&st=0#entry1088248
    The link is still available
  4. Capuche's post in Obb like script was marked as the answer   
    http://rathena.org/board/topic/74782-make-new-box-like-old-blue-box/?p=158975
    or
    Groupranditem
    to make a new box
  5. Capuche's post in help using addrid on script was marked as the answer   
    It's better to check if the item id exist and if the amount > 0
    also about getitem the values must be integer values
    A sample
    -    script    trial    -1,{ OnInit:     bindatcmd "test",strnpcinfo(3)+"::OnAtcommand";     end; OnAtcommand:     if ( .@atcmd_numparameters != 2 ) {         message .@myname$, "Usage: "+ .@atcmd_command$ +" <item id> <amount>";         end;     }     .atoi_id = atoi( .@atcmd_parameters$[0] );     .atoi_amount = atoi( .@atcmd_parameters$[1] );     .@myname$ = strcharinfo(0);     if ( getiteminfo( .atoi_id,0 ) == -1 ) {         message .@myname$, "Requesting to send an non-existing item ("+ .atoi_id +"). "+ .@atcmd_command$ +" failed.";         end;     }     else if ( .atoi_amount < 1 ) {         message .@myname$, "You can't send "+ .atoi_amount +" item. "+ .@atcmd_command$ +" failed.";         end;     }     addrid(1);     getitem .atoi_id, .atoi_amount;     end; }
    getiteminfo + atoi
     
    EDIT : fix an error
  6. Capuche's post in Help Please Job Changer> trans 2-1 with oborro and kag script :D was marked as the answer   
    trunk/npc/custom/jobmaster.txt
    set .ThirdClass,1; // Enable third classes? (1: yes / 0: no) put to 0
     
    if (Class == Job_Ninja) setarray .@exp[0],.@j1,70; if (.@exp[0] && .ThirdClass) { change to
    if (Class == Job_Ninja) setarray .@exp[0],.@j1,70; if (Class == Job_Ninja) {
  7. Capuche's post in Need help again for announcement was marked as the answer   
    About the Mystical card album, replace
    getrandgroupitem(IG_MagicCardAlbum),1; by
    set .@item, groupranditem(IG_MagicCardAlbum); getitem .@item,1; announce "[ Mystical Card Album ]:"+ strcharinfo(0) +" get a "+ getitemname( .@item ),0; like that
    12246,Magic_Card_Album,Mystical Card Album,2,10000,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ set .@item, groupranditem(IG_MagicCardAlbum); getitem .@item,1; announce "[ Mystical Card Album ]:"+ strcharinfo(0) +" get a "+ getitemname( .@item ),0; },{},{}
  8. Capuche's post in request monster arena was marked as the answer   
    // permanent monster
    prontera,0,0,0,0 monster Baphomet 1039,1,7200000,600000,"monster_points::OnMobDead1"
    prontera,0,0,0,0 monster Tao Gunka 1583,1,18000000,600000,"monster_points::OnMobDead2"
    // etc..
    - script monster_points -1,{
    OnMobDead1:// bapho
    .@points = 50;
    #monster_points = #monster_points + .@points ;// give points to the killer
    dispbottom "you got "+ .@points +" points. Total: "+ #monster_points +" points.";// display the points
    end;
    OnMobDead2:// tao
    .@points = 20;
    #monster_points = #monster_points + .@points ;
    dispbottom "you got "+ .@points +" points. Total: "+ #monster_points +" points.";
    end;
    }
    // etc..

  9. Capuche's post in R>scrip was marked as the answer   
    - script reward_woe -1,{ OnAgitEnd: callsub( L_reward, 0,19 ); OnAgitEnd2: callsub( L_reward, 24,33 ); L_reward: sleep 1000; set .@start, getarg(0); set .@end, getarg(1); for( set .@i, .@start; .@i <= .@end; set .@i, .@i +1 ) { set .@guild_id, getcastledata( .castle_map$[.@i],1 ); if( .@guild_id ) setd ".@points_"+ .@guild_id, getd( ".@points_"+ .@guild_id ) +1; } set .@size, query_sql( "SELECT `name`, `account_id` FROM `char` WHERE `online` = 1 and `guild_id` != 0 LIMIT 128", .@name$, .@account_id ); for ( set .@i, 0; .@i < .@size; set .@i, .@i +1 ) if( getd( ".@points_"+ getcharid( 2,.@name$[.@i] ) ) ) { attachrid .@account_id[.@i]; set #CASHPOINTS, #CASHPOINTS + .amount * getd( ".@points_"+ getcharid(2) ); dispbottom "you got "+ .amount +" cashpoints. Total: "+ #CASHPOINTS; } end; OnInit: set .amount, 100; // give 100 cashpoints setarray .castle_map$, "aldeg_cas01", "aldeg_cas02", "aldeg_cas03", "aldeg_cas04", "aldeg_cas05", "gefg_cas01", "gefg_cas02", "gefg_cas03", "gefg_cas04", "gefg_cas05", "payg_cas01", "payg_cas02", "payg_cas03", "payg_cas04", "payg_cas05", "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05", "nguild_alde", "nguild_gef", "nguild_pay", "nguild_prt", "schg_cas01", "schg_cas02", "schg_cas03", "schg_cas04", "schg_cas05", "arug_cas01", "arug_cas02", "arug_cas03", "arug_cas04", "arug_cas05"; } ea doesn't support direct variable assignment. That means
     
    .@start = getarg(0);// doesn't work on eathena .@i++;// doesn't work on eathena set .@start, getarg(0);// work on eathena set .@i, .@i +1;// work on eathena
  10. Capuche's post in ip check for event registeration was marked as the answer   
    prontera,150,175,5 script inin 75,{
    select( "register" );
    .@my_aid = getcharid(3);
    while( .@i < .size_aid && .aid_reg[.@i] != .@my_aid ) .@i++;// check if already register
    if ( .@i < .size_aid ) {// already register, can enter
    warp "geffen",0,0;
    end;
    }
    .@ip = getcharip();
    if ( getd( ".ip_"+ .@ip ) ) {// check the ip
    dispbottom "access denied. same ip detected.";
    end;
    }
    setd ".ip_"+ .@ip, 1;// save the ip
    .aid_reg[.size_aid] = .@my_aid;// save the account id
    .size_aid++;
    warp "geffen",0,0;
    end;
    }

  11. Capuche's post in No reborn job changer.. was marked as the answer   
    //===== rAthena Script ======================================= //= Job Master //===== By: ================================================== //= Euphy //===== Current Version: ===================================== //= 1.3 //===== Compatible With: ===================================== //= rAthena SVN r16114+ //===== Description: ========================================= //= A fully functional job changer. //===== Additional Comments: ================================= //= 1.0 Initial script. //= 1.1 Fixed reset on Baby job change. //= 1.2 Added Expanded Super Novice support and initial Kagerou/Oboro support. //= 1.3 Kagerou/Oboro added. //============================================================ prontera,153,193,6 script Job Master 123,{ function Job_Menu; function A_An; mes "[Job Master]"; if (Class > 4049) { mes "No more jobs are available."; close; } if (checkfalcon() || checkcart() || checkriding() || ismounting()) { mes "Please remove your "+((checkfalcon())?"falcon":"")+((checkcart())?"cart":"")+((checkriding())?"Peco":"")+((ismounting())?"mount":"")+" before proceeding."; close; } if (.SkillPointCheck && SkillPoint) { mes "Please use all your skill points before proceeding."; close; } set .@eac, eaclass(); set .@i, ((.ThirdClass)?roclass(.@eac&EAJ_UPPERMASK):Class); if (.@i > 6 && .@i < 22) { if (BaseLevel < .Rebirth[0] || JobLevel < .Rebirth[1]) { set .@blvl, .Rebirth[0]-BaseLevel; set .@jlvl, .Rebirth[1]-JobLevel; mes "You need "+((.@blvl>0)?.@blvl+" more base levels "+((.@jlvl>0)?"/ ":""):"")+((.@jlvl>0)?.@jlvl+" more job levels ":"")+"to continue."; close; } if (Class > 21) { mes "Switch to third class?"; next; Job_Menu(roclass(.@eac|EAJL_THIRD)); close; } while(1) { mes "Select an option."; next; set .@i, select(" ~ ^0055FF"+ jobname(roclass(.@eac|EAJL_UPPER)) +"^000000:"+((.ThirdClass)?" ~ ^FF0000Third Class^000000":"")+": ~ ^777777Cancel^000000"); if (.@i==3) close; mes "[Job Master]"; mes "Are you sure?"; next; Job_Menu(((.@i==1)? roclass(.@eac|EAJL_UPPER) :roclass(.@eac|EAJL_THIRD))); mes "[Job Master]"; } } set .@j1, roclass(.@eac|EAJL_2_1); set .@j2,roclass(.@eac|EAJL_2_2); if ((.@eac&EAJ_UPPERMASK) == EAJ_SUPER_NOVICE) setarray .@exp[0],roclass(.@eac|EAJL_THIRD),99; if (Class == Job_Ninja) setarray .@exp[0],.@j1,70; if (.@exp[0] && .ThirdClass) { if (BaseLevel < .Rebirth[0] || JobLevel < .@exp[1]) { set .@blvl, .Rebirth[0]-BaseLevel; set .@jlvl, .@exp[1]-JobLevel; mes "You need "+((.@blvl>0)?.@blvl+" more base levels "+((.@jlvl>0)?"/ ":""):"")+((.@jlvl>0)?.@jlvl+" more job levels ":"")+"to continue."; close; } mes "Switch to "+jobname(.@exp[0])+"?"; next; Job_Menu(.@exp[0]); close; } if (.@eac&EAJL_2) if (.@eac&(EAJL_UPPER|EAJL_BABY) || roclass(.@eac|EAJL_UPPER) == -1) { mes "No more jobs are available."; close; } if ((.@eac&EAJ_BASEMASK) == EAJ_NOVICE) { if (JobLevel < .JobReq[0]) mes "A job level of "+.JobReq[0]+" is required to change into the 1st Class."; else if (Class == 4001 && .LastJob && lastJob) { mes "Switch classes now?"; next; Job_Menu(roclass((eaclass(lastJob)&EAJ_BASEMASK)|EAJL_UPPER)); } else switch(Class) { case 0: Job_Menu(1,2,3,4,5,6,23,4046,24,25,4023); case 4001: Job_Menu(4002,4003,4004,4005,4006,4007); case 4023: Job_Menu(4024,4025,4026,4027,4028,4029,4045); default: mes "An error has occurred."; break; } close; } if (roclass(.@eac|EAJL_2_1) == -1 || roclass(.@eac|EAJL_2_2) == -1) mes "No more jobs are available."; else if (!(.@eac&EAJL_2) && JobLevel < .JobReq[1]) mes "A job level of "+.JobReq[1]+" is required to change into the 2nd Class."; else if (.LastJob && lastJob && (.@eac&EAJL_UPPER)) { mes "Switch classes now?"; next; Job_Menu(lastJob+4001); } else Job_Menu(.@j1,.@j2); close; function Job_Menu { while(1) { if (getargcount() > 1) { mes "Select a job."; set .@menu$,""; for(set .@i,0; .@i<getargcount(); set .@i,.@i+1) set .@menu$, .@menu$+" ~ "+jobname(getarg(.@i))+":"; set .@menu$, .@menu$+" ~ ^777777Cancel^000000"; next; set .@i, getarg(select(.@menu$)-1,0); if (!.@i) close; if ((.@i == 23 || .@i == 4045) && BaseLevel < .SNovice) { mes "[Job Master]"; mes "A base level of "+.SNovice+" is required to turn into a "+jobname(.@i)+"."; close; } mes "[Job Master]"; mes "Are you sure?"; next; } else set .@i, getarg(0); if (select(" ~ Change into ^0055FF"+jobname(.@i)+"^000000 class: ~ ^777777"+((getargcount() > 1)?"Go back":"Cancel")+"^000000") == 1) { mes "[Job Master]"; mes "You are now "+A_An(jobname(.@i))+"!"; if (.@i==4001 && .LastJob) set lastJob, Class; jobchange .@i; if (.@i==4001 || .@i==4023) resetlvl(1); specialeffect2 338; specialeffect2 432; if (.Platinum) callsub Get_Platinum; close; } if (getargcount() == 1) return; mes "[Job Master]"; } end; } 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); } Get_Platinum: skill 142,1,0; switch(BaseClass) { case 0: if (Class !=23) skill 143,1,0; break; case 1: skill 144,1,0; skill 145,1,0; skill 146,1,0; break; case 2: skill 157,1,0; break; case 3: skill 147,1,0; skill 148,1,0; break; case 4: skill 156,1,0; break; case 5: skill 153,1,0; skill 154,1,0; skill 155,1,0; break; case 6: skill 149,1,0; skill 150,1,0; skill 151,1,0; skill 152,1,0; break; default: break; } switch(BaseJob) { case 7: skill 1001,1,0; break; case 8: skill 1014,1,0; break; case 9: skill 1006,1,0; break; case 10: skill 1012,1,0; skill 1013,1,0; break; case 11: skill 1009,1,0; break; case 12: skill 1003,1,0; skill 1004,1,0; break; case 14: skill 1002,1,0; break; case 15: skill 1015,1,0; skill 1016,1,0; break; case 16: skill 1007,1,0; skill 1008,1,0; skill 1017,1,0; skill 1018,1,0; skill 1019,1,0; break; case 17: skill 1005,1,0; break; case 18: skill 238,1,0; break; case 19: skill 1010,1,0; break; case 20: skill 1011,1,0; break; default: break; } return; OnInit: setarray .Rebirth[0],99,50; // Minimum base level, job level to rebirth OR change to third class setarray .JobReq[0],10,40; // Minimum job level to turn into 1st class, 2nd class set .ThirdClass,0; // Enable third classes? (1: yes / 0: no) set .SNovice,45; // Minimum base level to turn into Super Novice set .LastJob,1; // Enforce linear class changes? (1: yes / 0: no) set .SkillPointCheck,1; // Force player to use up all skill points? (1: yes / 0: no) set .Platinum,1; // Get platinum skills automatically? (1: yes / 0: no) end; }  
  12. Capuche's post in One Touch, One Kill. was marked as the answer   
    like constants monsters?
    db/.../mob_skill_db.txt
    // MobID,Dummy value (info only),State,SkillID,SkillLv,Rate,CastTime,Delay,Cancelable,Target,Condition type,Condition value,val1,val2,val3,val4,val5,Emotion,Chat 1738,Constant@NPC_SELFDESTRUCTION,attack,173,1,10000,1000,0,no,self,always,0,,,,,,, 1738,Constant@NPC_SELFDESTRUCTION,chase,173,1,2000,1000,0,no,self,always,0,,,,,,,
  13. Capuche's post in Npc Warper 1 Click per char was marked as the answer   
    prontera,150,150,0 script Warper 100,{
    if ( already_warped ) end;
    warp "prontera",0,0;
    set already_warped, 1;
    end;
    }

  14. Capuche's post in All Equipment:true is warning in cmd was marked as the answer   
    all_equipment is a permission, not a command
    permissions: { all_equipment: true }
  15. Capuche's post in Reward for all online player was marked as the answer   
    An Emistry's script I like
  16. Capuche's post in Can Anyone help me? was marked as the answer   
    set .faildestroy,1; // Should the card remover have a chance of failure that destroys items? 1 = Yes, 0 = No. set this to 0
  17. Capuche's post in Poring Summoner script was marked as the answer   
    yes
     
    Onendevent: if(.Event) announce "The Poring Summon Event is now over!",bc_all; killmonster .Map$,"All"; set .Event,0; set .SpecialPorings[1],0; set .NormalPorings[1],0; close; change close to end here
     
     
    case 6: mes "Ending the event now..."; donpcevent strnpcinfo(0) +"::Onendevent"; } add a close after the donpcevent
  18. Capuche's post in OFF PVP when WOE is On was marked as the answer   
    in you pvp script add the label OnAgitStart + hideonnpc (hide the npc when the woe start) and OnAgitEnd + hideoffnpc (unhide)
    sample:
    OnAgitstart: hideonnpc strnpcinfo(0); end; OnAgitEnd: hideoffnpc strnpcinfo(0); end;
  19. Capuche's post in Guild broadcast was marked as the answer   
    - script guild_announce -1,{ OnWhisperGlobal: .@guild_id = getcharid(2); if ( getguildmasterid( .@guild_id ) != getcharid(0) ) end; if ( @accountid_member == 0 ) @total_guild_member = query_sql( "select `account_id`, `char_id` from `guild_member` where `guild_id` = "+ .@guild_id, @accountid_member, @charid_member ); .@mes$ = @whispervar0$; .@name$ = strcharinfo(0); .@origin = getcharid(3); while( .@i < @total_guild_member ) { if ( isloggedin( @accountid_member[.@i], @charid_member[.@i] ) ) { attachrid @accountid_member[.@i]; announce "[ "+ .@name$ +" ]: "+ .@mes$, bc_self; attachrid .@origin; } .@i++; } } I tested it, should work now
  20. Capuche's post in Help Me With This was marked as the answer   
    Your V4P doesn't use any account variable, it use a query to retrieve the value in a table
    //===== 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,3,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; } query_sql( "SELECT `point` FROM `vote_point` WHERE `loginname` = MD5('"+getcharid(3)+"')", .@vote ); 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(.@vote,.@q[5]*.@q[1])+(.@q[5]*.@q[1])+" "+.Points$[1]+" ("+.@vote+"/"+(.@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]) query_sql("UPDATE `vote_point` SET `point` = `point` - "+ (.@q[5]*.@q[1]) +" WHERE `loginname` = MD5('"+getcharid(3)+"')"); 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
  21. Capuche's post in Help please :3 was marked as the answer   
    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++; } */ }
  22. Capuche's post in MVP cashPoint was marked as the answer   
    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;
  23. Capuche's post in Egg Shop was marked as the answer   
    this error appear on eathena, not in the latest rathena revision
     
    You can make a normal shop by script command. Here a sample
    // dummy shop - shop Egg Shop 703,501:-1 prontera,160,172,7 script special egg 56,{ callshop "Egg Shop",1; end; OnBuyItem: set .@size, getarraysize( @bought_nameid ); while ( .@i < .@size ) { for ( set .@j, 0; .@j < .size_id; set .@j, .@j +1 ) if ( @bought_nameid[.@i] == .item_id[.@j] ) break; set .@total, .@total + .price[.@j] * @bought_quantity[.@i]; set .@i, .@i +1; } if ( Zeny < .@total ) { dispbottom "you don't have enough zeny"; end; } set Zeny, Zeny - .@total; for ( set .@j, 0; .@j < .@size; set .@j, .@j +1 ) makepet @bought_nameid[.@j]; end; OnInit: setarray .item_id, 9001, 9002;// yours pet egg setarray .price, 20, 20;// yours pet egg price set .size_id, getarraysize( .item_id); npcshopdelitem "Egg Shop",501; for ( ; .@i < .size_id; set .@i, .@i +1) npcshopadditem "Egg Shop",.item_id[.@i],.price[.@i]; npcshopattach "Egg Shop"; end; } your setting
    OnInit: setarray .item_id, 9001, 9002;// yours pet egg setarray .price, 20, 20;// yours pet egg price
  24. Capuche's post in Battle Ground script was marked as the answer   
    yes
  25. Capuche's post in how to make monster wiki automated every 1hour was marked as the answer   
    OnMinute00: for( set .@i,3; .@i > 0 ; set .@i,.@i - 1 ){ announce "Monster Wiki Event will take place in Prontera within "+.@i+" Minutes",bc_blue; sleep 60000; this event is already auto every hour
×
×
  • Create New...