Jump to content

Emistry

Forum Moderator
  • Posts

    10018
  • Joined

  • Days Won

    408

Everything posted by Emistry

  1. query_sql( "SELECT `card_id`, `card_name`, `card_type` FROM `card_list` WHERE `card_race` = 'monster' ORDER BY `card_name` ASC limit 500 ",.@iid,.@in$,.@tp$); .@size = getarraysize( .@iid ); for( .@i = 0; .@i < .@size; .@i++ ) { if (countitem(.@iid[.@i]) >= 1) set .@menu$, .@menu$ + .@in$[.@i] +" - " + .@tp$[.@i]; set .@menu$, .@menu$ + ":"; } .@i = select( .@menu$ ) - 1; or getinventorylist; for (.@i = 0; .@i < @inventorylist_count; .@i++) { if (getiteminfo(@inventorylist_id[.@i],2) == IT_CARD) .@menu$ = .@menu$ + getitemname(@inventorylist_id[.@i]); .@menu$ = .@menu$ + ":"; } .@i = select( .@menu$ ) - 1;
  2. OnTimer - if you want precision in interval time for checking.... OnClock are acceptable, but the interval time for checking aren't precise.
  3. yes. OnTOuchNPC: unitwarp <GID>,"<map name>",<x>,<y>; end;
  4. insert a dummy char with the guild name as char name ... and create the signed item using that newly created char id
  5. change the Constant that used in the array into MobID ... rathena doesnt support using these constants as MobIDs.
  6. doc/script_commands.txt#L3919 If you specify a from_mapname, 'warpparty' will only affect those on that map.
  7. use the warpparty script command. doc/script_commands.txt#L3905-L3931
  8. @Z3R0 you can simplify this part // Check Inventory for Coins getinventorylist; freeloop(true); for(.@coin_index = 0; .@coin_index < getarraysize(.exchange_ids); .@coin_index++) { for(.@i = 0; .@i < @inventorylist_count, .@i++) { if (@inventorylist_id[.@i] == .exchange_ids[.@coin_index]) { if (@inventorylist_amount[.@i] >= .exchange_amount[.@coin_index]) { set(.@menu_coin_index[getarraysize(.@menu_coin_index)], .@coin_index); set(.@menu$, ( .@menu$ = "" ? "" : ":" ) + getitemname(.exchange_ids[.@coin_index]) + "(" + @inventorylist_amount[.@i] + ")"); } } } } freeloop(false); // Display Option to Show them choices and how many coins they have... set .@choice, select(.@menu$) - 1; // Subtract 1 to get Array Index set .@index, .@menu_coin_index[.@choice]; into this, using the countitem() to check if player has the item with them or not. .@exchange_ids_size = getarraysize(.exchange_ids); for (.@i = 0; .@i < .@exchange_ids_size; .@i++) { if (countitem(.exchange_ids[.@i]) >= .exchange_amount[.@i]) { .@menu$ = .@menu$ + getitemname(.exchange_ids[.@i]); } .@menu$ = .@menu$ + ":"; } .@i = select(.@menu$) - 1; dispbottom("You have chosen to use " + getitemname(.exchange_ids[.@i]) );
  9. check for the mob id. if (killedrid == 1002) { // scripts... } but since this is an instance script, you could have just attach a unique event to this monster to trigger the event to assigns the rewards to players. ... .@current_map$ = instance_mapname("dew_dun02"); getpartymember getcharid(1),2; for( .@i = 0; .@i < $@partymembercount; .@i++ ) { if (attachrid($@partymemberaid[.@i])) { if (strcharinfo(3) == .@current_map$) { getitem 607,1; getexp 1000,1000; } detachrid; } } you need to loop each of the party member and check for their location. * this damn IPS4 editor just love to erase all the contents when i paste new things into the codebox.
  10. @Technoken because script will stop the script when detected blacklist items, hence the player will not drop anything even if they have other non-blacklisted items with them. @Erio-chan you can try this. Not the ideal way, but should be workable. - script nightmaremode -1,{ OnInit: .blacklist$ = "501,502,503,504,505"; end; OnPCDieEvent: if (countitem(7773) >= 1) end; if (BaseLevel < 40) end; //if ( strcharinfo(3) != "moc_fild12" ) end; // set your map //if ( pkpoints < 100 ) end; // decide on the pk points getinventorylist; .@size = (@inventorylist_count-1); for ( .@i = .@size; .@i >= 0; .@i--) { if (compare(","+.blacklist$+",", ","+@inventorylist_id[.@i]+",")) { deletearray @inventorylist_id[.@i],1; deletearray @inventorylist_amount[.@i],1; deletearray @inventorylist_identify[.@i],1; deletearray @inventorylist_refine[.@i],1; deletearray @inventorylist_attribute[.@i],1; deletearray @inventorylist_card1[.@i],1; deletearray @inventorylist_card2[.@i],1; deletearray @inventorylist_card3[.@i],1; deletearray @inventorylist_card4[.@i],1; .@size--; } } if (.@size > 0) { .@r = rand(.@size); delitem2 @inventorylist_id[.@r], @inventorylist_amount[.@r], @inventorylist_identify[.@r], @inventorylist_refine[.@r], @inventorylist_attribute[.@r], @inventorylist_card1[.@r], @inventorylist_card2[.@r], @inventorylist_card3[.@r], @inventorylist_card4[.@r]; getmapxy .@map$, .@x, .@y, 0; makeitem2 @inventorylist_id[.@r], @inventorylist_amount[.@r], .@map$, .@x, .@y, @inventorylist_identify[.@r], @inventorylist_refine[.@r], @inventorylist_attribute[.@r], @inventorylist_card1[.@r], @inventorylist_card2[.@r], @inventorylist_card3[.@r], @inventorylist_card4[.@r]; } end; }
  11. you can try something like this too. - script TestEvent -1,{ OnInit: sleep ( rand(18,22) * 60000 ); doevent "TestEvent::OnRunEvent"; end; }
  12. you can try like .. setarray .@menu_item$, "Menu 1", "Menu 2", "Menu 3"; .@menu_item_size = getarraysize(.@menu_item$); for (.@i = 0; .@i < .@menu_item_size; .@i++) { .@menu$ = .@menu$ + (.@i > 0 ? ":" : "") + .@menu_item$[.@i]; } .@i = select( .@menu$ ) - 1; mes "You selected menu : "+ .@menu_item$[.@i]; or setarray .@menu_item$, "Menu 1", "Menu 2", "Menu 3"; .@menu$ = implode(.@menu_item$, ":"); .@i = select( .@menu$ ) - 1; mes "You selected menu : "+ .@menu_item$[.@i];
  13. you can try this. https://pastebin.com/wZMFVB08
  14. when you use query_sql() ... always use escape_sql() for all the string variables that you passed in. otherwise your scripts are vulnerable to SQL injection. query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+.@name$+"'",.@acc_ID$) change to query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+escape_sql(.@name$)+"'",.@acc_ID$) etc..
  15. You can actually replace this whole part here... https://github.com/keitenai/keitenai/blob/master/WhoisCommand.txt#L30-L60 with this for (.@i = 0; .@i < .@atcmd_numparameters; .@i++) .@name$ = .@name$ + (.@i > 0 ? " ":"") + .@atcmd_parameters$[.@i]; or this .@name$ = implode(.@atcmd_parameters$, " "); (may get errors or warnings if the array size is less than 1 or 0)
  16. https://github.com/rathena/rathena/search?utf8=✓&q=run_script&type=
  17. you can try this. https://pastebin.com/nPrz8ctY
  18. lol ... hahahaha maybe you should just try while(1) { blablablablabla; sleep2 10000; } @firefox26 you can try this. - script sample -1,{ OnInit: .map$ = "prontera"; .itemid = 512; .interval = 5; setmapflag .map$, mf_loadevent; end; OnPCLoadMapEvent: if (strcharinfo(3) == .map$) { if (!countitem(.itemid)) { mes "Your item "+getitemname(.itemid)+" is gone. Warping out."; sleep2 1000; warp "SavePoint",0,0; } else { addtimer (.interval * 1000), .npc_name$+"::OnPCLoadMapEvent"; } } end; } I am not sure how exactly you want it to run .... basically my method are same with @crazyarashi post. EDIT: .... its @Erio-chan ... /swt' kindly open your own topic if the request are different from topic starter, dont hijack topic and request a script that run different from original topic.
  19. you can try this as well. my job changer allow you to setup different cost for each classes.
  20. change for( set .@i,1; .@i <= 6; set .@i,.@i + 1 ) into for( set .@i,EQI_SHOES; .@i <= EQI_HAND_R; set .@i,.@i + 1 ) and make sure your item are refine-able, check your item_db
  21. Master @Z3R0 is back. <3
  22. try https://pastebin.com/i5bQbr3G
×
×
  • Create New...