Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Community Answers

  1. Capuche's post in Annie Rururu's BG was marked as the answer   
    replace
    invek,125,211,5 script Red Team 733,{ end; OnInit: sleep 50; set getvariableofnpc( .rednpcname$, "custom_bg#control" ), strnpcinfo(0); OnStart: waitingroom "Red Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", getvariableofnpc( .minplayer2start, "custom_bg#control" ); end; } invek,132,208,3 script Blue Team 734,{ end; OnInit: sleep 50; set getvariableofnpc( .bluenpcname$, "custom_bg#control" ), strnpcinfo(0); OnStart: waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", getvariableofnpc( .minplayer2start, "custom_bg#control" ); end; }  
    by
    invek,125,211,5 script Red Team 733,{ end; OnInit: sleep 50; set getvariableofnpc( .rednpcname$, "custom_bg#control" ), strnpcinfo(0); OnStart: waitingroom "Red Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", 1; end; } invek,132,208,3 script Blue Team 734,{ end; OnInit: sleep 50; set getvariableofnpc( .bluenpcname$, "custom_bg#control" ), strnpcinfo(0); OnStart: waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "custom_bg#control" ) +1, "custom_bg#control::OnStart", 1; end; }
  2. Capuche's post in Requesting Save NPC was marked as the answer   
  3. Capuche's post in LMS Script " Support -Plz suggest was marked as the answer   
    The script try to disable a npc named Mr. Banker, your npc's name is Mr.Banker (no space)...
  4. Capuche's post in is there any way to see command log? specially for commands that GM accounts did? like @item? was marked as the answer   
    https://github.com/rathena/rathena/blob/master/conf/log_athena.conf#L96
  5. Capuche's post in How to make this account based? was marked as the answer   
    No the variable is permanent
     
    Here a revision
    - script login_reward -1,{ OnPCLoginEvent: .@pow = 1 << 10; .@todays = gettime(8); if ( #login_reward % .@pow == .@todays ) end; .@count = .reward_day; #login_reward = ( #login_reward &~ ( #login_reward % .@pow ) ) + .@todays + .@pow; .@count_day = ( #login_reward >> 10 ) % .@pow; if ( .@count_day % 7 == 0 ) { .@count += .reward_week; .@weekly_message$ = ( .@cond_ofthemonth ? ", " : " and " ) + .reward_week +" golds for being online a week"; } if ( .@count_day % 31 == 0 ) { .@count += .reward_month; .@montly_message$ = " and " + .reward_month +" golds for being online a month"; } getitem 969, .@count; dispbottom "Here your daily reward ! You got "+ .reward_day +" golds"+ .@weekly_message$ + .@montly_message$ +"."; end; OnInit: .reward_day = 2;// reward of the day : amount of gold .reward_week = 10;// reward of the week : amount of gold .reward_month = 35;// reward of the month : amount of gold end; }
  6. Capuche's post in How to make an item to recognize the refine rate of other item was marked as the answer   
    Use getequiprefinerycnt
    bonus bStr, getequiprefinerycnt( EQI_HEAD_TOP ); bonus bMaxSP, getequiprefinerycnt( EQI_HEAD_TOP );
  7. Capuche's post in This function into this script. Possible? was marked as the answer   
    The npc display NULL because of the non existent item. I thought your item ID existed so I didn't add a check
    prontera,152,170,4 script Custom Headgear Trader 797,{ function AddItem; mes "[Custom Headgear Trader]"; mes "Hello " +strcharinfo(0)+ ", I can exchange your Custom Headgear. That means if you're ever bored of your current Custom Headgear sprite, I can easily give you another!"; next; mes "[Custom Headgear Trader]"; mes "This service however is not free, if you want to change your Custom Headgear, I require:"; mes "1x Custom Headgear"; mes "3x Cash Points"; next; if (select("Continue, please.:I'm not interested.") - 1) close; if(#CASHPOINTS < 3) { mes "[Custom Headgear Trader]"; mes "I'm sorry You do not meet the requirements. For you to use my service, I need 3 Cash Points and a Custom Headgear."; close; } mes "[Custom Headgear Trader]"; mes "Very well, let's proceed with the process. Select the Customized Headgear that you want to exchange:"; getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { if ( getiteminfo( @inventorylist_id[.@i],5 ) & ( 1|256|512 ) == 0 ) continue;// not an headgear for ( .@j = 0; .@j <= .num_total/128; .@j++ ) { if ( compare( getd( ".itemidcompare"+ .@j +"$" ), ":"+ @inventorylist_id[.@i] +":" ) ) { setd ".@arraymenu_"+ ( .@count/10 ) +"$["+ ( .@count%10 ) +"]", getitemname( @inventorylist_id[.@i] ); setd ".@itemid_"+ ( .@count/10 ) +"["+ ( .@count%10 ) +"]", @inventorylist_id[.@i]; setd ".@refine_"+ ( .@count/10 ) +"["+ ( .@count%10 ) +"]", @inventorylist_refine[.@i]; setd ".@attribute_"+ ( .@count/10 ) +"["+ ( .@count%10 ) +"]", @inventorylist_attribute[.@i]; setd ".@identify_"+ ( .@count/10 ) +"["+ ( .@count%10 ) +"]", @inventorylist_identify[.@i]; setd ".@card1_"+ ( .@count/10 ) +"["+ ( .@count%10 ) +"]", @inventorylist_card1[.@i]; setd ".@card2_"+ ( .@count/10 ) +"["+ ( .@count%10 ) +"]", @inventorylist_card2[.@i]; setd ".@card3_"+ ( .@count/10 ) +"["+ ( .@count%10 ) +"]", @inventorylist_card3[.@i]; setd ".@card4_"+ ( .@count/10 ) +"["+ ( .@count%10 ) +"]", @inventorylist_card4[.@i]; .@count++; } } } if ( .@count == 0 ) { sleep2 2000; mes "...Oh, it appears that you have no Custom Headgear, sorry but I can't help you."; close; } while(1) { .@menu$ = ( .@page ? "^777777Back^000000:" : ":" ) + implode( getd( ".@arraymenu_"+ .@page +"$" ), ":" ) + ( .@page == .@count/10 ? "":":^777777Next Page^000000" ); .@s = select( .@menu$ ) -2; if ( .@s == -1 && .@page ) .@page--; else if ( .@s == 10 ) .@page++; else break; } .@item_name$ = getd( ".@arraymenu_"+ .@page +"$["+ .@s +"]" ); .@myitem_id = getd( ".@itemid_"+ .@page +"["+ .@s +"]" ); mes "You've selected your ^FF0000" + getd( ".@arraymenu_"+ .@page +"$["+ .@s +"]" ) + "^000000, is that correct?"; next; if (select("Yes, it is.:No.") - 1) close; next; mes "[Custom Headgear Trader]"; mes "Very well then, now select the item you want to exchange your " + .@item_name$ + " for:"; mes "^FF0000To see a list of available sprites, please talk to the Headgear NPC!^000000"; for ( .@j = 0; .@j < .num_total; .@j += 10 ) { .@menu$ = ( .@j/10 ? "^777777Back^000000:" : ":" ); for ( .@i = .@j; .@i < .@j +10; .@i++ ) { .@item_id = getd( ".itemid"+ ( .@i/128 ) +"["+ ( .@i%128 ) +"]" ); if ( .@item_id ) .@item_name2$ = getitemname( .@item_id ); else .@item_name2$ = ":"; .@menu$ = .@menu$ + .@item_name2$ +":"; } .@menu$ = .@menu$ + ( .@j/10 != .num_total/10 ? "^777777Next Page^000000" : "" ); .@s2 = select( .@menu$ ) -2; if ( .@s2 == -1 && .@j/10 ) .@j -= 20; else if ( .@s2 != 10 ) break; } .@tradeid = getd( ".itemid"+ ( ( .@j + .@s2 ) /128 ) +"["+ ( .@j + .@s2 )%128 +"]" ); next; mes "[Custom Headgear Trader]"; mes "Please confirm that you want to use 3 Cash Points for trading your ^FF0000" + .@item_name$ + "^000000 for a ^FF0000" + getitemname(.@tradeid)+ "^000000:"; next; if (select("Confirm:Cancel") - 1) close; if (countitem( .@myitem_id ) == 0 || #CASHPOINTS < 3) { mes "[Custom Headgear Trader]"; mes "It appears that you don't meet the requirements. In order to use my service, you need to have a Custom Headgear and 3 Cash Points."; close; } .@identify = getd( ".@identify_"+ .@page +"["+ .@s +"]" ); .@refine = getd( ".@refine_"+ .@page +"["+ .@s +"]" ); .@attribute = getd( ".@attribute_"+ .@page +"["+ .@s +"]" ); .@card1 = getd( ".@card1_"+ .@page +"["+ .@s +"]" ); .@card2 = getd( ".@card2_"+ .@page +"["+ .@s +"]" ); .@card3 = getd( ".@card3_"+ .@page +"["+ .@s +"]" ); .@card4 = getd( ".@card4_"+ .@page +"["+ .@s +"]" ); delitem2 .@myitem_id,1, .@identify, .@refine, .@attribute, .@card1, .@card2, .@card3, .@card4; getitem2 .@tradeid,1, .@identify, .@refine, .@attribute, .@card1, .@card2, .@card3, .@card4; set #CASHPOINTS,#CASHPOINTS - 3; mes "[Custom Headgear Trader]"; mes "==================================="; mes "Official Receipt"; mes "==================================="; mes "From : " + .@item_name$; mes "To : " +getitemname(.@tradeid); mes "==================================="; dispbottom "3 Cash Points have been deducted. Current Balance = "+#CASHPOINTS+" Cash Points."; next; mes "[Custom Headgear Trader]"; mes "Thank you for using my Custom Headgear trading system, " +strcharinfo(0)+ ". Have a nice day!"; close; OnInit: AddItem( 8005,8006,8015,8016,8017,8018,8019,8020,8021,8022,8023,8024,8025,8026,8027,8028,8029,8030,8031,8032,8033,8034,8035,8036,8037,8038,8039,8040,8041,8042,8043,8044,8045,8046,8047,8052,8053,8054,8055,8056,8057,8058,8059,8060,8062,8063,8064,8065,8066,8067,8068,8069,8070,8071,8072,8073,8074,8075,8076,8077,8078,8079,8080,8081,8082,8083,8084,8085,8086,8087,8094,8095,8098,8100,8102,8103,8104,8105,8106,8107,8108,8109,8110,8111,8112,8113,8114,8115,8116,8112,8117,8118,8119,8120,8121,8122,8123,8124,8125,8126,8127,8128,8130,8131,8132,8133,20051,20052,20053,20054,20055,20056,20057,20058,20059,20060,20061,20062,20063,20064,20065,20066,20067,20068,20069,20070,20071,20072,20073,20074,20075,20076,20077 ); // AddItem( 5009,5010,5011,5012,5013,5014,5015,5016,5017,5018,5019 ); // AddItem( 601,... ); end; function AddItem { .@amount = .num_total + getargcount(); .@i = .@tmp = .num_total; while( .@i < .@amount ) { .@arg = getarg( .@i - .@tmp ); if ( getitemname( .@arg ) != "NULL" ) { setd ".itemid"+ ( .num_total/128 ) +"["+ ( .num_total%128 ) +"]", .@arg; setd ".itemidcompare"+ ( .num_total/128 ) +"$", getd( ".itemidcompare"+ ( .num_total/128 ) +"$" ) +":"+ .@arg; .num_total += 1; if ( .num_total%128 == 0 ) setd ".itemidcompare"+ ( .num_total/128 -1 ) +"$", getd( ".itemidcompare"+ ( .num_total/128 -1 ) +"$" ) +":"; else if ( .num_total == .@amount ) setd ".itemidcompare"+ ( .num_total/128 ) +"$", getd( ".itemidcompare"+ ( .num_total/128 ) +"$" ) +":"; } .@i++; } } }  
    this version skip the non existent item ID
  8. Capuche's post in Decrease Flee Rate Of MVP was marked as the answer   
    Comment the lines with 'agiup' for the mvps
    https://github.com/rathena/rathena/blob/master/db/re/mob_skill_db.txt#L1169
  9. Capuche's post in NPC with timer was marked as the answer   
    I suggest you to use initnpctimer instead of sleep command : awake only 'awake' the current sleep, the script still run
    like that
    OnEnable: sleep2 5000; donpcevent "Greedsummoner::OnSummon"; mapannounce "prt_fild08","Summoner: Start now!",0; initnpctimer; end; OnTimer60000: mapannounce "prt_fild08","Summoner: 5 minute's left",0; end; OnTimer120000: mapannounce "prt_fild08","Summoner: 4 minute's left",0; end; OnTimer180000: mapannounce "prt_fild08","Summoner: 3 minute's left",0; end; // etc..  
    Don't forget to stop the timer
    - awake "GAnnounce"; + stopnpctimer;
  10. Capuche's post in Reward on connection was marked as the answer   
    - script login_reward -1,{ OnPCLoginEvent: .@pow = 1 << 10; .@todays = gettime(8); if ( login_reward % .@pow == .@todays ) end; .@count += .reward_day;// reward of the day login_reward = ( login_reward &~ ( login_reward % .@pow ) ) + .@todays + .@pow;// update day and count day +1 ; day/count day/check week/check month if ( login_reward != .@todays + .@pow ) {// login_reward was not empty .@count_day = ( login_reward >> 10 ) % .@pow; .@cond_ofthemonth = ( ( login_reward >> 30 ) % .@pow ) != ( .@count_day / 31 ); if ( ( ( login_reward >> 20 ) % .@pow ) != ( .@count_day / 7 ) ) { .@count += .reward_week; login_reward = login_reward + pow( 2,20 ); .@weekly_message$ = ( .@cond_ofthemonth ? ", " : " and " ) + .reward_week +" golds for being online a week"; } if ( .@cond_ofthemonth ) { .@count += .reward_month; login_reward = login_reward + pow( 2,30 ); .@montly_message$ = " and " + .reward_month +" golds for being online a month"; } } getitem 969, .@count; dispbottom "Here your daily reward ! You got "+ .reward_day +" golds"+ .@weekly_message$ + .@montly_message$ +"."; end; OnInit: .reward_day = 2;// reward of the day : amount of gold .reward_week = 10;// reward of the week : amount of gold .reward_month = 35;// reward of the month : amount of gold end; } with the settings
    .reward_day = 2;// reward of the day : amount of gold .reward_week = 10;// reward of the week : amount of gold .reward_month = 35;// reward of the month : amount of gold
  11. Capuche's post in Requesting @item (bindatcmd) w/ Password system was marked as the answer   
    - script item_cmd -1,{ OnInit: bindatcmd "item",strnpcinfo(3)+"::OnAtcommand",60,60;// your min gmlevel end; OnAtcommand: .@amount = atoi( .@atcmd_parameters$[1] ); .@amount = .@amount < 1 ? 1 : .@amount; .@myname$ = strcharinfo(0); if ( .@atcmd_numparameters == 0 ) { message .@myname$, "Please enter an item name or ID (usage: @item <item name/ID> <quantity>)."; message .@myname$, "@item failed."; end; } if ( countstr( .@atcmd_parameters$[0], ":" ) ) { explode( .@dummy$, .@atcmd_parameters$[0], ":" ); .@size = getarraysize( .@dummy$ ); while( .@i < .@size ) { .@item_id[.@i] = atoi( .@dummy$[.@i] ); if ( .@item_id[.@i] == 0 && getstrlen( .@dummy$[.@i] ) > 2 ) .@count = !searchitem( .@item_id[.@i],.@dummy$[.@i] ); if ( .@count || getiteminfo( .@item_id[.@i],0 ) == -1 ) { message .@myname$, "Invalid item ID or name."; message .@myname$, "@item failed."; end; } .@count = 0; .@i++; } } else { .@item_id = atoi( .@atcmd_parameters$[0] ); if ( .@item_id == 0 && getstrlen( .@atcmd_parameters$[0] ) > 2 ) .@count = !searchitem( .@item_id,.@atcmd_parameters$[0] ); if ( .@count || getiteminfo( .@item_id,0 ) == -1 ) { message .@myname$, "Invalid item ID or name."; message .@myname$, "@item failed."; end; } .@size = 1; } if ( #item_cmd_password$ == "" ) { L_password: message .@myname$, "Please set your @item password (length must be between 4-10)."; if ( input( .@tmp$, 4,10 ) != 0 ) { message .@myname$, "The length must be between 4-10.";// => cancel end; } message .@myname$, "Your @item password is now : "+ .@tmp$; #item_cmd_password$ = .@tmp$; } else { message .@myname$, "Your @item password ?"; input .@tmp$; if ( .@tmp$ != #item_cmd_password$ ) { message .@myname$, "Wrong password."; end; } if ( select( "Continue", "Change password" ) == 2 ) goto L_password; } while( .@j < .@size ) { getitem .@item_id[.@j], .@amount; .@j++; } message .@myname$, "Item created."; end; } it supports item name/ID and multi item name/ID
  12. Capuche's post in How to get Perfect hit..? was marked as the answer   
    to retrieve the current bPerfectHitRate of the player -> readparam( bPerfectHitRate );
    note that if you also use bPerfectHitAddRate like in your example, readparam( bPerfectHitRate ) will throw the total value
     
    bonus bPerfectHitRate,1; bonus bPerfectHitAddRate,3; -> readparam( bPerfectHitRate ) => 4
  13. Capuche's post in Kafra Cash Converter was marked as the answer   
    prontera,150,150,5 script trader 58,{
    .@exchange_value = 3;// get 3 kafrapoints for 1 cashpoints
    if ( #CASHPOINTS == 0 ) {
    mes "You need some cashpoints.";
    close;
    }
    if ( select( "Trade", "Leave" ) == 2 ) {
    mes "Good bye.";
    close;
    }
    mes "How many points do you want to trade? You currently have "+ #CASHPOINTS +" cashpoints. 1 cashpoint = "+ .@exchange_value +" kafrapoint";
    if ( input( .@value, 1, #CASHPOINTS ) != 0 ) {
    mes "Wrong value.";
    close;
    }
    #CASHPOINTS -= .@value;
    #KAFRAPOINTS = #KAFRAPOINTS + .@value * .@exchange_value;
    mes "you exchange "+ .@value +" cashpoints for "+ ( .@value * .@exchange_value ) +" kafrapoints";
    close;
    }

  14. Capuche's post in Limit the cast number of skills was marked as the answer   
    Change 'maxcount' of your skill in skill_db.txt
  15. Capuche's post in WoE SE announce breaker name was marked as the answer   
    announce "The [Valfreyja 1] stronghold of " + GetCastleName("arug_cas01") has been conquered by "+ .@breakername$ +" of the [" + getguildname(.@gid) + "] ,bc_all|bc_woe; There is some typo error
    announce "The [Valfreyja 1] stronghold of " + GetCastleName("arug_cas01") +" has been conquered by "+ .@breakername$ +" of the [" + getguildname(.@gid) + "]" ,bc_all|bc_woe;
  16. Capuche's post in NPC that buys/trades costume? was marked as the answer   
    - shop costume_shop -1,501:-1
    prontera,150,180,5 script bghjkl 58,{
    mes "Hi Good Day! Do you have spare costumes !";
    mes "that you wanna get rid of?";
    next;
    set .@s, select( "No ! Goood bye.", "Trade", "More informations" );
    if( .@s == 1 )
    mes "Okay have a nice day.";
    else if( .@s == 3 ) {
    mes "blabla more informations.";
    }
    getinventorylist;
    .@calc = 1024|2048|4096|8192;// to lazy to calculate
    for( set .@i, 0; .@i < @inventorylist_count; set .@i, .@i + 1 )
    if( !@inventorylist_expire[.@i] ) {
    if ( getiteminfo( @inventorylist_id[.@i],5 ) & .@calc ) {
    for( set .@j, 0; .@j < @inventorylist_amount[.@i]; set .@j, .@j + 1 ) {
    set .@list_id[ .@size_shop ], @inventorylist_id[.@i];
    set .@size_shop, .@size_shop + 1;
    }
    }
    }
    if( !.@size_shop )
    mes "Hmm I don't see any costumes on your inventory. Please check your inventory.";
    else {
    mes "Okay, here's a list of the costumes in your inventory.";
    next;
    npcshopitem "costume_shop",501,-1;
    for( set .@i, 0; .@i < .@size_shop; set .@i, .@i + 1 )
    npcshopadditem "costume_shop",.@list_id[.@i],0;
    npcshopdelitem "costume_shop",501;
    callshop "costume_shop", 1;
    npcshopattach "costume_shop";
    }
    end;
    OnBuyItem:
    // if( !checkweight2( .reward_ID,.reward_amount ) ) {
    // message strcharinfo(0),"You need additional weight capacity to complete this trade.";
    // close;
    // }
    set .@count, getarraysize( @bought_nameid );
    for( set .@i, 0; .@i < .size_count; set .@i, .@i + 1 ) {// don't check the weight..
    set .@check, .reward_amount[.@i] * .@count;
    if( .@check > 30000 ) {
    message strcharinfo(0),"You can't purchase that many "+ getitemname( .reward_ID[.@i] ) +".";
    end;
    }
    set .@gain$, .@gain$ + ( getstrlen( .@gain$ ) ? ", " : "" ) + .@check +" "+ getitemname( .reward_ID[.@i] );
    }
    mes "Sell the costume for "+ .@gain$ +"?";
    next;
    if( select( "Yes, I sell", "No" ) -1 ) end;
    for( set .@i, 0; .@i < .@count; set .@i, .@i + 1 )
    if ( countitem( @bought_nameid[.@i] ) < @bought_quantity[.@i] ) {
    mes "Have you lost one item?";
    close;
    }
    for( set .@i, 0; .@i < .@count; set .@i, .@i + 1 )
    delitem @bought_nameid[.@i], @bought_quantity[.@i];
    for( set .@i, 0; .@i < .size_count; set .@i, .@i + 1 )
    getitem .reward_ID[.@i], .reward_amount[.@i] * .@count;
    mes "Good bye.";
    close;
    OnInit:
    setarray .reward_ID, 7539; // item ID gained - you can add more ID <item ID>, <item ID>,...
    setarray .reward_amount, 10; // item count gained - ( count of the item /element of array of .reward_ID )
    set .size_count, getarraysize( .reward_amount );
    end;
    }

  17. Capuche's post in Ivion's Ranker sql error was marked as the answer   
  18. Capuche's post in R>trans job changer only was marked as the answer   
    http://rathena.org/board/topic/85794-no-reborn-job-changer/?p=214664
  19. Capuche's post in Help on Healer+ buffer script was marked as the answer   
    prontera,151,189,6 script Kuya Elly Healer 899,{
    function AddBuff;
    if ( getgmlevel() >= .gmlevel ) callsub L_GMConfig;
    for( ; .@i < .size_buff; set .@i, .@i +1 ) {
    if ( $buffconf & ( 1 << .@i ) )
    sc_start .buffcode[.@i],.buffduration*60*1000,.bufflevl[.@i];
    }
    percentheal 100,100;
    end;
    L_GMConfig:
    mes .npcname$;
    mes "Good day, GM "+strcharinfo(0)+".";
    mes "What kind of change you want to make today ?";
    next;
    switch( select( "~ Add / Remove a Buff",
    "~ Set all back to Default",
    "~ Turn on all the buff",
    "~ Give me Heal and Buff" ) ) {
    case 1:
    while(1) {
    for( set .@i, 0; .@i < .size_buff; set .@i, .@i +1 ) {
    set .@color$, ( $buffconf & ( 1 << .@i ) ) ? "^49b01c" : "^FF0000" ;
    set .@bufflist$, .@bufflist$ + .@color$ + .buffstr$[.@i] +"^000000" +":";
    }
    next;
    set .@s, select( .@bufflist$ ) -1;
    set $buffconf, $buffconf ^ ( 1 << .@s );
    next;
    mes .npcname$;
    mes "You have "+ ( $buffconf & ( 1 << .@s ) ? "added" : "removed" ) +" ^3c9cff"+ .buffstr$[.@s] +"^000000.";
    mes "Do you want to continue ?";
    next;
    if( select("Yes:No")==2 ) end;
    set .@bufflist$, "";
    }
    case 2:
    mes .npcname$;
    mes "Are you sure to revert all the changes back to default ?";
    mes "^ff0000NOTE : THIS WILL REMOVE ALL YOUR PREVIOUS CONFIGURATION.";
    next;
    if(select("No:Yes") == 2)
    set $buffconf, 3;
    end;
    case 3:
    mes .npcname$;
    mes "Are you sure to turn ON all the Buff ?";
    next;
    if(select("No:Yes") == 2) {
    for( set .@i, 0; .@i < .size_buff; set .@i, .@i +1 )
    set $buffconf, $buffconf | ( 1 << .@i );
    }
    end;
    case 4: return;
    }
    OnInit:
    //Default Buff is Blessing and Increase Agility
    // <skill lvl>, <sc_ const>, <skill name to display>
    AddBuff( 10, 30, "Blessing" );
    AddBuff( 10, 32, "Increase Agility" );
    AddBuff( 3, 36, "Suffragium" );
    AddBuff( 5, 37, "Aspersio" );
    AddBuff( 5, 44, "Weapon Perfection" );
    AddBuff( 5, 45, "Over Thrust" );
    AddBuff( 5, 72, "Weapon CP" );
    AddBuff( 5, 73, "Shield CP" );
    AddBuff( 5, 74, "Armor CP" );
    AddBuff( 5, 75, "Helm CP" );
    AddBuff( 5, 110,"Concentration" );
    AddBuff( 5, 115,"Assumptio" );
    AddBuff( 7, 147,"Kaizel" );
    AddBuff( 7, 148,"Kaahi" );
    AddBuff( 3, 149,"Kaupe" );
    AddBuff( 10, 120,"True Sight" );
    AddBuff( 10, 121,"Wind Walk" );
    AddBuff( 10, 175,"Poem of Bragis" );
    AddBuff( 10, 203,"Food Str +10" );
    AddBuff( 10, 204,"Food Agi +10" );
    AddBuff( 10, 205,"Food Int +10" );
    AddBuff( 10, 206,"Food Vit +10" );
    AddBuff( 10, 207,"Food Dex +10" );
    AddBuff( 10, 208,"Food Luk +10" );
    if ( $buffconf == 0 ) set $buffconf, 3;// default
    // ---------------------------------------------------------------------
    // -- Basic Configuration --
    // This is the basic configuration
    // ---------------------------------------------------------------------
    set .npcname$,"[ ^3a68ffHealer^000000 ]";
    set .gmlevel,99; // Min GM Level to do in-game configuration (See conf/groups.conf for group_id's lists)
    set .buffduration,5; // Buff Duration in minute
    waitingroom "Kuya Elly Healer",0;
    end;
    // ---------------------------------------------------------------------
    function AddBuff {
    set .bufflevl[ .size_buff ], getarg(0);
    set .buffcode[ .size_buff ], getarg(1);
    set .buffstr$[ .size_buff ], getarg(2);
    set .size_buff, .size_buff +1;
    }
    }

  20. Capuche's post in map drop when kill a specific monster! was marked as the answer   
    - script helloworld -1,{ OnInit: .itemID = 671; // Edit your item here .amount_item = 100;// amount items to throw monster "prt_fild08",0,0,"I'm a Poring",1002,1,strnpcinfo(0) + "::OnMyMobDead"; end; OnMyMobDead: announce "The mob is now killed, the special drop is ready to catch in all maps.", 0; .@map$ = strcharinfo(3); while( .@i < .amount_item ) { do { .@x = rand( 1,300 ); .@y = rand( 1,300 ); } while( !checkcell( .@map$,.@x,.@y,cell_chkpass ) ); makeitem .itemID,1, .@map$, .@x, .@y; .@i++; } end; } It's a sample. The monster spawn when the server start..
  21. Capuche's post in DS Event please need help was marked as the answer   
    I suggest you to try the redo
    http://rathena.org/board/topic/77632-devil-square/
     
    and add the diff
    @@ -99,6 +99,7 @@ OnClock1600:  OnClock1800:  OnClock2000:  OnClock2200: +    if( .start ) end;      .start = 1;      disablenpc "Exit#DS";      mapannounce "ordeal_1-1","Devil Square is now closed", bc_map; @@ -120,6 +121,7 @@ OnClock2200:          goto L_End;      .start = 2;      donpcevent strnpcinfo(0)+"::OnSurvive"; +    donpcevent strnpcinfo(0)+"::OnIdle";      .round = 1;      .mob = 75;      areamonster "ordeal_1-1",183,182,246,244,"[DS] SOLDIER SKELETON",1028,10,strnpcinfo(0)+"::Ondevildead"; @@ -231,6 +233,17 @@ OnSurvive:          sleep .ann_survive;      }      end; + +OnIdle: +    sleep 120000; // wait 120 secs +    while( .start ) { +        sleep 2000; +        for( .@i = 0; .@i < .register_num; .@i++ ) { +            if ( checkidle( rid2name( .register_aid[.@i] ) ) >= 120 ) +                unitkill .register_aid[.@i]; +        } +    } +    end;  }    ordeal_1-1,246,245,7    script    Exit#DS    51,{
  22. Capuche's post in Healer and time NPC and online view ( edit please ) was marked as the answer   
    1/
    Replace
    waitingroom getmapusers("prontera")+" player"+( getmapusers("prontera") > 1 ? "s":"") +" in Prontera", 0; by
    waitingroom getusers(1) +" player"+( getusers(1) > 1 ? "s":"") +" in the whole server", 0;  
    2/
    prontera,155,186,5 script Server Time(+8GMT) 790,{ end; OnInit: while(1) { delwaitingroom; waitingroom "Clock "+ gettimestr( "%I:%M:%S %p",21 ),0; sleep 1000; } }  
    3/
    Replace
    if (.@Delay) set @HD, gettimetick(2)+.@Delay; end; }  
    by
    if (.@Delay) set @HD, gettimetick(2)+.@Delay; delwaitingroom; waitingroom strcharinfo(0) +" is healed",0; end; }
  23. Capuche's post in Erro Syntax db site was marked as the answer   
    CREATE DATABASE `site_alan`; CREATE TABLE `site_alan`.`fama` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `foto` VARCHAR( 100 ) NOT NULL , `nome` VARCHAR( 100 ) NOT NULL , `nick` VARCHAR( 100 ) NOT NULL , `classe` VARCHAR( 100 ) NOT NULL , `cla` VARCHAR( 100 ) NOT NULL , `idade` VARCHAR( 100 ) NOT NULL , `mora` VARCHAR( 100 ) NOT NULL ) ENGINE = MYISAM; CREATE TABLE `site_alan`.`regras` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `regra` TEXT NOT NULL ) ENGINE = MYISAM; CREATE TABLE `site_alan`.`download` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `versao_pat` VARCHAR( 50 ) NOT NULL , `tamanho_pat` VARCHAR( 50 ) NOT NULL , `link_pat` TEXT NOT NULL , `episodio_bro` VARCHAR( 50 ) NOT NULL , `tamanho_bro` VARCHAR( 50 ) NOT NULL , `link_bro` TEXT NOT NULL ) ENGINE = MYISAM; CREATE TABLE `site_alan`.`equipe` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `cargo` VARCHAR( 50 ) NOT NULL , `nome` VARCHAR( 50 ) NOT NULL , `especi` TEXT NOT NULL ) ENGINE = MYISAM; CREATE TABLE `site_alan`.`noticias` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `titulo` TEXT NOT NULL , `noticia` TEXT NOT NULL , `data` VARCHAR( 20 ) NOT NULL , `por` VARCHAR( 50 ) NOT NULL ) ENGINE = MYISAM; CREATE TABLE `site_alan`.`eventos` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `titulo` TEXT NOT NULL , `evento` TEXT NOT NULL , `data` VARCHAR( 20 ) NOT NULL ) ENGINE = MYISAM; CREATE TABLE `site_alan`.`admin` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , `usuario` VARCHAR( 50 ) NOT NULL , `senha` VARCHAR( 50 ) NOT NULL , `privilegio` VARCHAR( 2 ) NOT NULL ) ENGINE = MYISAM; You forgot to remove ")  of mysql_query
  24. Capuche's post in Disable @go for novice was marked as the answer   
    -    script    go_restrict    -1,{ OnInit:     bindatcmd "go",strnpcinfo(3)+"::OnEvent";     end; OnEvent:     if ( getgmlevel() < 1 && Class == Job_Novice && JobLevel < 9 )         message strcharinfo(0), "Your Joblevel must be above 8 to use @go command.";     else         atcommand "@go "+ implode( .@atcmd_parameters$," " );     end; } Edit : replace while by implode
  25. Capuche's post in IP Check Loop was marked as the answer   
    delete the ] in red
    replace the $ in blue by .
    You forgot ; at the end of this line.
    .@i + 1 doesn't increment .@i variable. It must be .@i += 1 or .@i++
     
    This script check if the ip in array i is the same in array i+1. But it won't check if the ip in array i is the same in array i+2 etc
     
    With 2 loops
    .@size = getarraysize(.@names$); for(.@i = 0; .@i < .@size -1; .@i++ ) { .@ip_in_loop1$ = getcharip(.@names$[.@i]); for( .@j = .@i +1; .@j < .@size; .@j++ ) if( .@ip_in_loop1$ == getcharip(.@names$[.@j]) ) .@dual = .@dual + 1; }  
    With setd/getd + 1 loop
    .@size = getarraysize(.@names$); for( .@i = 0; .@i < .@size; .@i++ ) { if ( getd( ".@ip_"+ getcharip( .@names$[.@i] ) ) ) .@dual = .@dual + 1; setd ".@ip_"+ getcharip(.@names$[.@i]), 1; }
×
×
  • Create New...