Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/16/14 in all areas

  1. @Patskie You want to use a variable with the getarraysize value as opposed to calling the function directly inside the for loop. prontera,150,150,0 script Sample 100,{ for ( .@i = 0; .@i < .num_r; .@i += 2 ) { if ( countitem( .r[ .@i ] ) < .r[ .@i + 1 ] ) { mes "Lack of requirements"; close; } } for ( .@i = 0; .@i < .num_r; .@i += 2 ) delitem .r[ .@i ], .r[ .@i + 1 ]; for ( .@i = 0; .@i < .num_p; .@i += 2 ) getitem .p[ .@i ], .p[ .@i + 1 ]; mes "Nice!"; close; OnInit: // item id, amount ( r = requirements | p = prize ) setarray .r[0],7227,5,7179,5; setarray .p[0],1202,1,5013,1; set .num_r, getarraysize(.r); set .num_p, getarraysize(.p); end; } The getarraysize() function quite literally goes through the array checking if each value exists till the end. To put it in a loop like that means the processing time will increase quadratically as you add items. static int32 getarraysize(struct script_state* st, int32 id, int32 idx, int isstring, struct DBMap** ref) { int32 ret = idx; if( isstring ) { for( ; idx < SCRIPT_MAX_ARRAYSIZE; ++idx ) { char* str = (char*)get_val2(st, reference_uid(id, idx), ref); if( str && *str ) ret = idx + 1; script_removetop(st, -1, 0); } } else { for( ; idx < SCRIPT_MAX_ARRAYSIZE; ++idx ) { int32 num = (int32)__64BPRTSIZE(get_val2(st, reference_uid(id, idx), ref)); if( num ) ret = idx + 1; script_removetop(st, -1, 0); } } return ret; }
    2 points
  2. Evening all! So, earlier this evening i was having a conversation with Nanakiwurtz and Sandbox about Voting Sites, which reminded me that i'd begun to develop a voting site around this time two years ago. So naturally i bought a domain name, threw my code to my webspace and started to overhaul the functions. Now i need testers. I need as many testers as possible and the first 5 people that PM me offering their help will get premium status on the site, just to say thanks P.S. I need you to PM me offering to help, not reply to this topic. I need testers who can read ._.;
    1 point
  3. Disabling NPCs, since downloading SVNs would give you headache regarding packets and configuration.
    1 point
  4. You can simply add restriction on entering the new maps on npc/mapflag/nowarpto.txt and then disable the npcs in the npc folder. for the 2-2, simply disable the 3rd jobs on your job changer. or you can try downloading an old revision.
    1 point
  5. you can refer this text file to write your own item bonus doc/item_bonus.txt
    1 point
  6. UPDATE `char` SET `class` = XYZ WHERE `class` = ABC; replace the value yourself ... XYZ = 2nd job ID ABC = third job ID make sure you shutdown server before run this. you can also try other way....simpler... OnPCLoginEvent + jobchange
    1 point
  7. my own experience for scripting ... i used to search every single topic in here http://www.eathena.ws/board/index.php?s=79f689a6fb93259d61f8f27404fbfb0b&showforum=56 what i meant is ...EVERY SINGLE TOPIC + POSTS YES..everything not to mention that i read every topic and posts more than 1 times.... then after sometime ... when i capable to start writing .... i found sensei ~ AnnieRuru ...and Keyworld...and ToastofDoom .Z3R0 ... etc ... day by day get scolded by AnnieRuru ... day by day getting advise from Z3R0 and Keyworld .. then only i started to get improvement .. sometime.... it's not that people unwilling to share their knowledge ... it's just that they wanted you to find it by yourself ...since it's already in the forum .. something like feed you with food = survive 1 day cook food by yourself = survive all the time ~.~ ... now i have no idea what i wanted to say ... EDIT: those multi quotebox ... are soooooo irritating .... xP
    1 point
  8. Thank you Adel for your comment and your answer I make a little recolor of Luffy Hat <3 Name : Bacsojin Game : Ragnarok Online File Size: 1287 KB Author: Gravity Download : Mob - Bacsojin [ToZorMan].zip Link : www.green-peach.net ----------------------------------------------------------------- Name : Drooping_Bacsojin Categorie : Upper Headgear File Size: 291 KB Author: Unknown Download : Hat - Drooping_Bacsojin [ToZorMan].zip Link : www.green-peach.net ----------------------------------------------------------------- Name : Freesia_Bud_Leaf Categorie : Upper Headgear File Size: 472 KB Author: ToZorMan Download : Hat - Freesia_Bud_Leaf [ToZorMan].zip Link : www.green-peach.net ----------------------------------------------------------------- Name : Luffy_Hat Categorie : Upper Headgear File Size: 226 KB Author: Adel Download : Hat - Luffy_Hat [ToZorMan].zip Link : www.green-peach.net
    1 point
  9. - script Sample -1,{ OnNPCKillEvent: if ( getmonsterinfo( killedrid, 22 ) ) { for ( .@i = 0; .@i < getarraysize( .items ); .@i += 3 ) { if ( rand( 100 ) < .items[ .@i + 2 ] ) { getitem .items[ .@i ], .items[ .@i + 1 ]; announce "Wow! " +strcharinfo( 0 )+ " has obtained " +getitemname( .items[ .@i ] )+ " [" +.items[ .@i + 1 ]+ "] from " +getmonsterinfo(killedrid, 0)+ ".",0; } } } end; OnInit: // <item id>,<amount>,<chance> setarray .items[0],14232, 2, 5, 7615, 1, 3, 7227, 1, 2, 7179, 1, 1; end; }
    1 point
  10. That seems to be custom, not old..
    1 point
  11. Here is a preview: You can download the original file in .spr here. I hope you like ;D
    1 point
×
×
  • Create New...