Jump to content

Recommended Posts

A simple code that you can configure in the vector to add the maps where you do not want any boss or mob to drop their items.

 

service.h

#define ENABLE_BLOCK_DROP_MAP

utils.h

search:

extern void set_global_time(time_t t);

add:

#ifdef ENABLE_BLOCK_DROP_MAP
	extern bool is_drop_item(int map_index);
#endif

utils.cpp

add:

#ifdef ENABLE_BLOCK_DROP_MAP
bool is_drop_item(int map_index){
	vector<int> DropMap {41}; // -- add index the map (41 == jinno map)
	
	//dungeon
	for (int i=180000; i<190000; i++) DropMap.push_back(i);
	
	return std::find(DropMap.begin(), DropMap.end(), map_index) != DropMap.end();
}
#endif

char_battle.cpp

search:
				else if (IsRevive() == true)
				{
					Reward(false);
				}
				else
				{
					Reward(true); // Drops gold, item, etc..
				}
replace:

				else if (IsRevive() == true)
				{
					Reward(false);
				}
				else
				{
#ifdef ENABLE_BLOCK_DROP_MAP
					if (is_drop_item(GetMapIndex())){
						Reward(false);}
					else
					{
						Reward(true);
					}
				}
#else
					Reward(true);
				}
#endif

 

  • Metin2 Dev 1
Link to comment
https://metin2.dev/topic/32005-block-drop-on-a-map/
Share on other sites

  • Honorable Member

image.png?ex=65afc54b&is=659d504b&hm=8ae

What's this supposed to be?

Edited by Metin2 Dev International
Core X - External 2 Internal

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/32005-block-drop-on-a-map/#findComment-162284
Share on other sites

Your code has some really bad practice, inserting 10000 rows in that vector for every call to function make unecessary lag (use if (x >=xr && y <= yr)), however your code should look more like this

#ifdef ENABLE_BLOCK_DROP_MAP
                    if (is_drop_item(GetMapIndex())){
                        Reward(false);}
                    else
                    {
                        Reward(true);
                    }
                }
#else
                    Reward(true);
                }
#endif



to 

#ifdef ENABLE_BLOCK_DROP_MAP

                    bool bIsRewardItem = is_drop_item(GetDungeon() ? (GetDungeon()->GetMapIndex() / 10000) : GetMapIndex());
                    Reward(!bIsRewardItem);

#else
                    Reward(true);
                }
#endif

and

bool is_drop_item(int map_index)
{
    const std::unordered_set<int> DropMap{41};
    return DropMap.find(map_index) != DropMap.end();
}

(Didn't tested but should work)

Take it as an advice, hf.

Link to comment
https://metin2.dev/topic/32005-block-drop-on-a-map/#findComment-162288
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.