Jump to content

Emistry

Forum Moderator
  • Posts

    10013
  • Joined

  • Days Won

    396

Everything posted by Emistry

  1. .@size = query_sql( "SELECT `gm_name`,`nameid`,`amount`,`refine`,`reward_time`,`claim_name`,`claim_time`,`note`,`card1`,`card2`,`card3`,`card4` FROM `ero_gm_reward` WHERE `status` = 0 AND `format_name` = '"+escape_sql(strcharinfo(0))+"'",.@gm_name$,.@nameid,.@amount,.@refine,.@reward_time$,.@claim_name$,.@claim_time$,.@note$,.@card1,.@card2,.@card3,.@card4 ); if (checkweight2(.@nameid,.@amount)) { query_sql( "UPDATE `ero_gm_reward` SET `status` = 1,`claim_time` = NOW() WHERE `status` = 0 AND `format_name` = '"+escape_sql(strcharinfo(0))+"'"); for (.@i = 0; .@i < .@size; .@i++) { getitem2 .@nameid[.@i],.@amount[.@i],1,.@refine[.@i],0,.@card1[.@i],.@card2[.@i],.@card3[.@i],.@card4[.@i]; mes "Claimed Reward # "+ getitemname(.@nameid[.@i]); } mes "claimed "+.@size+" items."; } else { mes "You cant retrieve the rewards."; } close;
  2. //===== 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. just change the floating npc script into a npc with location
  4. SELECT * FROM rush_mvp WHERE `char_id` = '"+getcharid(0)+"'", .@CharID change to SELECT `char_id` FROM rush_mvp WHERE `char_id` = '"+getcharid(0)+"'", .@CharID or whatever that field was named for char id
  5. 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.
  6. - script test015677 -1,{ OnPCLoginEvent: ignoretimeout 1; // <------- ADD THIS mes "Welcome to rAthena"; next; mes "Hello"; close; }
  7. - 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
  8. these are reserved for npc sprite or clones. the numbers in these range are usable for monsters
  9. actually, you can also consider another alternative like this .size = getarraysize(.itemid); for (.@i = 0; .@i < .size; .@i++) .total_chance += .itemchance[.@i]; .@rate = rand(.total_chance); for (.@i = 0; .@i < .size; .@i++) { .@total_itemchance += .itemchance[.@i]; if (.@rate < .@total_itemchance) { getitem .itemid[.@i], 1; end; } } this would greatly reduce your array size, and probably perform slightly better
  10. .@aid = convertpcinfo(.players[.@i],CPC_ACCOUNT); getitem .item_win, .count_win, .@aid;
  11. summon monster, set hp to 10, skill invincible on or set immune to damage. the mob shall take only 1 damage afterwards
  12. Emistry

    Autopots

    start with readying the info inside the script. npc/custom/etc/autopot.txt#L25-L36 all the info is there.
  13. you could try something like this. initialize all the character as specific character, then search and replace them randomly. if (abcde$ == "") abcde$ = "____"; // initialize with a dummy character if (compare(abcde$, "_")) { .@length = getstrlen(abcde$); do { .@index = rand(.@length); } while (charat(abcde$, .@index) != "_")); // search for it setchar(abcde$, .word$[.@index], .@index); // replace it } message strcharinfo(0), "Letter's Collected : "+ abcde$;
  14. you can just do like this $Events = 5 * .@amount;
  15. OnPCAttackEvent: if (strcharinf(3) != "prontera") end; // <--- change to the punching bag map message strcharinfo(0), "You have dealt "+ @damage +" damage to Punching Bag"; end;
  16. may refer this post for guide to fix the account_id issue. https://rathena.org/board/topic/131467-need-help-sql-db-error-pls-thanks/#comment-407968
  17. may refer this post for guide to fix the account_id issue. https://rathena.org/board/topic/131467-need-help-sql-db-error-pls-thanks/#comment-407968
  18. 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.
  19. .@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; }
  20. bonus bMatk,(getrefine() + 10); Magical attack power +10 per refine bonus bMatkRate,(getrefine() + 2); Magical attack power + 2% per refine
  21. Emistry

    Rent npc

    prontera,155,181,5 script Sample 757,{ mes "Give me Red Potion."; if (select("Enter", "Cancel") == 1) { if (!countitem(501)) { mes "You dont have it."; } else { TIME_LEFT = gettimetick(2) + (3 * 3600); addtimer (3 * 3600 * 1000), strnpcinfo(3)+"::OnExpire"; warp "prt_fild01", 0, 0; } } close; OnPCLoginEvent: .@time_left = TIME_LEFT - gettimetick(2); if (.@time_left > 0) { addtimer (.@time_left * 1000), strnpcinfo(3)+"::OnExpire"; } end; OnExpire: TIME_LEFT = 0; warp "prontera", 155, 181; end; }
  22. GSTORAGE_NO_STORAGE - Guild hasn't invested in the Guild Storage Expansion skill (only if OFFICIAL_GUILD_STORAGE is enabled). doc\script_commands.txt
  23. .@item_id = groupranditem(IG_Taming); getitem .@item_id, 1; announce "["+strcharinfo(0)+" obtained "+getitemname(.@item_id)+"]", bc_all;
×
×
  • Create New...