AnnieRuru

Script Developers
  • Content count

    1324
  • Joined

  • Last visited

  • Days Won

    130

AnnieRuru last won the day on February 19

AnnieRuru had the most liked content!

About AnnieRuru

  • Rank
    ~~Cute~Cute~Scripter~~

Profile Information

  • Gender
    Female
  • Location:
    your next door ~
  • Interests
    event scripts ~ battleground scripts ~
    making battleground scripts is my hobby ~
  • Emulator:
    Hercules
  • Github
    AnnieRuru

Recent Profile Visitors

10471 profile views
  1. holy shit, I need this badly, thanks XD @M45T3R, just in-case you don't really understand, I made a fuss about it in rathena forum XD https://rathena.org/board/topic/117966-how-to-find-nearest-enemyobtain-a-list-of-units-on-the-same-map-etc/?do=findComment&comment=357565 . https://rathena.org/board/topic/118141-q-mercenaries-autoattack-and-clones-aspd-bonuses/#comment-357133 . https://rathena.org/board/topic/115401-client-2018-custom-ai-crash/?do=findComment&comment=344790 . btw when you say homunculus, you also means mercenary AI ... right ?
  2. #include "common/hercules.h" #include "map/pc.h" #include "common/nullpo.h" #include "plugins/HPMHooking.h" #include "common/HPMDataCheck.h" HPExport struct hplugin_info pinfo = { "blockexp", SERVER_TYPE_MAP, "0.1", HPM_VERSION, }; bool pc_authok_post( bool retVal, struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, const struct mmo_charstatus *st, bool changing_mapservers ) { if ( retVal == false ) return false; if ( pc_readglobalreg( sd, script->add_variable("blockexp") ) == true ) clif->message( sd->fd, "@blockexp turn ON." ); return true; } bool pc_gainexp_pre( struct map_session_data **sd, struct block_list **src, uint64 *base_exp, uint64 *job_exp, bool *is_quest ) { nullpo_ret(*sd); if ( *src == NULL && pc_readglobalreg( *sd, script->add_variable("blockexp") ) == true ) *base_exp = 0; return true; } void pc_calcexp_post( struct map_session_data *sd, uint64 *base_exp, uint64 *job_exp, struct block_list *src ) { if ( pc_readglobalreg( sd, script->add_variable("blockexp") ) == true ) *base_exp = 0; return; } ACMD(blockexp) { if ( pc_readglobalreg( sd, script->add_variable("blockexp") ) ) { clif->message( sd->fd, "@blockexp turn OFF." ); pc_setglobalreg( sd, script->add_variable("blockexp"), false ); } else { clif->message( sd->fd, "@blockexp turn ON." ); pc_setglobalreg( sd, script->add_variable("blockexp"), true ); } return true; } HPExport void plugin_init(void) { addHookPre( pc, gainexp, pc_gainexp_pre ); addHookPost( pc, calcexp, pc_calcexp_post ); addAtcommand( "blockexp", blockexp ); } //= the reason of using a script variable instead of creating a new SQL table, //= so server owner can also block exp gain for players from a script //= so just comment out the addAtcommand line ... @Crousti @kftof
  3. 1.3 .... plugin well just copy paste from Dastgir's topic and split 2 posts from this topic for the "@blockexp" request
  4. https://github.com/dastgirp/HPM-Plugins/blob/master/src/plugins/MaxLvExpGain.c#L66 should be else if ( !strcmpi( key, "battle_configuration/max_jlv_exp_gain" ) )
  5. basic SQL command ? https://www.w3schools.com/sql/sql_in.asp use NOT IN statement
  6. wait a moment ... why the *expandInventory has the I as capital letter ? I remember there was a script standardization topic, forgot where issit now, discussed years ago 1. all constants should be CAPITAL LETTERS -> QUEUEOPT_LOGOUT, IOT_PARTY, GETTIME_WEEKDAY ... 2. all functions start with F_, and Capitial Letters only on word -> F_MesInfo, F_MesColor, F_InsertComma, F_SaveQuestSkills 3. all script commands should be low cap 4. and the ... no idea when ... variables ... for example your *getInventorySize() has I and S capital, opposed to *getinventorylist() all low cap hercules script engine is case-sensitive, so we have to be extra be careful when apply the capital letters ... although there are already some controversial ... like the "All" vs "all" ... reported #784
  7. ok, read back the topic in rathena, I actually know what you are trying to make but your script totally ruined it, and I have no idea where to start fixing that ... it just a total mess so by the information what I gotten are ... 1. you just want to have guardians roaming in conquered castle 2. "guild_vs2" custom castle is actually not part of the code you want (I provide the template, and you failed to understand the template) is that correct ? its much easier if I have spoon feed from the beginning
  8. already mentioned in script_commands.txt *expandInventory(<value>) Adjust player inventory to given value. Maximum inventory size is MAX_INVENTORY. Minimum inventory size is FIXED_INVENTORY_SIZE. For supported clients it send inventory change packet. For old clients, this change is silent. Current max inventory size can be read by function getInventorySize(). https://github.com/HerculesWS/Hercules/blob/82d634ad431b2ffe7077a561f4eafd2486ede44b/doc/script_commands.txt#L10349 https://github.com/HerculesWS/Hercules/blob/82d634ad431b2ffe7077a561f4eafd2486ede44b/src/common/mmo.h#L170
  9. pet eggs are not simple as that, there is also a `pet` table you have to worry about you can't just *delitem ... have to list the pet owner, intimacy, ... etc fetch the pet information then use *delitem2 to delete the correct pet ID also your script is a total mess, I have totally no idea what you are doing // counting_sort_index <input array>, <output index>{, <total index>}; function script counting_sort_index { [email protected] = [email protected] = getarg( 2, getarraysize( getarg(0) ) ); copyarray [email protected], getarg(0), [email protected]; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) setd "[email protected]_"+ [email protected][[email protected]] +"["+( [email protected][[email protected][[email protected]]]++ )+"]", [email protected]; for ( ; [email protected]; [email protected] ) { [email protected] = getarraysize([email protected]) -1; [email protected][[email protected]] = getd( "[email protected]_"+ [email protected] +"["+( [email protected][[email protected]] )+"]" ); } copyarray getarg(1), [email protected], [email protected]; return; } prontera,155,185,5 script F_PetTrader 1_F_MARIA,{ disable_items; if ( getpetinfo(1) ) { mes "please return your pet into egg state to continue"; close; } getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( @inventorylist_card1[[email protected]] == -256 ) { [email protected]_id[[email protected]] = @inventorylist_id[[email protected]]; [email protected]_id[[email protected]] = @inventorylist_card2[[email protected]] + @inventorylist_card3[[email protected]] * ( 1 << 16 ); [email protected]; } } if ( [email protected] ) { mes "your inventory doesn't have any pet egg"; close; } counting_sort_index [email protected], [email protected], [email protected]; // never thought a time need a sorting algorithm for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) { [email protected][[email protected]] = [email protected]_id[[email protected][[email protected]]]; [email protected][[email protected]] = [email protected]_id[[email protected][[email protected]]]; } [email protected]_field$ = [email protected][0]; for ( [email protected] = 1; [email protected] < [email protected]; [email protected] ) [email protected]_field$ += ","+ [email protected][[email protected]]; [email protected] = query_sql( "select intimate, class, equip, name from pet where pet_id in ("+ [email protected]_field$ +") order by pet_id", [email protected], [email protected], [email protected], [email protected]$ ); if ( [email protected] != [email protected] ) { mes "Error ... "; close; } mesf "There are %d pet egg inside your inventory", [email protected]; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) { mesf "\rPet ID : %d", [email protected][[email protected]]; mesf "Pet Name : %s", [email protected]$[[email protected]]; mesf "Pet Class : %d", [email protected][[email protected]]; mesf "Egg ID : %d", [email protected][[email protected]]; mesf "Intimacy : %d", [email protected][[email protected]]; } next; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) [email protected]$ += sprintf( ("[%d] %s:"), [email protected][[email protected]], replacestr( [email protected]$[[email protected]], ":", ";" ) ); [email protected] = select([email protected]$) -1; mesf "Selected #%d %s", [email protected][[email protected]], [email protected]$; // then decide what you want to do here mes "delete it ?"; next; if ( select( "Yes", "No" ) == 2 ) close; delitem2 [email protected][[email protected]], 1,1,0,0, -256, [email protected][[email protected]] % ( 1 << 16 ), [email protected][[email protected]] / ( 1 << 16 ), 0; close; }
  10. bonus bUnbreakableGarment,`n`; | Garment cannot be damaged/broken by any means bonus bUnbreakableWeapon,`n`; | Weapon cannot be damaged/broken by any means bonus bUnbreakableArmor,`n`; | Armor cannot be damaged/broken by any means bonus bUnbreakableHelm,`n`; | Helm cannot be damaged/broken by any means bonus bUnbreakableShield,`n`; | Shield cannot be damaged/broken by any means bonus bUnbreakableShoes,`n`; | Shoes cannot be damaged/broken by any means there are already having item bonus to do this, so maybe a 3rd solution is simply extend the armor protection to protect garment and extend helm protection to protect shoes
  11. that means _$() or _() is equally detect by HULD, the only difference is it generate a comment in the pot file means nothing big differences ... I actually thought _() unable to parse %s or something ... seems I was wrong @Myriad, soon we will roll out a new version of HULD, it already discuss on the staff level old design -> http://herc.ws/board/topic/8687-hercules-ultimate-localization-design/ once the new design roll out, I will force recommend the community to adapt this new scripting style and for your question, because sprintf("Test %s", [email protected]); isn't detect by HULD and its sprintf(_("Text %s"), [email protected]); , only enclose the string by the way, on a side note, I seriously think we should change all the ^000000 into F_MesColor(C_BLACK) some machine translation can break ^000000 into ^ 000000 <-- can be solve by F_MesColor %s into % s <-- nothing can be done with this, other than manually fix it
  12. 1 sentence -> I cannot understand your post btw if you are talking about having a long list of array, isn't that already in your 1st post yeah, can't understand you, despite we live in the same country catch me in discord https://discordapp.com/invite/ZUzbRSp
  13. prontera,155,185,5 script kjsdhfksjf 1_F_MARIA,{ disable_items; getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { [email protected]_type = getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ); if ( ( [email protected]_type == IT_WEAPON || [email protected]_type == IT_ARMOR ) && [email protected]_equip[[email protected]] && !.costumeid[ @inventorylist_id[[email protected]] ] ) [email protected][[email protected]c++] = @inventorylist_id[[email protected]]; } mes "Equipments found that are not costumes"; if ( [email protected] ) { mes "<none>"; close; } mesf "Total -> %d", [email protected]; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) mes getitemname( [email protected][[email protected]] ); close; OnInit: // SQL query to fetch all the costumes [email protected] = query_sql( "select id from item_db where equip_locations & "+( EQP_COSTUME_HEAD_TOP|EQP_COSTUME_HEAD_MID|EQP_COSTUME_HEAD_LOW|EQP_COSTUME_GARMENT ), [email protected] ); // build the 'pointers' to compare later freeloop true; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) .costumeid[ [email protected][[email protected]] ] = true; end; }
  14. What is the difference between _("<string>") and _$("<string>") meant for HULD I found a few clues in script.c else if( strcmp(buildin->name, "mes") == 0 ) script->buildin_mes_offset = script->buildin_count; else if( strcmp(buildin->name, "mesf") == 0 ) script->buildin_mesf_offset = script->buildin_count; else if( strcmp(buildin->name, "select") == 0 ) script->buildin_select_offset = script->buildin_count; else if( strcmp(buildin->name, "_") == 0 ) script->buildin_lang_macro_offset = script->buildin_count; else if( strcmp(buildin->name, "_$") == 0 ) script->buildin_lang_macro_fmtstring_offset = script->buildin_count; so its script->buildin_lang_macro_offset and script->buildin_lang_macro_fmtstring_offset next, in generate-translations.c if (!duplicate) { if (script->syntax.last_func == script->buildin_mes_offset || script->syntax.last_func == script->buildin_select_offset || script->syntax.lang_macro_active ) { is_translatable_string = true; } else if (script->syntax.last_func == script->buildin_mesf_offset || script->syntax.lang_macro_fmtstring_active ) { is_translatable_fmtstring = true; } } now this make sense, _("<string>") is somehow group together with mes and select _$("<string>") is somehow group together with mesf so this is my guess ... _("<string>") is for those without %d %s ... _$("<string>") is for those with %d %s ... like sprintf ... right ? so ... my next question is ... there are 3 types <none> c format no c format what are those actually means then ? if translate by hand, it probably doesn't mean anything ... line 187 in generate-translations.c is_translatable_fmtstring ? "#, c-format\n" : (has_percent_sign ? "#, no-c-format\n" : ""), @Haru @Dastgir
  15. cannot reproduce, 0,9,14,31 .... all status GREEN prontera,155,185,5 script kjsdhfksjf 1_F_MARIA,{ input [email protected]; setbattleflag "land_skill_limit", [email protected]; getmapxy [email protected]$, [email protected], [email protected], UNITTYPE_NPC; areamonster [email protected]$, [email protected] -10, [email protected] -10, [email protected] +10, [email protected] +10, "--ja--", NAGHT_SIEGER, 30, "", Size_Small, AI_ATTACK; areamonster [email protected]$, [email protected] -10, [email protected] -10, [email protected] +10, [email protected] +10, "--ja--", PORING_V, 30, "", Size_Small, AI_NONE; end; }