Jump to content

Capuche

Developer
  • Posts

    2,407
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by Capuche

  1. Without mod - script Weird Plant -1,{ OnInit: .mobid = 2135; //2135 for ( [email protected] = 0; [email protected] < 10; [email protected]++ ) { monster "prontera",0,0,"Weird Plant",.mobid,1,strnpcinfo(0)+"::OnMyMobDead"+ [email protected]; .mob_gid[[email protected]] = [email protected][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),[email protected]; // dispbottom "Coordonnée x : "+ [email protected][6]; // dispbottom "Coordonnée y : "+ [email protected][7]; for ( [email protected] = 0; [email protected] < rand(2); [email protected]++ ) makeitem 909, 1, strcharinfo(3), ( [email protected][6]+rand(2)-1 ), ( [email protected][7]+rand(2)-1 ); monster "alberta",94,54,"Weird Plant",.mobid,1,strnpcinfo(0)+"::OnMyMobDead"+ getarg(0); .mob_gid[ getarg(0) ] = [email protected][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([email protected]$) + "'),' ', '')", [email protected]) > 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: [email protected]_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), [email protected]_id; if ( [email protected]_result > 0 && compare( .whiteList$,getcharid(3) +"" ) == 0 )// not in the list dispbottom "there is "+ [email protected]_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,{ [email protected]_id = getcharid(0); [email protected] = countitem( 7420 ) - countitem2( 7420, 1,0,0, 254, 0, ([email protected]_id & 65535), ([email protected]_id >> 16) ); // can't exchange his own skull mes "Puntos Totales: "+ #skull_points +" Skull points."; if ( [email protected] == 0 ) close; mes "¿Deseas intercambiar tus Skulls por Skulls Points?"; next; if ( select( "~ Yes", "~ No" ) -1 ) end; [email protected] = countitem( 7420 ) - countitem2( 7420, 1,0,0, 254, 0, ([email protected]_id & 65535), ([email protected]_id >> 16) ); getinventorylist; while( [email protected] < @inventorylist_count && [email protected] < [email protected] ) { if ( @inventorylist_id[[email protected]] == 7420 && @inventorylist_card3[[email protected]] != [email protected]_id ) { delitem2 7420, @inventorylist_amount[[email protected]],1,0,0, @inventorylist_card1[[email protected]], 0, @inventorylist_card3[[email protected]], 0; [email protected]++; } [email protected]++; } #skull_points = #skull_points + [email protected]; mes "Obtuviste "+ [email protected] +" 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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.