Jump to content

Recommended Posts

Hi, Is there a way to change the drop of the item to be on the ground under the character instead of droping on the ground under the mob. So basically all of the items that drop are underneath the character instead of everwhere around him.

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • Premium

What you're trying to achieve is pretty simple when you think about it, you just have to pay attention to who is the attacker and who is the victim.

In the server source, you should look at every instance where CItem::AddToGround (item.cpp) is called, the main function who takes care of the mob drop is CHARACTER::Reward (char_battle.cpp). I'll guide you step by step how to modify the Reward function to take the attacker's position instead of the victim.

Logically, the attacker is our character and the victim is the mob, so in that case we'll just use the pkAttacker pointer when taking the coordinates for the pixel position.
 

PIXEL_POSITION pos = GetXYZ();

// will become

PIXEL_POSITION pos = pkAttacker->GetXYZ();

// In some cases (like using martysama's files) you will probably have a call to GetMovablePosition inisde the Reward function
// to make sure items dropped are not in unreachable places. Just adapt the arguments (probably GetX and GetY) by using the same concept, using the attacker's pointer.


The same applies for every function where there are items added on the ground. You can control where they will drop based on who's position you're taking. (GetXYZ function)

 

Edited by CORKY
GetMovablePosition tip

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.