Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Community Answers

  1. Capuche's post in How to convert number when max int was marked as the answer   
    you can use insertchar to insert something in the string
    insertchar(<string>,<char>,<index>)
     
    like this
    function format_number; mes format_number( "100000", "," );// display 100,000 close; function format_number { .@num$ = getarg(0); .@format$ = getarg(1); .@len = getstrlen( .@num$ ); for ( .@i = ( .@len%3 ? .@len%3 : 3 ); .@i < .@len; .@i += 4 ) { .@num$ = insertchar( .@num$, .@format$, .@i ); .@len++; } return .@num$; }
    I forgot the function in the main repo..
    ////////////////////////////////////////////////////////////////////////////////// // Returns a number with commas between every three digits. // -- callfunc "F_InsertComma",<number> // Examples: // callfunc("F_InsertComma",7777777) // returns "7,777,777" ////////////////////////////////////////////////////////////////////////////////// function script F_InsertComma { set .@str$, getarg(0); for (set .@i,getstrlen(.@str$)-3; .@i>0; set .@i,.@i-3) set .@str$, insertchar(.@str$,",",.@i); return .@str$; } it's better D:
  2. Capuche's post in Command '@question' problem/doubt was marked as the answer   
    You're welcome!
    I forgot, the source doesn't create a chat if the player doesn't have basic skill lvl 4 too, is near a npc or is mute
  3. Capuche's post in help masters was marked as the answer   
    http://rathena.org/board/topic/76615-showevent-emotions-not-showing/
  4. Capuche's post in Change Baby PVP Room into Novice PVP Room was marked as the answer   
    if ( Class != Job_Novice ) goto L_NotBaby; + change the message in L_NotBaby
  5. Capuche's post in @itemfloor command? was marked as the answer   
    - script item_floor -1,{ OnInit: bindatcmd "itemfloor",strnpcinfo(3)+"::OnAtcommand",99,99; end; OnAtcommand: .@item_id = atoi(.@atcmd_parameters$[0]); .@amount = ( .@amount = atoi(.@atcmd_parameters$[1]) ) ? .@amount : 1; if ( getiteminfo( .@item_id,0 ) == -1 ) { message strcharinfo(0), "non existent item id"; message strcharinfo(0), "usage "+ .@atcmd_command$ +" <item_id> {<amount>}"; end; } getmapxy .@map$, .@x, .@y, 0; freeloop 1; while ( .@i < .@amount ) { do { .@dx = rand( -200, 200 ); .@dy = rand( -200, 200 ); } while( !checkcell( .@map$,(.@x+.@dx),(.@y+.@dy),cell_chkpass ) ); makeitem .@item_id, 1, .@map$, (.@x + .@dx), (.@y + .@dy); .@i++; } end; } .@item_id typo error
  6. Capuche's post in Script itemall excluding vendors was marked as the answer   
    if( .@aid[.@i] != .@self_id && !checkvending(.@name$[.@i]) ){

  7. Capuche's post in rAthena shop which takes whichever item is available. was marked as the answer   
    prontera,150,180,5 script excahnger 56,{
    if ( countitem(7828) ) {// valor
    getitem 522, countitem(7828);
    delitem 7828, countitem(7828);
    }
    else if ( countitem(7829) ) {// bravery
    getitem 522, countitem(7829);
    delitem 7829, countitem(7829);
    }
    end;
    }

  8. Capuche's post in Optimzing Help was marked as the answer   
    getitemname(getd(".Tier"+ .@e +"["+ .@i +"]")) or
    getitemname( getelementofarray( getd(".Tier"+ .@e), .@i ) )
  9. Capuche's post in SQL table resetter script was marked as the answer   
    prontera,150,150,5 script jopijip 75,{
    setarray .@table$, "zenylog", "picklog";
    .@s = select( "truncate zenylog", "truncate picklog" ) -1;
    query_logsql "truncate table `"+ .@table$[.@s] +"`";
    mes "you truncate table "+ .@table$[.@s];
    close;
    }

  10. Capuche's post in Card Seller Questio, was marked as the answer   
    It doesn't work because npcshopdelitem was here to delete the default item in the shop, then npcshopadditem added the cards in the shop. You need to put npcshopdelitem after npcshopadditem
    .@nb = query_sql( "SELECT `"+ .@item_db$ +"`.`id` FROM `"+ .@item_db$ +"` RIGHT JOIN `"+ .@mob_db$ +"` ON `"+ .@item_db$ +"`.`id` = `"+ .@mob_db$ +"`.`dropcardid` WHERE ~(`MODE`) & 32 AND `type` = 6 AND LEFT( `name_japanese`, 1 ) = '"+ .alphabet$[.@i] +"' GROUP BY `name_japanese` ORDER BY `name_japanese` LIMIT 128;", .@id ); for ( .@j = 0; .@j < .@nb; .@j++ ) npcshopadditem "card_mob#"+ .alphabet$[.@i], .@id[.@j], 1000000; npcshopdelitem "card_mob#"+ .alphabet$[.@i],501,4055,4035,4058; }
  11. Capuche's post in How to show the value of a var in a NPC message? was marked as the answer   
    mes "Available Amount : "+ValueConvert( getd(#DONATIONPOINTS) )+"^000000"; You make thing too hard. To display the value of #DONATIONPOINTS, it's.. well..
    mes "Available Amount : "+ #DONATIONPOINTS +"^000000"; Also you miss a step in your script.
    player input amount you check the input (.@amount == 0) check if the player have the amount of eKoin - you forgot this part etc..
  12. Capuche's post in mob_skill_db.sql to txt was marked as the answer   
    it's in inter_athena.conf not login_athena.conf
     
    it's all or nothing (or ask for a source mod)
  13. Capuche's post in How can I make a tag on a player? was marked as the answer   
    a sample, you attached the var to the character
    train: if ( attach_variable > 0 ) { mes "you already get the items"; close; } mes "That's Great!"; mes "I am giving you these equipments so you can start your adventure!"; getitem 1243,1; getitem 569,100; attach_variable = 1; close; to attach the var to the account, use the prefix # (attach_variable become #attach_variable in our sample)
  14. Capuche's post in Instant rebirth sceipt was marked as the answer   
    - script auto_job -1,{
    OnPCBaseLvUpEvent:
    OnPCJobLvUpEvent:
    if ( BaseLevel != 99 || JobLevel != 50 ) end;
    if ( roclass(eaclass()|EAJL_UPPER) != -1 )
    jobchange Job_Novice_High;
    }

  15. Capuche's post in Forbidden player to hit monster. was marked as the answer   
    make a new group in conf/group.conf and add the perm disable_pvm for this group
    https://github.com/rathena/rathena/blob/master/doc/permissions.txt#L95
  16. Capuche's post in Requesting map effect script was marked as the answer   
    hmm maybe using OnTouch is a bit buggy well, try
    prt_fild01,1,1,0 script #dummy_light 111,{ end; OnAttach: addrid 1; getmapxy .@map_npc$,.@x_npc,.@y_npc,1; getmapxy .@map$,.@x,.@y,0; if ( distance( .@x_npc,.@y_npc,.@x,.@y ) < 2 ) unitkill getcharid(3); end; } - script main_bolt -1,{ OnInit: while(1) { do { .@x = rand(1,400); .@y = rand(1,400); } while( !checkcell( "prt_fild01",.@x,.@y,cell_chkpass ) ); movenpc "#dummy_light",.@x,.@y; enablenpc "#dummy_light"; specialeffect EF_LIGHTBOLT,AREA,"#dummy_light";// seems doesn't work with sprite -1 disablenpc "#dummy_light"; if ( getareausers( "prt_fild01",(.@x-1),(.@y-1),(.@x+1),(.@y+1) ) > 0 ) donpcevent "#dummy_light::OnAttach"; sleep 30000; } }
  17. Capuche's post in Job changer was marked as the answer   
    this one is not the last one, there is an issue with this version.
    Whatever, just search jobchange :
    if (.@i==4001 && .LastJob) set lastJob, Class; jobchange .@i; if (.@i==4001 || .@i==4023) resetlvl(1); add resetstatus;
    if (.@i==4001 && .LastJob) set lastJob, Class; jobchange .@i; resetstatus; if (.@i==4001 || .@i==4023) resetlvl(1);
  18. Capuche's post in requesting for Some Script was marked as the answer   
    try
    prt_fild01,170,322,5 script sdfg 56,{ setarray .@equipped, getequipid( EQI_COSTUME_HEAD_LOW ), getequipid( EQI_COSTUME_HEAD_MID ), getequipid( EQI_COSTUME_HEAD_TOP ), getequipid( EQI_COSTUME_GARMENT ); .@s = select( ( .@equipped[0] > 0 ? "Deslot costume low" : "" ), ( .@equipped[1] > 0 ? "Deslot costume mid" : "" ), ( .@equipped[2] > 0 ? "Deslot costume top" : "" ), ( .@equipped[3] > 0 ? "Deslot costume garment" : "" ) ) -1; getinventorylist; for ( .@i = 0; .@i < @inventorylist_count; .@i++ ) if ( .@equipped[.@s] == @inventorylist_id[.@i] && @inventorylist_equip[.@i] > 1000 && @inventorylist_equip[.@i] < 9000 ) break; if ( !@inventorylist_card1[.@i] && !@inventorylist_card1[.@i] && !@inventorylist_card1[.@i] && !@inventorylist_card1[.@i] ) { mes "none card inserted"; close; } delequip (11+.@s); getitem2 .@equipped[.@s],1,1,@inventorylist_refine[.@i],@inventorylist_attribute[.@i],0,0,0,0; for ( .@j = 1; .@j <= 4; .@j++ ) if ( getd( "@inventorylist_card"+ .@j +"["+ .@i +"]" ) > 0 ) getitem getd( "@inventorylist_card"+ .@j +"["+ .@i +"]" ),1; end; }
  19. Capuche's post in Named Weapon was marked as the answer   
    Read getitem2 in docs/script_commands to enchant an item
     
    to check if an item is made by someone, same thing as above
    check if @card4 > 150000, if so it's an item named
    .@char_id = @card3 + ( @card4 << 16 ) to retrieve the char id
  20. Capuche's post in command off on map was marked as the answer   
    setarray .Map$[0],"n_pvp","ufc_pvp2","ufc_pvp3","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";
    .@concat$ = implode( .Map$, "|" );
    if( compare( .@concat$, strcharinfo(3) ) == 0 ){
    message strcharinfo(0),"This Command goes here not !";

  21. Capuche's post in How to disable PINK MOB HP BAR was marked as the answer   
    /monsterhp
  22. Capuche's post in pc_bonus: max number of spells is only 10. What to do? was marked as the answer   
    Try to increase in pc.h
    #define MAX_PC_BONUS 10
  23. Capuche's post in bindatcmd Help was marked as the answer   
    - script Haze2 -1,{
    Onitemrain:
    .@itemid = atoi( .@atcmd_parameters$ );
    .@amount = atoi( .@atcmd_parameters$[1] );
    if ( getitemname( .@itemid ) == "null" ) {
    message strcharinfo(0), "Invalid Item ID";
    end;
    }
    if ( .@amount <= 0 || .@amount > 100 )
    .@amount = 100;
    .@area = getbattleflag("area_size");
    getmapxy .@map$, .@x, .@y, 0;
    while ( .@i < .@amount ) {
    do {
    .@dx = rand( -.@area, .@area );
    .@dy = rand( -.@area, .@area );
    } while( !checkcell( .@map$,(.@x+.@dx),(.@y+.@dy),cell_chkpass ) );
    makeitem .@itemid, 1, .@map$, .@x + .@dx, .@y + dy;
    .@i++;
    }
    end;
    OnInit:
    bindatcmd "itemrain", strnpcinfo(0) +"::Onitemrain", 60,100;
    end;
    }

  24. Capuche's post in R> if @autotrade can't get exp and item anymore was marked as the answer   
    there is a conf about autoloot
    https://github.com/rathena/rathena/blob/master/conf/battle/player.conf#L150
  25. Capuche's post in Refiner script that has no safe limit was marked as the answer   
    Then don't put a limit in the refiner
    prontera,150,150,3 script Refiner 56,{ for( .@part = 1; .@part < 11; .@part++ ) if( getequipisequiped(.@part) && getequipisenableref(.@part) ) successrefitem( .@part,( 10- getequiprefinerycnt(.@part) ) ) }
×
×
  • Create New...