Jump to content
Cheshire

Working Spreading out loot upon Entity death

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

Share this post


Link to post
Share on other sites
6 minutes ago, Gibier said:

Does the loot can spawn on a blocked tile?

 

It can't, it tries to find open tiles (ie not blocked and no players/npcs on it)

If there are none, it drops under the NPC.

Share this post


Link to post
Share on other sites
Guest

Work in lastest dev build?

Share this post


Link to post
Share on other sites
6 minutes ago, Celtos said:

Work in lastest dev build?

 

Maybe, maybe not. I develop against the stable branch.

 

You're free to try though.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Oh, sorry I downloaded the last version but it didn't go to the right directory and I ended up using the old version again!

Now i'ts working!

Share this post


Link to post
Share on other sites

Hey, i'm merging some mods and got this... I tried some ways to resolve the conflict but not success!

 

Quote

64a565de895c35147e93d3a9e6cff06d.png

 

Share this post


Link to post
Share on other sites
Guest

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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...