Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/15/23 in all areas

  1. try this //===== rAthena Script ======================================= //= Free Script //===== By: ================================================== //= Sader1992 //= https://rathena.org/board/profile/30766-sader1992/ //= Email [email protected] //===== Compatible With: ===================================== //= rAthena Project //= ========================================================== //= @aitem this command allows you to check how many of the item in the server //= command @aitem2 allows you to check also who have the items //= @aitem is fast, but @aitem2 will take some time to finish //= the time depend on how big your database is! //= ========================================================== //= you should wait until the command is done , do not logout/talk to npc/ anything until you get the results! //= ========================================================== //= '@AnalyzeItem' return the count of the item in the server. //= '@AnalyzeItem2' return the count of the item and the lst of who have it in the server (take more time). //= USAGE: //= @AnalyzeItem <ITEM_ID> //= @AnalyzeItem2 <ITEM_ID> //= OR //= @AItem <ITEM_ID> //= @AItem2 <ITEM_ID> //= Wait until you get the results in your chat //= to add more tables (like other storages) check the array .@tables$ and .@id$ //= F_GET_REAL_OWNER_NAME(<"string table">,<id>) get the name for id //============================================================ function script F_GET_REAL_OWNER_NAME { .@table$ = getarg(0); .@id = getarg(1); .@n$ = ""; if(.@table$ != "account_id" && .@table$ != "char_id"){ if(.@table$ != "id"){ return "(Mails):"; }else{ return "(Guilds):"; } } .@acc = .@id; if(.@table$ == "char_id"){ query_sql("SELECT `account_id` FROM `char` WHERE `char_id` = '" + .@id + "'",.@acc); } query_sql("SELECT `group_id`,`userid` FROM `login` WHERE `account_id` = '" + .@acc + "'",.@g,.@name$); if(.@g >= 1){ .@n$ = "[ Player ] "; } if(.@g >= 80){ .@n$ = "[ Staff ] "; } .@name1$ = .@n$ + .@name$; return .@name1$; } prontera,155,181,5 script Sample 757,{ input .@item_id; .@owner_name = select("Continue", "Get Real Owner Name") - 1; setarray .@tables$,"cart_inventory","guild_storage","inventory","storage", "mail_attachments"; setarray .@id$, "char_id", "guild_id", "char_id", "account_id","id"; mes "Searching for item '" + getitemname(.@item_id) + "'",0x9FFFB5; mes "Analyze Tables",0x9FFFB5; for(.@i=0;.@i<getarraysize(.@tables$);.@i++){ query_sql("SELECT `amount`,`" + .@id$[.@i] + "` FROM `" + .@tables$[.@i] + "` WHERE nameid = '"+ .@item_id +"' OR card0 = "+.@item_id+" OR card1 = "+.@item_id+" OR card2 = "+.@item_id+" OR card3 = "+.@item_id, .@count, .@id, .@c0, .@c1, .@c2, .@c3); for(.@n=0;.@n<getarraysize(.@count);.@n++){ if (.@id[.@n] != .@item_id) { .@allcounts += (.@c0[.@n] == .@item_id); .@allcounts += (.@c1[.@n] == .@item_id); .@allcounts += (.@c2[.@n] == .@item_id); .@allcounts += (.@c3[.@n] == .@item_id); } else .@allcounts += .@count[.@n]; if(.@owner_name){ .@n$ = F_GET_REAL_OWNER_NAME(.@id$[.@i],.@id[.@n]); .@ndx = inarray(.@name_list$,.@n$); if(.@ndx == -1){ .@ndx = getarraysize(.@name_list$); .@name_list$[.@ndx] = .@n$; } .@count_list[.@ndx] += .@count[.@n]; sleep2 2; } } sleep2 5; deletearray .@count[0],getarraysize(.@count); } if(.@owner_name){ mes "==================================",0x9FFFB5; mes "Extended List:",0x9FFFB5; if(getarraysize(.@name_list$) > 20){ for(.@i=0;.@i<getarraysize(.@name_list$);.@i += 3){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")" + " " + "(" + .@name_list$[.@i+1] + "): (" + .@count_list[.@i+1] + ")" + " " + "(" + .@name_list$[.@i+2] + "): (" + .@count_list[.@i+2] + ")",0x9FFFB5; } }else{ for(.@i=0;.@i<getarraysize(.@name_list$);.@i++){ mes "" + .@name_list$[.@i] + " - (" + .@count_list[.@i] + ")"; } } mes "==================================",0x9FFFB5; } mes "Analyze Done.",0x9FFFB5; mes "(" + .@allcounts + ")" + getitemname(.@item_id) + ".",0x9FFFB5; close; }
    1 point
  2. - script test -1,{ OnPCKillEvent: //if ( ( !getmapflag( strcharinfo(3), mf_pvp ) && !getmapflag( strcharinfo(3), mf_gvg ) ) || killedrid == getcharid(3) ) end; if ( getmapflag( strcharinfo(3), mf_pvp ) == 0 || killedrid == getcharid(3) ) end; attachrid killedrid; .@charid = getcharid(0); attachrid killerrid; if(getcharip(killedrid) == getcharip(getcharid(3))) end; getitem2 8966, 1,1,0,0, 254, 0, .@charid % pow(2,16), .@charid / pow(2,16); // getnameditem 7420, rid2name( killedrid ); // <-- EDITED, this command doesn't drop item on floor end; }
    1 point
  3. change sleep() into sleep2() to keep the player attached.
    1 point
  4. So a custom mapflag? Can you make me a src mod for this sir? Thank you. not tested, but this will does what u wanted https://github.com/pservero/rathena/commit/1992cac7cca37bd3c54876252b48db93c6be7caf
    1 point
  5. a new technique has been found in this topic, by abusing SQL table to save the kills so this will effectively break the limit of player data storage, rendering it unlimited /* create table last_pvp_kill ( id int(11) unsigned primary key auto_increment, killercid int(11) unsigned not null, killedcid int(11) unsigned not null, count smallint(6) unsigned, key (killercid), key (killedcid) ) engine = innodb; */ - script jfhdksfjhsk -1,{ OnClock0000: query_sql "truncate last_pvp_kill;"; end; OnPCKillEvent: if ( killedrid == getcharid(3) ) end; if ( query_sql( "select count from last_pvp_kill where killercid = "+( .@killercid = getcharid(0) )+" and killedcid = "+( .@killedcid = getcharid( 0, rid2name( killedrid ) ) ), .@count ) ) { // check if the user is in the list if ( .@count == .max_skull ) { dispbottom "you have reach the max amount of skull for that player today"; end; } query_sql "update last_pvp_kill set count = count +1 where killercid = "+ .@killercid +" and killedcid = "+ .@killedcid; } else query_sql "insert into last_pvp_kill values ( null, "+ .@killercid +", "+ .@killedcid +", 1 )"; // insert into table getitem2 7420, 1,1,0,0, 254, 0, .@killedcid % ( 1 << 16 ), .@killedcid >> 16; end; OnInit: .max_skull = 3; end; }
    1 point
×
×
  • Create New...