Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by Capuche

  1. Without mod - script Weird Plant -1,{ OnInit: .mobid = 2135; //2135 for ( .@i = 0; .@i < 10; .@i++ ) { monster "prontera",0,0,"Weird Plant",.mobid,1,strnpcinfo(0)+"::OnMyMobDead"+ .@i; .mob_gid[.@i] = $@mobid[0]; } end; OnMyMobDead0: callsub S_Makeitem, 0,.mob_gid[0]; OnMyMobDead1: callsub S_Makeitem, 1,.mob_gid[1]; OnMyMobDead2: callsub S_Makeitem, 2,.mob_gid[2]; OnMyMobDead3: callsub S_Makeitem, 3,.mob_gid[3]; OnMyMobDead4: callsub S_Makeitem, 4,.mob_gid[4]; OnMyMobDead5: callsub S_Makeitem, 5,.mob_gid[5]; OnMyMobDead6: callsub S_Makeitem, 6,.mob_gid[6]; OnMyMobDead7: callsub S_Makeitem, 7,.mob_gid[7]; OnMyMobDead8: callsub S_Makeitem, 8,.mob_gid[8]; OnMyMobDead9: callsub S_Makeitem, 9,.mob_gid[9]; S_Makeitem: getunitdata getarg(1),.@array; // dispbottom "Coordonnée x : "+ .@array[6]; // dispbottom "Coordonnée y : "+ .@array[7]; for ( .@i = 0; .@i < rand(2); .@i++ ) makeitem 909, 1, strcharinfo(3), ( .@array[6]+rand(2)-1 ), ( .@array[7]+rand(2)-1 ); monster "alberta",94,54,"Weird Plant",.mobid,1,strnpcinfo(0)+"::OnMyMobDead"+ getarg(0); .mob_gid[ getarg(0) ] = $@mobid[0]; end; } It's true it would be better to return the mob unique id to use getunitdata. Maybe we should implement it
  2. So you need a source mod to trigger an event everytime someone buy something (I pass I suck in source mod). Another way should be checking the log table occasionally but it would be inefficient.
  3. Yes you need to attach the shop https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6321 callshop "your shop name",0; npcshopattach "your shop name"; Just read the doc about it
  4. Well you can use callshop and OnBuyItem or OnSellItem to trigger an event on a specific npc shop https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L6252
  5. What do you mean? something like trigger an event when someone buying? buying on npc or player?
  6. This ? https://github.com/rathena/rathena/blob/master/conf/log_athena.conf#L16 then check your picklog table
  7. There is an optionnal param for ai in rathena <map name>,<x>,<y>,<xs>,<ys>%TAB%monster%TAB%<monster name>%TAB%<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>} Try with ai = 1 (like a slave - without master)
  8. or what about this one by Annieruru
  9. what about select account_id from `char` where online = 1 and account_id not in ( select account_id from vendings ) order by rand() limit 1 to exclude vendor?
  10. Query now return -1 on failure/empty Replace the condition by if (query_sql("select family_id from family where replace(family_name,' ','') = replace(trim('" + escape_sql(.@FN$) + "'),' ', '')", .@uno) > 0) {
  11. This NPC give only one splendide coin per day
  12. To disable /str+ X you need to mod the src (I think it's clif_parse_StatusUp function)
  13. - script DualControl -1,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnAtcommand";// create @test command for the sample .whiteList$ = "2000000,2000001,2000002,2000003"; end; OnAtcommand: .@query_result = query_sql("SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id WHERE "+ "login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") AND `char`.online=1 and account_id != "+ getcharid(3), .@account_id; if ( .@query_result > 0 && compare( .whiteList$,getcharid(3) +"" ) == 0 )// not in the list dispbottom "there is "+ .@query_result +" people with the same ip than you"; end; }
  14. getelementofarray( getarg(0),<index> ) should work
  15. Capuche

    Script help

    It depends on what he wants to do. There is no point to change the card if he doesn't make an announce and he didn't ask about that.
  16. Capuche

    Script help

    prontera,150,150,5 script Sample 89,{ if ( gettimetick(2) > .timer ) { query_sql "SELECT `cards`,`card_name`,`points`,`id` FROM `cards` WHERE `id` = "+ rand(1,494) +" limit 1", .ccards, .cnames$, .cpoints, .card_index; .timer = gettimetick(2) + 5 *60; } mes "I'm missing a " + .cnames$ + ". I can offer " + .cpoints + " premium points in return. # "+ .card_index; close; }
  17. Capuche

    Script help

    I don't understand what you want to do, just select a random card form the query or ? What is the meaning of `cedi_points` and `id`
  18. You can exchange the skull of others players vs points, you can't exchange your own skull with this script.
  19. prontera,139,180,5 script Skull Points 63,{ .@char_id = getcharid(0); .@count = countitem( 7420 ) - countitem2( 7420, 1,0,0, 254, 0, (.@char_id & 65535), (.@char_id >> 16) ); // can't exchange his own skull mes "Puntos Totales: "+ #skull_points +" Skull points."; if ( .@count == 0 ) close; mes "¿Deseas intercambiar tus Skulls por Skulls Points?"; next; if ( select( "~ Yes", "~ No" ) -1 ) end; .@count = countitem( 7420 ) - countitem2( 7420, 1,0,0, 254, 0, (.@char_id & 65535), (.@char_id >> 16) ); getinventorylist; while( .@i < @inventorylist_count && .@j < .@count ) { if ( @inventorylist_id[.@i] == 7420 && @inventorylist_card3[.@i] != .@char_id ) { delitem2 7420, @inventorylist_amount[.@i],1,0,0, @inventorylist_card1[.@i], 0, @inventorylist_card3[.@i], 0; .@j++; } .@i++; } #skull_points = #skull_points + .@count; mes "Obtuviste "+ .@count +" Skull points. Tienes en total: "+ #skull_points +" Skull points."; close; }
  20. Make a PR I want to test it !
  21. Well getarraysize return the size of an array. No need to do something else to use it
×
×
  • Create New...