Jump to content

Working Spreading out loot upon Entity death


Cheshire

Recommended Posts

Spreading out loot upon Entity death

 

Description:

This Patch modifies how loot is dropped from dying Entities (ie Players and NPCs).

The server will attempt to find all available tiles around the Entity that is dying and spawn its loot in a random one.

If none are found, the default location of under the Entity will be used instead.

 

NOTE: This uses a modified piece of code from Resources.cs, namely the method SpawnResourceItems.

 

Update: The latest release now lets you configure the range of tiles this mod will search for for possible loot spawns!

 

Media:

29be72927b28d2adb6edd428739b1355.gif

 

Git Patch:

Download (For 0.6.1.245   Commit 3ff3d7dd5ba0d33d193297a98c36cf6a2f8406b8 onwards)

 

Older versions*:

Download (For 0.6.1.240)

 

*= May not contain all features listed.

 

Based On:

Version: 0.6.1.245

 

Setup:

Download and apply the patch, then simply build your server and find the nearest punching bag to dispense loot from!

 

In your server's config.json you can find the following option under CombatOpts to tweak for the drop range: ItemDropRange

Link to comment
Share on other sites

2 minutes ago, Hitz said:

About last dev build:

 

 

II think you're using an old version of this patch. Because Globals.Rand is no longer used in the new version.

 

You can go fix that error by replacing Globals.Rand with Randomization though.

Link to comment
Share on other sites

10 minutes ago, Joyce said:

 

II think you're using an old version of this patch. Because Globals.Rand is no longer used in the new version.

 

You can go fix that error by replacing Globals.Rand with Randomization though.

 

I deleted my old branch and fetch origin/development, last history change was 7 hours ago #100, i'll try again

Link to comment
Share on other sites

  • 3 weeks later...

can you help me to add this patch?

Quote

G:\Celtos Online\Intersect-Engine>git apply --check Spread.patch
error: patch failed: Intersect.Server/Entities/Entity.cs:2417
error: Intersect.Server/Entities/Entity.cs: patch does not apply

G:\Celtos Online\Intersect-Engine>
 

 

http://prntscr.com/s3ov9y

 

http://prntscr.com/s3ovgn

 

 

EDIT: I learned to manually add HAHA
NOW NOBODY SAVES ME

Link to comment
Share on other sites

  • 6 months later...

For noobies like myself that are using the 6.2 development branch you will want to install this patch with:

git apply -3 ./<filename>.patch

 

Once installed you will have an error in your build but here is how I fixed it:

fed05c6c096fc856da656ec4624bca79.png

 

Explaination:

Lines 2697 and 2701 use 'var map' which isn't allowed because it already exists on line 2690. You will have to change the name but make sure to update the corresponding line below.

If this is all you do you will have an issue where your loot takes 5 seconds to appear, this is because you need to add the lootOwner variable at the end of line 2697. 

You should also add it to line 2702 as well (I just got this working so I wanted to share it before I forgot to)

 

Thanks @Cheshire for helping me with the 5 second spawn issue.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...