Jump to content

AnnieRuru

Script Developers
  • Content Count

    1677
  • Joined

  • Last visited

  • Days Won

    245

Reputation Activity

  1. Upvote
    AnnieRuru reacted to Ind in Correct Pneuma Effect Update   
    nope, still broken D: clif_skill_delunit (ZC_SKILL_DISAPPEAR) is unable to delete pneuma, so the visual effect remains even after the server has deleted it because of landprotector.
  2. Upvote
    AnnieRuru reacted to Ind in [Suggestion] Implementation of Source-based per RO Episode.   
    this has been proposed a number of times throughout time and there are many issues involved that make it hardly practical, besides those already presented in this thread, for example many regional servers have misused (or split) the first few episodes which causes a number of users recollect how things were in episode x y or z differently from those on other regional servers, which'd flood us with "this episode didn't have y", "this episode had x" reports which'd be very troublesome and take a great amount of research from us in order to assert the validity.
  3. Upvote
    AnnieRuru reacted to Ind in Map Zone Debuff   
    To use the disabled_skills info, it'd be like (just drafted) int i, type; for(i = 0; i < map->list[sd->bl.m].zone->disabled_skills_count; i++) { if( (type = status->skill2sc(map->list[sd->bl.m].zone->disabled_skills[i]->nameid) ) && sd->sc.data[type] ) { status_change_end(&sd->bl, type, INVALID_TIMER); } }I think what I'm proposing would be more like a bugfix than related to this suggestion, since without it if you have assumptio blocked in prontera you can get inside with the effect by casting it before warping...wouldn't it be confusing to users to maintain the icon? (I'd say it'd be interesting however since it'd mean once you leave the map/zone the effect would resume)
  4. Upvote
    AnnieRuru reacted to Ind in Implement New skill GD   
    I see...I think we can manage that, something like if ( itemskill == GD_EMERGENCYCALL ) { switch( level ) { case 1: limit = 7; ... } }
  5. Upvote
    AnnieRuru reacted to Ind in Logs for cashshop_db   
    does it really need a new table? can't we share picklog? (with a new type)
  6. Upvote
    AnnieRuru reacted to Ind in Monster transform   
    humm I wonder would this be implemented in "autobonus" fashion?
  7. Upvote
    AnnieRuru got a reaction from kyeme in Regarding the Character Deletion   
    // Restrict character deletion if carrying these item IDschar_del_itemid: 1530,2629,2857prevent character deletion if carrying mjolnir, magingiorde, brisingamen 
    and the check range should included inventory, cart, mail attachment
  8. Upvote
    AnnieRuru reacted to Ind in [Suggestion] displaybottom & message colors   
    colormes needs to be modified (or a new version since we rely on that for hardcoded things)
  9. Upvote
    AnnieRuru reacted to kisuka in Question about Script Developer.   
    Sorry for the delay. My job has had me overworked for about a month or so now, I should be free'd up after tomorrow and can get back to the Academy scripts.
     
    They are almost finished, a small portion of untranslated text remains (the last part of each job quest), then I just have to convert to AS (Athena Script) and QA it.
     
    The updates I rolled out were pre-reqs for the academy as they have some interesting script commands. The quest log / bubbles will need to be overhauled 1 last time before I roll out the scripts, so expect that as well.
     
    After academy the goal is to knock out the to-do lists we have on our issues section on github.
  10. Upvote
    AnnieRuru got a reaction from dhaisuke in Help in KOTH Bug   
    in my original koe script, I did
    mes "[Exit]"; mes "See ya."; if ( getcharid(2) == $koegid ) getitem 501, 1; // configure prize here close2; warp "Save",0,0; end;so yeah, members can talk to this npc (claim the prize), don't press the close buttonand wait for guild master recall them, and talk to this npc (claim the prize), don't press the close button
    repeat
    so yeah, that's how they abuse the prize
    I just figured it out 2 days ago when I read bug report section about someone posting about guild aura bug
     
    to fix it, simply move the condition of giving the prize into after the close2; button
    mes "[Exit]"; mes "See ya."; close2; if ( getcharid(2) == $koegid ) getitem 501, 1; // configure prize here warp "Save",0,0; end;like this 
     
    so in your modified script, it should be
    // KoE Exitguild_vs1,49,56,5 script Exit#KoE 51,{ mes "[Exit]"; mes "Thank you for Joining"; mes "You Won PVP Tokens and Cash Points"; close2; if ( getcharid(2) == $koegid ) { getitem 8039,150; set #CASHPOINTS,#CASHPOINTS + 50; dispbottom "You got "+#CASHPOINTS+" cash points."; } warp "Save",0,0; end;}
  11. Upvote
    AnnieRuru reacted to KeyWorld in help me improve this merge sort algorithm   
    So rathena sux
    Only implement a buggy version of .@var++ sux a lot...
    So let say I forget about rathena for this script now.
     
    I know about getd() and setd(), the only problem with this command is the memory leak it create (specially in this case), so I'm not fan of it anymore
    So here a new version, with the *counting_sort_index*, and also a big bonus : asm functions (for fun).
     
    http://upaste.me/2d0f10561576aed88
     
    [Debug]: script debug : 0 110198899 : ==== [SORT INDEX] Testing for 1000 elements.[Debug]: script debug : 0 110198899 : [merge_sort_index] Time used -> 610 ms [PASSED][Debug]: script debug : 0 110198899 : [merge_sort_index_asm] Time used -> 578 ms [PASSED][Debug]: script debug : 0 110198899 : [comb_sort_index] Time used -> 508 ms [PASSED][Debug]: script debug : 0 110198899 : [comb_sort_index_asm] Time used -> 476 ms [PASSED][Debug]: script debug : 0 110198899 : [counting_sort_index] Time used -> 94 ms [PASSED][Debug]: script debug : 0 110198899 : [counting_sort_index_asm] Time used -> 91 ms [PASSED][Debug]: script debug : 0 110198900 : ==== [SORT] Testing for 1000 elements.[Debug]: script debug : 0 110198900 : [merge_sort] Time used -> 407 ms [PASSED][Debug]: script debug : 0 110198900 : [merge_sort_asm] Time used -> 378 ms [PASSED][Debug]: script debug : 0 110198900 : [comb_sort] Time used -> 385 ms [PASSED][Debug]: script debug : 0 110198900 : [comb_sort_asm] Time used -> 343 ms [PASSED][Debug]: script debug : 0 110198900 : [counting_sort] Time used -> 57 ms [PASSED][Debug]: script debug : 0 110198900 : [counting_sort_asm] Time used -> 53 ms [PASSED]
  12. Upvote
    AnnieRuru reacted to KeyWorld in help me improve this merge sort algorithm   
    It's not cheating, it's just reducing commands calls

    The best for now is counting sort in Hercules. Can't write it now in my phone but it will execute faaaar faster.
     
    Edit: So I checked today in a slow server, with some stupids greats optimizations in all functions. Here my results using 1000 elements :

    [Debug]: script debug : 0 110144879 : ==== [SORT] Testing for 1000 elements.[Debug]: script debug : 0 110144879 : [merge_sort] Time used -> 405 ms [PASSED][Debug]: script debug : 0 110144879 : [comb_sort] Time used -> 394 ms [PASSED][Debug]: script debug : 0 110144879 : [counting_sort] Time used -> 57 ms [PASSED] [Debug]: script debug : 0 110144878 : ==== [SORT INDEX] Testing for 1000 elements.[Debug]: script debug : 0 110144878 : [merge_sort_index] Time used -> 608 ms [PASSED][Debug]: script debug : 0 110144878 : [comb_sort_index] Time used -> 483 ms [PASSED]  
    So as you can see, a hacky Comb Sort is faster than a hacky merge sort in all cases.
    If you want to cheat even more, you can use my hackyyyy counting sort (but it does not sort indexes).
     
    Have fun: http://rathena.org/board/pastebin/2kto2abymrp/
  13. Upvote
    AnnieRuru reacted to KeyWorld in Hercules 1st 2014 MegaPatch   
    Basically:
    https://github.com/HerculesWS/Hercules/blob/master/src/map/script.c#L1105
    https://github.com/HerculesWS/Hercules/blob/master/src/map/script.c#L3011
    https://github.com/HerculesWS/Hercules/blob/master/src/map/script.c#L3425
     
    Number in script are integer, supported from -2147483647 to 2147483647, else it lead to overflow error.
    So if you can't create a number greater than this value, you will never be able to select an index superior than 2147483647 in an array.
  14. Upvote
    AnnieRuru reacted to malufett in MvP and @reloadscript   
    this could be done in src easily..
     
    MVP killed -> save to db left respawn time
    Server restarted or npc reloaded -> server fetch respawn time from db then parse then load to its ticking process before respawn
     
    this will only work if the MVP mob dies after server initial start...
     
    ATM just an idea and the codes are still in my brain..if I have time I'll do it..
     

  15. Upvote
    AnnieRuru reacted to Ind in Introducing Hercules' Map Zone Database   
    Introducing Hercules' Map Zone Database
    Hello~! - What?!
    1st, it is a merge from item_noequip.txt and skill_nocast_db.txt functionality. 2nd, it is a major improvement on what these features did in both performance and usability. map_zone_db.txt format sample
    {     name: "My Zone"     inherit: ( "My Other Zone" )     disabled_skills: {         AL_HEAL: "PLAYER | MONSTER | ELEMENTAL"         AL_TELEPORT: "MONSTER"         MG_FIREBOLT: "NONE"         //MG_NAPALMBEAT: "PLAYER"         //ID11: "PLAYER"     }     disabled_items: {         Assumptio_5_Scroll: false         //Apple: true         //ID501: true     }     mapflags: (         "adjust_skill_damage    MG_FIREBOLT    250",         "adjust_unit_duration    PR_SANCTUARY    50"     )     /* "command:min-group-lv-to-override" e.g. "heal: 70" */     disabled_commands: {         //Example Below makes @heal be used in maps within this zone only by those group lv 70 and above         //heal: 70     }     skill_damage_cap: {         //Exemple Below caps firebolt damage in maps within this zone to a maximum 50 damage,         // (depends on HMAP_ZONE_DAMAGE_CAP_TYPE in src/config/core.h)         // when cast vs players and monsters.         //MG_COLDBOLT: (50,"PLAYER | MONSTER")     } } Notes on the format
    In disabled_skills the var following the name (: "PLAYER | MONSTER | HOMUN | MERCENARY | ELEMENTAL | PET | CLONE | MOB_BOSS") is what allows a zone to know what unit types should have this skill disabled. In the sample above, for example, in My Zone, player, monster and elemental unit types are unable to cast heal, while only monsters are unable to cast teleport. this variable may also be used to ignore skills from inheritance, for example if My Other Zone disabled a number of skills, including MG_FIREBOLT, in My Zone all of them will be disabled as well, except for MG_FIREBOLT since it is set as NONE. In disabled_items the var following the name (: true or : false) is what allows a zone to override what it inherited, for example if My Other Zone disables a number of items, including Assumptio_5_Scroll, in My Zone all of them will be disabled as well, except Assumptio_5_Scroll since it is as false. A zone may enforce an unlimited number of mapflags on all its maps, by using this sample all maps under My Zone will have Fire Bolt damage increased by 2.5x and Sanctuary will have its duration halved. A unlimited number of maps may be linked to a specific zone through a mapflag '<map name><tab>mapflag<tab>zone<tab><zone name>' Changes The mf_restrict (restrict) was dropped. item_noequip.txt and skill_nocast_db.txt were dropped, replaced by map_zone_db.txt. setmapflag script command was modified to support the new zones. @mapinfo was modified to support the new zones, also modified the formatting and made it include the amount of vendings. Improvements As opposed to item_noequip.txt and skill_nocast_db.txt, map_zone_db.txt supports an unlimited number of zones. map_zone_db.txt implementation surpasses the ones from item_noequip.txt and skill_nocast_db.txt, making item equipping (pc_useitem/status_calc_pc) and skill using (previously skillnotok, now status_check_skilluse) processing much faster and efficient. @mapinfo performance was improved (was doing chat room dbmap lookups without even checking if player was on the map in question) Special Thanks to Muad_Dib <3. to lighta for discussing the feature with me and helping design the unit-based restrictions on skills to Bahmut and Emistry for ideas on how to format the file. to kyeme for feature ideas. Links~! Commit Commit 2 (update) Map Zone Database File
  16. Upvote
    AnnieRuru reacted to KeyWorld in help me improve this merge sort algorithm   
    Optimized version of the merge sort index :
    function script mergeSortIndex { .@size = getarg(2); copyarray .@arr, getarg(0), .@size; while (.@i < .@size) { set .@idx[.@i], .@i; .@i++; } .@width = 1; while (.@width < .@size) { .@left = 0; while (.@left < .@size) { .@middle = .@size < .@left + .@width ? .@size : .@left + .@width; .@right = .@size < .@left + .@width * 2 ? .@size : .@left + .@width * 2; .@l = .@left; .@m = .@middle; while (.@l < .@middle && .@m < .@right) { if (.@arr[.@l] < .@arr[.@m]) { .@tmp_arr[.@left] = .@arr[.@l]; .@tmp_idx[.@left] = .@idx[.@l]; .@l++; } else { .@tmp_arr[.@left] = .@arr[.@m]; .@tmp_idx[.@left] = .@idx[.@m]; .@m++; } .@left++; } if (.@middle - .@l) { copyarray .@tmp_arr[.@left], .@arr[.@l], .@middle - .@l; copyarray .@tmp_idx[.@left], .@idx[.@l], .@middle - .@l; .@left += .@middle - .@l; } if (.@right - .@m) { copyarray .@tmp_arr[.@left], .@arr[.@m], .@right - .@m; copyarray .@tmp_idx[.@left], .@idx[.@m], .@right - .@m; .@left += .@right - .@m; } } .@width *= 2; copyarray .@arr, .@tmp_arr, .@size; copyarray .@idx, .@tmp_idx, .@size; } copyarray getarg(1), .@tmp_idx, .@size; return;}
  17. Upvote
    AnnieRuru reacted to Haru in help me improve this merge sort algorithm   
    Yep, it's slower because it does more operations, since it needs to swap values from two arrays instead of one~
  18. Upvote
    AnnieRuru reacted to Haru in help me improve this merge sort algorithm   
    Yup, I think so too (decreasing readability but oh well, if a script is performance-critical)  
    Ah I just noticed an error in the script. In the do/while condition, there's a .@gap > 10 that should be .@gap10 > 10 (I had to introduce that extra gap10 variable because of some checks that were getting messed up because of the division by 1.3, and forgot to update it through the script.Not so much compared to today's standards, it's a late-2009 iMac with an i7-870 cpu... But it still works reasonably well Yes, this is certainly true. As keyworld said, they compile to different assembly, and the for one calls more jump commands.With some luck, we might be able to get an even faster implementation. Just theoretical right now, but there's something in the works That's to avoid affecting the original array, and let the function work on a local copy when it does the swaps.Hmm, I see. Then how about, instead of using the .@output array as index, you sort @inventorylist_id, and whenever you do one swap on it, you do the very same swap on @inventorylist_amount as well? 
    Here's two examples (untested, sorry if there's any error). First one sorts in place *both* the original arrays, so you just need to print @inventorylist_id[.@i] and @inventorylist_amount[.@i]. Second one should be what you wanted, it doesn't sort the original arrays at all, and only returns the array of sorted indices, so that you need to print @inventorylist_id[ .@output[.@i] ] and @inventorylist_amount[ .@output[.@i] ]:
     
    http://upaste.me/5c1c8f
    (changing the for() to while() is left as an exercise to the reader )
     
    //Edit: did I ever say I hate IPB's broken bbcode parser?
  19. Upvote
    AnnieRuru reacted to kisuka in Authors of Athena   
    I added you because you've helped contribute greatly to the community for a long time :3 again, this list is a work in-progress. Anyone who made an impact is to be added. It's only fair. Athena would be no where today without the help of the community and those that have given back to the project.
     
    <3
  20. Upvote
    AnnieRuru reacted to Haru in help me improve this merge sort algorithm   
    Here's some optimizations to those functions, as well as an iterative, bottom-up implementation of mergesort.
     
    http://upaste.me/20dc8e
     
    This is how they perform on my Hercules copy, using 1000-element arrays:
     
    Mergesort (recursive):
    [Debug]: script debug : 0 110000001 : time used -> 131 milli-secondsMergesort (bottom-up):[Debug]: script debug : 0 110000002 : time used -> 89 milli-secondsCombsort:[Debug]: script debug : 0 110000003 : time used -> 98 milli-secondsFor question 2: what about a parallel array of indices, that you swap when you swap the main one?
  21. Upvote
    AnnieRuru reacted to KeyWorld in help me improve this merge sort algorithm   
    Hi Annie
     
    I'll check later more deeply your script to see if there are rooms for improvements, not much time currently.
    But from what I remember (maybe not the case anymore) the script engine do not like recursion (call functions, return to the previous state) and that's what slowing down the script.
  22. Upvote
    AnnieRuru got a reaction from Mumbles in Is this possible?   
    a bit off-topic butyeah, 1 of the reason I move here because in hercules already has some powerful scripters around
     
    the only thing that jabote missed out is missing setmapflag
    - script warp_banned -1,{OnInit: setarray .not_2ndjob$[0], "morocc", "payon", "aldebaran"; // Maps NOT for second jobs. Add more with a comma, last member should have a semicolon setarray .not_3rdjob$[0], "amatsu", "gonryun", "geffen"; // Same as above, but for third jobs .not_2ndjob_size = getarraysize(.not_2ndjob$); .not_3rdjob_size = getarraysize(.not_3rdjob$); for ( .@i = 0; .@i < .not_2ndjob_size; .@i++ ) setmapflag .not_2ndjob$[.@i], mf_loadevent; // Thx to Keyworld <3 for ( .@i = 0; .@i < .not_3rdjob_size; .@i++ ) setmapflag .not_3rdjob$[.@i], mf_loadevent; end;OnPCLoadMapEvent: if ( eaclass() & ( EAJL_UPPER | EAJL_2 ) ) { // Player is 2nd trans job while ( strcharinfo(3) != .not_2ndjob$[.@i] && .@i < .not_2ndjob_size ) .@i++; } else if ( eaclass() & EAJL_THIRD ) { // Player is the 3rd job while ( strcharinfo(3) != .not_3rdjob$[.@i] && .@i < .not_3rdjob_size ) .@i++; } else end; if ( .@i != .not_2ndjob_size || .@i != .not_3rdjob_size ) { dispbottom "You're not supposed to be here..."; warp "SavePoint",0,0; } end;}... hmm .. why this {code} doesn't has cut the length ...edit ... oh ... have to refresh the page =/
  23. Upvote
    AnnieRuru reacted to KeyWorld in Is this possible?   
    @Annie
     
    Just because it's you <3
    You miss array element in the setmapflag
     
    And because it's too much time since the last time I touch to Athena script, just cheating:
     
    - script warp_banned -1,{OnInit: setarray .@denymap_2nd$, "morocc", "payon", "aldebaran"; // Maps NOT for second jobs. Add more with a comma, last member should have a semicolon setarray .@denymap_3rd$, "amatsu", "gonryun", "geffen"; // Same as above, but for third jobs .@denymap_2ndSize = getarraysize(.@denymap_2nd$); .@denymap_3rdSize = getarraysize(.@denymap_3rd$); for (.@i = 0; .@i < .@denymap_2ndSize; .@i++) { setmapflag .@denymap_2nd$[.@i], mf_loadevent; } for (.@i = 0; .@i < .@denymap_3rdSize; .@i++) { setmapflag .@denymap_3rd$[.@i], mf_loadevent; } .@joinMap_2nd$ = "x1" + implode( .@denymap_2nd$, "x1") + "x1"; .@joinMap_3rd$ = "x1" + implode( .@denymap_3rd$, "x1") + "x1"; end;OnPCLoadMapEvent: .@class = eaclass(); .@search$ = "x1" + strcharinfo(3) + "x1"; if ( ((.@class & (EAJL_UPPER | EAJL_2)) && strpos(.@joinMap_2nd$, .@search$) > -1) || ((.@class & EAJL_THIRD) && strpos(.@joinMap_3rd$, .@search$) > -1) ) { dispbottom "You're not supposed to be here..."; warp "SavePoint",0,0; }}  
  24. Upvote
    AnnieRuru got a reaction from kyeme in Is this possible?   
    a bit off-topic butyeah, 1 of the reason I move here because in hercules already has some powerful scripters around
     
    the only thing that jabote missed out is missing setmapflag
    - script warp_banned -1,{OnInit: setarray .not_2ndjob$[0], "morocc", "payon", "aldebaran"; // Maps NOT for second jobs. Add more with a comma, last member should have a semicolon setarray .not_3rdjob$[0], "amatsu", "gonryun", "geffen"; // Same as above, but for third jobs .not_2ndjob_size = getarraysize(.not_2ndjob$); .not_3rdjob_size = getarraysize(.not_3rdjob$); for ( .@i = 0; .@i < .not_2ndjob_size; .@i++ ) setmapflag .not_2ndjob$[.@i], mf_loadevent; // Thx to Keyworld <3 for ( .@i = 0; .@i < .not_3rdjob_size; .@i++ ) setmapflag .not_3rdjob$[.@i], mf_loadevent; end;OnPCLoadMapEvent: if ( eaclass() & ( EAJL_UPPER | EAJL_2 ) ) { // Player is 2nd trans job while ( strcharinfo(3) != .not_2ndjob$[.@i] && .@i < .not_2ndjob_size ) .@i++; } else if ( eaclass() & EAJL_THIRD ) { // Player is the 3rd job while ( strcharinfo(3) != .not_3rdjob$[.@i] && .@i < .not_3rdjob_size ) .@i++; } else end; if ( .@i != .not_2ndjob_size || .@i != .not_3rdjob_size ) { dispbottom "You're not supposed to be here..."; warp "SavePoint",0,0; } end;}... hmm .. why this {code} doesn't has cut the length ...edit ... oh ... have to refresh the page =/
  25. Upvote
    AnnieRuru got a reaction from Cabrera in Is this possible?   
    a bit off-topic butyeah, 1 of the reason I move here because in hercules already has some powerful scripters around
     
    the only thing that jabote missed out is missing setmapflag
    - script warp_banned -1,{OnInit: setarray .not_2ndjob$[0], "morocc", "payon", "aldebaran"; // Maps NOT for second jobs. Add more with a comma, last member should have a semicolon setarray .not_3rdjob$[0], "amatsu", "gonryun", "geffen"; // Same as above, but for third jobs .not_2ndjob_size = getarraysize(.not_2ndjob$); .not_3rdjob_size = getarraysize(.not_3rdjob$); for ( .@i = 0; .@i < .not_2ndjob_size; .@i++ ) setmapflag .not_2ndjob$[.@i], mf_loadevent; // Thx to Keyworld <3 for ( .@i = 0; .@i < .not_3rdjob_size; .@i++ ) setmapflag .not_3rdjob$[.@i], mf_loadevent; end;OnPCLoadMapEvent: if ( eaclass() & ( EAJL_UPPER | EAJL_2 ) ) { // Player is 2nd trans job while ( strcharinfo(3) != .not_2ndjob$[.@i] && .@i < .not_2ndjob_size ) .@i++; } else if ( eaclass() & EAJL_THIRD ) { // Player is the 3rd job while ( strcharinfo(3) != .not_3rdjob$[.@i] && .@i < .not_3rdjob_size ) .@i++; } else end; if ( .@i != .not_2ndjob_size || .@i != .not_3rdjob_size ) { dispbottom "You're not supposed to be here..."; warp "SavePoint",0,0; } end;}... hmm .. why this {code} doesn't has cut the length ...edit ... oh ... have to refresh the page =/
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.