Jump to content

Emistry

Forum Moderator
  • Posts

    10013
  • Joined

  • Days Won

    396

Community Answers

  1. Emistry's post in Good day. I humbly ask for help to fixed the issue. The script made by Sir tyrfing. The script itself is working. was marked as the answer   
    shouldn't call the  clear() script command if there are no active mes() message.
    find all those clear() and remove it if there isn't any mes(...) executed before it.
     
  2. Emistry's post in R>Counting NPC was marked as the answer   
    //===== 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 +"'", .@count,.@id); for(.@n=0;.@n<getarraysize(.@count);.@n++){ .@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; }  
  3. Emistry's post in I would like to ask a script about Auto Kick in the Woe With Restricted items was marked as the answer   
    - script sample -1,{ OnInit: setarray .map$, "prtg_cas01", "prtg_cas02", "prtg_cas03", "prtg_cas04", "prtg_cas05", "payg_cas01", "payg_cas02", "payg_cas03", "payg_cas04", "payg_cas05", "gefg_cas01", "gefg_cas02", "gefg_cas03", "gefg_cas04", "gefg_cas05", "aldeg_cas01", "aldeg_cas02", "aldeg_cas03", "aldeg_cas04", "aldeg_cas05", "arug_cas01", "arug_cas02", "arug_cas03", "arug_cas04", "arug_cas05", "schg_cas01", "schg_cas02", "schg_cas03", "schg_cas04", "schg_cas05"; .@size = getarraysize(.map$); for (.@i = 0; .@i < .@size; .@i++) setmapflag .map$[.@i], mf_loadevent; end; OnPCLoadMapEvent: if (inarray(.map$, strcharinfo(3)) != -1) { if (isequippedcnt(5001, 5002, 5003) >= 1) { mes "You have equipped with restricted items. Please remove them."; close2; warp "SavePoint", 0, 0; } } end; } try
  4. Emistry's post in Kick player if inactive while dialog "mes" is open (avoid mes from changing to "close") was marked as the answer   
    - script test015677 -1,{ OnPCLoginEvent: ignoretimeout 1; // <------- ADD THIS mes "Welcome to rAthena"; next; mes "Hello"; close; }  
  5. Emistry's post in WOE Job count limit - Updated was marked as the answer   
    try
    - script Sample -1,{ OnInit: .max_limit = 10; setarray .castles$[0], "prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05", "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05", "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05", "aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05", "arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05", "schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05"; .castle_size = getarraysize(.castles$); for (.@i = 0; .@i < .castle_size; .@i++) setmapflag .castles$[.@i], mf_loadevent; end; OnPCLoadMapEvent: .@map$ = strcharinfo(3); if (inarray(.castles$, .@map$) != -1) { .@guild_id = getcharid(2); if (.@guild_id) { getguildmember .@cid, 1; getguildmember .@aid, 2; // skip check if member count less than limit if ($@guildmembercount < .max_limit) end; for (.@i = 0; .@i < $@guildmembercount && .@match_count < .max_limit; .@i++) { if (isloggedin(.@aid[.@i], .@cid[.@i])) { if (attachrid(.@aid[.@i])) { .@eac = eaclass(); if (.@eac & EAJ_SWORDMAN|EAJL_2_1 == EAJ_KNIGHT) .@match_count++; detachrid; } } } if (.@match_count >= .max_limit) { for (.@i = 0; .@i < $@guildmembercount; .@i++) { if (isloggedin(.@aid[.@i], .@cid[.@i])) { if (attachrid(.@aid[.@i])) { if (strcharinfo(3) == .@map$) { dispbottom "There can only be "+.max_limit+" Knight per guild members inside a castle during woe."; warp "SavePoint", 0, 0; } detachrid; } } } } } } end; }  
  6. Emistry's post in Convert prize giving mail to getitem was marked as the answer   
    .@aid = convertpcinfo(.players[.@i],CPC_ACCOUNT); getitem .item_win, .count_win, .@aid;  
  7. Emistry's post in Convert prize giving mail to getitem was marked as the answer   
    .@aid = convertpcinfo(.players[.@i],CPC_ACCOUNT); getitem .item_win, .count_win, .@aid;  
  8. Emistry's post in Top 10 Items sold tracker was marked as the answer   
    conf\log_athena.conf
    // Enable Logs? (Note 3) ... ... // 0x00000010 - (S) Log NPC transactions (buy/sell) ... ... enable_logs: 0x00000010 load the NPC
    prontera,155,181,5 script Sample 757,{ .@sql$ = "SELECT `nameid`, SUM(`amount`) AS `total` FROM `picklog` WHERE `type` = 'S' AND `amount` > 0 GROUP BY `nameid` ORDER BY `total` DESC LIMIT 10"; .@count = query_sql(.@sql$, .@nameid, .@total); mes "Items:"; for (.@i = 0; .@i < .@count; .@i++) mes getitemname(.@nameid[.@i])+" - "+F_InsertComma(.@total[.@i]); close; }  
    however there is no way telling how much NPC have earned or lost from the transaction since it's not log.
  9. Emistry's post in Adding multiplier on query like (5*.@amount) was marked as the answer   
    you can just do like this
    $Events = 5 * .@amount;  
  10. Emistry's post in H>Guild Storage was marked as the answer   
    GSTORAGE_NO_STORAGE - Guild hasn't invested in the Guild Storage Expansion skill (only if OFFICIAL_GUILD_STORAGE is enabled). doc\script_commands.txt
  11. Emistry's post in script enhancement request was marked as the answer   
    .@i = select( .@menu$ ) - 1; setarray .@look, LOOK_HEAD_TOP, LOOK_HEAD_MID, LOOK_HEAD_BOTTOM; if (getlook(.@look[.@i]) <= 0) { dispbottom .@hgmenu$[.@i] +" is already hidden"; end; }  
  12. Emistry's post in Punching Bag Script Problem was marked as the answer   
    OnPCAttackEvent: if (strcharinf(3) != "prontera") end; // <--- change to the punching bag map message strcharinfo(0), "You have dealt "+ @damage +" damage to Punching Bag"; end;  
  13. Emistry's post in Need help - SQL db error pls thanks was marked as the answer   
    the account_id field has been dropped from the guild_member table, unless you rollback the commits that did this, else no point to re-add it since the field wont have value stored there
    alternatively, you could just rewrite the SQL to do a INNER JOIN or LEFT JOIN, to get your data.
    but since you're not really using .Options & 4 ... I guess its fine if you do the easier way.
    find
    SELECT account_id,char_id FROM `guild_member`.... and replace into
    SELECT account_id,char_id FROM `char`....  
  14. Emistry's post in Cancel Script? was marked as the answer   
    mes "Hit 'Cancel' Buton"; if( prompt( "Continue","Close" ) == 2 ){ mes "It's Closed now."; }else{ mes "Wew..it CONTINUED."; } close; prompt
    'prompt' works almost the same as select, except that when a character clicks the Cancel button, this function will return 255 instead.
  15. Emistry's post in Help Edit This Script was marked as the answer   
    try this

    - script Sample -1,{ OnAgitEnd: setarray .Map$,"pay_gcas04","prtg_cas03","aldeg_cas02"; for( set .@i,0; .@i < getarraysize( .Map$ ); set .@i,.@i + 1 ) warpguild "prontera",155,181,getcastledata( .Map$[.@i],1 ); end; }
  16. Emistry's post in Quest items preview NPC and buyable with KVM/BG points. was marked as the answer   
    You can try my Multi Currency Shop Script or Euphy Muti Currency Shop Script.
    but mine doesnt have preview...
    but for preview script..
    i think the script made by Euphy better...since his Quest Shop is based on LunarCast script.
    and i think it does support Custom Points.
    http://rathena.org/board/topic/64394-%E2%9C%B0-euphys-scripts-%E2%9C%B0/
  17. Emistry's post in Event That Spawns A Tressure Box In City Which Gives Coins was marked as the answer   
    getitem <CoinID>,<amount>; set Zeny,Zeny + <amount>;
  18. Emistry's post in Quest Template was marked as the answer   
    check for Euphy Topic at Scrip release section.
  19. Emistry's post in NPC Refiner Only Donation Item was marked as the answer   
    you can try this if you want.
    http://upaste.me/713e522505b0a24
  20. Emistry's post in buffer for guild was marked as the answer   
    actually....both above
    also wrong....because..
    getcharid(2) return an integer...not string....so no need to use any quotation marks here...
    suppose to be

    if( getcharid(2) != GuildID ) goto failed;
    beside using goto command....you can do it like this also

    if( getcharid(2) != GuildID ){ mes "You cant use this NPC. Because it is not belong to your Guild."; close; }
  21. Emistry's post in Requesting for a PVP Ranking w/ Reset. was marked as the answer   
    try this
    https://pastebin.com/PeG5nuwy
  22. Emistry's post in Bubble Gum change Percentage at @mi. it used to not change was marked as the answer   
    this? conf/battle/gm.conf#L38-L42
    // requires RENEWAL_EXP or RENEWAL_DROP to be enabled (src/config/renewal.hpp) // modifies @mobinfo to display the users' real drop rate as per renewal_drop formula // modifies @iteminfo to not display the minimum item drop rate (since it can't tell the mob level) // modifies @whodrops to display the users' real drop rate as per renewal_drop formula atcommand_mobinfo_type: 1  
  23. Emistry's post in SQL insert to another Database. was marked as the answer   
    if the db isn't stored in same instance, then you probably should setup a scheduled tasks to sync it or manually sync it instead.
     
  24. Emistry's post in group cash was marked as the answer   
    try this
    31002,Bônus_Eletrônico,Bônus Eletrônico,2,10000,,2500,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc("F_PartyEarnCash"); },{},{} load this npc script
    function script F_PartyEarnCash { .@amount = rand(1, 100); #CASHPOINTS += .@amount; dispbottom "PowkRO: Você Ganhou "+F_InsertComma(.@amount)+" Rops."; .@party_id = getcharid(1); if (.@party_id) { .@owner_aid = getcharid(3); .@owner_cid = getcharid(0); getpartymember .@party_id, 2; .@partymembercount = $@partymembercount; for (.@i = 0; .@i < .@partymembercount; .@i++) { if ($@partymemberaid[.@i] == .@owner_aid) continue; if (attachrid($@partymemberaid[.@i])) { .@amount = rand(1, 50); #CASHPOINTS += .@amount; dispbottom "PowkRO: Você Ganhou "+F_InsertComma(.@amount)+" Rops."; dispbottom "PowkRO: '"+strcharinfo(0)+"' gained "+F_InsertComma(.@amount)+" Rops.", 0x00FF00, .@owner_cid; detachrid; } } } return; }  
  25. Emistry's post in [Warning]: script:query_sql: Too many columns, discarding last 3 columns. was marked as the answer   
    if (query_sql(.@selectIfKillExistQuery$) > 0) { // Exist a kill of that MVP so +1 to kill count change to
    if (query_sql(.@selectIfKillExistQuery$, .@charid, .@kills, .@name$) > 0) { // Exist a kill of that MVP so +1 to kill count  
×
×
  • Create New...