Jump to content

Lincoln Binda

Members
  • Posts

    7
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Lincoln Binda

  1. 18 hours ago, namerpus18 said:

    Hello everyone,

     

    I just wanna ask for help if how I can limit account registration per IP. I camt find it anywhere here. Like you can only register 2 accounts per IP address... Sorry I am not sure which section to ask this but i am guessing here. 

     

    Thank you so much

    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

    • Like 1
  2. 3 hours ago, Jayz said:

    Okay thank you for the idea ill try to my end to find the conflicts and i will wait your's because im newbie on src starting learning

    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.

    • MVP 1
  3. 4 minutes ago, Jayz said:

    I found the issue about @mobinfo but i use the excluded_item_ids since both are same concept and it work, when i use @whodrops 1202 the Knife rate will not affected on SC_ITEMBOOST but when i use @mi the Knife is affected by SC_ITEMBOOST all i can say is its working we need to find the logic on @mi command thanks

     

    image.png.ff6cc93767d275a5fe2af1d1ba581e4b.png

    image.png.ff559beb5ed0bb7b6837de7555320c3e.png

     

    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. 8 minutes ago, Jayz said:

    I see now i understand the logic,, btw about the mob_id and item_id have error undeclared identifier how to declare this identifier? for adding int mob_id;  ?

    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.

    • Love 1
  5. 3 minutes ago, cahadeyelo said:

    Hi rA community. Can i request a script that will teleport the player back to it's recent location after touching a specific npc.
     

    EXAMPLE SCENARIO:

    A player is happily farming on um_fild01 then triggers the script when he kills 100 Dryads. He/She got teleported to sec_pri then after he/she clicks a walking/sliding npc inside prison. The npc will teleport him/her back to his/her recent exact location on um_fild01. And he/she lives happily ever after. Thank You.

     

    -	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

    • Love 1
  6. 22 hours ago, Jayz said:

    How can I make SC_ITEMBOOST not be effective for a specific item or mob id, for example for Knife_/1202 or Poring/1002, so that even if SC_ITEMBOOST is used, it will still retain its original drop rate?

    if (sd->sc.getSCE(SC_ITEMBOOST))
                    drop_rate_bonus += sd->sc.getSCE(SC_ITEMBOOST)->val1;
    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

    • MVP 1
  7. On 3/30/2021 at 12:36 PM, Syon said:

    De nada, @crosxx2.

    Estou mais ativo durante o fim de semana e pretendo deixar tudo traduzido. Vejo que muitos ganham dinheiro vendendo versões em português, então nada melhor que disponibilizar uma gratuita. Depois de deixar esse projeto atualizado, pretendo trabalhar no emulador.

    O projeto ainda existe me pleno ano de 2023?

×
×
  • Create New...