-
Posts
2407 -
Joined
-
Last visited
-
Days Won
51
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Capuche
-
if(Hp == 0){
-
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
-
How to detect the item bought from shops and the map where it was bought
Capuche replied to Ninja's question in Scripting Support
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. -
How to detect the item bought from shops and the map where it was bought
Capuche replied to Ninja's question in Scripting Support
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 -
How to detect the item bought from shops and the map where it was bought
Capuche replied to Ninja's question in Scripting Support
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 -
How to detect the item bought from shops and the map where it was bought
Capuche replied to Ninja's question in Scripting Support
What do you mean? something like trigger an event when someone buying? buying on npc or player? -
How to detect the item bought from shops and the map where it was bought
Capuche replied to Ninja's question in Scripting Support
This ? https://github.com/rathena/rathena/blob/master/conf/log_athena.conf#L16 then check your picklog table -
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)
-
or what about this one by Annieruru
-
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?
-
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) {
-
This NPC give only one splendide coin per day
-
Make Script command NPC to do arbitrary code
Capuche replied to Satoh's question in Scripting Support
What about -
How to disable /stat example /str 99 on player?
Capuche replied to trizzy's question in Script Requests
Yes I think it's here -
How to disable /stat example /str 99 on player?
Capuche replied to trizzy's question in Script Requests
It's a clif function in clif.c -
How to disable /stat example /str 99 on player?
Capuche replied to trizzy's question in Script Requests
To disable /str+ X you need to mod the src (I think it's clif_parse_StatusUp function) -
[Basic-to-experts] Ways to call a "function" in another npc.
Capuche replied to Tales's question in Scripting Support
- 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; } -
getelementofarray( getarg(0),<index> ) should work
-
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.
-
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; }
-
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`
-
Problem with this NPC just works with some players
Capuche replied to ItsFree's question in Scripting Support
You can exchange the skull of others players vs points, you can't exchange your own skull with this script. -
Problem with this NPC just works with some players
Capuche replied to ItsFree's question in Scripting Support
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; } -
Make a PR I want to test it !
-
Well getarraysize return the size of an array. No need to do something else to use it