Jump to content

Lincoln Binda

Members
  • Posts

    7
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Lincoln Binda

  1. This is so easy to get around that it's not worth the effort, there are many tools that change your IP so this would only be a setting for some people
  2. Let the necessary changes in the 'mob.cpp' file: change it: int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md) to: int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md, int nameid) still in the same file, in the same function, change this: if (sd->sc.getSCE(SC_ITEMBOOST)) drop_rate_bonus += sd->sc.getSCE(SC_ITEMBOOST)->val1; to: if (sd->sc.getSCE(SC_ITEMBOOST)) { int mob_id = mob->id; int item_id = nameid; int excluded_item_ids[] = {1202}; // Knife_ = 1202 int excluded_mob_ids[] = {1002}; // Poring = 1002 bool is_excluded_item = false; bool is_excluded_mob = false; for(int i = 0; i < sizeof(excluded_item_ids)/sizeof(excluded_item_ids[0]); i++) { if(item_id == excluded_item_ids[i]) { is_excluded_item = true; break; } } for(int i = 0; i < sizeof(excluded_mob_ids)/sizeof(excluded_mob_ids[0]); i++) { if(mob_id == excluded_mob_ids[i]) { is_excluded_mob = true; break; } } // Only apply the SC_ITEMBOOST if the item and mob aren't in the excluded lists if(!is_excluded_item && !is_excluded_mob) { drop_rate_bonus += sd->sc.getSCE(SC_ITEMBOOST)->val1; } } inside the loop "for (i = 0; i < MAX_MOB_DROP_TOTAL; i++) {" Change it: drop_rate = mob_getdroprate(src, md->db, md->db->dropitem[i].rate, drop_modifier, md); to: drop_rate = mob_getdroprate(src, md->db, md->db->dropitem[i].rate, drop_modifier, md, md->db->dropitem[i].nameid); in archive 'mob.hpp' change it: int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md = nullptr); to: int mob_getdroprate(struct block_list *src, std::shared_ptr<s_mob_db> mob, int base_rate, int drop_modifier, mob_data* md, int nameid); and finally in the 'atcommand.cpp' file, change it: int droprate = mob_getdroprate( &sd->bl, mob, mob->dropitem[i].rate, drop_modifier ); to: int droprate = mob_getdroprate( &sd->bl, mob, mob->dropitem[i].rate, drop_modifier, nullptr, mob->dropitem[i].nameid ); I had to use a breakpoint in visual studio to find out that the md->mob_id was null and that's why the @mi command was closing the map-server. soon I realized that inside the function there is already mob data just by accessing the 'mob->id'. the item_id conflict I solved by adding a new parameter, consequently it is mandatory to change the parameters for the other calls, maybe there is a better way to access the item_id but this way works great for me.
  3. It's late for me, it's almost 3 am here, anyway it's an interesting setup, tomorrow I'll test it to eliminate the conflicts
  4. For mob_id: If you're in a context where a monster is being handled (like in the drop function), you might have access to a mob_data structure or something similar, from which you can get the monster ID. It might look something like this: int mob_id = md->class_; 'md' is a commonly used abbreviation for mob_data in rAthena source code.
  5. - script DryadKillCounter -1,{ OnPCKillEvent: if (killedrid == DRYAD_MOB_ID) { .@kills = killcount(DRYAD_MOB_ID); if (.@kills == 100) { set saveMap$, strcharinfo(3); set saveX, getcharinfo(0); set saveY, getcharinfo(1); warp "sec_pri", X_COORD, Y_COORD; // Teleport player to sec_pri (Replace X_COORD and Y_COORD with actual coordinates) } } end; } sec_pri,X_COORD,Y_COORD,5 script Returning NPC 722,{ if (killcount(DRYAD_MOB_ID) > 99) { mes "I noticed you've killed 100 Dryads in um_fild01."; mes "Do you want to return to where you were?"; next; if(select("Yes:No") == 1) { set killcount(DRYAD_MOB_ID), 0; // Reset the kill count for Dryads warp saveMap$, saveX, saveY; // Return player to their saved location } } else { mes "You have no reason to interact with me."; } close; } pay attention to items: X_COORD Y_COORD DRYAD_MOB_ID Just make the appropriate substitutions
  6. if (sd->sc.getSCE(SC_ITEMBOOST)) { // List of item IDs and mob IDs to exclude int excluded_item_ids[] = {1202}; // Knife_ = 1202 int excluded_mob_ids[] = {1002}; // Poring = 1002 // Check if the current item_id and mob_id are not in the excluded lists bool is_excluded_item = false; bool is_excluded_mob = false; for(int i = 0; i < sizeof(excluded_item_ids)/sizeof(excluded_item_ids[0]); i++) { if(item_id == excluded_item_ids[i]) { is_excluded_item = true; break; } } for(int i = 0; i < sizeof(excluded_mob_ids)/sizeof(excluded_mob_ids[0]); i++) { if(mob_id == excluded_mob_ids[i]) { is_excluded_mob = true; break; } } // Only apply the SC_ITEMBOOST if the item and mob aren't in the excluded lists if(!is_excluded_item && !is_excluded_mob) { drop_rate_bonus += sd->sc.getSCE(SC_ITEMBOOST)->val1; } } You can test this or at least get an idea to follow
  7. O projeto ainda existe me pleno ano de 2023?
×
×
  • Create New...